Resource allocation method, electronic equipment, storage medium and program product

By using load prediction and resource configuration evaluation methods in the server resource allocation system, the problem of unreasonable resource allocation caused by inaccurate load prediction in existing systems is solved, and more efficient resource utilization and response performance is achieved.

CN120104356AActive Publication Date: 2025-06-06INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202510593395.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-06-06
Estimated Expiration
2045-05-09

AI Technical Summary

Technical Problem

In the case of inaccurate load prediction of existing server resource allocation systems, the resource allocation plan is insufficiently reasonable and difficult to cope with the actual load situation in the future period, reducing the server resource utilization and response performance.

Method used

By obtaining the resource operation parameters of the server, the resource operation data is obtained, and load prediction is performed based on this, short-term and long-term load values ​​are obtained, the initial resource configuration plan is determined, and the evaluation value is adjusted to the target resource configuration plan to achieve flexible and reasonable allocation of resources.

Benefits of technology

It improves the flexibility and rationality of server resource allocation, enhances resource utilization and response performance, and can better respond to the short-term and long-term load needs of the server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104356A_ABST
    Figure CN120104356A_ABST
Patent Text Reader

Abstract

The invention provides a resource allocation method which can be applied to the technical field of dynamic allocation of server resources. The method comprises the following steps: processing resource operation parameters of a server acquired at the current moment to obtain resource operation data; according to the resource operation data, predicting the load of the server to obtain a first load value of the first time period and a second load value of the second time period; determining an initial resource configuration scheme based on the first load value, the second load value and the resource operation data; evaluating the initial resource configuration scheme to obtain an evaluation value; and determining a target resource configuration scheme according to the evaluation value and the initial resource configuration scheme so as to carry out resource allocation according to the target resource configuration scheme. The invention further provides electronic equipment, a storage medium and a program product. According to the resource allocation method, the resource utilization rate of the server and the response performance of the server are improved through flexible allocation and reasonable allocation of the resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of dynamic allocation of server resources, and in particular to a resource allocation method, electronic equipment, storage medium and program product. Background Art

[0002] With the development of big data technology, servers are devices for processing data. The effective allocation and utilization of server resources can improve the efficiency of server data processing and service performance at the same time.

[0003] The current server resource allocation system allocates server resources based on the predicted load of the server in the future period. However, the current server resource allocation system does not accurately predict the load of the server in the future period, which leads to insufficient rationality of the server resource allocation plan, making it difficult to cope with the actual load situation in the future period, and reducing the server resource utilization and the server's response performance. Summary of the invention

[0004] In view of the above problems, the present invention provides a resource allocation method, an electronic device, a storage medium and a program product.

[0005] On the one hand, the present invention provides a resource allocation method, which includes: processing the resource operation parameters of the server obtained at the current moment to obtain resource operation data; predicting the load of the server based on the resource operation data to obtain a first load value for a first time period and a second load value for a second time period, wherein the start time of the first time period is earlier than or equal to the start time of the second time period, and the duration of the first time period is less than the duration of the second time period; determining an initial resource allocation plan based on the first load value, the second load value and the resource operation data; evaluating the initial resource allocation plan to obtain an evaluation value; determining a target resource allocation plan based on the evaluation value and the initial resource allocation plan, so as to allocate resources according to the target resource allocation plan.

[0006] Another aspect of the present invention provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0007] Another aspect of the present invention further provides a computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, the steps of the above method are implemented.

[0008] Another aspect of the present invention provides a computer program product, comprising a computer program or instructions, which implement the steps of the above method when the computer program or instructions are executed by a processor.

[0009] According to the resource allocation method provided by the embodiment of the present invention, since the first load value and the second load value of the server are determined according to the resource operation data during the resource allocation process, since the starting time of the first period is less than the starting time of the second period, and the first period and duration are less than the duration of the second period, the first load value can be a short-term load value, and the second load value can be a long-term load value, so that the server resource allocation system can respond to both the short-term load of the server and the long-term load of the server when performing resource allocation, thereby improving the flexibility of resource allocation. The initial resource allocation scheme of the present invention is determined according to the resource operation data, the first load value and the second load value collected in real time, and such an initial resource allocation scheme can be closer to the actual operation of the server, thereby improving the rationality and availability of the resource allocation scheme. By evaluating the initial resource allocation scheme and further determining the target resource allocation scheme according to the evaluation value, the rationality of the target resource allocation scheme can be further improved, and the waste of resources can be reduced. The resource allocation method of the present invention improves the resource utilization rate of the server and the response performance of the server through flexible and reasonable allocation of resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The above contents and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings.

[0011] Figure 1 An application scenario diagram of a resource allocation method according to an embodiment of the present invention is shown.

[0012] Figure 2 The flowchart of the resource allocation method according to the embodiment of the present invention is schematically shown.

[0013] Figure 3A A diagram showing the relationship between the first time period and the second time period according to an embodiment of the present invention is shown.

[0014] Figure 3B A relationship diagram between a first time period and a second time period according to another embodiment of the present invention is shown.

[0015] Figure 3C A diagram showing the relationship between the first time period and the second time period according to yet another embodiment of the present invention is shown.

[0016] Figure 4 A flow chart of a resource allocation method according to another embodiment of the present invention is shown.

[0017] Figure 5 The structure block diagram of the resource allocation device according to the embodiment of the present invention is schematically shown.

[0018] Figure 6A block diagram of an electronic device suitable for implementing a resource allocation method according to an embodiment of the present invention is schematically shown. DETAILED DESCRIPTION

[0019] Below, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present invention. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of embodiments of the present invention. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of concepts of the present invention.

[0020] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0021] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0022] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0023] The purpose of dynamic allocation of server resources is to improve the efficiency of server resource utilization and response speed. In the current dynamic allocation of server resources, the data collected from the server nodes is noisy, resulting in deviations in the predicted load; due to the large differences in the data scales of different resource types, directly using the original data for analysis will lead to inaccurate load predictions. In addition, the current load predictions are difficult to effectively capture the long-term dependencies in time series data, resulting in inaccurate load value predictions, which in turn makes the resource allocation scheme determined based on the predicted load value not only have low resource utilization, but also difficult to cope with sudden high or low load situations of the server. The current resource allocation system is difficult to respond in a timely manner when dealing with sudden high or low loads, which can easily cause service interruptions or lead to server performance degradation.

[0024] In view of this, embodiments of the present invention provide a resource allocation method, an electronic device, a storage medium, and a program product, which are used to improve the utilization of server resources and server performance.

[0025] Figure 1 An application scenario diagram of a resource allocation method according to an embodiment of the present invention is shown.

[0026] like Figure 1 As shown, the application scenario 100 of this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server cluster 105. The network 104 is used to provide a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server cluster 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables.

[0027] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices with display screens, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers. The user may use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 cluster through the network 104 to receive or send messages, etc. For example, to send a resource allocation request, or to receive a target resource configuration plan, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as resource allocation applications, load prediction applications, shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as an example). Optionally, the resource allocation request may not require the user to trigger it through the terminal device. The resource allocation request may be automatically triggered by a scheduled task or in response to the amount of tasks to be executed exceeding a predetermined task amount threshold. The user may only browse the resource allocation process of the embodiment of the present invention through the terminal device.

[0028] The servers in the server cluster 105 may be servers that provide various services, such as a first server 1051 for resource allocation, and a second server 1052 for executing tasks. The first server 1051 may process the resource operation parameters of the second server 1052, predict the load of the second server 1052, and determine the target resource configuration scheme of the second server 1052 according to the load of the second server 1052 in response to the resource allocation request, and feed back the target resource configuration scheme to the terminal device. In another example, the first server 1051 may process the resource operation parameters of the first server 1051 and the second server 1052, predict the load of the first server 1051 and the second server 1052, determine the target resource configuration scheme of the first server 1051 and the second server 1052 according to the load of the first server 1051 and the second server 1052, and feed back the target resource configuration scheme to the terminal device in response to the resource allocation request. In another example, the second server 1052 can process the resource operation parameters of the first server 1051 and the second server 1052 in response to the resource allocation request, predict the load of the first server 1051 and the second server 1052, determine the target resource configuration scheme of the first server 1051 and the second server 1052 according to the load of the first server 1051 and the second server 1052, and feed back the target resource configuration scheme to the terminal device. That is, any server in the server cluster 105 can execute the resource allocation method of the embodiment of the present invention.

[0029] It should be noted that the resource allocation method provided in the embodiment of the present invention can generally be executed by the server cluster 105. Accordingly, the resource allocation device provided in the embodiment of the present invention can generally be set in the server cluster 105. The resource allocation method provided in the embodiment of the present invention can also be executed by a server or server cluster that is different from the server cluster 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server cluster 105. Accordingly, the resource allocation device provided in the embodiment of the present invention can also be set in a server or server cluster that is different from the server cluster 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server cluster 105.

[0030] It should be understood that Figure 1 The number of terminal devices, networks and server clusters in the embodiment is only for illustration. Any number of terminal devices, networks and server clusters may be provided according to implementation requirements.

[0031] The following will be based on Figure 1 The scene described by Figure 2~Figure 4The resource allocation method according to the embodiment of the present invention is described in detail.

[0032] Figure 2 The flowchart of the resource allocation method according to an embodiment of the present invention is schematically shown. Figure 2 As shown, the resource allocation method of this embodiment includes operations S210 to S250.

[0033] In operation S210, the resource operation parameters of the server acquired at the current moment are processed to obtain resource operation data.

[0034] In operation S220, the load of the server is predicted based on the resource operation data to obtain a first load value for a first time period and a second load value for a second time period, wherein the start time of the first time period is earlier than or equal to the start time of the second time period, and the duration of the first time period is less than the duration of the second time period.

[0035] In operation S230, an initial resource configuration scheme is determined based on the first load value, the second load value, and the resource operation data.

[0036] In operation S240, the initial resource allocation solution is evaluated to obtain an evaluation value.

[0037] In operation S250, a target resource allocation scheme is determined according to the evaluation value and the initial resource allocation scheme, so as to perform resource allocation according to the target resource allocation scheme.

[0038] In some embodiments, the current time may be the time when the resource allocation request is received, or the time when the resource allocation task starts to be executed. A task of regularly collecting server resource operation parameters may be set in the resource allocation task, and the current time may be the time when the task of collecting server resource operation parameters starts to be executed. The resource operation parameters may change in real time.

[0039] In some embodiments, the server may be a device for performing resource allocation. The server may refer to Figure 1 Any server in server cluster 105 shown.

[0040] In some embodiments, the resource operation parameters of the server can be obtained through a sensor network. The resource operation parameters of the server obtained at the current moment may include the current resource operation parameters of the server at the current moment and the historical resource operation parameters at historical moments before the current moment. The resource operation parameters may include central processing unit (CPU) utilization, memory occupancy, network traffic, and storage data. The resource operation data may be obtained by smoothing the resource operation parameters using a sliding window mean filter method and then processing them using a standardized method.

[0041] The load of the server in the future time period is predicted according to the data change trend and periodic distribution characteristics of the resource operation data, and the first load value of the first time period and the second load value of the second time period can be obtained. The starting time of the first time period can be earlier than or equal to the starting time of the second time period, the starting time of the first time period and the starting time of the second time period can both be the current time, and the duration of the first time period is less than the duration of the second time period. The first load value of the first time period can be the short-term load value of the server, and the second load value of the second time period can be the long-term load value of the server. The duration of the first time period and the duration of the second time period can be adaptively adjusted according to actual needs. The process of predicting the load of the server can be achieved through a load prediction model. The load prediction model can be constructed based on a deep learning network, such as a long short-term memory neural network based on processing and predicting long-term dependencies in time series data.

[0042] Figure 3A FIG. 4 shows a relationship diagram between the first time period and the second time period according to an embodiment of the present invention. Figure 3A As shown, the start time of the first time period is equal to the start time of the second time period, both of which are the current time t. Taking the current time t as 0, the end time of the first time period as 1, and the end time of the second time period as 24 as an example, based on the resource operation parameters obtained at 0, the load from 0 to 1 is predicted to obtain the first load value; the load from 0 to 24 is predicted to obtain the second load value.

[0043] Figure 3B FIG. 4 shows a relationship diagram between the first time period and the second time period according to another embodiment of the present invention. Figure 3B As shown, the start time of the first time period is earlier than the start time of the second time period. Taking the current time t as 0, the end time of the first time period as 1, and the end time of the second time period as 24 as an example, based on the resource operation parameters obtained at 0, the load from 0 to 1 is predicted to obtain the first load value; the load from 1 to 24 is predicted to obtain the second load value.

[0044] Figure 3C FIG. 4 shows a relationship diagram between the first time period and the second time period according to another embodiment of the present invention. Figure 3C As shown, the start time and end time of the first time period are both earlier than the start time of the second time period. Taking the current time t as 0, the end time of the first time period as 1, the start time of the second time period as 2, and the end time of the second time period as 24 as an example, based on the resource operation parameters obtained at 0, the load from 0 to 1 is predicted to obtain the first load value; the load from 2 to 24 is predicted to obtain the second load value.

[0045] The initial resource configuration scheme can be determined using the above-mentioned first load value, second load value and resource operation data. For example, the first load value, the second load value and resource operation data can be weighted and summed to obtain a comprehensive load index value. According to the relationship between the comprehensive load index value and the load threshold, the load state of the server is determined. When the server is about to enter a high load, the resources of the server can be expanded, such as increasing the core of the CPU, to obtain an initial resource configuration scheme. When the server is about to enter a low load, the resources of the server can be reduced, such as releasing idle resources to obtain an initial resource configuration scheme.

[0046] In some embodiments, the initial resource configuration scheme obtained by the above operation can be evaluated to evaluate the balance between resources in the initial resource configuration scheme, avoid excessive waste or overconsumption of resources, and thus improve the performance of the server. For example, the resource increment can be determined based on the difference between the initial resource distribution data in the initial resource configuration scheme and the current resource distribution data of the server at the current moment, and the resource increment is weighted and summed to obtain the evaluation value. The resource distribution data can be the data of the computing unit used to perform the task. For example, for CPU resources, the resource distribution data can be the number of computing units that independently perform tasks inside the CPU, that is, the number of CPU cores. In the current resource distribution data, the number of CPU cores is 4. When the server is about to enter a high load, 2 cores can be added to the CPU, that is, the number of CPU cores is 6. In this case, the resource increment is 2, that is, the CPU has added 2 cores.

[0047] The evaluation value obtained by the above operation can be compared with a predetermined evaluation threshold. In the case where the evaluation value is less than or equal to the predetermined evaluation threshold, the target resource configuration scheme can be the initial resource configuration scheme. In the case where the evaluation value is greater than the predetermined evaluation threshold, the initial resource configuration scheme can be adjusted to obtain an updated resource configuration scheme, and then the updated resource distribution data in the updated resource configuration scheme and the resource increment of the current resource distribution data are used to obtain an updated evaluation value, and then the updated evaluation value is compared with the predetermined evaluation threshold. If the updated evaluation value is less than or equal to the predetermined evaluation threshold, the target resource configuration scheme can be the updated resource configuration scheme, and if the updated evaluation value is greater than the predetermined evaluation threshold, the initial resource configuration scheme can continue to be adjusted until the updated evaluation value is less than or equal to the predetermined evaluation threshold, or the predetermined number of adjustments is reached.

[0048] In one example, if the predetermined number of adjustments is reached and the updated evaluation value is still greater than the predetermined evaluation threshold, in this case, the minimum evaluation value can be selected from the evaluation value of the initial resource configuration plan and the updated evaluation value, and the initial resource configuration plan or the updated resource configuration plan corresponding to the minimum evaluation value can be used as the target resource configuration plan.

[0049] According to the resource allocation method provided by the embodiment of the present invention, the first load value and the second load value of the server are determined according to the resource operation data, so that the server resource allocation system can respond to both the short-term load of the server and the long-term load of the server when performing resource allocation, thereby improving the flexibility of resource allocation. The initial resource allocation scheme determined according to the resource operation data, the first load value and the second load value collected in real time can be closer to the actual operation of the server, thereby improving the rationality and availability of the resource allocation scheme. By evaluating the initial resource allocation scheme and determining the target resource allocation scheme according to the evaluation value, the rationality of the target resource allocation scheme can be improved, the waste of resources can be reduced, and the resource utilization rate of the server and the response performance of the server can be improved.

[0050] In some embodiments, the above operation S210 may include the following operations: determining a smoothing value based on the sum of current resource operation parameters and historical resource operation parameters, and the ratio between the number at the current moment and the sum of the number at the historical moments; processing the smoothing value using the distribution characteristic value determined based on the historical resource operation parameters to obtain resource operation data.

[0051] The data can be smoothed by using a sliding window mean filter method to reduce the impact of noise data and obtain smoothed data. Taking CPU utilization as an example, the CPU utilization at the current time t is 80%, the CPU utilization at time t-1 is 79%, and the CPU utilization at time t-2 is 78%. The smoothed value can be obtained by The sum of the current resource operating parameters and the historical resource operating parameters is , the sum of the current time and the historical time is 3. The smoothed CPU utilization is 79%.

[0052] In some embodiments, a normalization method may be used to normalize the data of different scales in the smoothed value into the same range to obtain standardized resource operation data. In one embodiment, the distribution characteristic value determined based on the historical resource operation parameters may include a standard deviation and a mean. In one example, the mean of the CPU utilization determined based on the historical resource operation parameters is 75%, and the standard deviation is 5%. The standardized CPU utilization can be .

[0053] According to an embodiment of the present invention, by using a variety of sensors to collect resource operation parameters and perform standardized processing, not only the accuracy and consistency of the data are ensured, but also high-quality data support is provided for load prediction and resource allocation. This method can effectively reduce the load prediction error caused by noise data in the resource operation parameters, thereby improving the accuracy and reliability of the decision-making of the entire resource allocation system.

[0054] In some embodiments, the above operation S220 may include the following operations: predicting the load of the server at multiple times within a predetermined time period based on resource operation data to obtain multiple load values, where the start time of the predetermined time period is earlier than the start time of the first time period, and the end time of the predetermined time period is the end time of the second time period; determining the first load value based on the load value corresponding to the first time period among the multiple load values; determining the second load value based on the load value corresponding to the second time period among the multiple load values.

[0055] The process of predicting the load of the server at multiple times within a predetermined period of time based on the resource operation data can be implemented using a load prediction model. The resource operation data is processed using the load prediction model to obtain the load values ​​of the server at multiple times within the predetermined period of time.

[0056] The start time of the scheduled period may be earlier than the current time, and the end time of the scheduled period may be the end time of the second period. The multiple times included in the scheduled period may be the current time, historical times before the current time, and future times after the current time.

[0057] In some embodiments, the above-mentioned load prediction model can be trained in the following manner: obtain multiple sample data, wherein the sample data includes resource operation data at multiple sample times and actual load values ​​corresponding to the resource operation data; input the sample data into the initial load prediction model to obtain a predicted load value; according to the difference between the predicted load value and the actual load value, adjust the model parameters of the initial load prediction model, and return to the operation of inputting the sample data into the initial load prediction model until the difference converges.

[0058] The sample data may be obtained from a database, and may include sample resource operation data at multiple sample moments and actual load values ​​corresponding to the sample resource operation data. The collected sample data may be smoothed and standardized using the processing method mentioned in operation S210 to obtain a standardized data sample set.

[0059] In one example, the expression of the load prediction model can be shown as formula (1) to formula (2).

[0060] (1)

[0061] (2)

[0062] in, Indicates the current time The hidden state of represents the hidden state at time t-1, x tRepresents the input data at the current time t, that is, the standardized data sample set. LSTM(.) represents the operation process of the time series feature extraction unit in the load prediction model. t is the predicted load value after the fully connected layer, W y is the weight matrix of the output layer, b y is the bias term of the output layer.

[0063] Take the standardized data sample set as input x t Substituting into formula (1), for each moment, the hidden state is calculated by forward propagation , and then converted into the predicted load value y through formula (2) t .

[0064] According to the predicted load value y t The difference between the training result and the actual load value can be used to adjust the model parameters of the initial load prediction model, and return to the operation of inputting the sample data into the initial load prediction model until the difference converges to obtain the load prediction model. Using the trained load prediction model, the resource operation data obtained in operation S210 can be processed to obtain multiple load values ​​within a predetermined period.

[0065] The first time period and the second time period can be obtained by adjusting the time window length, and the first load value can be determined according to the load values ​​at multiple moments corresponding to the first time period, and the second load value can be determined according to the load values ​​at multiple moments corresponding to the second time period. The process of determining the first load value can be shown in formula (3), and the process of determining the second load value can be shown in formula (4).

[0066] (3)

[0067] (4)

[0068] Among them, L short (t) a first load value, and the multiple time points corresponding to the first time period may be from time t to At the time point within, L short (t) is the time from the current time t to The average load value at the time point within is taken from the current time t The predicted load value y at the moment i , and then find the predicted load value y i The average value of .

[0069] L long (t) is the second load value, and the multiple time points corresponding to the second time period may be historical time points, i.e., from time To the time point within the current time t. L long (t) is the time from The average load value from the current time t to the current time t is taken as the average load value from the current time t forward. The predicted load value y at a time point i , and then find these predicted load values ​​y i The average value of . is the length of the time window corresponding to the first period, is the length of the time window corresponding to the second period, and t is the current time.

[0070] The above process of determining the first load value and the second load value will utilize a load prediction model based on a long short-term memory network. This load prediction model can not only capture the complex pattern of server load changes over time, but also flexibly adjust the prediction results according to different time window lengths, and provide load prediction values ​​for the first time period and the second time period. This flexibility enables the resource allocation system to cope with sudden high loads while providing a reliable basis for long-term planning of resource allocation, thereby improving the adaptability and foresight of the resource allocation system.

[0071] The above operation S230 may include the following operations: determining a comprehensive load index value according to the first load value, the second load value and resource operation data; determining a load status of the server according to the comprehensive load index value; and determining an initial resource configuration plan according to the load status.

[0072] In some embodiments, the process of determining a comprehensive load index value may include the following operations: determining a distribution characteristic value of resource operation data based on resource operation data; and performing weighted summation of the first load value, the second load value, and the distribution characteristic value to determine a comprehensive load index value.

[0073] In some embodiments, the resource operation data required for determining the comprehensive load index value may be the resource operation data obtained in operation S210, or may be the resource operation data obtained by reacquiring resource operation parameters at the time of determining the comprehensive load index value using a sensor that continuously detects the operation status of the server in real time, and performing standardization on the reacquired resource operation parameters. The time of determining the comprehensive load index value may be later than the current time mentioned in operation S210. That is, the resource operation data of the server may be updated in real time. The process of determining the comprehensive load index value may be as shown in formula (5).

[0074] (5)

[0075] Where Z(t) is the comprehensive load index value at the current time t, α is the weight of the first load value, and β is the weight of the second load value. are the weights of resource operation data, α, β and The sum of can be 1.short (t) is the first load value obtained by formula (3), L long (t) is the second load value obtained by formula (4), R(t) is the resource operation data, and R(t) can be the weighted sum of CPU utilization, memory occupancy, network traffic and storage data. The sum of the weight of CPU utilization, the weight of memory occupancy, the weight of network traffic and the weight of storage data can be 1.

[0076] According to the comprehensive load index value obtained by the above operation, the load state of the server can be determined. In one example, the process may include the following operations: according to the identification information of the server, obtain the load threshold set of the server, the load threshold set includes a first load threshold and a second load threshold, and the first load threshold is less than the second load threshold; according to the comprehensive load index value being greater than the second load threshold, determine that the load state of the server is high load; according to the comprehensive load index value being greater than or equal to the first load threshold and less than or equal to the second load threshold, determine that the load state of the server is normal load; according to the comprehensive load index value being less than the first load threshold, determine that the load state of the server is low load.

[0077] The identification information of the server may be information such as the name or model of the server. A mapping relationship between the identification information of the server and the load threshold set of the server may be stored in the database. The load threshold set corresponding to the server may be obtained from the database according to the server identification information. The load threshold set may include a first load threshold and a second load threshold greater than the first load threshold. The first load threshold and the second load threshold may be set according to the capacity and performance requirements of the server, and may be adaptively adjusted according to implementation needs.

[0078] In some embodiments, according to the relationship between the comprehensive load index value and the first load threshold and the second load threshold, the process of determining the load state can be as shown in formula (6).

[0079] (6)

[0080] Among them, S loadg (t) is the load state, Z(t) is the comprehensive load index value obtained by formula (5), is the first load threshold, T h is the second load threshold. When the comprehensive load index Z(t) exceeds the second load threshold T h When the server enters a high load state, the comprehensive load index Z(t) exceeds the first load threshold. and is lower than the second load threshold T h When the server enters a high load state, the comprehensive load index Z(t) is lower than the first load threshold. The server enters a low load state.

[0081] Optionally, the real-time resource operation data is combined with the first load value and the second load value to obtain a comprehensive load index value, which can more comprehensively evaluate the load state of the server at the current moment and timely identify whether the server is about to enter a high load state or a low load state. The process of determining the comprehensive load index value and the server load state not only improves the accuracy of the resource allocation system in judging the server state, but also helps management users respond quickly, avoids service interruption or resource waste due to insufficient or excessive resources, and improves server performance.

[0082] An adaptive resource adjustment method can be used to perform resource expansion or reduction operations on the load status results determined by the above operations. When a high load state is detected, computing instances are added in advance, and when a low load state is detected, idle resources are released to obtain a resource configuration plan.

[0083] The process of determining the initial resource configuration plan based on the load status determined by the above operations may include the following operations: when the server load status is high: obtaining the resource supply threshold based on the server identification information; determining the bottleneck resource from the resource operation data by comparing the resource operation data with the supply threshold; performing a resource expansion operation on the bottleneck resource to obtain the initial resource configuration plan.

[0084] The supply threshold of resources can be obtained from the database based on the identification information of the server. The supply threshold refers to the maximum available capacity or performance limit set by the system for each resource type (such as CPU resources, memory resources, network traffic resources, and storage data resources). It is used to indicate the upper limit of resources that the server can provide. Exceeding this upper limit may cause performance degradation or service interruption. The main function of the supply threshold is to serve as a criterion for judging whether a resource has become a bottleneck. When a resource exceeds the supply threshold, the resource is regarded as a bottleneck resource and corresponding resource expansion measures need to be taken. The supply threshold can be adaptively adjusted according to actual needs.

[0085] In some embodiments, the resource operation data of the server can be compared with the supply threshold, and the resources that exceed the supply threshold can be regarded as bottleneck resources. The resource instances of the bottleneck resources can be dynamically expanded, such as increasing the number of CPU cores, increasing the number of virtual machines, or the number of containers; hardware resources can also be expanded, such as upgrading the server, upgrading the bandwidth of the network connection, or adding storage devices, etc. The system architecture can also be optimized to reduce dependence on bottleneck resources.

[0086] Taking the CPU utilization in the resource operation data as an example, the number of CPU cores is 4 at the current moment, and the CPU utilization is 79%, which exceeds the supply threshold of 75%. In this case, the CPU resource can be identified as a bottleneck resource, and 2 cores can be added to the CPU. The initial resource configuration plan can be to use 6 cores for the CPU.

[0087] The process of determining the initial resource configuration plan based on the load status determined by the above operations may also include the following operations: obtaining a resource release threshold based on the server's identification information; determining idle resources from the resource operation data when there are resources in the resource operation data that are continuously below the release threshold for a predetermined period of time; releasing the idle resources to obtain an initial resource configuration plan.

[0088] The release threshold of the resource can be obtained from the database according to the identification information of the server. The release threshold can be used as a criterion for judging whether each resource type (such as CPU resources, memory resources, network traffic resources, and storage data resources) can be released. When the resource operation data is continuously lower than the release threshold for a predetermined period of time, the resource distribution data corresponding to the resource operation data can be released. The release threshold can be adaptively adjusted according to actual needs.

[0089] The resource operation data of the server can be compared with the release threshold, and the resources below the release threshold can be regarded as idle resources. The resource instances of idle resources can be dynamically reduced, such as reducing the number of CPU cores, the number of virtual machines, or the number of containers. Hardware resources can also be expanded, such as reducing storage devices, etc. The system architecture can also be optimized to reduce dependence on idle resources.

[0090] Taking the CPU utilization in the resource operation data as an example, the number of CPU cores is 4 at the current moment, and the CPU utilization is 20%, which has been lower than the release threshold of 30% for 15 minutes. In this case, the CPU resources can be determined as idle resources, and 2 cores can be reduced for the CPU. The initial resource configuration plan can be to use 2 cores for the CPU.

[0091] By using an adaptive resource adjustment method that adjusts resource distribution based on actual load status, we can ensure that there are enough resource instances available during periods of high server load, and release idle resources during periods of low load to save costs. This process not only improves resource utilization, but also enhances the system's elasticity and responsiveness, ensuring service continuity and stability.

[0092] The above operation S250 may include the following operations: determining a resource increment according to a difference between initial resource distribution data in the initial resource configuration solution and current resource distribution data of the server at the current moment; and obtaining an evaluation value according to the resource increment.

[0093] In some embodiments, the process of obtaining the evaluation value may be as shown in formula (7).

[0094] (7)

[0095] Among them, C(t) is the evaluation value, α cpu is the weight of the CPU resource increment, α mem is the weight of memory resource increment, α net is the weight of the network traffic resource increment, α io is the weight of the storage data resource increment, For CPU resource increment, Incremental memory resources. is the network traffic resource increment, To store data resource increments.

[0096] In one example, the initial resource configuration scheme may be that the CPU uses 6 cores, which is 2 more cores than the current CPU uses 4 cores. The memory, network traffic, and storage data of the initial resource configuration scheme are the same as the memory, network traffic, and storage data of the current resource distribution data. Based on this, is 2, is 0, is 0, and is 0. cpu , α mem , α net and α io The sum is 1, for example, α cpu is 0.5, α mem is 0.3, α net is 0.1 and α io is 0.1. Substituting these values ​​into formula (7), we can obtain is 1, that is, the evaluation value of the initial resource allocation plan is 1.

[0097] By evaluating the initial resource allocation plan, the demand and supply of different resources such as CPU resources, memory resources, network traffic resources and storage data resources are comprehensively considered, and the supply and demand of resources are effectively balanced to avoid service interruption or resource waste due to insufficient resources. This can achieve optimal resource allocation, improve the rationality and reliability of the resource allocation plan, and improve the resource utilization and response performance of the server.

[0098] On the basis of the above operations, the process of determining the target resource configuration scheme according to the evaluation value and the initial resource configuration scheme can repeat the following steps until the updated evaluation value is less than or equal to the predetermined evaluation threshold; when the evaluation value is higher than the predetermined evaluation threshold, the initial resource configuration scheme is adjusted to obtain an updated resource configuration scheme; an updated resource increment is determined according to the difference between the updated resource distribution data in the updated resource configuration scheme and the current resource distribution data; an updated evaluation value is obtained according to the updated resource increment; when the updated evaluation value is less than or equal to the predetermined evaluation threshold, the updated resource configuration scheme is used as the target resource configuration scheme.

[0099] In some embodiments, a predetermined evaluation threshold can be used as a criterion for determining whether the initial resource allocation scheme needs to be adjusted. If the evaluation value of the initial resource allocation scheme is less than or equal to the predetermined evaluation threshold, the initial resource allocation scheme does not need to be adjusted. If the evaluation value of the initial resource allocation scheme is higher than the predetermined evaluation threshold, the initial resource allocation scheme needs to be adjusted. The stopping condition for adjusting the initial resource allocation scheme can also be that the number of adjustments reaches a predetermined number of adjustments.

[0100] The above process of adjusting the initial resource configuration plan to obtain an updated resource configuration plan can expand resources with a priority higher than a predetermined priority and reduce resources with a priority lower than a predetermined priority according to the priority of the resources in the initial resource configuration plan to obtain an updated resource configuration plan.

[0101] Resources can be configured with priorities. For example, CPU resource priority 1 is higher than memory resource priority 2, memory resource priority 2 is higher than network traffic resource priority 3, and network traffic resource priority 3 is higher than storage data resource priority 4. Resources can be sorted according to priority, and the sorting results can be CPU resources, memory resources, network traffic resources, and storage data resources.

[0102] In one example, the predetermined priority may be 2. Resources with a higher priority than the predetermined priority 2 may be CPU resources with a priority of 1, and resources with a lower priority than the predetermined priority 2 may be network traffic resources and storage data resources. Resources with a priority equal to the predetermined priority 2 may be memory resources.

[0103] For resources with a priority higher than the predetermined priority, resources are expanded, for resources with a priority lower than the predetermined priority, resources are reduced, and resources with a priority equal to the predetermined priority may not be changed. For example, the core of the CPU resource can be increased to achieve the expansion of the CPU resource, the network transmission rate can be reduced, for example, from 10Gbps to 1Gbps to achieve the reduction of network traffic resources, and the storage data resource can be reduced by deleting files or reducing the capacity of the storage volume. According to the adjusted resource configuration, the updated resource configuration plan A is obtained.

[0104] In some embodiments, the initial resource configuration may be adjusted according to the above priority ranking results: CPU resources, memory resources, network traffic resources, and storage data resources. For example, the initial resource configuration scheme may be adjusted according to the order of expanding or reducing CPU resources, expanding or reducing memory resources, expanding or reducing network traffic resources, and expanding or reducing storage data resources.

[0105] In some embodiments, an updated resource increment is obtained according to the difference between the updated resource distribution data of the updated resource configuration scheme A and the current resource distribution data, and the updated resource increment is input into formula (7) to obtain an updated evaluation value.

[0106] If the updated evaluation value is less than the predetermined evaluation threshold, the updated resource configuration plan A will be used as the target resource configuration plan; if the updated evaluation value is greater than or equal to the predetermined evaluation threshold, the initial resource configuration plan or the updated resource configuration plan A can be further adjusted to obtain an updated resource configuration plan B that is different from the updated resource configuration plan A.

[0107] The stopping condition for adjusting the initial resource configuration plan operation may also be that the number of adjustments reaches a predetermined number of adjustments. When the number of adjustments reaches the predetermined number of adjustments and there is still no evaluation value less than the predetermined evaluation threshold, the minimum evaluation value can be selected from the evaluation value of the initial resource configuration plan and the updated evaluation value, and the resource configuration plan corresponding to the minimum evaluation value is used as the target resource configuration plan.

[0108] In the process of adjusting the initial resource allocation plan to obtain an updated resource allocation plan, the impact of the resource distribution change on the evaluation value can also be determined based on the historical resource distribution data of the server; the initial resource allocation plan is adjusted based on the impact to obtain an updated resource allocation plan. The impact can be the difference between the evaluation value before the resource distribution change and the evaluation value after the resource distribution change.

[0109] The historical resource distribution data of the server can be obtained, and the impact of the resource distribution change on the evaluation value can be determined based on the historical resource distribution data. For example, for CPU resources, the CPU impact of the change in CPU resource distribution on the evaluation value can be determined when the CPU cores change from 4 to 6 cores, and the specifications of memory resources, network traffic resources, and storage data resources remain unchanged; the memory impact of the change in memory resource distribution on the evaluation value can be determined when the memory resources change from 16GB to 10GB, and the specifications of CPU resources, network traffic resources, and storage data resources remain unchanged; the network traffic impact of the change in network traffic resource distribution on the evaluation value can be determined when the network traffic resources change from 10Gbps to 1Gbps, and the specifications of CPU resources, memory resources, and storage data resources remain unchanged; the storage data impact of the change in storage data resource distribution on the evaluation value can be determined when the storage volume capacity of the storage data resource changes from capacity 1 to capacity 2, and the specifications of CPU resources, memory resources, and network traffic resources remain unchanged. In one example, the CPU impact, memory impact, network traffic impact, and storage data impact can be added or subtracted with the same or different predetermined values ​​to obtain the CPU impact range, memory impact range, network traffic impact range, and storage data impact range.

[0110] The initial resource configuration scheme can be adjusted based on the relationship between the evaluation value of the initial resource configuration scheme or the updated resource evaluation value and the predetermined evaluation threshold, and the CPU impact range, the memory impact range, and the network traffic impact range. If the difference falls into any one of the CPU impact range, the memory impact range, and the network traffic impact range, the corresponding resource distribution is adjusted according to the range it falls into. For example, if it falls into the CPU impact range, the CPU resources in the initial resource configuration scheme are adjusted. If the difference falls into at least two of the CPU impact range, the memory impact range, and the network traffic impact range, the resources that fall into the range can be prioritized and adjusted. If the difference does not fall into any one of the CPU impact range, the memory impact range, and the network traffic impact range, the above-mentioned method of adjusting the initial resource configuration scheme according to resource priority can be adopted.

[0111] By determining the impact of changes in resource distribution on the evaluation value and using the relationship between the impact range and the evaluation value difference to adjust the initial resource allocation plan, the resources that need to be adjusted in the initial resource allocation plan can be accurately located according to the evaluation value difference, thereby improving the efficiency of adjusting the initial resource allocation plan and thus improving resource allocation efficiency and resource utilization.

[0112] By continuously adjusting the initial resource allocation plan until a resource allocation plan that is less than or equal to the predetermined evaluation threshold is found, it can be indicated that the distribution of resources in the resource allocation plan is relatively balanced, thereby avoiding service interruption or resource waste due to insufficient resources, thereby improving the resource utilization of the server.

[0113] Figure 4 FIG. 4 is a flow chart showing a resource allocation method according to another embodiment of the present invention. Figure 4 As shown, the resource allocation method of this embodiment may include operations S410 to S450.

[0114] In operation S410, multiple sensors are used to collect resource operation parameters of each server node, and the collected resource operation parameters are processed to obtain standardized resource operation data.

[0115] In operation S420, a load prediction model is constructed based on a machine learning algorithm, and standardized resource operation data is input into the load prediction model, and a first load value and a second load value are obtained according to the load value predicted by the load prediction model.

[0116] In operation S430, the real-time resource operation data, the first load value, and the second load value are combined to identify a high load situation and obtain an actual load status result.

[0117] In operation S440, an adaptive resource adjustment method is used to perform resource expansion or reduction operations on the actual load status results. When a high load situation is detected, computing instances are added in advance, and unnecessary idle resources are released during a low load period to obtain an initial resource configuration plan.

[0118] In operation S450, a multi-dimensional resource optimization method is used to comprehensively consider the initial resource allocation plan, combine the existing CPU resource and memory resource usage, evaluate the demand and supply of different resources, and apply the load prediction model and resource operation data to obtain the target resource allocation plan.

[0119] Operation S440 may include the following process:

[0120] Based on the actual load status results, a resource demand function is defined, and the number of required resources is dynamically adjusted according to the current load status. The resource demand function can be defined as shown in formula (8).

[0121] (8)

[0122] in, is the resource difference, R current(t) is the resource operation data of the server collected at the time when operation S440 starts to be executed, and R(t) can be R(t) in formula (5). ,when >0, indicating that the platform is under high load and needs to increase resources; <0, indicating that the platform is in a low-load state and needs to reduce resources. =0, indicating that the platform is under normal load and there is no need to adjust resource allocation.

[0123] According to the operation of expanding or reducing resources, the initial resource configuration scheme can be obtained as shown in formula (9).

[0124] (9)

[0125] Among them, P(t) is the initial resource allocation plan, R current (t) is the resource operation data in formula (8), is the resource difference in formula (8).

[0126] In some embodiments, operation S450 may include the following process:

[0127] Based on the actual load status results S load (t) and the historical usage of each resource to dynamically adjust the number of required resources and define a multi-dimensional resource demand function R multi (t), as shown in formula (10):

[0128] (10)

[0129] in, is the CPU resource increment, that is, the CPU resource demand. is the memory resource increment, that is, the memory resource demand, is the network traffic resource increment, that is, the network traffic resource demand, It is the increment of storage data resources, that is, the demand for storage I / O resources.

[0130] The resource configuration plan P(t) is combined with the resource operation data to ensure the rationality and effectiveness of resource allocation; and the comprehensive resource demand index shown in formula (7) is defined to evaluate the resource demand of the server in various dimensions.

[0131] According to the capacity and performance requirements of the server, you can set the supply threshold of each resource type of the server; for example, the supply threshold of CPU utilization, memory, network traffic, and storage data. When the demand for a resource type exceeds the supply threshold, the resource can be regarded as a bottleneck resource, and computing instances can be added to the bottleneck resource to expand the resource. For example, when the CPU resource is a bottleneck resource, you can add computing instances to the CPU resource, such as expanding the number of CPU cores of the virtual machine, and assigning tasks to multiple different CPU cores to reduce the pressure on the original CPU core.

[0132] By combining the multi-dimensional resource demand function with the first load value and the second load value obtained by the load prediction model, and based on the analysis results of the comprehensive load index value, the target resource allocation plan can be obtained, as shown in formula (11).

[0133] (11)

[0134] Among them, P final (t) is the target resource allocation plan, For CPU resource increment, Incremental memory resources. is the network traffic resource increment, To store data resource increments, P opt (t) at the current moment resource allocation plan, The CPU resource demand or utilization at the current time t, The memory resource demand or utilization at the current time t, The network traffic resource demand or utilization at the current time t, The storage data resource demand or utilization at the current time t, T cpu is the supply threshold of CPU resources, T mem is the supply threshold of memory resources, T net is the supply threshold of network traffic resources, T io is the supply threshold of storage data resources, otherwise it can be expressed <T cpu , <T mem , <T net ,as well as <T io These four conditions are met at the same time.

[0135] It should be noted that, unless it is explicitly stated that there is a sequence of execution between different operations shown in the flowchart in the embodiments of the present invention, or different operations have a sequence of execution in technical implementation, otherwise, the execution order of multiple operations may not be particular, and multiple operations may also be executed simultaneously.

[0136] Based on the above resource allocation method, the present invention also provides a resource allocation device. Figure 5 The device is described in detail.

[0137] Figure 5 The structure block diagram of the resource allocation device according to the embodiment of the present invention is schematically shown.

[0138] like Figure 5 As shown, the resource allocation device 500 of this embodiment may include a processing module 510 , a prediction module 520 , a first determination module 530 , an evaluation module 540 and a second determination module 550 .

[0139] The processing module 510 is used to process the resource operation parameters of the server obtained at the current moment to obtain resource operation data.

[0140] The prediction module 520 is used to predict the load of the server based on the resource operation data to obtain a first load value for a first time period and a second load value for a second time period, wherein the start time of the first time period is earlier than or equal to the start time of the second time period, and the duration of the first time period is less than the length of the second time period.

[0141] The first determination module 530 is used to determine an initial resource configuration solution based on the first load value, the second load value and the resource operation data.

[0142] The evaluation module 540 is used to evaluate the initial resource configuration plan to obtain an evaluation value.

[0143] The second determination module 550 is used to determine a target resource configuration scheme according to the evaluation value and the initial resource configuration scheme.

[0144] According to the resource allocation method provided by the embodiment of the present invention, the resource allocation method of the present invention improves the resource utilization rate of the server and the response performance of the server through flexible and reasonable allocation of resources.

[0145] In some embodiments, the first determination module 530 may include a first determination submodule, a second determination submodule, and a third determination submodule. The first determination submodule is used to determine the comprehensive load index value according to the first load value, the second load value, and the resource operation data. The second determination submodule is used to determine the load state of the server according to the comprehensive load index value. The third determination submodule is used to determine the initial resource configuration plan according to the load state.

[0146] In some embodiments, the first determination submodule may include a first determination unit and a second determination unit. The first determination unit is used to determine the distribution characteristic value of the resource operation data according to the resource operation data. The second determination unit is used to perform weighted summation on the first load value, the second load value, and the distribution characteristic value to determine the comprehensive load index value.

[0147] In some embodiments, the second determination submodule may include an acquisition unit, a third determination unit, a fourth determination unit, and a fifth determination unit. The acquisition unit is used to acquire a load threshold set of the server according to the identification information of the server, wherein the load threshold set includes a first load threshold and a second load threshold, and the first load threshold is less than the second load threshold. The third determination unit is used to determine that the load state of the server is a high load when the comprehensive load index value is greater than the second load threshold. The fourth determination unit is used to determine that the load state of the server is a normal load when the comprehensive load index value is greater than or equal to the first load threshold and less than or equal to the second load threshold. The fifth determination unit is used to determine that the load state of the server is a low load when the comprehensive load index value is less than the first load threshold.

[0148] In some embodiments, the third determination submodule may include a first acquisition unit, a comparison unit, and an expansion unit. The first acquisition unit is used to acquire a supply threshold of a resource according to the identification information of the server. The comparison unit is used to determine the bottleneck resource from the current resource distribution data by comparing the current resource distribution data of the server at the current moment with the supply threshold. The expansion unit is used to perform a resource expansion operation on the bottleneck resource to obtain an initial resource configuration plan.

[0149] In some embodiments, the third determination submodule may include a second acquisition unit, a sixth determination unit, and a release unit. The second acquisition unit is used to acquire a release threshold of a resource according to identification information of the server. The sixth determination unit is used to determine idle resources from the current resource distribution data when there are resources in the resource distribution data that are continuously lower than the release threshold for a predetermined period of time. The release unit is used to release idle resources to obtain an initial resource configuration plan.

[0150] In some embodiments, the evaluation module 540 may include a fourth determination submodule and a first result submodule. The fourth determination submodule is used to determine the resource increment according to the difference between the initial resource distribution data in the initial resource configuration scheme and the current resource distribution data. The first result submodule is used to obtain the evaluation value according to the resource increment.

[0151] In some embodiments, the resource allocation device may further include a repetition module. The repetition module is used to repeatedly perform the following steps until the updated evaluation value is less than or equal to a predetermined evaluation threshold, and when the evaluation value is higher than the predetermined evaluation threshold, adjust the initial resource configuration scheme to obtain an updated resource configuration scheme; determine an updated resource increment according to the difference between the updated resource distribution data and the current resource distribution data in the updated resource configuration scheme; obtain an updated evaluation value according to the updated resource increment; and when the updated evaluation value is less than or equal to the predetermined evaluation threshold, use the updated resource configuration scheme as the target resource configuration scheme.

[0152] In some embodiments, the repetition module may include an adjustment submodule, which is used to expand resources with a priority higher than a predetermined priority and reduce resources with a priority lower than a predetermined priority according to the priority of resources in the initial resource configuration scheme, so as to obtain an updated resource configuration scheme.

[0153] In some embodiments, the prediction module 520 may include a prediction submodule, a fifth determination submodule, and a sixth determination submodule. The prediction submodule is used to predict the load of the server at multiple times within a predetermined period according to the resource operation data, and obtain multiple load values, wherein the start time of the predetermined period is earlier than the start time of the first period, and the end time of the predetermined period is the end time of the second period. The fifth determination submodule is used to determine the first load value according to the load value corresponding to the first period among the multiple load values. The sixth determination submodule is used to determine the second load value according to the load value corresponding to the second period among the multiple load values.

[0154] In some embodiments, the prediction submodule may include a processing unit. The processing unit is used to process resource operation data using a load prediction model. The load prediction model is trained in the following manner: obtaining a plurality of sample data, wherein the sample data includes sample resource operation data at a plurality of sample moments and an actual load value corresponding to the sample resource operation data; inputting the sample data into an initial load prediction model to obtain a predicted load value; adjusting a model parameter of the initial load prediction model according to a difference between the predicted load value and the actual load value, and returning to the operation of inputting the sample data into the initial load prediction model until the difference converges.

[0155] In some embodiments, the processing module 510 may include a seventh determination submodule and a second result submodule. The seventh determination submodule is used to determine the smoothed value according to the sum of the current resource operation parameter and the historical resource operation parameter and the ratio between the sum of the number of the current moment and the sum of the number of the historical moments. The second result submodule is used to process the smoothed value using the distribution characteristic value determined based on the historical resource operation parameter to obtain the resource operation data.

[0156] According to an embodiment of the present invention, any multiple modules of the processing module 510, the prediction module 520, the first determination module 530, the evaluation module 540, and the second determination module 550 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present invention, at least one of the processing module 510, the prediction module 520, the first determination module 530, the evaluation module 540, and the second determination module 550 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, at least one of the processing module 510, the prediction module 520, the first determination module 530, the evaluation module 540 and the second determination module 550 may be at least partially implemented as a computer program module, which may perform a corresponding function when executed.

[0157] Figure 6 A block diagram of an electronic device suitable for implementing a resource allocation method according to an embodiment of the present invention is schematically shown.

[0158] like Figure 6 As shown, the electronic device 600 according to an embodiment of the present invention includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM 602) or a program loaded from a storage part 608 to a random access memory (RAM 603). The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.

[0159] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present invention by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present invention by executing the program stored in the one or more memories.

[0160] According to an embodiment of the present invention, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the input / output (I / O) interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output (I / O) interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.

[0161] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.

[0162] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM 603), a read-only memory (ROM 602), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.

[0163] The embodiment of the present invention also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the resource allocation method provided by the embodiment of the present invention.

[0164] The computer program executes the above functions defined in the system / device of the embodiment of the present invention when it is executed by the processor 601. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0165] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0166] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above functions defined in the system of the embodiment of the present invention are performed. According to the embodiment of the present invention, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0167] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present invention may be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in the various embodiments of the present invention may be combined and / or combined in various ways. All of these combinations and / or combinations fall within the scope of the present invention.

[0168] The embodiments of the present invention are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment is described above, it does not mean that the measures in each embodiment cannot be used in combination advantageously. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.

Claims

1. A resource allocation method, characterized in that: The method comprises: Process the resource operation parameters of the server obtained at the current moment to obtain resource operation data; Predicting the load of the server according to the resource operation data to obtain a first load value of a first time period and a second load value of a second time period, wherein a start time of the first time period is earlier than or equal to a start time of the second time period, and a duration of the first time period is less than a duration of the second time period; Determining an initial resource configuration scheme based on the first load value, the second load value, and the resource operation data; Evaluating the initial resource allocation plan to obtain an evaluation value; A target resource allocation scheme is determined according to the evaluation value and the initial resource allocation scheme, so as to allocate resources according to the target resource allocation scheme.

2. The method according to claim 1, characterized in that The determining an initial resource configuration scheme based on the first load value, the second load value and the resource operation data includes: Determining a comprehensive load index value according to the first load value, the second load value, and the resource operation data; Determining the load status of the server according to the comprehensive load index value; The initial resource configuration scheme is determined according to the load status.

3. The method according to claim 2, characterized in that The determining a comprehensive load index value according to the first load value, the second load value and the resource operation data includes: Determining, according to the resource operation data, a distribution characteristic value of the resource operation data; The first load value, the second load value, and the distribution characteristic value are weightedly summed to determine the comprehensive load index value.

4. The method according to claim 2, characterized in that: Determining the load state of the server according to the comprehensive load indicator value includes: Acquire a load threshold set of the server according to the identification information of the server, wherein the load threshold set includes a first load threshold and a second load threshold, and the first load threshold is less than the second load threshold; When the comprehensive load index value is greater than the second load threshold, determining that the load state of the server is high load; When the comprehensive load index value is greater than or equal to the first load threshold and less than or equal to the second load threshold, determining that the load state of the server is a normal load; When the comprehensive load index value is less than the first load threshold, it is determined that the load state of the server is low load.

5. The method according to claim 4, characterized in that The determining the initial resource configuration scheme according to the load state includes, when the load state of the server is the high load: Acquiring a resource supply threshold according to the identification information of the server; determining a bottleneck resource from the resource operation data by comparing the resource operation data with the supply threshold; A resource expansion operation is performed on the bottleneck resource to obtain the initial resource configuration solution.

6. The method according to claim 4, characterized in that The determining the initial resource configuration scheme according to the load state includes, when the load state of the server is the low load: Acquire a resource release threshold according to the identification information of the server; In the case where there are resources in the resource operation data that are continuously below the release threshold for a predetermined period of time, determining idle resources from the resource operation data; The idle resources are released to obtain the initial resource allocation scheme.

7. The method according to claim 1, characterized in that The step of evaluating the initial resource allocation scheme to obtain an evaluation value includes: Determining a resource increment according to a difference between initial resource distribution data in the initial resource configuration scheme and current resource distribution data of the server at the current moment; The evaluation value is obtained according to the resource increment.

8. The method according to claim 7, characterized in that The method further comprises: Repeat the following steps until the updated evaluation value is less than or equal to the predetermined evaluation threshold. When the evaluation value is higher than the predetermined evaluation threshold, adjusting the initial resource configuration scheme to obtain an updated resource configuration scheme; Determining an update resource increment according to a difference between the update resource distribution data in the update resource configuration scheme and the current resource distribution data; Obtaining the update evaluation value according to the update resource increment; In a case where the updated evaluation value is less than or equal to the predetermined evaluation threshold, the updated resource configuration scheme is used as the target resource configuration scheme.

9. The method according to claim 8, characterized in that The adjusting the initial resource configuration scheme to obtain an updated resource configuration scheme includes: According to the priorities of the resources in the initial resource configuration scheme, resources with priorities higher than the predetermined priority are expanded, and resources with priorities lower than the predetermined priority are reduced, so as to obtain the updated resource configuration scheme.

10. The method according to claim 1, characterized in that The step of predicting the load of the server according to the resource operation data to obtain a first load value for a first time period and a second load value for a second time period comprises: Predicting the load of the server at multiple times within a predetermined period according to the resource operation data to obtain multiple load values, wherein the start time of the predetermined period is earlier than the current time, and the end time of the predetermined period is the end time of the second period; determining the first load value according to a load value corresponding to the first time period among the multiple load values; The second load value is determined according to a load value corresponding to the second time period among the multiple load values.

11. The method according to claim 10, characterized in that The step of predicting the load of the server at multiple times within a predetermined period of time according to the resource operation data comprises: processing the resource operation data using a load prediction model, The load prediction model is trained in the following way: Acquire a plurality of sample data, wherein the sample data includes sample resource operation data at a plurality of sample moments and actual load values ​​corresponding to the sample resource operation data; Inputting the sample data into an initial load prediction model to obtain a predicted load value; According to the difference between the predicted load value and the actual load value, the model parameters of the initial load prediction model are adjusted, and the operation of inputting the sample data into the initial load prediction model is returned until the difference converges.

12. The method according to claim 1, characterized in that The resource operation parameters of the server acquired at the current moment include current resource operation parameters and historical resource operation parameters at historical moments before the current moment; The resource operation parameters of the server obtained at the current moment are processed to obtain resource operation data, including: Determine a smoothing value according to a ratio between a sum of the current resource operation parameter and the historical resource operation parameter and a sum of the number at the current moment and the number at the historical moments; The smoothed value is processed using a distribution characteristic value determined based on the historical resource operation parameter to obtain the resource operation data.

13. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 12.

14. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

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

Citation Information

Patent Citations

  • Business resource capacity dynamic allocation method and device, equipment and storage medium

    CN114666224A

  • Optical communication device resource allocation method and system based on virtualization technology

    CN118555510A

  • Traffic demand prediction method and system based on LSTM

    CN119052112A

  • Dynamic resource scheduling method and device for multi-GPU cluster reasoning service

    CN119311396A

  • Virtual machine resource dynamic allocation method based on load prediction

    CN119938221A

Cited By

  • Server resource scheduling system for high-density computing environment

    CN120872610A

  • Server resource scheduling system for high-density computing environments

    CN120872610B