Processor resource allocation method, computer program product, equipment and medium

By determining the number of processor cores and storage units in the server, configuring and allocating processor resources, the application delay problem caused by mismatch between CPU and memory speed is solved, and the delay satisfaction and optimal use of resources are achieved.

CN118964033APending Publication Date: 2024-11-15LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411131771.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The CPU computing speed in the server does not match the memory read and write speed, which makes application delay difficult to meet the requirements, and multiple applications compete for limited CPU cores and last-level cache (LLC) resources, resulting in the delay not meeting the requirements.

Method used

By determining the number of processor cores and storage units in the server, the processor cores and storage units are configured, and the processor cores and storage units are allocated to the target application according to the configuration results to meet their latency requirements. This method includes collecting delay data for a preset time, dynamically adjusting resource allocation, ensuring that the application's delay meets the requirements, and performing global coordinated allocation in idle resources.

Benefits of technology

It effectively avoids the problem of delay failure caused by processor-free core or storage unit allocation, realizes global coordinated processor resource allocation, ensures that the delay of the target application meets the requirements, and optimizes resource usage and avoids excessive resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964033A_ABST
    Figure CN118964033A_ABST
Patent Text Reader

Abstract

The invention discloses a processor resource allocation method, a computer program product, equipment and a medium, and relates to the technical field of computers. A first total number value of processor cores in a server is determined; determining a second total number value of storage units in the server, wherein the storage units comprise storage units divided in the last-level cache of the processor; according to the first total number value and the second total number value, configuring a storage unit for each processor core to obtain a configuration result; and allocating a processor core and a storage unit to the target application program according to the configuration result, so that the delay of the target application program meets the requirement. The storage unit configured for each processor core is determined according to the configuration result, and the processor core and the storage unit are subsequently allocated for the target application program according to the configuration result, which is equivalent to allocation of processor resources according to the storage unit configured for the processor core; it is guaranteed that the delay of the target application program meets the requirement in a global overall distribution mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and more specifically, to a processor resource allocation method, a computer program product, a device and a medium. Background Art

[0002] The CPU (Central Processing Unit) in the server usually contains multiple CPU cores, and in order to solve the contradiction between the CPU operation speed and the memory read and write speed, the CPU Cache is introduced. The CPU Cache is usually divided into three levels of cache of varying sizes, namely L1 Cache, L2 Cache and L3 Cache, of which L3 Cache is shared by multiple CPU cores. L3 Cache is also called last level cache (LLC), which is usually divided into multiple independent storage units. An independent storage unit is called a way. The number of LLC ways will directly affect the size and efficiency of LLC. In addition, there are multiple applications in the server, and these applications will compete for limited CPU cores and limited LLC ways, resulting in the delay of the application being difficult to meet the requirements.

[0003] In summary, how to make the delay of the application in the server meet the requirements is a problem that needs to be solved urgently by those skilled in the art. Summary of the invention

[0004] The purpose of the present invention is to provide a processor resource allocation method, which can solve the technical problem of how to make the delay of application programs in the server meet the requirements to a certain extent. The present invention also provides a computer program product, an electronic device and a computer readable storage medium.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] In a first aspect, a processor resource allocation method is provided, comprising:

[0007] determining a first total number of processor cores in the server;

[0008] Determining a second total number of storage units in the server, the storage units comprising storage units divided in a last level cache of a processor;

[0009] According to the first total value and the second total value, configure the storage unit for each of the processor cores to obtain a configuration result;

[0010] The processor core and the storage unit are allocated to the target application according to the configuration result, so that the delay of the target application meets the requirement.

[0011] On the other hand, configuring the storage unit for each of the processor cores according to the first total value and the second total value to obtain a configuration result includes:

[0012] Determine configuration information according to the first total value and the second total value, wherein the configuration information is used to record the quantity value of the storage units to be configured for each of the processor cores;

[0013] According to the configuration information, a corresponding number of the storage units are configured for each of the processor cores to obtain the configuration result.

[0014] On the other hand, determining configuration information according to the first total value and the second total value includes:

[0015] generating a first ratio of the second total value to the first total value;

[0016] The configuration information is determined to configure the first ratio of the storage units for each of the processor cores.

[0017] On the other hand, allocating the processor core and the storage unit to the target application according to the configuration result so that the delay of the target application meets the requirement includes:

[0018] Selecting an unassigned processor core as a first core;

[0019] Allocating the first core and the corresponding storage unit to the target application according to the configuration result;

[0020] collecting a first delay of the target application after a preset time period;

[0021] In response to the first delay not meeting the delay requirement of the target application, returning to the step of selecting an unassigned processor core as a first core;

[0022] In response to the first delay reaching the delay requirement of the target application, the process ends.

[0023] On the other hand, after allocating the processor core and the storage unit to the target application according to the configuration result, the method further includes:

[0024] determining a third total number of the processor cores allocated to the target application;

[0025] According to the delay requirement of the target application, resources of the target application are reduced according to the third total value.

[0026] On the other hand, according to the delay requirement of the target application, reducing the resources of the target application according to the third total value includes:

[0027] In response to the third total value being greater than 1, selecting a first number of the processor cores allocated to the target application as second cores, and prohibiting the second cores from serving the target application;

[0028] After a preset time period, collecting a second delay of the target application;

[0029] In response to the second delay not satisfying a delay requirement of the target application, allocating the second core to the target application;

[0030] In response to the second delay satisfying the delay requirement of the target application, the second core is changed to the idle processor core.

[0031] On the other hand, according to the delay requirement of the target application, reducing the resources of the target application according to the third total value includes:

[0032] In response to the third total value being equal to 1, selecting a second number of the storage units allocated to the target application as first units, and prohibiting the first units from serving the target application;

[0033] collecting a third delay of the target application after a preset time period;

[0034] In response to the third delay not satisfying a delay requirement of the target application, allocating the first unit to the target application;

[0035] In response to the third delay satisfying the delay requirement of the target application, the first unit is changed to the idle storage unit.

[0036] On the other hand, after allocating the processor core and the storage unit to the target application according to the configuration result, the method further includes:

[0037] determining a fourth total number of said processor cores that are idle;

[0038] determining a fifth total number of said memory cells that are free;

[0039] According to the fourth total value and the fifth total value, the idle processor cores and the idle storage units are allocated to existing applications in the server.

[0040] On the other hand, allocating the idle processor cores and the idle storage units to existing applications in the server according to the fourth total value and the fifth total value includes:

[0041] In response to the fifth total value being greater than the fourth total value, and the fourth total value being greater than zero, generating a second ratio of the fifth total value to the fourth total value; allocating one idle processor core and the second ratio of idle storage units to the existing application each time;

[0042] In response to the fifth total value being less than or equal to the fourth total value, and the fifth total value being greater than zero, one idle processor core and one idle storage unit are allocated to the existing application each time.

[0043] On the other hand, allocating the idle processor cores and the idle storage units to existing applications in the server according to the fourth total value and the fifth total value includes:

[0044] In response to the fourth total value being greater than zero and the fifth total value being equal to zero, allocating one idle processor core to the existing application at a time;

[0045] In response to the fifth total value being greater than zero and the fourth total value being equal to zero, one free storage unit is allocated to the existing application each time.

[0046] On the other hand, allocating the idle processor cores and the idle storage units to existing applications in the server according to the fourth total value and the fifth total value includes:

[0047] According to the rule of giving priority to applications with burst input / output, the idle processor cores and the idle storage units are allocated to existing applications in the server according to the fourth total value and the fifth total value.

[0048] On the other hand, it also includes:

[0049] Determine the existing application program with burst input / output as an object to be allocated, and collect the fourth delay of the object to be allocated;

[0050] Detecting whether the fourth delay meets the delay requirement;

[0051] In response to the fourth delay not meeting the delay requirement, an object to be transferred is selected from the existing application without burst input / output, and the idle processor core and the idle storage unit allocated to the object to be transferred are transferred to the object to be allocated.

[0052] In a second aspect, a computer program product is provided, comprising a computer program / instruction, which implements the steps of any of the above-mentioned processor resource allocation methods when executed by a processor.

[0053] According to a third aspect, an electronic device is provided, including:

[0054] Memory for storing computer programs;

[0055] A processor is used to implement the steps of any of the above-mentioned processor resource allocation methods when executing the computer program.

[0056] According to a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of any of the above-mentioned processor resource allocation methods are implemented.

[0057] The present invention provides a processor resource allocation method, which determines a first total value of processor cores in a server; determines a second total value of storage units in the server, wherein the storage units include storage units divided in the last level cache of the processor; configures storage units for each processor core according to the first total value and the second total value to obtain a configuration result; and allocates processor cores and storage units to a target application according to the configuration result, so that the delay of the target application meets the requirements. The beneficial effect of the present invention is that: according to the first total value of the processor core and the second total value of the storage unit, the storage unit is configured to the processor core to obtain the corresponding configuration result, so that the storage unit configured by each processor core is determined, and if the processor core and storage unit are subsequently allocated to the target application according to the configuration result, it is equivalent to allocating processor resources for the target application according to the storage unit configured by the processor core, which can avoid the situation where no processor core or no storage unit is allocated to the application, resulting in failure to meet the delay requirements, and realizes the guarantee that the delay of the target application meets the requirements through global coordinated allocation. The computer program product, electronic device and computer-readable storage medium provided by the present invention also solve the corresponding technical problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0059] Figure 1 A flowchart of a processor resource allocation method provided by an embodiment of the present invention;

[0060] Figure 2 A schematic diagram of the structure of a server;

[0061] Figure 3 A schematic diagram for allocating processor resources to applications;

[0062] Figure 4 A schematic diagram for reducing application processor resources;

[0063] Figure 5 A schematic diagram for allocating idle processor resources to applications;

[0064] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;

[0065] Figure 7 Another structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0066] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0067] See also Figure 1 , Figure 1 A flowchart of a processor resource allocation method provided by an embodiment of the present invention.

[0068] A processor resource allocation method provided by an embodiment of the present invention may include the following steps:

[0069] Step S101: Determine a first total number of processor cores in a server.

[0070] Step S102: determining a second total number of storage units in the server, where the storage units include storage units divided in the last level cache of the processor.

[0071] In actual applications, because processor cores and storage units need to be allocated to applications, it is necessary to determine a first total value of all processor cores in the server and a second total value of storage units in the server, so that processor resources can be subsequently allocated to the application according to the first total value and the second total value. This server can be a cloud server, etc.

[0072] It should be noted that there are multiple processors in the server, each processor has a processor core and a last-level cache, and each last-level cache can be divided into multiple storage units. Therefore, the first total value refers to the number of all processor cores in the server, and the second total value refers to the number of all storage units in the server. Assuming that the processor resources in the server are as follows: Figure 2 As shown, the server includes two processors, processor 0 and processor 1, each processor includes 8 cores, and the last level cache is divided into 32 storage units, then the first total value is 16, and the second total value is 64. It should also be noted that the division method of the storage units in the last level cache can be flexibly determined according to the application scenario, for example, the corresponding storage units can be obtained by evenly dividing the last level cache, or the corresponding storage units can be obtained by randomly dividing the last level cache. In addition, when the application is executed, the data in the memory will first be loaded into the L3 Cache shared by the processor cores, then loaded into the L2 Cache unique to each core, and finally enter the fastest L1 Cache before being read by the processor.

[0073] Step S103: configuring a storage unit for each processor core according to the first total value and the second total value to obtain a configuration result.

[0074] Step S104: allocating processor cores and storage units to the target application according to the configuration result, so that the delay of the target application meets the requirement.

[0075] In actual applications, after knowing the first total value of the processor cores and the second total value of the storage units, allocating processor resources to the application is equivalent to allocating the processor cores of the first total value and the storage units of the second total value to the application. In this process, in order to ensure that the application can be allocated to the processor cores and the storage units at the same time, the storage units can be configured for each processor core according to the first total value and the second total value to obtain the configuration result, that is, the processor core and the storage unit can be bound together first; then the processor core and the storage unit are allocated to the target application according to the configuration result, so that the target application is allocated with the processor core and the storage unit at the same time, which can avoid the delay of the target application that cannot meet the requirements due to the lack of the processor core or the storage unit. Among them, the type of application can be flexibly determined according to the scenario.

[0076] It should be noted that in the process of allocating processor cores and storage units to the target application according to the configuration results so that the delay of the target application meets the requirements, due to the limitations of the allocation method, it may be necessary to perform only one allocation according to the configuration results to make the delay of the target application meet the requirements, or it may be necessary to perform multiple allocations according to the configuration results to make the delay of the target application meet the requirements. In specific application scenarios, the allocation method and the number of allocations can be flexibly determined according to the allocation requirements to make the delay of the target application meet the requirements, and the present invention does not make specific limitations here.

[0077] In actual applications, in the process of configuring storage units for each processor core according to the first total value and the second total value to obtain the configuration result, the configuration information can be determined according to the first total value and the second total value, and the configuration information is used to record the number of storage units that need to be configured for each processor core; according to the configuration information, the corresponding number of storage units are configured for each processor core to obtain the configuration result.

[0078] In a specific application scenario, in the process of determining configuration information according to the first total value and the second total value, a first ratio of the second total value to the first total value can be generated; the configuration information is determined to configure the first ratio of storage units for each processor core. That is, the storage units are evenly distributed to each processor core, so that the number of storage units configured for each processor core is consistent, and the processing capabilities between the processor cores are equivalent, which is convenient for load balancing of the server.

[0079] Accordingly, when the storage units are evenly allocated to each processor core, in the process of allocating processor cores and storage units to the target application according to the configuration results so that the delay of the target application meets the requirements, an unallocated processor core can be selected as the first core; according to the configuration results, the first core and the corresponding storage unit are allocated to the target application; the first delay of the target application is collected after a preset time, and the preset time can be 300ms, 500ms, 600ms, etc., which can be flexibly determined according to the delay characteristics of the application; in response to the first delay not meeting the delay requirement of the target application, returning to the step of selecting an unallocated processor core as the first core; in response to the first delay meeting the delay requirement of the target application, ending.

[0080] For ease of understanding, assuming that the first ratio is R, the preset duration is 500ms, that is, one processor core is configured with R storage units, the process of allocating processor resources to the application is as follows: Figure 3As shown: 1 processor core and corresponding R storage units are allocated to the application, and the first delay of the application is collected after 500ms, and it is determined whether the first delay meets the delay requirement. If not, the step of allocating 1 processor core and corresponding R storage units to the application is returned, and if so, the allocation of processor cores and storage units is completed for the application. It should be noted that this allocation method can be applicable to the case where processor resources are allocated to the application for the first time after the server is turned on, and can also be used to allocate idle processor resources to the application. The present invention does not make specific limitations here.

[0081] It can be seen from the implementation process that when the storage units are evenly allocated to each processor core, since the number of storage units configured by all processor cores is the same, the processor resources can be allocated to the application in units of processor cores, that is, first select an unallocated processor core as the first core, and allocate the first core and the corresponding storage unit to the target application according to the configuration result; collect the first delay of the target application after a preset time, and in response to the first delay not meeting the delay requirement of the target application, return to the step of selecting an unallocated processor core as the first core; in response to the first delay meeting the delay requirement of the target application, the process ends. In the whole process, each time a processor core and a corresponding storage unit are allocated to an application, it is detected whether the delay of the application meets the requirement. If not, a processor core and a corresponding storage unit are continuously allocated to the application until the delay of the application meets the requirement. In this way, it can be ensured that the delay of the application meets the requirement, and it can avoid excessive allocation of processor resources to the application, so that more applications can be allocated processor resources to meet the delay requirement.

[0082] In actual applications, as the application runs, the application's demand for processor resources may decrease. For example, after the application completes a task, the application's demand for processor resources will decrease. At this time, the application may have excess processor resources allocated to it. In order to call processor resources as much as possible, after allocating processor cores and storage units to the target application according to the configuration results, a third total value of processor cores allocated to the target application can also be determined; based on the delay requirements of the target application, the target application's resources can be reduced according to the third total value.

[0083] In a specific application scenario, according to the delay requirement of the target application, the process of reducing the resources of the target application according to the third total value can be as follows: Figure 4As shown, in response to the third total value being greater than 1, that is, the target application is allocated with multiple processor cores, the first number of processor cores allocated to the target application can be selected as the second core, and the second core is prohibited from serving the target application. The first number can be 1, 2, 3, etc.; after a preset time, the second delay of the target application is collected; in response to the second delay not meeting the delay requirement of the target application, the second core is allocated to the target application; in response to the second delay meeting the delay requirement of the target application, the second core is changed to an idle processor core to reduce the processor cores allocated to the target application. Correspondingly, in response to the third total value being equal to 1, that is, the target application is only allocated with one processor core, the second number of storage units allocated to the target application can be selected as the first unit, and the first unit is prohibited from serving the target application. The second number can be 1, 2, 3, etc.; after a preset time, the third delay of the target application is collected; in response to the third delay not meeting the delay requirement of the target application, the first unit is allocated to the target application; in response to the third delay meeting the delay requirement of the target application, the first unit is changed to an idle storage unit to reduce the storage unit allocated to the target application. It should be noted that the target application can be resource-reduced multiple times according to this embodiment as needed, that is, the step of reducing the target application's resources according to the third total value is performed multiple times until the target application's resources cannot be reduced twice in a row and the operation is terminated.

[0084] From the implementation process, it can be known that, when the number of processor cores allocated to the target application is greater than 1, the present invention reduces the first number of processor cores for the target application each time, and decides whether to perform this reduction based on the delay of the target application after the reduction, which can ensure that the delay of the target application meets the requirements and can reduce the redundant processor cores of the target application. Similarly, when the number of processor cores allocated to the target application is only 1, the second number of storage units is reduced each time for the target application, and decides whether to perform this reduction based on the delay of the target application after the reduction, which can ensure that the delay of the target application meets the requirements and can reduce the redundant storage units of the target application.

[0085] In actual application scenarios, when resources are reduced for applications or processor resources are not fully allocated, there will be idle processor resources in the server. At this time, the idle processor resources can continue to be allocated so that the application can maximize the application of processor resources and ensure application performance. That is, after allocating processor cores and storage units to the target application according to the configuration results, a fourth total value of idle processor cores can be determined; a fifth total value of idle storage units can be determined; and according to the fourth total value and the fifth total value, the idle processor cores and the idle storage units can be allocated to existing applications in the server.

[0086] In a specific application scenario, according to the fourth total value and the fifth total value, the process of allocating the idle processor cores and the idle storage units to the existing application programs in the server can be as follows: Figure 5 As shown, in response to the fifth total value being greater than the fourth total value, and the fourth total value being greater than zero, a second ratio of the fifth total value to the fourth total value is generated, and one idle processor core and the second ratio of idle storage units are allocated to existing applications each time; in response to the fifth total value being less than or equal to the fourth total value, and the fifth total value being greater than zero, one idle processor core and one idle storage unit are allocated to existing applications each time; in response to the fourth total value being greater than zero and the fifth total value being equal to zero, one idle processor core is allocated to existing applications each time; in response to the fifth total value being greater than zero and the fourth total value being equal to zero, one idle storage unit is allocated to existing applications each time.

[0087] In a specific application scenario, in the process of allocating idle processor cores and idle storage units to existing applications in a server according to the fourth total value and the fifth total value, the idle processor cores and idle storage units can be allocated to the existing applications in the server according to the rule of preferentially allocating to applications with burst input / output (burst IO). On this basis, when burst input / output occurs in an existing application, the existing application with burst input / output can also be determined as an object to be allocated, and the fourth delay of the object to be allocated is collected; whether the fourth delay meets the delay requirement is detected; in response to the fourth delay not meeting the delay requirement, the object to be transferred is selected from the existing application without burst input / output, and the idle processor cores and idle storage units allocated to the object to be transferred are transferred to the object to be allocated.

[0088] In actual applications, in the process of determining configuration information according to the first total value and the second total value, the storage units of the second total value can be first grouped, the number of groups is equal to the first total value, and the number of storage units in some groups is the same, and the number of storage units in the remaining groups is different, and each group is configured to the processor core to obtain corresponding configuration information; accordingly, in the process of allocating processor cores and storage units to the target application according to the configuration result, a first-class processor core can be first allocated to the target application according to the configuration result, and the first-class processor core refers to a processor core configured with a group of the same number of storage units, and then the fifth delay of the target application is collected, and the gap between the fifth delay and the delay requirement is counted to detect whether the gap is greater than the set value; if so, a second-class processor core is allocated to the target application according to the configuration result, and the number of storage units of the second-class processor core is greater than the number of storage units of the first-class processor core, and the step of collecting the fifth delay of the target application is returned; if not, a third-class processor core is allocated to the target application according to the configuration result, and the number of storage units of the third-class processor core is less than or equal to the number of storage units of the first-class processor core, and the step of collecting the fifth delay of the target application is returned until the fifth delay meets the delay requirement.

[0089] From the implementation process, it can be seen that the present invention divides the storage units into unequal groups, so that there are differences in the number of storage units allocated to the processor cores, thereby making the processor cores have different abilities to meet the delay requirements of the application. In the process of allocating processor resources to the application, a processor core of a group with the same number of storage units is first allocated to the application, and then according to the gap between the fifth delay of the application and the delay requirement, when the gap is greater than the set value, more processor cores are continuously allocated to the application, and when the gap is less than the set value, fewer or the same number of processor cores are continuously allocated to the application. This not only makes the process of the application meeting the delay requirements smoother, but also makes the processor resources allocated to the application as small as possible, so as to save processor resources to serve more applications.

[0090] The present invention provides a processor resource allocation method, which determines a first total value of processor cores in a server; determines a second total value of storage units in the server, the storage units including storage units divided in the last level cache of the processor; configures storage units for each processor core according to the first total value and the second total value to obtain a configuration result; allocates processor cores and storage units to a target application according to the configuration result, so that the delay of the target application meets the requirements. The beneficial effect of the present invention is: according to the first total value of the processor core and the second total value of the storage unit, the storage unit is configured to the processor core to obtain the corresponding configuration result, so that the storage unit configured for each processor core is determined, and if the processor core and storage unit are subsequently allocated to the target application according to the configuration result, it is equivalent to allocating processor resources for the target application according to the storage unit configured by the processor core, which can avoid the situation where no processor core or no storage unit is allocated to the application, resulting in failure to meet the delay requirements, and realizes the guarantee of meeting the delay requirements of the target application through global coordinated allocation.

[0091] Based on the above embodiments, the present invention further provides a processor resource allocation system, which may include:

[0092] A first determining module, configured to determine a first total number of processor cores in the server;

[0093] A second determination module is used to determine a second total value of storage units in the server, where the storage units include storage units divided in the last level cache of the processor;

[0094] A first configuration module, configured to configure a storage unit for each processor core according to the first total value and the second total value to obtain a configuration result;

[0095] The first allocation module is used to allocate processor cores and storage units to the target application according to the configuration result, so that the delay of the target application meets the requirement.

[0096] The description of the processor resource allocation system provided by the present invention can be found in the above embodiments, which will not be repeated here.

[0097] The present invention also provides an electronic device and a computer-readable storage medium, both of which have the corresponding effects of the processor resource allocation method provided in the embodiment of the present invention. Figure 6 , Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.

[0098] An electronic device provided by an embodiment of the present invention includes a memory 201 and a processor 202. The memory 201 stores a computer program. When the processor 202 executes the computer program, the steps of the processor resource allocation method described in any of the above embodiments are implemented.

[0099] See also Figure 7 Another electronic device provided in an embodiment of the present invention may also include: an input port 203 connected to the processor 202, used to transmit commands input from the outside to the processor 202; a display unit 204 connected to the processor 202, used to display the processing results of the processor 202 to the outside; a communication module 205 connected to the processor 202, used to realize communication between the electronic device and the outside. The display unit 204 can be a display panel, a laser scanning display, etc.; the communication method adopted by the communication module 205 includes but is not limited to mobile high-definition link technology (Mobile High-Definition Link, MHL), Universal Serial Bus (Universal Serial Bus, USB), High-Definition Multimedia Interface (High-Definition Multimedia Interface, HDMI), wireless connection: wireless fidelity technology (WIreless Fidelity, WiFi), Bluetooth communication technology, low-power Bluetooth communication technology, and communication technology based on IEEE802.11s.

[0100] An embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the processor resource allocation method described in any of the above embodiments are implemented.

[0101] The computer-readable storage medium involved in the present invention includes random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM (Compact Disc Read-Only Memory), or any other form of storage medium known in the technical field.

[0102] A computer program product provided by an embodiment of the present invention includes a computer program / instruction. When the computer program / instruction is executed by a processor, the following steps are implemented:

[0103] determining a first total number of processor cores in the server;

[0104] Determining a second total number of storage units in the server, the storage units including storage units divided in a last level cache of the processor;

[0105] According to the first total value and the second total value, configure a storage unit for each processor core to obtain a configuration result;

[0106] Processor cores and storage units are allocated to the target application according to the configuration result, so that the delay of the target application meets the requirement.

[0107] A computer program product provided by an embodiment of the present invention includes a computer program / instruction, which implements the following steps when executed by a processor: determining configuration information based on a first total value and a second total value, the configuration information being used to record the quantity value of storage units to be configured for each processor core; and configuring a corresponding number of storage units for each processor core according to the configuration information to obtain a configuration result.

[0108] A computer program product provided by an embodiment of the present invention includes a computer program / instruction, which implements the following steps when executed by a processor: generating a first ratio of a second total value to a first total value; and determining configuration information to configure a first ratio of storage units for each processor core.

[0109] A computer program product provided by an embodiment of the present invention includes a computer program / instruction, which implements the following steps when executed by a processor: selecting an unassigned processor core as a first core; allocating the first core and the corresponding storage unit to a target application according to a configuration result; collecting a first delay of the target application after a preset time; in response to the first delay not meeting the delay requirement of the target application, returning to execute the step of selecting an unassigned processor core as the first core; in response to the first delay meeting the delay requirement of the target application, ending.

[0110] A computer program product provided by an embodiment of the present invention includes a computer program / instruction, which implements the following steps when executed by a processor: after allocating processor cores and storage units to a target application according to a configuration result, determining a third total value of processor cores allocated to the target application; and reducing resources of the target application according to the third total value based on a delay requirement of the target application.

[0111] A computer program product provided by an embodiment of the present invention includes a computer program / instruction, which implements the following steps when executed by a processor: in response to a third total value being greater than 1, selecting a first number of processor cores allocated to a target application as a second core, and prohibiting the second core from serving the target application; collecting a second delay of the target application after a preset time; in response to the second delay not meeting the delay requirement of the target application, allocating the second core to the target application; in response to the second delay meeting the delay requirement of the target application, changing the second core to an idle processor core.

[0112] A computer program product provided by an embodiment of the present invention includes a computer program / instruction, which implements the following steps when executed by a processor: in response to a third total value being equal to 1, selecting a second number of storage units allocated to a target application as a first unit, and prohibiting the first unit from serving the target application; collecting a third delay of the target application after a preset time; in response to the third delay not meeting the delay requirement of the target application, allocating the first unit to the target application; in response to the third delay meeting the delay requirement of the target application, changing the first unit to an idle storage unit.

[0113] A computer program product provided by an embodiment of the present invention includes a computer program / instruction, which implements the following steps when executed by a processor: after allocating processor cores and storage units to a target application according to a configuration result, determining a fourth total value of idle processor cores; determining a fifth total value of idle storage units; and allocating the idle processor cores and idle storage units to existing applications in a server based on the fourth total value and the fifth total value.

[0114] A computer program product provided by an embodiment of the present invention includes a computer program / instruction, which implements the following steps when executed by a processor: in response to a fifth total value being greater than a fourth total value, and the fourth total value being greater than zero, generating a second ratio of the fifth total value to the fourth total value; allocating an idle processor core and a second ratio of idle storage units to existing applications each time; in response to the fifth total value being less than or equal to the fourth total value, and the fifth total value being greater than zero, allocating an idle processor core and an idle storage unit to existing applications each time.

[0115] A computer program product provided by an embodiment of the present invention includes a computer program / instruction, which implements the following steps when executed by a processor: in response to a fourth total value being greater than zero and a fifth total value being equal to zero, allocating an idle processor core to an existing application each time; in response to a fifth total value being greater than zero and a fourth total value being equal to zero, allocating an idle storage unit to an existing application each time.

[0116] A computer program product provided by an embodiment of the present invention includes a computer program / instruction, which implements the following steps when executed by a processor: according to a rule of giving priority to applications with burst input / output, according to a fourth total value and a fifth total value, idle processor cores and idle storage units are allocated to existing applications in a server.

[0117] A computer program product provided by an embodiment of the present invention includes a computer program / instruction, which implements the following steps when executed by a processor: determining an existing application program with burst input / output as an object to be allocated, collecting a fourth delay of the object to be allocated; detecting whether the fourth delay meets a delay requirement; in response to the fourth delay not meeting the delay requirement, selecting an object to be transferred from an existing application program without burst input / output, and transferring an idle processor core and an idle storage unit allocated to the object to be transferred to the object to be allocated.

[0118] For the description of the relevant parts of a processor resource allocation system, electronic device, computer program product, and computer-readable storage medium provided by the embodiment of the present invention, please refer to the detailed description of the corresponding parts in a processor resource allocation method provided by the embodiment of the present invention, which will not be repeated here. In addition, the parts of the above technical solutions provided by the embodiment of the present invention that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive elaboration.

[0119] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0120] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A processor resource allocation method, characterized in that: include: determining a first total number of processor cores in the server; Determining a second total number of storage units in the server, the storage units comprising storage units divided in a last level cache of a processor; According to the first total value and the second total value, configure the storage unit for each of the processor cores to obtain a configuration result; The processor core and the storage unit are allocated to the target application according to the configuration result, so that the delay of the target application meets the requirement.

2. The processor resource allocation method according to claim 1, characterized in that: According to the first total value and the second total value, the storage unit is configured for each of the processor cores to obtain a configuration result, including: Determine configuration information according to the first total value and the second total value, wherein the configuration information is used to record the quantity value of the storage units to be configured for each of the processor cores; According to the configuration information, a corresponding number of the storage units are configured for each of the processor cores to obtain the configuration result.

3. The processor resource allocation method according to claim 2, characterized in that: Determining configuration information according to the first total value and the second total value includes: generating a first ratio of the second total value to the first total value; The configuration information is determined to configure the first ratio of the storage units for each of the processor cores.

4. The processor resource allocation method according to claim 3, characterized in that: Allocating the processor core and the storage unit to the target application according to the configuration result so that the delay of the target application meets the requirement, including: Selecting an unassigned processor core as a first core; Allocating the first core and the corresponding storage unit to the target application according to the configuration result; collecting a first delay of the target application after a preset time period; In response to the first delay not meeting the delay requirement of the target application, returning to the step of selecting an unassigned processor core as a first core; In response to the first delay reaching the delay requirement of the target application, the process ends.

5. The processor resource allocation method according to claim 1, characterized in that: After allocating the processor core and the storage unit to the target application according to the configuration result, the method further includes: determining a third total number of the processor cores allocated to the target application; According to the delay requirement of the target application, resources of the target application are reduced according to the third total value.

6. The processor resource allocation method according to claim 5, characterized in that: According to the delay requirement of the target application, reducing the resources of the target application according to the third total value includes: In response to the third total value being greater than 1, selecting a first number of the processor cores allocated to the target application as second cores, and prohibiting the second cores from serving the target application; After a preset time period, collecting a second delay of the target application; In response to the second delay not satisfying a delay requirement of the target application, allocating the second core to the target application; In response to the second delay satisfying the delay requirement of the target application, the second core is changed to the idle processor core.

7. The processor resource allocation method according to claim 5, characterized in that: According to the delay requirement of the target application, reducing resources of the target application according to the third total value includes: In response to the third total value being equal to 1, selecting a second number of the storage units allocated to the target application as first units, and prohibiting the first units from serving the target application; collecting a third delay of the target application after a preset time period; In response to the third delay not satisfying a delay requirement of the target application, allocating the first unit to the target application; In response to the third delay satisfying the delay requirement of the target application, the first unit is changed to the idle storage unit.

8. The processor resource allocation method according to claim 1, characterized in that: After allocating the processor core and the storage unit to the target application according to the configuration result, the method further includes: determining a fourth total number of said processor cores that are idle; determining a fifth total number of said memory cells that are free; According to the fourth total value and the fifth total value, the idle processor cores and the idle storage units are allocated to existing applications in the server.

9. The processor resource allocation method according to claim 8, characterized in that: Allocating the idle processor cores and the idle storage units to existing applications in the server according to the fourth total value and the fifth total value, comprising: In response to the fifth total value being greater than the fourth total value, and the fourth total value being greater than zero, generating a second ratio of the fifth total value to the fourth total value; allocating one idle processor core and the second ratio of idle storage units to the existing application each time; In response to the fifth total value being less than or equal to the fourth total value, and the fifth total value being greater than zero, one idle processor core and one idle storage unit are allocated to the existing application each time.

10. The processor resource allocation method according to claim 8, characterized in that: Allocating the idle processor cores and the idle storage units to existing applications in the server according to the fourth total value and the fifth total value, comprising: In response to the fourth total value being greater than zero and the fifth total value being equal to zero, allocating one idle processor core to the existing application at a time; In response to the fifth total value being greater than zero and the fourth total value being equal to zero, one free storage unit is allocated to the existing application each time.

11. The processor resource allocation method according to claim 8, characterized in that: Allocating the idle processor cores and the idle storage units to existing applications in the server according to the fourth total value and the fifth total value, comprising: According to the rule of giving priority to applications with burst input / output, the idle processor cores and the idle storage units are allocated to existing applications in the server according to the fourth total value and the fifth total value.

12. The processor resource allocation method according to claim 11, characterized in that: Also includes: Determine the existing application program with burst input / output as an object to be allocated, and collect the fourth delay of the object to be allocated; Detecting whether the fourth delay meets the delay requirement; In response to the fourth delay not meeting the delay requirement, an object to be transferred is selected from the existing application without burst input / output, and the idle processor core and the idle storage unit allocated to the object to be transferred are transferred to the object to be allocated.

13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the processor resource allocation method according to any one of claims 1 to 12 are implemented.

14. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the processor resource allocation method according to any one of claims 1 to 12 when executing the computer program.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the processor resource allocation method according to any one of claims 1 to 12 are implemented.