Resource Allocation Method, Electronic Device, Storage Medium, and Program Product

By obtaining server resource operation parameters, using load prediction models to predict short-term and long-term load values, and adjusting resource configuration plans, the problem of inaccurate load prediction in the server resource allocation system is solved, and resource utilization and response performance are improved.

CN120104356BActive Publication Date: 2025-07-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The load prediction of the existing server resource allocation system is inaccurate, which leads to insufficient rationality of the resource allocation plan, making it difficult to cope with the actual load situation in the future period, and reduces the server resource utilization and response performance.

Method used

By obtaining the server's resource operation parameters, using the load prediction model to predict short-term and long-term load values, determining the initial resource allocation plan, and improving the flexibility and rationality of resource allocation through evaluation and adjustment to the target resource allocation plan.

Benefits of technology

It improves server resource utilization and response performance, reduces resource waste, enhances the adaptability and forward-looking nature of the system, and can respond to sudden high and low load situations in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104356B_ABST
    Figure CN120104356B_ABST
Patent Text Reader

Abstract

The present invention provides a resource allocation method, which can be applied to the technical field of dynamic allocation of server resources. The method 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 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; determining an initial resource configuration plan based on the first load value, the second load value and the resource operation data; evaluating the initial resource configuration plan to obtain an evaluation value; determining a target resource configuration plan according to the evaluation value and the initial resource configuration plan, so as to perform resource allocation according to the target resource configuration plan. The present invention also provides an electronic device, a storage medium and a program product. 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.
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 particularly relates to a resource allocation method, an electronic device, a storage medium, and a program product. Background Art

[0002] With the development of big data technology, as a device for processing data, the effective allocation and utilization of server resources can improve the performance of services while enhancing the data processing efficiency of the server.

[0003] When the current server resource allocation system allocates server resources, it needs to be based on the predicted load of the server in a future period. However, the current server resource allocation system has inaccurate load prediction for the server in a future period, resulting in insufficient rationality of the server resource allocation scheme, being difficult to cope with the actual load situation in a future period, and reducing the server resource utilization rate and the response performance of the server. 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, the method including: processing the resource operation parameters of a 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 in a first period and a second load value in a second period, wherein the starting moment of the first period is earlier than or equal to the starting moment of the second period, and the duration of the first period is less than the duration of the second 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 perform resource allocation according to the target resource configuration scheme.

[0006] On the other hand, the present invention also provides an electronic device, including: one or more processors; a memory for storing one or more computer programs, and the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0007] On the other hand, the present invention also provides a computer-readable storage medium, on which a computer program or instruction is stored, and when the computer program or instruction is executed by a processor, the steps of the above method are implemented.

[0008] On the other hand, the present invention also provides a computer program product, including a computer program or instruction, and when the computer program or instruction is executed by a processor, the steps of the above method are implemented.

[0009] According to the resource allocation method provided by the embodiments of the present invention, during the resource allocation process, the first load value and the second load value of the server are determined based on the resource operation data. Since the start time of the first time period is less than 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, the first load value can be a short-term load value, and the second load value can be a long-term load value. This enables the server resource allocation system to respond to both the short-term load and the long-term load of the server during resource allocation, improving the flexibility of resource allocation. The initial resource configuration scheme of the present invention is determined based on the real-time collected resource operation data, the first load value, and the second load value. Such an initial resource configuration scheme can be closer to the actual operation of the server, improving the rationality and availability of the resource configuration scheme. By evaluating the initial resource configuration scheme and further determining the target resource configuration scheme based on the evaluation value, the rationality of the target resource configuration scheme can be further improved, reducing resource waste. 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 content and other objects, features, and advantages of the present invention will become clearer through the following description of the embodiments of the present invention with reference to the accompanying drawings.

[0011] Figure 1 The application scenario diagram of the resource allocation method according to the embodiments of the present invention is shown.

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

[0013] Figure 3A The relationship diagram of the first time period and the second time period according to the embodiments of the present invention is shown.

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

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

[0016] Figure 4 The flowchart of the resource allocation method according to another embodiment of the present invention is shown.

[0017] Figure 5 The structural block diagram of the resource allocation device according to the embodiments 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 implementation manners

[0019] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. In the following detailed description, for the sake of explanation, many specific details are set forth in order to provide a comprehensive understanding of the embodiments of the present invention. However, obviously, one or more embodiments can also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present invention.

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

[0021] All terms used herein (including technical and scientific terms) 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] In the case of using expressions such as "at least one of A, B, and C, etc.", generally, it should be interpreted according to the meaning 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 only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).

[0023] The dynamic allocation of server resources aims to improve the utilization efficiency and response speed of server resources. In the current dynamic allocation of server resources, the data collected from server nodes is subject to noise interference, resulting in a deviation in predicted load; due to the large difference in data scales of different resource types, directly using the original data for analysis will lead to inaccurate load prediction. Moreover, the current prediction of load is difficult to effectively capture the long-term dependence relationship in time series data, resulting in inaccurate prediction of load values. As a result, the resource allocation scheme determined based on the predicted load values not only has low resource utilization rate but also is difficult to cope with sudden high or low loads on the server. The current resource allocation system is difficult to respond in a timely manner when dealing with sudden high or low loads, which is likely to cause service interruption or lead to a decrease in server performance.

[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 rate of server resources and server performance.

[0025] Figure 1 The application scenario diagram of the resource allocation method according to the embodiments of the present invention is shown.

[0026] As Figure 1 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 fiber optic cables, etc.

[0027] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices with a display screen, including but not limited to smartphones, tablets, laptop computers, and desktop computers, etc. Users can 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, sending a resource allocation request, or receiving 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 a resource allocation application, a load prediction application, a shopping application, a web browser application, a search application, an instant messaging tool, an email client, a social platform software, etc. (only for example). Optionally, the resource allocation request may not need to be triggered by the user through the terminal device. The resource allocation request may be automatically triggered by a timing task or in response to the amount of tasks to be executed exceeding a predetermined task amount threshold. The user can only view the resource allocation process of the embodiments of the present invention through the terminal device.

[0028] The servers in the server cluster 105 can be servers that provide various services. For example, the first server 1051 is used for resource allocation, and the second server 1052 is used for task execution. The first server 1051 can, in response to a resource allocation request, process the resource operation parameters of the second server 1052, predict the load of the second server 1052, determine the target resource configuration plan for the second server 1052 based on the load of the second server 1052, and feedback the target resource configuration plan to the terminal device. In another example, the first server 1051 can, in response to a resource allocation request, process the resource operation parameters of the first server 1051 and the second server 1052, predict the loads of the first server 1051 and the second server 1052, determine the target resource configuration plans for the first server 1051 and the second server 1052 based on the loads of the first server 1051 and the second server 1052, and feedback the target resource configuration plans to the terminal device. In yet another example, the second server 1052 can, in response to a resource allocation request, process the resource operation parameters of the first server 1051 and the second server 1052, predict the loads of the first server 1051 and the second server 1052, determine the target resource configuration plans for the first server 1051 and the second server 1052 based on the loads of the first server 1051 and the second server 1052, and feedback the target resource configuration plans to the terminal device. That is, any server in the server cluster 105 can execute the resource allocation method of the embodiments of the present invention.

[0029] It should be noted that the resource allocation method provided by the embodiments of the present invention can generally be executed by the server cluster 105. Correspondingly, the resource allocation device provided by the embodiments of the present invention can generally be set in the server cluster 105. The resource allocation method provided by the embodiments of the present invention can also be executed by a server or a server cluster different from the server cluster 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or the server cluster 105. Correspondingly, the resource allocation device provided by the embodiments of the present invention can also be set in a server or a server cluster different from the server cluster 105 and capable of communicating 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 numbers of the terminal devices, networks, and server clusters in

[0031] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and server clusters. Figure 1 described scenarios, through Figures 2 to 4A detailed description of the resource allocation method according to an embodiment of the present invention is given.

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

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

[0034] In operation S220, based on the resource operation data, the load of the server is predicted to obtain a first load value for a first time period and a second load value for a second time period, where 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 plan is determined based on the first load value, the second load value, and the resource operation data.

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

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

[0038] In some embodiments, the current moment may be the moment when a resource allocation request is received, or the moment when a resource allocation task starts to be executed. A task of periodically collecting server resource operation parameters may be set in the resource allocation task, and the current moment may be the moment 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 one of the servers in the server cluster 105 shown.

[0040] In some embodiments, the resource operation parameters of the server may 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 the historical moment before the current moment. The resource operation parameters may include the utilization rate of the central processing unit (Central Processing Unit, hereinafter referred to as CPU), memory occupancy, network traffic, and stored data, etc. The resource operation data may be obtained by smoothing the resource operation parameters using a sliding window mean filtering method and then processing them using a normalization method.

[0041] Based on the data change trend and periodic distribution characteristics of resource operation data, the load of the server in a future period can be predicted, and a first load value for a first period and a second load value for a second period can be obtained. The start time of the first period can be earlier than or equal to the start time of the second period. The start times of the first period and the second period can both be the current time. The duration of the first period is less than the duration of the second period. The first load value of the first period can be the short-term load value of the server, and the second load value of the second period can be the long-term load value of the server. The durations of the first period and the second period can both be adaptively adjusted according to actual needs. The process of predicting the load of the server can be implemented 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 that processes and predicts long-term dependencies in time series data.

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

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

[0044] Figure 3C Shows a relationship diagram of the first period and the second period according to still another embodiment of the present invention. As Figure 3C shown, both the start time and the end time of the first period are earlier than the start time of the second period. Taking the start time of the current time t as 0, the end time of the first period as 1, the start time of the second period as 2, and the end time of the second period as 24 as an example, based on the resource operation parameters obtained at 0 o'clock, the load from 0 o'clock to 1 o'clock is predicted to obtain the first load value; the load from 2 o'clock to 24 o'clock 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 embodiments of the present invention, the first load value and the second load value of the server are determined according to the resource operation data. This enables the server resource allocation system to respond not only to the short-term load of the server but also to the long-term load of the server during resource allocation, improving the flexibility of resource allocation. The initial resource configuration plan determined according to the real-time collected resource operation data, the first load value, and the second load value can be closer to the actual operation of the server, improving the rationality and availability of the resource configuration plan. By evaluating the initial resource configuration plan and determining the target resource configuration plan according to the evaluation value, the rationality of the target resource configuration plan can be improved, resource waste can be reduced, and thus 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 according to the ratio between the sum of the current resource operation parameters and the historical resource operation parameters and the sum of the number at the current moment and the number at the historical moment; and processing the smoothing value by using the distribution characteristic value determined based on the historical resource operation parameters to obtain the resource operation data.

[0051] The moving window mean filtering method can be used to smooth the data to reduce the influence of noise data and obtain the smoothed data. Taking the CPU utilization rate as an example, if the CPU utilization rate at the current moment t is 80%, the CPU utilization rate at t - 1 is 79%, and the CPU utilization rate at t - 2 is 78%, then the smoothing value can be obtained through . The sum of the current resource operation parameters and the historical resource operation parameters is , and the sum of the number at the current moment and the number at the historical moment is 3. The smoothed CPU utilization rate is 79%.

[0052] In some embodiments, for the smoothing value, the standardization method can be used to unify the data with different scales in the smoothing value into the same range to obtain the standardized resource operation data. In one embodiment, the distribution characteristic value determined based on the historical resource operation parameters may include the standard deviation and the mean. In one example, if the mean of the CPU utilization rate determined according to the historical resource operation parameters is 75% and the standard deviation is 5%, then the standardized CPU utilization rate can be .

[0053] According to the embodiments of the present invention, by using multiple sensors to collect resource operation parameters and perform standardization 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 the 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 loads of the server at multiple moments within a predetermined time period according to the resource operation data to obtain multiple load values, where the start moment of the predetermined time period is earlier than the start moment of the first time period, and the end moment of the predetermined time period is the end moment of the second time period; determining a first load value according to the load value corresponding to the first time period among the multiple load values; and determining a second load value according to the load value corresponding to the second time period among the multiple load values.

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

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

[0057] In some embodiments, the above load prediction model may be trained in the following manner: obtaining a plurality of sample data, where the sample data includes the resource operation data at multiple sample moments and the actual load values corresponding to the resource operation data; inputting the sample data into an initial load prediction model to obtain predicted load values; adjusting the model parameters of the initial load prediction model according to the difference between the predicted load values and the actual load values, and returning 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. The sample data may include the sample resource operation data at multiple sample moments and the actual load values corresponding to the sample resource operation data. For the collected sample data, the processing methods mentioned in operation S210 may be adopted for smoothing and standardization processing to obtain a standardized data sample set.

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

[0060] (1)

[0061] (2)

[0062] Wherein, represents the hidden state at the current moment and represents the hidden state at the t-1 moment, and x tRepresents the input data at the current moment 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. y t is the predicted load value after passing through the fully connected layer. W y is the weight matrix of the output layer, and b y is the bias term of the output layer.

[0063] Take the standardized data sample set as the input x t and substitute it into formula (1). For each moment, calculate the hidden state through forward propagation , and then convert it to the predicted load value y through formula (2) t .

[0064] According to the difference between the predicted load value y t and the actual load value, the model parameters of the initial load prediction model can be adjusted, and the operation of inputting the sample data into the initial load prediction model is returned until the difference converges to obtain the load prediction model. Using the trained load prediction model to process the resource operation data obtained in operation S210, multiple load values within a predetermined time period can be obtained.

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

[0066] (3)

[0067] (4)

[0068] where, L short (t) is the first load value. The multiple time points corresponding to the first time period can be the time points from time t to within. L short (t) is the average value of the load values at the time points from the current time t to within. Take the predicted load values y at the first i time points starting from the current time t, and then calculate the average value of the predicted load values y i .

[0069] L long (t) is the second load value. The multiple time points corresponding to the second time period can be historical time points, that is, the time points from time to the current time t. L long (t) is from time The mean value of the load values at time points within the current time t, taking the predicted load value y for the time points pushed forward from the current time t i , and then calculating the average value of these predicted load values y i . is the time window length corresponding to the first time period, is the time window length corresponding to the second time period, and t is the current time.

[0070] The process of determining the first load value and the second load value described above utilizes a load prediction model based on a long short-term memory network. This load prediction model can not only capture the complex patterns of server load changes over time but also flexibly adjust the prediction results according to different time window lengths, providing 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 also providing a reliable basis for long-term planning of resource allocation, enhancing the adaptability and forward-looking nature of the resource allocation system.

[0071] The above operation S230 may include the following operations: determining a comprehensive load index value based on 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; and determining an initial resource allocation plan according to the load status.

[0072] In some embodiments, the process of determining the comprehensive load index value may include the following operations: determining the distribution characteristic value of the resource operation data according to the resource operation data; performing a weighted sum of the first load value, the second load value, and the distribution characteristic value to determine the 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 the resource operation parameters obtained again by using sensors that continuously detect the server operation in real time at the moment of determining the comprehensive load index value, and the resource operation data obtained by performing standardization processing on the re-obtained resource operation parameters. The moment 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 can be updated in real time. The process of determining the comprehensive load index value can 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, β is the weight of the second load value, is the weight of the resource operation data, and the sum of α, β, and can be 1. Lshort (t) is the first load value obtained from formula (3), L long (t) is the second load value obtained from formula (4), R(t) is resource operation data, and R(t) can be the weighted sum of CPU utilization rate, memory occupancy rate, network traffic, and stored data. The sum of the weights of CPU utilization rate, memory occupancy rate, network traffic, and stored data can be 1.

[0076] Based on the comprehensive load index value obtained from the above operations, the load status of the server can be determined. In one example, this process may include the following operations: According to the identification information of the server, obtain the set of load thresholds of the server. The set of load thresholds includes a first load threshold and a second load threshold, and the first load threshold is less than the second load threshold; Determine that the load status of the server is high load according to the comprehensive load index value being greater than the second load threshold; Determine that the load status of the server is normal 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 status of the server is low load according to the comprehensive load index value being less than the first load threshold.

[0077] The identification information of the server can be information such as the name or model of the server. The mapping relationship between the identification information of the server and the set of load thresholds of the server can be stored in the database. According to the identification information of the server, the corresponding set of load thresholds of the server can be obtained from the database. The set of load thresholds can 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 can be set according to the capacity and performance requirements of the server and can be adaptively adjusted according to implementation needs.

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

[0079] (6)

[0080] Wherein, S loadg (t) is the load status, Z(t) is the comprehensive load index value obtained from 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 , the server enters the high load state. When the comprehensive load index Z(t) exceeds the first load threshold and is lower than the second load threshold T h , the server enters the high load state. When the comprehensive load index Z(t) is lower than the first load threshold When the server enters the low-load state.

[0081] Optionally, by using real-time resource operation data in combination with the first load value and the second load value to obtain a comprehensive load index value, the load status of the server at the current moment can be evaluated more comprehensively, and it can be timely identified whether the server is about to enter the high-load state or the low-load state. The process of determining the comprehensive load index value and the server load status not only improves the accuracy of the resource allocation system in judging the server status, but also helps the management user to make a quick response, avoiding service interruption or resource waste caused by insufficient or excessive resources, and improving the server performance.

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

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

[0084] The supply threshold of the resources can be obtained from the database according to 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, storage data resources), which is used to represent the upper limit of the resources that the server can provide. Exceeding this upper limit may cause performance degradation or service interruption; the main role of the supply threshold is to serve as a judgment criterion for whether a resource becomes 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 exceeding the supply threshold are regarded as bottleneck resources. For the bottleneck resources, resource instances 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 the dependence on bottleneck resources.

[0086] Taking the CPU utilization rate in the resource operation data as an example, at the current moment, the number of CPU cores is 4, the CPU utilization rate is 79%, exceeding the supply threshold of 75%. In this case, the CPU resources can be determined as bottleneck resources, and 2 more cores can be added to the CPU. The initial resource configuration plan can be that the CPU uses 6 cores.

[0087] The process of determining the initial resource configuration plan according to the load status determined by the above operations may also include the following operations: obtaining the release threshold of the resources according to the identification information of the server; in the case that there are resources in the resource operation data that are continuously lower than the release threshold for a predetermined duration, determining the idle resources from the resource operation data; releasing the idle resources to obtain the initial resource configuration plan.

[0088] The release threshold of the resources can be obtained from the database according to the identification information of the server. The role of the release threshold can be used as a judgment criterion for whether each resource type (such as CPU resources, memory resources, network traffic resources, storage data resources) can be released. When the resource operation data is continuously lower than the release threshold for a predetermined duration, 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 lower than the release threshold can be regarded as idle resources. For the idle resources, the resource instances can be dynamically reduced, such as reducing the number of CPU cores, reducing the number of virtual machines, or the number of containers, etc.; the hardware resources can also be expanded, such as reducing storage devices, etc., and the system architecture can also be optimized to reduce the dependence on idle resources.

[0090] Taking the CPU utilization rate in the resource operation data as an example, at the current moment, the number of CPU cores is 4, the CPU utilization rate is 20%, and it is continuously 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 that the CPU uses 2 cores.

[0091] Through the adaptive resource adjustment method of adjusting the resource distribution based on the actual load status, it can ensure that there are sufficient resource instances available during the high-load period of the server, and releasing idle resources during the low-load period can save costs. This process not only improves the resource utilization rate, but also enhances the elasticity and response speed of the system, and ensures the continuity and stability of the service.

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

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

[0094] (7)

[0095] Wherein, C(t) is the evaluation value, α cpu is the weight of the CPU resource increment, α mem is the weight of the memory resource increment, α net is the weight of the network traffic resource increment, α io is the weight of the stored data resource increment, is the CPU resource increment, is the memory resource increment, is the network traffic resource increment, is the stored data resource increment.

[0096] In an example, the initial resource configuration scheme can be that the CPU uses 6 cores, which is 2 more cores than the current CPU with 4 cores. The memory, network traffic, and stored data of the initial resource configuration scheme have no changes compared with the memory, network traffic, and stored data of the current resource distribution data. Based on this, is 2, is 0, is 0, and is 0. The sum of α cpu , α mem , α net and α io 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 this initial resource configuration scheme is 1.

[0097] By evaluating the initial resource configuration scheme, the demand and supply situations of different resources such as CPU resources, memory resources, network traffic resources, and stored data resources are comprehensively considered, effectively balancing the supply and demand of resources, avoiding service interruption or resource waste caused by insufficient partial resources, achieving the optimal allocation of resources, improving the rationality and reliability of the resource configuration scheme, and improving the resource utilization rate and response performance of the server.

[0098] Based on the above operations, the process of determining the target resource allocation plan according to the evaluation value and the initial resource allocation plan can repeatedly execute 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, adjust the initial resource allocation plan to obtain an updated resource allocation plan; determine the updated resource increment according to the difference between the updated resource distribution data and the current resource distribution data in the updated resource allocation plan; obtain the updated evaluation value according to the updated resource increment; when the updated evaluation value is less than or equal to the predetermined evaluation threshold, use the updated resource allocation plan as the target resource allocation plan.

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

[0100] In the process of adjusting the initial resource allocation plan to obtain the updated resource allocation plan, according to the priority of the resources in the initial resource allocation plan, resources with a priority higher than the predetermined priority can be resource-expanded, and resources with a priority lower than the predetermined priority can be resource-reduced to obtain the updated resource allocation plan.

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

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

[0103] Resource-expand resources with a priority higher than the predetermined priority, resource-reduce resources with a priority lower than the predetermined priority, and resources with a priority equal to the predetermined priority can remain unchanged. For example, the cores of CPU resources can be increased to achieve the expansion of CPU resources. The network transmission rate can be reduced, for example, from 10 Gbps to 1 Gbps, to achieve the reduction of network traffic resources. The storage data resources can be reduced by deleting files or reducing the capacity of the storage volume. According to the adjusted resource allocation, obtain the updated resource allocation plan A.

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

[0105] In some embodiments, according to the difference between the updated resource distribution data of the updated resource configuration plan A and the current resource distribution data, an updated resource increment is obtained, 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 is 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 may be continuously adjusted to obtain an updated resource configuration plan B different from the updated resource configuration plan A.

[0107] The stop condition for the operation of adjusting the initial resource configuration plan may also be that the number of adjustments reaches the predetermined number of adjustments. When the number of adjustments reaches the predetermined number of adjustments and an evaluation value less than the predetermined evaluation threshold still does not appear, the minimum evaluation value may 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 configuration plan to obtain the updated resource configuration plan, the influence degree of the resource distribution change on the evaluation value may also be determined according to the historical resource distribution data of the server; the initial resource configuration plan is adjusted according to the influence degree to obtain the updated resource configuration plan. The influence degree may be the difference between the evaluation value before the resource distribution change and the evaluation value after the resource distribution change.

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

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

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

[0112] By continuously adjusting the initial resource allocation plan until a resource allocation plan smaller than a predetermined evaluation threshold is found, being smaller than or equal to the predetermined evaluation threshold can characterize that the distribution among various resources in the resource allocation plan is relatively balanced, thereby avoiding service interruption or resource waste caused by insufficient resources, and improving the resource utilization rate of the server.

[0113] Figure 4 FIG. shows a flowchart of a resource allocation method according to another embodiment of the present invention. As Figure 4 shown, the resource allocation method of this embodiment may include operation S410 to operation S450.

[0114] In operation S410, multiple sensors are used to collect the 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 the standardized resource operation data is input into the load prediction model. According to the load value predicted by the load prediction model, a first load value and a second load value are obtained.

[0116] In operation S430, by combining real-time resource operation data, the first load value, and the second load value, a high-load situation is identified to 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 result. When a high-load situation is detected, computing instances are added in advance, and unnecessary idle resources are released during the low-load period to obtain an initial resource allocation plan.

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

[0119] Operation S440 may include the following process:

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

[0121] (8)

[0122] Wherein, is the resource difference, R current(t) is the resource operation data of the server collected at the moment when operation S440 starts to execute, and R(t) can be the R(t) in formula (5). According to the calculated resource difference , when >0, it indicates that the platform is in a high-load state and resources need to be increased; when <0, it indicates that the platform is in a low-load state and resources need to be reduced. When =0, it indicates that the platform is under normal load and the resource allocation can be left unadjusted.

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

[0124] (9)

[0125] Among them, P(t) is the initial resource configuration plan, and 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 result S load (t) and the historical usage of each resource, dynamically adjust the required amount of resources, and define the multi-dimensional resource demand function R multi (t), as shown in formula (10):

[0128] (10)

[0129] Among them, 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, is the storage data resource increment, that is, the storage I / O resource demand.

[0130] Combine the resource configuration plan P(t) with the resource operation data to ensure the rationality and effectiveness of resource allocation; and define the comprehensive resource demand index as shown in formula (7) to evaluate the resource demand of the server in each dimension.

[0131] According to the capacity and performance requirements of the server, the supply threshold of each resource type of the server can be set; for example, the supply threshold of CPU utilization, the supply threshold of memory, the supply threshold of network traffic, and the supply threshold of stored 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 expand the resources for the bottleneck resource. For example, when the CPU resource is a bottleneck resource, computing instances are added to the CPU resource, such as expanding the CPU cores of a virtual machine, and tasks are assigned to multiple different CPU cores to reduce the pressure on the original CPU cores.

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

[0133] (11)

[0134] Among them, P final (t) is the target resource configuration plan, is the CPU resource increment, is the memory resource increment, is the network traffic resource increment, is the stored data resource increment, P opt (t) is the resource configuration plan at the current moment , is the CPU resource demand or utilization rate at the current moment t, is the memory resource demand or utilization rate at the current moment t, is the network traffic resource demand or utilization rate at the current moment t, is the stored data resource demand or utilization rate at the current moment t, T cpu is the supply threshold of the CPU resource, T mem is the supply threshold of the memory resource, T net is the supply threshold of the network traffic resource, T io is the supply threshold of the stored data resource, otherwise it can represent < T cpu 、 < T mem 、 < T net 、and < T io the situation where these four conditions hold simultaneously.

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

[0136] Based on the above resource allocation method, the present invention also provides a resource allocation device. The following will describe this device in detail in conjunction with Figure 5 this.

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

[0138] As Figure 5 shown, the resource allocation device 500 in 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 configured 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 configured 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, where 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.

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

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

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

[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 sub-module, a second determination sub-module, and a third determination sub-module. The first determination sub-module is configured to determine a comprehensive load index value according to the first load value, the second load value, and the resource operation data. The second determination sub-module is configured to determine the load status of the server according to the comprehensive load index value. The third determination sub-module is configured to determine an initial resource configuration plan according to the load status.

[0146] In some embodiments, the first determination sub-module may include a first determination unit and a second determination unit. The first determination unit is configured to determine a distribution characteristic value of the resource operation data according to the resource operation data. The second determination unit is configured to perform a weighted sum of the first load value, the second load value, and the distribution characteristic value to determine a comprehensive load metric value.

[0147] In some embodiments, the second determination sub-module may include an acquisition unit, a third determination unit, a fourth determination unit, and a fifth determination unit. The acquisition unit is configured to acquire a set of load thresholds of the server according to the identification information of the server, where the set of load thresholds 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 configured to determine that the load status of the server is a high load when the comprehensive load metric value is greater than the second load threshold. The fourth determination unit is configured to determine that the load status of the server is a normal load when the comprehensive load metric 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 configured to determine that the load status of the server is a low load when the comprehensive load metric value is less than the first load threshold.

[0148] In some embodiments, the third determination sub-module may include a first acquisition unit, a comparison unit, and an expansion unit. The first acquisition unit is configured to acquire a supply threshold of the resource according to the identification information of the server. The comparison unit is configured to determine a 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 configured to perform a resource expansion operation on the bottleneck resource to obtain an initial resource configuration scheme.

[0149] In some embodiments, the third determination sub-module may include a second acquisition unit, a sixth determination unit, and a release unit. The second acquisition unit is configured to acquire a release threshold of the resource according to the identification information of the server. The sixth determination unit is configured to determine an idle resource from the current resource distribution data when there is a resource in the resource distribution data that is continuously lower than the release threshold for a predetermined duration. The release unit is configured to release the idle resource to obtain an initial resource configuration scheme.

[0150] In some embodiments, the evaluation module 540 may include a fourth determination sub-module and a first result sub-module. The fourth determination sub-module is configured to determine a 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 sub-module is configured to obtain an 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 execute the following steps until the updated evaluation value is less than or equal to a predetermined evaluation threshold. In the case where 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; in the case where 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 sub-module. The adjustment sub-module is used to expand the resources with a priority higher than a predetermined priority and reduce the resources with a priority lower than the predetermined priority according to the priority of the resources in the initial resource configuration scheme to obtain an updated resource configuration scheme.

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

[0154] In some embodiments, the prediction sub-module may include a processing unit. The processing unit is used to process the resource operation data by using a load prediction model. The load prediction model is trained in the following manner: obtain a plurality of sample data, where the sample data includes sample resource operation data at multiple sample moments and actual load values corresponding to the sample resource operation data; input the sample data into an initial load prediction model to obtain predicted load values; adjust the model parameters of the initial load prediction model according to the difference between the predicted load values and the actual load values, and return 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 sub-module and a second result sub-module. The seventh determination sub-module is used to determine a smoothing value according to the ratio between the sum of the current resource operation parameters and the historical resource operation parameters and the sum of the number of the current moment and the number of the historical moment. The second result sub-module is used to process the smoothing value by using a distribution characteristic value determined based on the historical resource operation parameters to obtain resource operation data.

[0156] According to an embodiment of the present invention, any multiple 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 combined and implemented in one module, or any one of them may be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules may 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 may 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 chip, a system on a substrate, a system in a package, an application specific integrated circuit (ASIC), or any other reasonable manner that can be achieved by integrating or packaging circuits, etc., in hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in an appropriate combination of any several 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, and when the computer program module is run, the corresponding functions may be 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] As Figure 6 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 section 608 into a random access memory (RAM 603). The processor 601 may include, for example, a general microprocessor (such as a CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (such as an application specific integrated circuit (ASIC)), etc. The processor 601 may also include on-board 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 the RAM 603, various programs and data required for the operation of the electronic device 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flow according to the embodiments of the present invention by executing the programs in the ROM 602 and / or the RAM 603. It should be noted that the programs may also be stored in one or more memories other than the ROM 602 and the RAM 603. The processor 601 may also perform various operations of the method flow according to the embodiments of the present invention by executing the programs 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, and the input / output (I / O) interface 605 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 from it can be 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 embodiments; or may exist separately without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to the embodiments 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: portable computer disks, hard disks, random access memory (RAM 603), read-only memory (ROM 602), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present invention, the computer-readable storage medium may be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the above-described ROM 602 and / or RAM 603 and / or one or more memories other than ROM 602 and RAM 603.

[0163] An embodiment of the present invention further includes a computer program product, which includes a computer program that contains program code for executing the method shown in the flowchart. When the computer program product runs 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] When the computer program is executed by the processor 601, it executes the above functions defined in the system / apparatus of the embodiment of the present invention. According to an embodiment of the present invention, the above-described systems, apparatuses, modules, units, etc. can be implemented by computer program modules.

[0165] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices and magnetic storage devices. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and be downloaded and installed through the communication part 609, and / or be installed from the removable medium 611. The program code included in the computer program can be transmitted by any suitable 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 be installed from the removable medium 611. When the computer program is executed by the processor 601, it executes the above functions defined in the system of the embodiment of the present invention. According to an embodiment of the present invention, the above-described systems, devices, apparatuses, modules, units, etc. can be implemented by computer program modules.

[0167] Those skilled in the art will appreciate that the features described in the various embodiments of the present invention can 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 can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present invention.

[0168] The embodiments of the present invention have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present invention. Although the embodiments have been described separately above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Without departing from the scope of the present invention, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present invention.

Claims

1. A resource allocation method, characterized in that, The method 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 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, where 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 configuration plan based on the first load value, the second load value, and the resource operation data; Evaluating the initial resource configuration plan to obtain an evaluation value; Determining a target resource configuration plan according to the evaluation value and the initial resource configuration plan, so as to allocate resources according to the target resource configuration plan; Wherein, the method further includes: when the evaluation value is higher than a predetermined evaluation threshold, determining the influence degree of the resource distribution change on the evaluation value according to the historical resource distribution data of the server; determining the influence degree range of the resource distribution change on the evaluation value according to the influence degree and a predetermined value; adjusting the initial resource configuration plan according to the matching result between the influence degree range and the difference between the evaluation value and the predetermined evaluation threshold to obtain an updated resource configuration plan.

2. The method according to claim 1, characterized in that, The determining the initial resource configuration plan 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; Determining the initial resource configuration plan according to the load status.

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

4. The method according to claim 2, wherein The determining the load status of the server according to the comprehensive load index value includes: Obtaining a set of load thresholds of the server according to the identification information of the server, where the set of load thresholds 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 status 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 status of the server is normal load; When the comprehensive load index value is less than the first load threshold, determining that the load status of the server is low load.

5. The method according to claim 4, wherein The determining the initial resource configuration plan according to the load status includes, when the load status of the server is high load: Obtaining a supply threshold of the resource according to the identification information of the server; Determine bottleneck resources from the resource operation data by comparing the resource operation data with the supply threshold; Perform a resource expansion operation on the bottleneck resources to obtain the initial resource configuration plan.

6. The method according to claim 4, wherein The determining the initial resource configuration plan according to the load status includes, when the load status of the server is the low load: Obtain the release threshold of the resources according to the identification information of the server; When there are resources in the resource operation data that are continuously lower than the release threshold for a predetermined duration, determine idle resources from the resource operation data; Release the idle resources to obtain the initial resource configuration plan.

7. The method according to claim 1, wherein The evaluating the initial resource configuration plan to obtain an evaluation value includes: Determine a resource increment according to the difference between the initial resource distribution data in the initial resource configuration plan and the current resource distribution data of the server at the current moment; Obtain the evaluation value according to the resource increment.

8. The method according to claim 7, characterized in that, The method further includes: Repeatedly execute the following steps until the updated evaluation value is less than or equal to a predetermined evaluation threshold. When the evaluation value is higher than the predetermined evaluation threshold, adjust the initial resource configuration plan to obtain an updated resource configuration plan; Determine an updated resource increment according to the difference between the updated resource distribution data in the updated resource configuration plan and the current resource distribution data; Obtain the updated evaluation value according to the updated resource increment; When the updated evaluation value is less than or equal to the predetermined evaluation threshold, use the updated resource configuration plan as the target resource configuration plan.

9. The method according to claim 8, wherein The adjusting the initial resource configuration plan to obtain an updated resource configuration plan includes: According to the priority of the resources in the initial resource configuration plan, expand the resources with a priority higher than a predetermined priority, and reduce the resources with a priority lower than the predetermined priority to obtain the updated resource configuration plan.

10. The method according to claim 1, characterized in that, The predicting the load of the server according to the resource operation data to obtain a first load value in a first time period and a second load value in a second time period includes: Predict the load of the server at multiple moments within a predetermined time period according to the resource operation data to obtain multiple load values. The start moment of the predetermined time period is earlier than the current moment, and the end moment of the predetermined time period is the end moment of the second time period; Determine the first load value according to the load value corresponding to the first time period among the multiple load values; Determine the second load value according to the load value corresponding to the second time period among the multiple load values.

11. The method according to claim 10, wherein The predicting the load of the server at multiple moments within a predetermined time period according to the resource operation data includes: processing the resource operation data by using a load prediction model. The load prediction model is trained in the following manner: Obtain a plurality of sample data, where 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; Input the sample data into an initial load prediction model to obtain a predicted load value; Adjust the model parameters of the initial load prediction model according to the difference between the predicted load value and the actual load value, and return the operation of inputting the sample data into the initial load prediction model until the difference converges.

12. The method according to claim 1, wherein The resource operation parameters of the server obtained at the current moment include current resource operation parameters and historical resource operation parameters at historical moments before the current moment; Processing the resource operation parameters of the server obtained at the current moment to obtain resource operation data includes: Determine a smoothing value according to the ratio between the sum of the current resource operation parameters and the historical resource operation parameters and the sum of the number of the current moment and the number of the historical moment; Process the smoothing value by using the distribution characteristic value determined based on the historical resource operation parameters to obtain the resource operation data.

13. An electronic device, comprising: One or more processors; A memory for storing one or more computer programs, 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 instructions stored thereon, characterized in that, When the computer program or instruction is executed by the 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 the processor, the steps of the method according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

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

    CN118555510A

  • Traffic demand prediction method and system based on LSTM

    CN119052112A

  • Virtual machine resource dynamic allocation method based on load prediction

    CN119938221A