Resource allocation method of data center, electronic equipment, storage medium and product

By monitoring the online application latency and resource utilization of the data center in real time, and making gradual resource adjustments based on preset thresholds and minimum resource units, the problem of high investment and low utilization in data centers is solved, and flexible resource allocation and performance optimization are achieved.

CN122064480APending Publication Date: 2026-05-19CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD
Filing Date
2026-01-19
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

The high investment and low resource utilization of data centers mean that existing technologies cannot effectively cope with dynamically changing load demands, and the cost of training neural network models is high.

Method used

By monitoring the latency and resource utilization of online applications in real time, resources are adjusted based on preset thresholds and minimum resource units, and the process is iterated until the latency is reduced, avoiding excessive resource adjustments at once.

Benefits of technology

It enables flexible and low-cost resource allocation, dynamically matches the actual needs of online applications, avoids resource waste and offline application operation disruptions, and improves the overall performance and stability of the data center.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122064480A_ABST
    Figure CN122064480A_ABST
Patent Text Reader

Abstract

The invention provides a resource allocation method of a data center, electronic equipment, a storage medium and a product. The method comprises the following steps: acquiring delay time of an online application running in a data center and utilization rates of various resources corresponding to the online application in real time; determining a target online application needing resource adjustment based on the delay time and a first preset threshold value, determining a target resource based on the utilization rate of the resource corresponding to the target online application, and increasing the target resource based on a preset minimum resource unit; and circularly executing the steps until determining that the target online application does not exist based on the comparison result. Therefore, the resource quota of the resource with the maximum use demand is increased according to the priority of the resource demand, and the resource quota is finely adjusted step by step through the minimum step length, so that the resource can dynamically match the actual demand of the online application, and resource waste and offline application operation blocking caused by one-time excessive resource adjustment are avoided; and a resource allocation scheme which is more flexible and has better dynamic adaptability is provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and in particular to a data center resource allocation method, electronic device, storage medium and product. Background Technology

[0002] High investment and low resource utilization in data centers have always been a concern for cloud service providers. A direct solution to this problem is to deploy online and offline applications together on equal resources to improve resource efficiency. However, competition for shared resources among these mixed deployments leads to performance interference between applications, impacting application performance, service quality, and user satisfaction. Related technologies include solutions that limit the resources available to offline applications, but these cannot effectively handle dynamically changing load demands. Another approach involves training neural network models to adjust resource allocation, but this requires a large amount of historical data and training time, and running neural network models is costly. Summary of the Invention

[0003] In view of this, embodiments of this application provide a resource allocation method, electronic device, storage medium, and product for a data center, aiming to achieve flexible and low-cost resource allocation.

[0004] The technical solution of this application embodiment is implemented as follows: In a first aspect, embodiments of this application provide a resource allocation method for a data center, the method comprising: Obtain the latency of the online applications running in the data center and the utilization rate of various resources corresponding to the online applications; If it is determined that there is a target online application that needs resource adjustment based on the delay time and the first preset threshold, then the target resource is determined based on the utilization rate of the resource corresponding to the target online application, and the target resource is increased based on the preset minimum resource unit. Repeat the above steps until it is determined that the target online application does not exist based on the delay time and the first preset threshold.

[0005] In the above scheme, the resources include a central processing unit (CPU), cache, and memory. Determining the target resources based on the utilization rate of the resources corresponding to the target online application includes: The first score is determined based on the CPU utilization rate and the rate of change of the CPU utilization rate. The second score is determined based on the cache utilization rate and the rate of change of the cache utilization rate; The third score is determined based on the memory usage rate and the rate of change of the memory usage rate; The resource corresponding to the highest score among the first score, the second score, and the third score is determined as the target resource.

[0006] In the above scheme, if at least two of the first score, the second score, and the third score are the highest scores, the method further includes: The target resource is determined based on the resource type and priority strategy corresponding to the highest score.

[0007] In the above scheme, increasing the target resource based on a preset minimum resource unit includes: If the target resource is CPU, add a thread to the target resource; If the target resource is a cache, add a cache path to the target resource; If the target resource is memory, increase the preset minimum memory capacity to the target resource.

[0008] The method in the above scheme further includes: Allocate unused resources in the data center to offline applications.

[0009] The method in the above scheme further includes: The historical latency times of multiple online applications are obtained, a target historical latency time is determined based on a preset ratio and the historical latency times arranged from smallest to largest, and a first preset threshold is determined based on the target historical latency time.

[0010] In the above scheme, determining the existence of a target online application requiring resource adjustment based on the delay time and a first preset threshold includes: For each of the aforementioned online applications, determine the average of the latest acquired preset quantity or multiple delay times within a preset duration; If the average value is greater than or equal to the first preset threshold, then the corresponding online application is determined to be the target online application.

[0011] In a second aspect, embodiments of this application provide an electronic device, including a processor and a memory for storing a computer program capable of running on the processor, wherein the processor executes the computer program to implement the steps of the method described in the first aspect.

[0012] Thirdly, a computer storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.

[0013] Fourthly, a computer program product includes a computer program that, when executed by a processor, implements the steps of the method as described in the first aspect.

[0014] The technical solution provided in this application provides real-time acquisition of the latency of online applications running in the data center and the utilization rate of various resources corresponding to the online applications; based on the latency and a first preset threshold, it determines the target online application that needs resource adjustment; based on the utilization rate of the resources corresponding to the target online application, it determines the target resource; and based on a preset minimum resource unit, it increases the target resource; it repeats the above steps until it is determined that there is no target online application based on the comparison results. This application's solution does not require building a neural network model, has clear and simple logic, and reduces costs; after detecting a large latency in an online application, it adjusts the resources occupied by that online application. Specifically, it increases the resource with the highest usage demand by a preset minimum resource unit, and after the resource adjustment, it judges the latency again until the latency of the online application is low. Thus, this application increases the resource quota of the resource with the highest usage demand according to the priority of resource demand, and gradually fine-tunes the resource quota through a minimum step size. This allows resources to dynamically match the actual needs of online applications, and avoids resource waste and offline application operation obstruction caused by excessive resource adjustments at once, providing a more flexible and dynamically adaptable resource allocation scheme. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating the resource allocation method for a data center provided in an embodiment of this application; Figure 2 This is a schematic diagram of the architecture of the data center resource allocation system provided in the application example of this application; Figure 3 This is a schematic diagram of the structure of the data center resource allocation device provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0016] The present application will now be described in further detail with reference to the accompanying drawings and embodiments.

[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.

[0018] High investment and low resource utilization in data centers have always been a concern for cloud service providers. A direct solution to this problem is to deploy online and offline applications together on equal resources to improve resource efficiency. However, competition for shared resources among these mixed deployments leads to performance interference between applications, impacting application performance, service quality, and user satisfaction. Related technologies include solutions that limit the resources available to offline applications, but these cannot effectively handle dynamically changing load demands. Another approach involves training neural network models to adjust resource allocation, but this requires a large amount of historical data and training time, and running neural network models is costly.

[0019] In various embodiments of this application, there is no need to construct a neural network model, the logic is clear and simple, and costs are reduced. After detecting a significant latency in an online application, the resources used by the online application are adjusted. Specifically, the resources with the highest usage demand are increased in preset minimum resource units. After resource adjustment, the latency is assessed again until the latency of the online application is low. In this way, this application increases the resource quota of the most demanding resource according to the priority of resource demand, and gradually fine-tunes the resource quota through minimum step sizes. This allows resources to dynamically match the actual needs of online applications, while avoiding resource waste and offline application operation obstruction caused by excessive resource adjustments at once, providing a more flexible and dynamically adaptable resource allocation scheme.

[0020] This application provides a resource allocation method for a data center, such as... Figure 1 As shown, the method includes: Step 101: Obtain the latency of the online applications running in the data center and the utilization rate of various resources corresponding to the online applications; Step 102: Based on the delay time and the first preset threshold, if it is determined that there is a target online application that needs resource adjustment, then the target resource is determined based on the utilization rate of the resource corresponding to the target online application, and the target resource is increased based on the preset minimum resource unit. Step 103: Repeat steps 101 and 102 until it is determined that the target online application does not exist based on the delay time and the first preset threshold.

[0021] In practical applications, by deploying and configuring log collection plugins, latency information of online applications is extracted non-intrusively from log files generated by the online applications. This latency information is then processed into a format conforming to the Prometheus system's (an open-source monitoring and alerting system) standard. Prometheus Exporter (a standardized data collection plugin in the Prometheus ecosystem, acting as a data bridge between the monitored object and the Prometheus server) is used to push this standard-format latency information to the Prometheus server. Additionally, Node Exporter (an open-source plugin in the Prometheus ecosystem for collecting server metrics) needs to be deployed to collect the utilization rates of various resources corresponding to the online applications. This metric data is exposed on an HTTP endpoint, which is added as the crawling target in the Prometheus configuration file. The crawling interval can be set so that Prometheus periodically obtains and stores the utilization information of various resources provided by Node Exporter, achieving comprehensive resource monitoring and efficient data analysis.

[0022] In Prometheus's alarm configuration file, a rule is set to trigger an alarm if the latency exceeds a first preset threshold. Upon detecting a latency exceeding this threshold, Prometheus responds to the alarm by having its resource adjustment module increase the resources most needed by the online application with high latency, using a preset minimum resource unit. After adjusting the resources, the latency and resource utilization are retrieved again to determine if any other online applications with high latency exist. If so, resource fine-tuning continues, again based on the preset minimum resource unit, ensuring the accuracy and effectiveness of the optimization process until no online applications with latency exceeding the first preset threshold remain.

[0023] Here, "delay time exceeding the first preset threshold" can be understood as "delay time greater than the first preset threshold" or "delay time greater than or equal to the first preset threshold". This application embodiment does not limit this.

[0024] In some embodiments, the latency of online applications running in the data center and the utilization rate of various resources corresponding to the online applications are acquired in real time to promptly identify online applications with high latency. Here, "real-time" can be understood as collecting latency and the utilization rate of various resources at preset collection intervals, such as 1 millisecond or 1 second, etc. This application embodiment does not limit the collection frequency. If the current application latency is lower than a first preset threshold, latency monitoring continues in real time. Once the Prometheus system issues an alarm, it immediately responds and adjusts resources for online applications with excessive latency to ensure that system performance remains at the expected level.

[0025] Understandably, this solution eliminates the need for building a neural network model, resulting in clear and simple logic and reduced costs. Upon detecting significant latency in an online application, the resources used by that application are adjusted. Specifically, the resources with the highest usage demand are increased in preset minimum resource units. Latency is assessed again after each resource adjustment until the online application's latency is reduced. In this way, this application increases the resource quota of the most demanding resource based on resource priority, and fine-tunes the resource quota step by step using minimum increments. This allows resources to dynamically match the actual needs of the online application while avoiding resource waste and offline application disruption caused by excessive one-time resource adjustments, providing a more flexible and dynamically adaptable resource allocation scheme.

[0026] In some embodiments, the method further includes: The historical latency times of multiple online applications are obtained, a target historical latency time is determined based on a preset ratio and the historical latency times arranged from smallest to largest, and a first preset threshold is determined based on the target historical latency time.

[0027] Here, the preset ratio can be a value such as 95% or 99%. This application embodiment does not limit the preset ratio. For example, if the preset ratio is 95%, then an alarm threshold for application latency is set based on the p95 metric. Specifically, the response latency times of 100 requests for online applications can be collected and sorted from smallest to largest. The sequence number of the selected latency time is determined by 95% of the total number of latency times. Thus, the 95th latency time is selected as the first preset threshold. The alarm threshold set based on the p95 metric can accurately reflect the response time of most requests, thereby quickly responding to potential performance problems.

[0028] In some embodiments, the resources include a central processing unit (CPU), cache, and memory, and determining the target resources based on the utilization rate of the resources corresponding to the target online application includes: The first score is determined based on the CPU utilization rate and the rate of change of the CPU utilization rate. The second score is determined based on the cache utilization rate and the rate of change of the cache utilization rate; The third score is determined based on the memory usage rate and the rate of change of the memory usage rate; The resource corresponding to the highest score among the first score, the second score, and the third score is determined as the target resource.

[0029] Here, the scores for CPU, Cache, and Memory are determined based on the current CPU, Cache, and Memory usage rates of the online application. The scoring formula can be: Score = Usage Rate × Rate of Change in Usage Rate. Based on the scores, CPU, Cache, and Memory are sorted from highest to lowest. During resource adjustments, the resource with the highest score is prioritized for adjustment. For example, if the CPU usage rate is 50% and the rate of change in usage is 5% / s, the first score is 0.5 × 0.05 = 0.025; if the Cache usage rate is 20% and the rate of change in usage is 5% / s, the second score is 0.2 × 0.05 = 0.010; and if the Memory usage rate is 70% and the rate of change in usage is 2% / s, the third score is 0.7 × 0.02 = 0.014. It is clear that the first score is the highest, therefore the CPU is considered the target resource, and resource adjustments are made to the CPU.

[0030] In some embodiments, if at least two of the first score, the second score, and the third score are the highest scores, the method further includes: The target resource is determined based on the resource type and priority strategy corresponding to the highest score.

[0031] Here, the priority strategy can be set as follows: prioritize memory adjustment, followed by cache, and finally CPU. This application embodiment does not limit the specific content of the priority strategy. For example, if the first, second, and third scores are the same, or if the third score is the highest score along with the first or second score, memory is determined as the target resource, and memory resource adjustments are performed.

[0032] In some embodiments, increasing the target resource based on a preset minimum resource unit includes: If the target resource is CPU, add a thread to the target resource; If the target resource is a cache, add a cache path to the target resource; If the target resource is memory, increase the preset minimum memory capacity to the target resource.

[0033] Here, resources are adjusted based on a preset minimum step size; specifically, resource adjustments are made based on the minimum adjustment unit. When the target resource is CPU, the minimum adjustment unit can be one CPU core; when the target resource is cache, the minimum adjustment unit can be one cache way; when the target resource is memory, the minimum adjustment unit can be a preset minimum memory capacity, such as 1GB. It is understood that this application embodiment does not limit the preset minimum memory capacity.

[0034] This ensures the meticulousness and precision of the resource optimization process. For example, if the current online application has a latency of 120 milliseconds, while the first preset threshold is 100 milliseconds, a Prometheus alert triggers the resource selection phase. It is found that the CPU's first score is higher than the cache's second score and the memory's third score; therefore, the CPU is prioritized for adjustment, adding one CPU core. After this adjustment, the latency drops to 110 milliseconds, and then another CPU core is added until the latency falls below 100 milliseconds. Adding only one CPU core at a time, rather than multiple cores, helps to observe the specific impact of each adjustment on system performance.

[0035] In some embodiments, after adjusting the target resources based on a preset minimum resource unit, various performance metrics of the system are continuously monitored in real time, including latency and the usage of each resource (such as the absolute value and percentage change rate of CPU, cache, and memory usage). Appropriate monitoring tools are used to record key performance indicators (such as average latency, maximum latency, and minimum latency). This data helps evaluate the effectiveness of the previous resource adjustment and determine whether further optimization is needed. If the latency of the online application remains higher than a first preset threshold after the previous adjustment, and the latency improvement is not significant, the preset minimum resource unit number for each adjustment can be appropriately increased.

[0036] Specifically, the gradient of latency change can be calculated. A low gradient indicates slow latency change and minimal latency improvement, thus requiring adjustment of the step size. The specific step size can be determined using a mapping table between the latency change gradient and the step size. For example, if the current online application latency is 120 milliseconds and the first preset threshold is 100 milliseconds, in response to a Prometheus alert, the resource selection phase begins. After calculating the resource scores for the online application, it is found that the CPU's first score is higher than the cache's second score and the memory's third score. Therefore, the CPU is prioritized for adjustment, adding one CPU core. After adjustment, the latency drops to 118 milliseconds. Assuming the time elapsed since the resource adjustment is 2 seconds, the latency change gradient is determined to be -1 ms / s. Based on this gradient value, the step size obtained from the mapping table is 2. Therefore, in the next resource adjustment, two CPU cores are added until the latency drops below 100 milliseconds. It is understood that the specific content of the mapping table is not limited in this embodiment.

[0037] In some embodiments, each time resources are adjusted, the system records the latency before and after the adjustment, resource usage (such as the absolute value and percentage change rate of CPU, cache, and memory utilization), key performance indicators (such as average latency, maximum latency, and minimum latency), and the amount and type of resource adjustment. It also monitors system load and performance anomalies, generating a detailed report. This report can be provided to neural network models or developers to help them determine the step size for the next resource adjustment.

[0038] In some embodiments, the method further includes: Allocate unused resources in the data center to offline applications.

[0039] Here, resources other than those for online applications are allocated to offline applications. This maximizes the operation of offline applications while ensuring low response times for online applications, improving resource competition between online and offline applications and enhancing the overall performance and stability of the data center.

[0040] In some embodiments, the Node Exporter also collects cache hit rate, specifically LLC (Level 3 cache) hit rate, which can be used to evaluate cache efficiency and help identify potential cache misses. Upper limit alarm thresholds can also be set for the collected CPU utilization, memory utilization, and LLC hit rate. For example, the upper limit alarm threshold for CPU utilization can be 90%, the upper limit alarm threshold for memory utilization can be 80%, and the upper limit alarm threshold for LLC hit rate can be 80%. Furthermore, resources exceeding the upper limit alarm threshold are adjusted based on a preset minimum resource unit. Specifically, if the resource exceeding the upper limit alarm threshold is CPU, one CPU thread is reduced; if the resource exceeding the upper limit alarm threshold is cache, one cache path is reduced; if the resource exceeding the upper limit alarm threshold is memory, the preset minimum memory capacity is reduced, such as by 1GB. After resource adjustment, the latest CPU utilization, memory utilization, and LLC hit rate are collected, and resource adjustments continue to be made based on the preset minimum resource unit for resources exceeding the upper limit alarm threshold until CPU utilization, memory utilization, and LLC hit rate are no longer exceeded.

[0041] Thus, limiting CPU and memory usage can prevent server crashes caused by sudden load increases and avoid crowding out offline application resources. Limiting cache or LLC hit rates can prevent a single online application from monopolizing the shared cache and protect the cache space of other applications.

[0042] In some embodiments, determining that there is a target online application requiring resource adjustment based on the delay time and a first preset threshold includes: For each of the aforementioned online applications, determine the average of the latest acquired preset quantity or multiple delay times within a preset duration; If the average value is greater than or equal to the first preset threshold, then the corresponding online application is determined to be the target online application.

[0043] Here, based on Prometheus's moving window analysis capability, statistical analysis is performed on latency, CPU utilization, memory utilization, and LLC hit rate. For example, taking latency as an example, the `avg_over_time()` function calculates the average latency within a specified time window. The most recently acquired latency value is added to the time window, while the latency value that has remained within the window the longest is excluded. If the average latency of all times within the current time window exceeds a first preset threshold, Prometheus issues an alarm. Thus, moving window analysis helps smooth data fluctuations, reduces false positive alarms, and ensures that alarms are based on persistent performance issues rather than transient anomalies, thereby improving the accuracy and reliability of the alarm system.

[0044] The technical solution provided in this application provides real-time acquisition of the latency of online applications running in the data center and the utilization rate of various resources corresponding to the online applications; based on the latency and a first preset threshold, it determines the target online application that needs resource adjustment; based on the utilization rate of the resources corresponding to the target online application, it determines the target resource; and based on a preset minimum resource unit, it increases the target resource; it repeats the above steps until it is determined that there is no target online application based on the comparison results. This application's solution does not require building a neural network model, has clear and simple logic, and reduces costs; after detecting a large latency in an online application, it adjusts the resources occupied by that online application. Specifically, it increases the resource with the highest usage demand by a preset minimum resource unit, and after the resource adjustment, it judges the latency again until the latency of the online application is low. Thus, this application increases the resource quota of the resource with the highest usage demand according to the priority of resource demand, and gradually fine-tunes the resource quota through a minimum step size. This allows resources to dynamically match the actual needs of online applications, and avoids resource waste and offline application operation obstruction caused by excessive resource adjustments at once, providing a more flexible and dynamically adaptable resource allocation scheme.

[0045] The following section provides a more detailed description of this application with reference to application examples.

[0046] The system architecture diagram provided in this application example is as follows: Figure 2 As shown, the monitoring module 201 collects logs from various online applications through the log collection module 202, converts the logs into a format recognizable by the Prometheus system, and uses the Prometheus Exporter to push the formatted log data to the Prometheus server. The monitoring module 201 also sets up a Node Exporter plugin to collect CPU usage, cache usage, LLC hit rate, and memory usage. The HTTP endpoint of the Node Exporter is added to the Prometheus configuration file as the crawling target so that Prometheus can periodically obtain usage data of various resources.

[0047] Interference detection module 203 starts resource adjustment based on Prometheus alarm information. If resource adjustment is determined to be necessary, resource adjustment module 204 determines the target resource to be adjusted based on CPU utilization, cache utilization, memory utilization, and priority strategy, and adjusts the target resource based on minimum step size.

[0048] Based on the above analysis, this solution uses real-time monitoring of online task application latency as a direct performance indicator, combined with monitoring of system resources such as CPU, LLC, and memory, to provide a more efficient and immediate interference detection mechanism. The dynamic resource allocation algorithm makes resource adjustment decisions based on real-time monitoring data and interference models, including increasing or decreasing resources. This solution makes multiple gradual adjustments by determining a step size, allowing for flexible resource adjustments after interference is detected. This solution gradually increases the resource quota for online applications according to the priority of resource requirements. Unlike fixed or single-amplitude adjustment methods, this solution can dynamically adjust resource allocation based on the priority and requirements of different tasks.

[0049] In order to implement the method of the embodiments of this application, the embodiments of this application also provide a resource allocation device for a data center, which corresponds to the resource allocation method of the data center described above. The steps in the resource allocation method embodiments of the data center are also fully applicable to the resource allocation device embodiments of the data center.

[0050] like Figure 3 As shown, the resource allocation device of the data center includes a monitoring module 301 and a resource adjustment module 302.

[0051] The monitoring module 301 is used to obtain the latency of the online applications running in the data center and the utilization rate of various resources corresponding to the online applications; The resource adjustment module 302 is used to determine that there is a target online application that needs resource adjustment based on the delay time and a first preset threshold, then determine the target resource based on the utilization rate of the resource corresponding to the target online application, and increase the target resource based on a preset minimum resource unit; Repeat the above steps until it is determined that the target online application does not exist based on the delay time and the first preset threshold.

[0052] In some embodiments, the resources include a central processing unit (CPU), cache, and memory, and the resource adjustment module 302 is specifically used for: The first score is determined based on the CPU utilization rate and the rate of change of the CPU utilization rate. The second score is determined based on the cache utilization rate and the rate of change of the cache utilization rate; The third score is determined based on the memory usage rate and the rate of change of the memory usage rate; The resource corresponding to the highest score among the first score, the second score, and the third score is determined as the target resource.

[0053] In some embodiments, if at least two of the first score, the second score, and the third score are the highest scores, the resource adjustment module 302 is specifically used for: The target resource is determined based on the resource type and priority strategy corresponding to the highest score.

[0054] In some embodiments, the resource adjustment module 302 is specifically used for: If the target resource is CPU, add a thread to the target resource; If the target resource is a cache, add a cache path to the target resource; If the target resource is memory, increase the preset minimum memory capacity to the target resource.

[0055] In some embodiments, the apparatus further includes a resource allocation module 303, which is configured to allocate unused resources in the data center to offline applications.

[0056] In some embodiments, the apparatus further includes a determining module 304, the determining module 304 being configured to: The historical latency times of multiple online applications are obtained, a target historical latency time is determined based on a preset ratio and the historical latency times arranged from smallest to largest, and a first preset threshold is determined based on the target historical latency time.

[0057] In some embodiments, the resource adjustment module 302 is specifically used for: For each of the aforementioned online applications, determine the average of the latest acquired preset quantity or multiple delay times within a preset duration; If the average value is greater than or equal to the first preset threshold, then the corresponding online application is determined to be the target online application.

[0058] It should be noted that the resource allocation device for data centers provided in the above embodiments is only illustrated by the division of the above-described program modules. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. Furthermore, the resource allocation device for data centers provided in the above embodiments and the resource allocation method embodiments for data centers belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0059] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiments of this application, the embodiments of this application also provide an electronic device. Figure 4 The diagram shows only an exemplary structure of the electronic device, not the entire structure; implementation is possible as needed. Figure 4 The structure shown may be part or all of the structure.

[0060] like Figure 4 As shown, the electronic device 400 provided in this application embodiment includes at least one processor 401, a memory 402, and a user interface 403. The various components in the electronic device 400 are coupled together via a bus system 404. It can be understood that the bus system 404 is used to implement communication between these components. In addition to a data bus, the bus system 404 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in… Figure 4 The general designated all buses as Bus System 404.

[0061] The user interface 403 may include a monitor, keyboard, mouse, trackball, click wheel, buttons, touchpad, or touch screen.

[0062] The memory 402 in this embodiment is used to store various types of data to support the operation of the electronic device 400. Examples of such data include any computer program used to operate on the electronic device 400.

[0063] The face liveness detection method disclosed in this application embodiment can be applied to, or implemented by, processor 401. Processor 401 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the face liveness detection method can be completed by the integrated logic circuitry of the hardware in processor 401 or by instructions in software form. The processor 401 can be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 401 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules can be located in a storage medium, specifically memory 402. Processor 401 reads information from memory 402 and, in conjunction with its hardware, completes the steps of the face liveness detection method provided in the embodiments of this application.

[0064] In an exemplary embodiment, the electronic device 400 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.

[0065] It is understood that memory 402 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Sync Link Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memories.

[0066] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory 402 that stores a computer program. The computer program can be executed by the processor 401 of the electronic device 400 to complete the steps described in the method of this application embodiment. The computer-readable storage medium can be a ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM, etc.

[0067] In an exemplary embodiment, this application also provides a computer program product, including a computer program that can be executed by a processor 401 of an electronic device 400 to perform the steps described in the method of this application embodiment.

[0068] It should be noted that terms such as "first" and "second" are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. In this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0069] It should be understood that the phrase "some embodiments" throughout the specification means that a particular feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, "some embodiments" appearing throughout the specification does not necessarily refer to the same embodiment.

[0070] In the description of the embodiments of this application, it should be noted that, unless otherwise explicitly specified and limited, the terms "connected" or "linked" should be interpreted broadly. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, an electrical connection, or a connection that allows communication between the components; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal communication between two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0071] Furthermore, the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.

[0072] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A resource allocation method for a data center, characterized in that, The method includes: Obtain the latency of the online applications running in the data center and the utilization rate of various resources corresponding to the online applications; If it is determined that there is a target online application that needs resource adjustment based on the delay time and the first preset threshold, then the target resource is determined based on the utilization rate of the resource corresponding to the target online application, and the target resource is increased based on the preset minimum resource unit. Repeat the above steps until it is determined that the target online application does not exist based on the delay time and the first preset threshold.

2. The method according to claim 1, characterized in that, The resources include a central processing unit (CPU), cache, and memory. Determining the target resources based on the utilization rate of the resources corresponding to the target online application includes: The first score is determined based on the CPU utilization rate and the rate of change of the CPU utilization rate. The second score is determined based on the cache utilization rate and the rate of change of the cache utilization rate; The third score is determined based on the memory usage rate and the rate of change of the memory usage rate; The resource corresponding to the highest score among the first score, the second score, and the third score is determined as the target resource.

3. The method according to claim 2, characterized in that, If at least two of the first score, the second score, and the third score are the highest scores, the method further includes: The target resource is determined based on the resource type and priority strategy corresponding to the highest score.

4. The method according to claim 1, characterized in that, The method of increasing the target resource based on a preset minimum resource unit includes: If the target resource is CPU, add a thread to the target resource; If the target resource is a cache, add a cache path to the target resource; If the target resource is memory, increase the preset minimum memory capacity to the target resource.

5. The method according to claim 1, characterized in that, The method further includes: Allocate unused resources in the data center to offline applications.

6. The method according to claim 1, characterized in that, The method further includes: The historical latency times of multiple online applications are obtained, a target historical latency time is determined based on a preset ratio and the historical latency times arranged from smallest to largest, and a first preset threshold is determined based on the target historical latency time.

7. The method according to claim 1, characterized in that, The step of determining that there is a target online application requiring resource adjustment based on the delay time and a first preset threshold includes: For each of the aforementioned online applications, determine the average of the latest acquired preset quantity or multiple delay times within a preset duration; If the average value is greater than or equal to the first preset threshold, then the corresponding online application is determined to be the target online application.

8. An electronic device comprising a processor and a memory for storing a computer program capable of running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7.

9. A computer storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.