System resource adaptation method and device, and storage medium

By dynamically adjusting system resource configuration based on historical resource usage information, the problem of system resource configuration failing to meet performance bottleneck shifts was solved, thereby improving resource utilization and user experience.

CN120144291BActive Publication Date: 2026-04-10CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In existing technologies, the system resource configuration is fixed, which cannot meet the user needs after the performance bottleneck point shifts, resulting in a poor user experience.

Method used

By obtaining the initial resource configuration of the target system, dividing the historical time period into multiple time windows, collecting resource usage information, identifying resource modules to be expanded and reduced, and calculating the adjustment amount based on the actual throughput and maximum throughput, the resource configuration is dynamically adjusted.

Benefits of technology

It enables flexible adjustment of resource configuration according to user needs, improves resource utilization and user experience, and avoids performance bottlenecks in fixed configuration mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144291B_ABST
    Figure CN120144291B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of data processing, in particular to a system resource adaptation method and device and a storage medium. The method comprises the following steps: obtaining initial resource configuration of a target system; dividing a historical time period into multiple time windows which appear periodically, and counting resource usage information of the target system by a target user in each time window; determining a resource module to be expanded, a target time window corresponding to the resource module to be expanded, and a resource module to be reduced according to the initial resource configuration and the resource usage information; determining an adjustment amount according to actual throughput, maximum throughput and actual system resource amount of the resource module to be expanded and the resource module to be reduced corresponding to the target time window; when the current time is in the target time window, increasing the actual system resource amount of the resource module to be expanded by the adjustment amount, and reducing the system resource amount of the resource module to be reduced by the adjustment amount. The embodiment of the application can solve the problem that the current system resource configuration mode has poor user experience.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a system resource adaptation method and device and storage medium. BACKGROUND

[0002] With the change of user service demand, the performance bottleneck point of system resources may shift. For example, in the early stage, the system may be limited by storage capacity, and in the later stage, throughput or access delay may become the main bottleneck as data grows. However, the current system resource configuration is still in a fixed mode, that is, the initial configuration provided to the user is used to provide services to the user, which cannot meet the user's demand after the performance bottleneck point shifts, resulting in poor user experience. SUMMARY

[0003] To solve the above technical problems, the present application provides a system resource adaptation method, device and storage medium, which can solve the problem that the current system resource configuration method cannot meet the user's demand after the performance bottleneck point shifts, resulting in poor user experience.

[0004] In a first aspect, the present application provides a system resource adaptation method, comprising: obtaining an initial resource configuration of a target system; the initial resource configuration at least including the type and maximum throughput of each resource module; dividing a historical time period into a plurality of time windows that occur periodically, and counting resource usage information of the target system by a target user in each time window; the resource usage information including the type, actual throughput, and actual system resource amount of each resource module; determining a resource module to be expanded, a target time window corresponding to the resource module to be expanded, and a resource module to be reduced according to the initial resource configuration and the resource usage information; the actual throughput of the resource module to be expanded corresponding to the target time window being greater than or equal to a first preset proportion of the maximum throughput; the actual throughput of the resource module to be reduced corresponding to the target time window being less than a second preset proportion of the maximum throughput, and the type of the resource module to be reduced being the same as that of the resource module to be expanded; the second preset proportion being less than the first preset proportion; determining an adjustment amount according to the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be expanded corresponding to the target time window, and the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be reduced; and when the current time is in the target time window, increasing the actual system resource amount of the resource module to be expanded by the adjustment amount, and reducing the system resource amount of the resource module to be reduced by the adjustment amount.

[0005] In some embodiments, according to the initial resource configuration and the resource usage information, the to-be-expanded resource module and the target time window corresponding to the to-be-expanded resource module are determined, including: when the actual throughput of the resource module in the time window is greater than or equal to a first preset proportion of the maximum throughput, the resource module is determined as a candidate resource module, and the time window is determined as a candidate time window; when the candidate time window corresponding to the candidate resource module appears more than a quantity threshold in a historical time period, the candidate resource module is determined as the to-be-expanded resource module, and the candidate time window is determined as the target time window.

[0006] In some embodiments, according to the actual throughput, the maximum throughput, and the actual system resource amount of the to-be-expanded resource module corresponding to the target time window, and the actual throughput, the maximum throughput, and the actual system resource amount of the to-be-reduced resource module, the adjustment amount is determined, including: a first preset proportion of the maximum throughput of the to-be-expanded resource module is determined as a first true value, and a second preset proportion of the maximum throughput of the to-be-reduced resource module is determined as a second true value; a difference between the actual throughput of the to-be-expanded resource module and the first true value is determined as a first difference, and a difference between the actual throughput of the to-be-reduced resource module and the second true value is determined as a second difference; a product of the first difference and the actual system resource amount of the to-be-expanded resource module is determined as a first product, and a product of the second difference and the actual system resource amount of the to-be-reduced resource module is determined as a second product; a quotient of the first product and the maximum throughput of the to-be-expanded resource module is determined as a first threshold, and a quotient of the second product and the maximum throughput of the to-be-reduced resource module is determined as a second threshold; any value between the first threshold and the second threshold is determined as the adjustment amount.

[0007] In some embodiments, the actual system resource amount of the to-be-expanded resource module is increased by the adjustment amount, including: when the type of the resource module is CPU, the number of threads scheduling the CPU in the to-be-expanded resource module is increased according to the adjustment amount; or the execution efficiency of a single thread in the to-be-expanded resource module is modified according to the adjustment amount.

[0008] In some embodiments, the initial resource configuration further includes an initial system resource amount of each resource module; after the target time window ends, the system resource amounts of the to-be-expanded resource module and the to-be-reduced resource module are adjusted to the initial system resource amounts according to the initial resource configuration.

[0009] In some embodiments, the maximum throughput and the actual throughput are input-output (IO) throughputs of the resource module; the to-be-reduced resource module supports at least one other service in addition to supporting IO services.

[0010] In a second aspect, the present application provides an adaptive device for system resources, comprising: an obtaining module, configured to obtain an initial resource configuration of a target system; the initial resource configuration at least comprising a type and a maximum throughput of each resource module; a processing module, configured to divide a historical time period into a plurality of time windows which occur periodically, and to count resource usage information of the target system by a target user in each time window; the resource usage information comprising the type, an actual throughput, and an actual system resource amount of each resource module; a determining module, configured to determine a resource module to be expanded, a target time window corresponding to the resource module to be expanded, and a resource module to be reduced according to the initial resource configuration and the resource usage information; the actual throughput of the resource module to be expanded in the target time window being greater than or equal to a first preset proportion of the maximum throughput; the actual throughput of the resource module to be reduced in the target time window being less than a second preset proportion of the maximum throughput, and the type of the resource module to be reduced being the same as that of the resource module to be expanded; the second preset proportion being less than the first preset proportion; the determining module being further configured to determine an adjustment amount according to the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be expanded in the target time window, and the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be reduced; and an adjusting module, configured to increase the actual system resource amount of the resource module to be expanded by the adjustment amount and to decrease the system resource amount of the resource module to be reduced by the adjustment amount when the current time is in the target time window.

[0011] In some embodiments, the determining module is specifically configured to: determine a resource module as a candidate resource module and a time window as a candidate time window when the actual throughput of the resource module in the time window is greater than or equal to a first preset proportion of the maximum throughput; and determine the candidate resource module as the resource module to be expanded and the candidate time window as the target time window when the candidate time window corresponding to the candidate resource module occurs more than a quantity threshold value in the historical time period.

[0012] In some embodiments, the determining module is specifically configured to: determine the first preset proportion of the maximum throughput of the resource module to be expanded as a first true value, and determine the second preset proportion of the maximum throughput of the resource module to be reduced as a second true value; determine a first difference value as a difference between the actual throughput of the resource module to be expanded and the first true value, and determine a second difference value as a difference between the actual throughput of the resource module to be reduced and the second true value; determine a first product value as a product of the first difference value and the actual system resource amount of the resource module to be expanded, and determine a second product value as a product of the second difference value and the actual system resource amount of the resource module to be reduced; determine a first threshold value as a quotient of the first product value and the maximum throughput of the resource module to be expanded, and determine a second threshold value as a quotient of the second product value and the maximum throughput of the resource module to be reduced; and determine any value between the first threshold value and the second threshold value as the adjustment amount.

[0013] In some embodiments, the adjusting module is specifically configured to increase the number of threads of the scheduled CPU in the resource module to be expanded according to the adjustment amount when the type of the resource module is CPU; or modify the execution efficiency of a single thread in the resource module to be expanded according to the adjustment amount.

[0014] In some embodiments, the initial resource configuration further includes an initial system resource amount of each resource module; and the adjusting module is further configured to adjust the system resource amount of the resource module to be expanded and the resource module to be reduced to the initial system resource amount according to the initial resource configuration after the end of the target time window.

[0015] In some embodiments, the maximum throughput and the actual throughput are input / output (IO) throughputs of the resource module; and the resource module to be reduced supports at least one type of service in addition to IO service.

[0016] In a third aspect, the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, and the computer program is executed by the processor to implement the system resource adaptation method in any one of the embodiments of the first aspect.

[0017] In a fourth aspect, the present application provides a computer readable storage medium, comprising a computer program stored on the computer readable storage medium, and the computer program is executed by the processor to implement the system resource adaptation method in any one of the embodiments of the first aspect.

[0018] In a fifth aspect, the present application provides a computer program product, comprising: when the computer program product is executed on a computer, the computer is enabled to implement the system resource adaptation method in any one of the embodiments of the first aspect.

[0019] Compared with the prior art, the technical scheme provided in the application has the following advantages: first, the initial resource configuration of the target system is obtained. The initial resource configuration at least includes the type and maximum throughput of each resource module. Then, a historical time period is divided into a plurality of time windows that occur periodically, and the resource usage information of the target system by the target user in each time window is counted. The resource usage information includes the type, actual throughput, and actual system resource amount of each resource module. Then, according to the initial resource configuration and the resource usage information, the resource module to be expanded, the target time window corresponding to the resource module to be expanded, and the resource module to be reduced are determined. The actual throughput of the resource module to be expanded in the target time window is greater than or equal to the first preset proportion of the maximum throughput; the actual throughput of the resource module to be reduced in the target time window is less than the second preset proportion of the maximum throughput, and the type of the resource module to be reduced is the same as that of the resource module to be expanded; the second preset proportion is less than the first preset proportion. Finally, according to the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be expanded in the target time window, and the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be reduced, the adjustment amount is determined, and when the current time is in the target time window, the actual system resource amount of the resource module to be expanded is increased by the adjustment amount, and the system resource amount of the resource module to be reduced is reduced by the adjustment amount. In this way, the resource configuration in the corresponding time period can be flexibly adjusted according to the corresponding resource usage information of the target user in the historical time period, avoiding the problem that all users are configured with fixed configurations, which cannot meet the user demand after the performance bottleneck point is transferred, thereby improving the resource utilization rate and improving the user experience. BRIEF DESCRIPTION OF DRAWINGS

[0020] The accompanying drawings, which are incorporated into and form a part of the specification, illustrate an embodiment consistent with the present application and, together with the specification, serve to explain the principles of the application.

[0021] In order to more clearly illustrate the technical scheme in the embodiments of the application or the prior art, the accompanying drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, for those skilled in the art, other drawings can also be obtained without creative labor.

[0022] Figure 1 One of the flowcharts of the system resource adaptation method provided in the embodiments of the application;

[0023] Figure 2 The second flowchart of the system resource adaptation method provided in the embodiments of the application;

[0024] Figure 3The third flowchart of the system resource adaptation method provided by the embodiment of the present application;

[0025] Figure 4 The structural schematic diagram of a system resource adaptation device provided by the embodiment of the present application;

[0026] Figure 5 The structural schematic diagram of an electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0028] When the storage system is delivered, a reasonable hardware and software configuration scheme is formulated according to the performance requirement of the user, that is, a fixed system resource configuration scheme is configured at the initial delivery. However, for the same storage cluster of the same user, the business model and pressure borne by the cluster are different every day or every week, and present a certain regularity. In this way, with the change of the business, such as the change of the bandwidth, calculation or throughput, the performance bottleneck point of the storage will shift. Such fixed configuration strategy cannot completely meet the optimal performance matching requirement in the whole time period.

[0029] To solve the above problems, the embodiment of the present application provides a system resource adaptation method, comprising: obtaining initial resource configuration of a target system; the initial resource configuration at least comprises the type and maximum throughput of each resource module; dividing a historical time period into a plurality of time windows which occur periodically, and counting resource usage information of the target system by a target user in each time window; the resource usage information comprises the type, actual throughput and actual system resource amount of each resource module; determining a resource module to be expanded, a target time window corresponding to the resource module to be expanded, and a resource module to be reduced according to the initial resource configuration and the resource usage information; the actual throughput of the resource module to be expanded corresponding to the target time window is greater than or equal to a first preset proportion of the maximum throughput; the actual throughput of the resource module to be reduced corresponding to the target time window is less than a second preset proportion of the maximum throughput, and the type of the resource module to be reduced is the same as that of the resource module to be expanded; the second preset proportion is less than the first preset proportion; determining an adjustment amount according to the actual throughput, the maximum throughput and the actual system resource amount of the resource module to be expanded corresponding to the target time window, and the actual throughput, the maximum throughput and the actual system resource amount of the resource module to be reduced; when the current time is in the target time window, increasing the actual system resource amount of the resource module to be expanded by the adjustment amount, and reducing the system resource amount of the resource module to be reduced by the adjustment amount. In this way, the resource configuration of the corresponding time period can be flexibly adjusted according to the corresponding resource usage information of the target user in the historical time period, avoiding the problem that all users are configured with fixed configurations, and the user demand cannot be met after the performance bottleneck point is transferred, thereby improving the resource utilization rate and the user experience.

[0030] The system resource adaptation method provided by the embodiment of the present application can be executed by a system resource adaptation device. The system resource adaptation device can be hardware or software. When the system resource adaptation device is hardware, it can be various electronic devices with a system resource adaptation function, including but not limited to a mobile phone, a computer, a computer, a tablet computer, etc. When the system resource adaptation device is software, it can be installed in the above-mentioned electronic devices. It can be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is made here.

[0031] In the following description, many specific details are set forth in order to provide a thorough understanding of the present application. However, the present application can be practiced in a variety of ways different from those described herein; obviously, the embodiments in the specification are only a part of the embodiments of the present application, not all the embodiments.

[0032] Figure 1 The flowchart of the system resource adaptation method provided by the embodiment of the present application is shown in Figure 1 The system resource adaptation method can comprise the following steps:

[0033] S11, obtaining an initial resource configuration of a target system.

[0034] The initial resource configuration at least includes a type and a maximum throughput of each resource module. The type of system resource refers to a classification of various hardware and software resources available for users in the target system, for example, memory, network bandwidth, central processing unit (CPU), etc. The target system can be a centralized storage system, a distributed storage system, various computer systems, etc. The maximum throughput can be the maximum Input / Output (IO) throughput of the resource module.

[0035] In some embodiments, the initial resource configuration can further include a capacity type, an identifier, and an initial system resource amount of each resource module. The capacity type can be the read-write capacity of the IO corresponding to the resource module, and the identifier of the resource module can be the name corresponding to the resource module. For example, when the type of system resource is CPU, the initial resource configuration is shown in Table 1 below, including the capacity type, the maximum throughput, the identifier, the type, and the initial system resource amount of each resource module.

[0036] Table 1

[0037] Capacity Type Max Throughput Identification Type Initial System Resource Amount Small IO Read 80K Gateway CPU 8 Small IO Read / Write 60K Storage Index Pool CPU 24 Small IO Write 40K Storage Index Pool CPU 24 Large IO Read 1 GB Storage Data Pool CPU 8 Large IO Read / Write 500 MB Storage Data Pool CPU 8 Large IO Write 300 MB Storage Data Pool CPU 8

[0038] Specifically, the way to obtain the initial resource configuration of the target system can be to obtain it from a pre-stored database, or to configure it according to the actual performance results before release according to the hardware configuration and software version of the target system, which is not limited in the present application.

[0039] S12, dividing a historical time period into a plurality of periodically occurring time windows, and counting resource usage information of the target system by the target user in each time window.

[0040] The resource usage information includes the type, the actual throughput, and the actual system resource amount of each resource module. The historical time period is long enough and can be divided into a plurality of periodically occurring time windows. For example, when the time window is calculated in minutes, the historical time period is calculated in hours, days, weeks, months, years, etc. When the time window is calculated in hours, the historical time period is calculated in days, weeks, months, years, etc. Similarly, when the time window is calculated in months, the historical time period is calculated in years, decades, etc. The actual throughput can be the actual IO throughput of the resource module.

[0041] Specifically, the target system records historical resource usage information of the target system in a historical time period when the target system is running in a production environment corresponding to the target user, and divides the historical time period into a plurality of time windows according to a preset granularity (such as seconds, minutes, hours, days, etc.), and determines the historical resource usage information corresponding to each time window as the resource usage information of the target system in the time window.

[0042] In some embodiments, the granularity of the time window can be 10 minutes. In some embodiments, the resource usage information can further include the capacity type and the identifier of each resource module.

[0043] For example, when the type of the system resource is CPU and the granularity of the time window is 10 minutes, the resource usage information of the target system in the following time windows of the target user is as shown in Table 2.

[0044] Table 2

[0045]

[0046] In some embodiments, after the resource usage information of each time window of the target system is counted, the system resource adaptation method further includes removing outliers (such as too large or too small data) in the resource usage information to ensure the accuracy of the data.

[0047] S13, determining the to-be-expanded resource module, the target time window corresponding to the to-be-expanded resource module, and the to-be-reduced resource module according to the initial resource configuration and the resource usage information.

[0048] The actual throughput of the to-be-expanded resource module in the target time window is greater than or equal to a first preset proportion of the maximum throughput, and the actual throughput of the to-be-reduced resource module in the target time window is less than a second preset proportion of the maximum throughput, and the type of the to-be-reduced resource module is the same as that of the to-be-expanded resource module. The second preset proportion is less than the first preset proportion. The first preset proportion and the second preset proportion are preset, for example, are default values, or are values set by relevant personnel according to actual conditions, for example, the first preset proportion is 80%, and the second preset proportion is 50%.

[0049] Specifically, according to the initial resource configuration and the resource usage information, the to-be-expanded resource module and the target time window corresponding to the to-be-expanded resource module can be determined in the following manner: when the actual throughput of a certain resource module is greater than or equal to a first preset proportion of the maximum throughput, the time window corresponding to the actual throughput is determined as the target time window, and the resource module is determined as the to-be-expanded resource module.

[0050] For example, when the first preset proportion is 75%, and the resource usage information of the target system of the target user in each time window of the historical time period is as shown in Table 2, it can be obtained that the storage data pool is the to-be-expanded resource module in the time period from 00:30 to 01:10. In the time period from 00:30 to 00:40, the ratio of the actual throughput to the maximum throughput of the storage data pool is 800÷1024=0.78>75%; in the time period from 00:40 to 00:50, the ratio of the actual throughput to the maximum throughput of the storage data pool is 860÷1024=0.84>75%; in the time period from 00:50 to 01:00, the ratio of the actual throughput to the maximum throughput of the storage data pool is 460÷500=0.92>75%; and in the time period from 01:00 to 01:10, the ratio of the actual throughput to the maximum throughput of the storage data pool is 300÷300=1>75%.

[0051] Then, the to-be-reduced resource module is determined according to the resource usage information of the other resource modules corresponding to the target time window. Specifically, a resource module corresponding to the target time window, whose actual throughput is less than the maximum throughput by the second preset proportion, and whose type is the same as that of the to-be-expanded resource module, is determined as the to-be-reduced resource module.

[0052] For example, when the second preset proportion is 50%, the storage data pool is the to-be-expanded resource module in the time period from 00:30 to 01:10, and the ratio of the actual throughput to the maximum throughput of the gateway in the time period from 00:30 to 01:10 is 800÷80000=0.01, since 0.01<50%, the gateway is determined as the to-be-reduced resource module.

[0053] In some embodiments, the maximum throughput and the actual throughput are input-output (IO) throughputs of the resource module; and the to-be-reduced resource module supports at least one other service in addition to the IO service. The other service is a service that does not need to occupy the resource of the type corresponding to the to-be-expanded resource module, for example, when the type corresponding to the to-be-expanded resource module is CPU, the other service can be a broadband service. In this way, the influence of the adjustment process on the IO service can be avoided to the greatest extent when the system resources are adjusted, and the normal operation of the service is ensured.

[0054] S14, determining an adjustment amount according to the actual throughput, the maximum throughput, and the actual system resource amount of the to-be-expanded resource module corresponding to the target time window, and the actual throughput, the maximum throughput, and the actual system resource amount of the to-be-reduced resource module.

[0055] Specifically, first, the adjustment amount can be determined according to the formula calculating a minimum value of the adjustment amount, wherein x represents the minimum value of the adjustment amount, X represents the actual system resource amount of the resource module to be expanded, a represents the actual throughput of the resource module to be expanded, w1 represents a first preset proportion of the maximum throughput of the resource module to be expanded, and A represents the maximum throughput of the resource module to be expanded.

[0056] Then, according to the formula calculating a maximum value of the adjustment amount of a single resource module to be reduced, wherein y represents the maximum value of the adjustment amount of a single resource module to be reduced, Y represents the actual system resource amount of the resource module to be reduced, b represents the actual throughput of the resource module to be reduced, w1 represents a second preset proportion of the maximum throughput of the resource module to be reduced, and B represents the maximum throughput of the resource module to be reduced.

[0057] Finally, if y > x, the adjustment amount can be determined using one resource module to be reduced, that is, the adjustment amount takes any value between x and y; if y < x, the adjustment amount can be determined using at least two resource modules to be reduced, that is, the adjustment amount takes any value between x and the sum of the maximum values of the adjustment amount of a single resource module to be reduced calculated by the at least two resource modules to be reduced; if y = x, the adjustment amount can be directly set as y or x, and the one resource module to be reduced is used to adjust the resource module to be expanded.

[0058] S15, at a current time in a target time window, increasing the actual system resource amount of the resource module to be expanded by the adjustment amount, and reducing the system resource amount of the resource module to be reduced by the adjustment amount.

[0059] First, the actual system resource amount of the resource module to be expanded is increased by the adjustment amount. Specifically, the actual system resource amount of the resource module to be expanded can be increased by the adjustment amount in the following ways: when the type of the resource module is CPU, the number of threads scheduling the CPU in the resource module to be expanded is increased according to the adjustment amount; or the execution efficiency of a single thread in the resource module to be expanded is modified according to the adjustment amount, for example, the mapping relationship between the original thread and the CPU is changed from 2 threads mapping 1 CPU to 1 thread mapping 1 CPU.

[0060] Then, the system resource amount of the resource module to be reduced is reduced by the adjustment amount.

[0061] Specifically, first, when the resource module to be reduced is one, the system resource amount of the one resource module to be reduced is directly reduced by the adjustment amount; when the resource module to be reduced is multiple, the system resource amounts of the multiple resource modules to be reduced are collectively reduced by the adjustment amount according to the actual situation (the proportion of the actual throughput to the maximum throughput) of the multiple resource modules to be reduced.

[0062] Secondly, the way of reducing the system resource amount of the resource module to be reduced by the adjustment amount can be, when the type of the resource module is CPU, reducing the CPU ratio of the resource module to be reduced, i.e. reducing the number of CPUs used by the resource module to be reduced. For example, it can be dynamically reduced or restarted in turn after configuration modification.

[0063] For example, when the type of the system resource is CPU, the resource module to be expanded is a storage data pool, the target time window includes 00:30 to 01:10, the resource module to be reduced is a gateway, and the adjustment amount is 4, Table 2 is adjusted as follows in Table 3.

[0064] Table 3

[0065]

[0066] In some embodiments, the initial resource configuration further includes an initial system resource amount of each resource module; and the system resource adaptation method further includes: adjusting the system resource amount of the resource module to be expanded and the resource module to be reduced to the initial system resource amount according to the initial resource configuration after the end of the target time window. In this way, the system resource amount of the resource module to be expanded and the resource module to be reduced can be adjusted to the initial state after the end of the target time window, ensuring that the system resource can be configured in the most suitable way selected initially outside the target time window, and ensuring the stability of the system.

[0067] In the scheme, first, the initial resource configuration of the target system is acquired. The initial resource configuration at least includes the type and maximum throughput of each resource module. Then, the historical time period is divided into multiple time windows that occur periodically, and the resource usage information of the target system in each time window by the target user is counted. The resource usage information includes the type, actual throughput, and actual system resource amount of each resource module. Then, according to the initial resource configuration and the resource usage information, the resource module to be expanded, the target time window corresponding to the resource module to be expanded, and the resource module to be reduced are determined. The actual throughput of the resource module to be expanded in the target time window is greater than or equal to the first preset proportion of the maximum throughput; the actual throughput of the resource module to be reduced in the target time window is less than the second preset proportion of the maximum throughput, and the type of the resource module to be reduced is the same as that of the resource module to be expanded; and the second preset proportion is less than the first preset proportion. Finally, according to the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be expanded in the target time window, and the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be reduced, the adjustment amount is determined, and when the current time is in the target time window, the actual system resource amount of the resource module to be expanded is increased by the adjustment amount, and the system resource amount of the resource module to be reduced is reduced by the adjustment amount. In this way, the resource configuration in the corresponding time period can be flexibly adjusted according to the corresponding resource usage information of the target user in the historical time period, avoiding the problem that all users are configured with fixed configurations, and the user demand after the performance bottleneck point shifts cannot be met, thereby improving the resource utilization rate and improving the user experience.

[0068] In some embodiments, as shown in Figure 2 The way of determining the resource module to be expanded, and the target time window corresponding to the resource module to be expanded according to the initial resource configuration and the resource usage information can include the following steps:

[0069] S131, when the actual throughput of the resource module in the time window is greater than or equal to the first preset proportion of the maximum throughput, the resource module is determined as a candidate resource module, and the time window is determined as a candidate time window.

[0070] S132, when the number of times of occurrence of the candidate time window corresponding to the candidate resource module in the historical time period is greater than a quantity threshold, the candidate resource module is determined as the resource module to be expanded, and the candidate time window is determined as the target time window.

[0071] The quantity threshold is a preset value, which can be a default value, or a value set by relevant personnel according to actual conditions, or a value set according to the number of time window periods in the historical time period.

[0072] According to the actual throughput, the maximum throughput, and the actual system resource amount of the to-be-expanded resource module corresponding to the target time window, and the actual throughput, the maximum throughput, and the actual system resource amount of the to-be-reduced resource module, the adjustment amount is determined, so that the system resource adjustment method is improved in flexibility, and the user experience is indirectly improved.

[0073] In some embodiments, as shown in Figure 3 The manner of determining the adjustment amount according to the actual throughput, the maximum throughput, and the actual system resource amount of the to-be-expanded resource module corresponding to the target time window, and the actual throughput, the maximum throughput, and the actual system resource amount of the to-be-reduced resource module can include the following steps:

[0074] S141, a first preset proportion of the maximum throughput of the to-be-expanded resource module is determined as a first true value, and a second preset proportion of the maximum throughput of the to-be-reduced resource module is determined as a second true value.

[0075] Specifically, the first true value can be calculated according to the formula w1=A*n, and the second true value can be calculated according to the formula w2=B*m. Wherein, w1 is used to represent the first true value, that is, the first preset proportion of the maximum throughput of the to-be-expanded resource module; A is used to represent the maximum throughput of the to-be-expanded resource module; n is used to represent the first preset proportion; B is used to represent the maximum throughput of the to-be-reduced resource module; w2 is used to represent the second true value, that is, the second preset proportion of the maximum throughput of the to-be-reduced resource module; m is used to represent the second preset proportion.

[0076] S142, the difference between the actual throughput of the to-be-expanded resource module and the first true value is determined as a first difference, and the difference between the actual throughput of the to-be-reduced resource module and the second true value is determined as a second difference.

[0077] Specifically, the first difference can be calculated according to the formula c1=a-w1, and the second difference can be calculated according to the formula c2=b-w2. Wherein, c1 is used to represent the first difference, and c2 is used to represent the second difference; a is used to represent the actual throughput of the to-be-expanded resource module, and b is used to represent the actual throughput of the to-be-reduced resource module; w1 is used to represent the first true value, and w2 is used to represent the second true value.

[0078] S143, the product of the first difference and the actual system resource amount of the to-be-expanded resource module is determined as a first product, and the product of the second difference and the actual system resource amount of the to-be-reduced resource module is determined as a second product.

[0079] Specifically, the first product can be calculated according to a formula d1=c1*X, and the second product can be calculated according to a formula d2=c2*Y. Wherein, d1 is used to represent the first product, d2 is used to represent the second product; c1 is used to represent the first difference value, c2 is used to represent the second difference value; X is used to represent the actual system resource amount of the resource module to be expanded, and Y is used to represent the actual system resource amount of the resource module to be reduced.

[0080] In S144, a quotient of the first product and the maximum throughput of the resource module to be expanded is determined as the first threshold value, and a quotient of the second product and the maximum throughput of the resource module to be reduced is determined as the second threshold value.

[0081] Specifically, the first threshold value can be calculated according to a formula e1=d1 / A, and the second threshold value can be calculated according to a formula e2=d2 / B. Wherein, e1 is used to represent the first threshold value, e2 is used to represent the second threshold value; d1 is used to represent the first product, d2 is used to represent the second product; A is used to represent the maximum throughput of the resource module to be expanded, and B is used to represent the maximum throughput of the resource module to be reduced.

[0082] In S145, any value between the first threshold value and the second threshold value is determined as the adjustment amount.

[0083] Specifically, if the first threshold value is less than the second threshold value, any value between the first threshold value and the second threshold value is determined as the adjustment amount; if the first threshold value is equal to the second threshold value, the first threshold value or the second threshold value is determined as the adjustment amount; if the first threshold value of the resource module to be expanded is greater than the second threshold value of all the resource modules to be reduced in the target time window, it is determined that there is no resource module to be reduced in the target time window, and the adjustment amount cannot be determined, that is, the resource adjustment cannot be completed. When it is determined that the resource adjustment cannot be completed, a non-adjustment indication can be sent.

[0084] In the above scheme, the selectable range of the adjustment amount can be determined according to the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be expanded and the resource module to be reduced, which avoids the problem that the resource of the resource module to be reduced is insufficient after the resource module to be expanded is adjusted, guarantees the stability of the system, and indirectly improves the user experience.

[0085] The embodiment of the present application can divide the functional modules of the system resource adaptation device according to the above method examples. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated in one processing unit. The integrated modules can be realized in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is illustrative, and is only a logical function division. In actual implementation, another division mode can be used.

[0086] AsFigure 4 Fig. 2 shows a structural diagram of a system resource adaptation device provided by an embodiment of the present application, which comprises an obtaining module 51, a processing module 52, a determining module 53, and an adjusting module 54.

[0087] The obtaining module 51 is configured to obtain an initial resource configuration of a target system; the initial resource configuration at least comprises the type and the maximum throughput of each resource module; the processing module 52 is configured to divide a historical time period into a plurality of periodically occurring time windows, and to count resource usage information of the target system by a target user in each time window; the resource usage information comprises the type, the actual throughput, and the actual system resource amount of each resource module; the determining module 53 is configured to determine a resource module to be expanded, a target time window corresponding to the resource module to be expanded, and a resource module to be reduced according to the initial resource configuration and the resource usage information; the actual throughput of the resource module to be expanded in the target time window is greater than or equal to a first preset proportion of the maximum throughput; the actual throughput of the resource module to be reduced in the target time window is less than a second preset proportion of the maximum throughput, and the type of the resource module to be reduced is the same as that of the resource module to be expanded; the second preset proportion is less than the first preset proportion; the determining module 53 is further configured to determine an adjustment amount according to the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be expanded in the target time window, and the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be reduced; and the adjusting module 54 is configured to increase the actual system resource amount of the resource module to be expanded by the adjustment amount and to decrease the system resource amount of the resource module to be reduced by the adjustment amount when the current time is in the target time window.

[0088] In the scheme, first, the initial resource configuration of the target system is acquired. The initial resource configuration at least includes the type and the maximum throughput of each resource module. Then, the historical time period is divided into a plurality of time windows that occur periodically, and the resource usage information of the target system in each time window by the target user is counted. The resource usage information includes the type, the actual throughput, and the actual system resource amount of each resource module. Then, according to the initial resource configuration and the resource usage information, the resource module to be expanded, the target time window corresponding to the resource module to be expanded, and the resource module to be reduced are determined. The actual throughput of the resource module to be expanded in the target time window is greater than or equal to the first preset proportion of the maximum throughput; the actual throughput of the resource module to be reduced in the target time window is less than the second preset proportion of the maximum throughput, and the type of the resource module to be reduced is the same as that of the resource module to be expanded; and the second preset proportion is less than the first preset proportion. Finally, according to the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be expanded in the target time window, and the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be reduced, the adjustment amount is determined, and the actual system resource amount of the resource module to be expanded is increased by the adjustment amount and the system resource amount of the resource module to be reduced is reduced by the adjustment amount when the current time is in the target time window. In this way, the resource configuration in the corresponding time period can be flexibly adjusted according to the resource usage information of the target user in the historical time period, avoiding the problem that all users are configured with fixed configurations, which cannot meet the user demand after the performance bottleneck point is transferred, thereby improving the resource utilization rate and improving the user experience.

[0089] In some embodiments, the determining module 53 is specifically configured to: when the actual throughput of the resource module in the time window is greater than or equal to the first preset proportion of the maximum throughput, the resource module is determined as a candidate resource module, and the time window is determined as a candidate time window; when the number of occurrences of the candidate time window corresponding to the candidate resource module in the historical time period is greater than a quantity threshold, the candidate resource module is determined as the resource module to be expanded, and the candidate time window is determined as the target time window.

[0090] In some embodiments, the determining module 53 is specifically configured to: determine a first preset proportion of the maximum throughput of the resource module to be expanded as a first true value, and determine a second preset proportion of the maximum throughput of the resource module to be reduced as a second true value; determine a difference between the actual throughput of the resource module to be expanded and the first true value as a first difference, and determine a difference between the actual throughput of the resource module to be reduced and the second true value as a second difference; determine a product of the first difference and the actual system resource amount of the resource module to be expanded as a first product, and determine a product of the second difference and the actual system resource amount of the resource module to be reduced as a second product; determine a quotient of the first product and the maximum throughput of the resource module to be expanded as a first threshold value, and determine a quotient of the second product and the maximum throughput of the resource module to be reduced as a second threshold value; and determine any value between the first threshold value and the second threshold value as the adjustment amount.

[0091] In some embodiments, the adjusting module 54 is specifically configured to, when the type of the resource module is a CPU, increase the number of threads of the CPU in the resource module to be expanded according to the adjustment amount; or modify the execution efficiency of a single thread in the resource module to be expanded according to the adjustment amount.

[0092] In some embodiments, the initial resource configuration further includes an initial system resource amount of each resource module; and the adjusting module 54 is further configured to, after the end of the target time window, adjust the system resource amount of the resource module to be expanded and the resource module to be reduced to the initial system resource amount according to the initial resource configuration.

[0093] In some embodiments, the maximum throughput and the actual throughput are input / output (IO) throughputs of the resource module; and the resource module to be reduced supports at least one type of service in addition to IO services.

[0094] The system resource adaptation apparatus provided by the embodiment can execute the system resource adaptation method provided by the method embodiments, and has similar implementation principles and technical effects, which will not be described here.

[0095] Figure 5 An electronic device according to an example embodiment. The electronic device can include a processor 802 configured to execute application code to implement the system resource adaptation method of the present application.

[0096] The processor 802 can be a central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of programs of the present application.

[0097] As Figure 5As shown, the electronic device may also include a memory 803. The memory 803 stores application code that executes the scheme of this application, and its execution is controlled by the processor 802.

[0098] The memory 803 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 803 may exist independently and be connected to the processor 802 via bus 804. The memory 803 may also be integrated with the processor 802.

[0099] like Figure 5 As shown, the electronic device may also include a communication interface 801, wherein the communication interface 801, the processor 802, and the memory 803 may be coupled to each other, for example, through a bus 804. The communication interface 801 is used for information interaction with other devices, for example, supporting information interaction between the electronic device and other devices.

[0100] It should be pointed out that, Figure 5 The device structure shown does not constitute a limitation on the electronic device, except... Figure 5 In addition to the components shown, the electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. Furthermore, the electronic device provided in this embodiment can execute the system resource adaptation method provided in the above-described method embodiments; its implementation principle and technical effects are similar to the above methods, and will not be repeated here.

[0101] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the system resource adaptation method in the above-described method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0102] The computer readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0103] The computer program product stores a computer program, and the computer program is executed by a processor to implement each process of the system resource adaptation method in the method embodiments and achieve the same technical effects. To avoid repetition, details are not described herein.

[0104] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media including computer-usable program code.

[0105] In the present application, the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or can also be any conventional processor.

[0106] In the present application, the memory can include a non-persistent memory in a computer readable medium, a random access memory (RAM) and / or a non-volatile memory, etc. in the form of a read-only memory (ROM) or a flash memory (flash RAM). The memory is an example of a computer readable medium.

[0107] In this application, computer readable medium includes permanent and non-permanent, removable and non-removable storage media. Storage media can be implemented by any method or technology to store information, which can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic disk storage or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable medium does not include transitory media such as modulated data signal and carrier wave.

[0108] It should be noted that, in this text, relational terms such as "first" and "second" 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 the entities or operations. Moreover, the terms "include", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0109] The above is only a specific embodiment of the present application, so that those skilled in the art can understand or implement the present application. Various modifications of these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method of adapting system resources, characterized by, The method comprises: obtaining an initial resource configuration of a target system; the initial resource configuration at least comprises a type and a maximum throughput of each resource module; dividing a historical time period into a plurality of periodically-occurring time windows, and counting resource usage information of the target system by a target user in each time window; the resource usage information comprises the type, actual throughput, and actual system resource amount of each resource module; determining a resource module to be expanded, a target time window corresponding to the resource module to be expanded, and a resource module to be reduced according to the initial resource configuration and the resource usage information; the actual throughput of the resource module to be expanded in the target time window is greater than or equal to a first preset proportion of the maximum throughput; the actual throughput of the resource module to be reduced in the target time window is less than a second preset proportion of the maximum throughput, and the type of the resource module to be reduced is the same as that of the resource module to be expanded; the second preset proportion is less than the first preset proportion; determining an adjustment amount according to the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be expanded in the target time window, and the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be reduced; when the current time is in the target time window, increasing the actual system resource amount of the resource module to be expanded by the adjustment amount, and decreasing the system resource amount of the resource module to be reduced by the adjustment amount; wherein the determining of the adjustment amount according to the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be expanded in the target time window, and the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be reduced comprises: determining a first true value as the first preset proportion of the maximum throughput of the resource module to be expanded, and determining a second true value as the second preset proportion of the maximum throughput of the resource module to be reduced; determining a first difference value as a difference between the actual throughput of the resource module to be expanded and the first true value, and determining a second difference value as a difference between the actual throughput of the resource module to be reduced and the second true value; determining a first product value as a product of the first difference value and the actual system resource amount of the resource module to be expanded, and determining a second product value as a product of the second difference value and the actual system resource amount of the resource module to be reduced; determining a first threshold value as a quotient of the first product value and the maximum throughput of the resource module to be expanded, and determining a second threshold value as a quotient of the second product value and the maximum throughput of the resource module to be reduced; determining any value between the first threshold value and the second threshold value as the adjustment amount.

2. The adaptation method according to claim 1, characterized in that, The determining of the resource module to be expanded, the target time window corresponding to the resource module to be expanded, comprises: when the actual throughput of a resource module in a time window is greater than or equal to a first preset proportion of the maximum throughput, determining the resource module as a candidate resource module, and determining the time window as a candidate time window; When a number of occurrences of a candidate time window corresponding to the candidate resource module in a historical time period is greater than a quantity threshold, the candidate resource module is determined as a resource module to be expanded, and the candidate time window is determined as a target time window.

3. The adaptation method of claim 1, wherein, The actual system resource amount of the resource module to be expanded is increased by the adjustment amount, including: When the type of the resource module is a CPU, a number of threads of the resource module to be expanded is increased according to the adjustment amount, or an execution efficiency of a single thread of the resource module to be expanded is modified according to the adjustment amount.

4. The adaptation method of claim 1, wherein, The initial resource configuration further includes an initial system resource amount of each resource module; After the target time window ends, system resource amounts of the resource module to be expanded and the resource module to be reduced are adjusted to initial system resource amounts according to the initial resource configuration.

5. The adaptation method of claim 1, wherein, The maximum throughput and the actual throughput are input / output (IO) throughputs of the resource module; and the resource module to be reduced supports at least one type of service in addition to IO service.

6. A system resource adaptation apparatus, characterized by comprising: The method comprises: an obtaining module configured to obtain an initial resource configuration of a target system; The initial resource configuration at least includes a type and a maximum throughput of each resource module; a processing module configured to divide a historical time period into a plurality of time windows occurring periodically, and to count resource usage information of the target system by a target user in each time window; The resource usage information includes the type, the actual throughput, and the actual system resource amount of each resource module; a determining module configured to determine a resource module to be expanded, a target time window corresponding to the resource module to be expanded, and a resource module to be reduced according to the initial resource configuration and the resource usage information; The actual throughput of the resource module to be expanded in the target time window is greater than or equal to a first preset proportion of the maximum throughput; The actual throughput of the resource module to be reduced in the target time window is less than a second preset proportion of the maximum throughput, and the type of the resource module to be reduced is the same as that of the resource module to be expanded; The second preset proportion is less than the first preset proportion; The determining module is further configured to determine an adjustment amount according to the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be expanded in the target time window, and the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be reduced. an adjusting module configured to increase an actual system resource amount of the resource module to be expanded by the adjustment amount, and to decrease a system resource amount of the resource module to be reduced by the adjustment amount when a current time is in the target time window. The determining module is further configured to determine an adjustment amount according to the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be expanded in the target time window, and the actual throughput, the maximum throughput, and the actual system resource amount of the resource module to be reduced, including: A first preset proportion of the maximum throughput of the resource module to be expanded is determined as a first true value, and a second preset proportion of the maximum throughput of the resource module to be reduced is determined as a second true value. determining a first difference value between the first true value and the actual throughput of the resource module to be expanded, and a second difference value between the second true value and the actual throughput of the resource module to be reduced; determining a first product value of the first difference value and the actual system resource amount of the resource module to be expanded, and a second product value of the second difference value and the actual system resource amount of the resource module to be reduced; determining a first threshold value of the first product value and the maximum throughput of the resource module to be expanded, and a second threshold value of the second product value and the maximum throughput of the resource module to be reduced; determining any value between the first threshold value and the second threshold value as the adjustment value.

7. An electronic device, comprising: comprising: a processor, a memory, and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implements the system resource adaptation method of any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, comprising: a computer program stored on the computer readable storage medium, the computer program, when executed by a processor, implements the system resource adaptation method of any one of claims 1 to 5.

9. A computer program product, characterised in that, the computer program product, when executed on a computer, causes the computer to implement the system resource adaptation method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Server resource control method and device, electronic equipment and storage medium

    CN117349015A

  • System resource adjustment method and device, storage medium and electronic equipment

    CN118349346A