Resource scheduling method and device and electronic equipment
By scheduling resource information with the smallest resource weight among multiple resource queues, the problem of low resource scheduling efficiency in the prior art is solved, and efficient computing resource reuse and cost control are achieved.
Patent Information
- Application Number
- CN202411604962.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-18
AI Technical Summary
The existing resource scheduling efficiency is low, making it difficult to achieve efficient computing resource reuse under the premise of controllable cost in task-based billing scenarios.
By scheduling the target computing resources corresponding to the resource information with the smallest resource weight in multiple resource queues, and deleting their resource information from the target resource queue, and subtracting the resource weights of each resource information in the target resource queue from the preset to improve resource scheduling efficiency.
It improves resource scheduling efficiency, enhances the utilization rate and efficiency of computing resources, and reduces operating costs.
Smart Images

Figure CN119473612A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a resource scheduling method, device and electronic device. Background Art
[0002] With the rapid development of computer hardware, computing resources have gradually become an indispensable part of cloud services. For cloud service providers, in task-based billing scenarios, how to achieve efficient computing resource reuse while keeping costs under control is a major challenge. Computing resource reuse refers to allocating computing resources to multiple tasks or applications in the same time period to improve computing utilization and efficiency.
[0003] The current mainstream computing power reuse solutions are as follows: Containerization technology is a typical early resource reuse method, which can run multiple services on the same physical server in the form of packaged containers; virtualization technology achieves resource reuse by dividing the physical server into multiple virtual machine instances, which is also a common method used by most cloud service providers.
[0004] However, current computing power reuse usually requires allocating available computing power resources to some computing tasks according to certain scheduling strategies. The scheduling process is complicated, resulting in low resource scheduling efficiency. Summary of the invention
[0005] The embodiments of the present application provide a resource scheduling method, device and electronic device to solve the problem of low efficiency of existing resource scheduling.
[0006] To solve the above technical problems, this application is implemented as follows:
[0007] In a first aspect, an embodiment of the present application provides a resource scheduling method, the method comprising:
[0008] Scheduling the target computing resources corresponding to the resource information with the smallest resource weight in multiple resource queues;
[0009] Deleting the resource information of the target computing power resource from the target resource queue, and subtracting a first preset value from the resource weight of each resource information in the target resource queue;
[0010] Among them, the resource weight of each resource information in the multiple resource queues is positively correlated with the order in which the resource information is placed in the resource queue, the first preset value is the sum of the second preset value and the preset inertia factor of the target resource queue, and the target resource queue is the resource queue where the resource information of the target computing power resource is located.
[0011] In a second aspect, an embodiment of the present application provides a resource scheduling device, the device comprising:
[0012] A scheduling module is used to schedule target computing resources corresponding to resource information with the smallest resource weight in multiple resource queues;
[0013] An updating module, configured to delete the resource information of the target computing power resource from the target resource queue, and to subtract a first preset value from the resource weight of each resource information in the target resource queue;
[0014] Among them, the resource weight of each resource information in the multiple resource queues is positively correlated with the order in which the resource information is placed in the resource queue, the first preset value is the sum of the second preset value and the preset inertia factor of the target resource queue, and the target resource queue is the resource queue where the resource information of the target computing power resource is located.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, including a transceiver and a processor.
[0016] The processor is configured to:
[0017] Scheduling the target computing resources corresponding to the resource information with the smallest resource weight in multiple resource queues;
[0018] Deleting the resource information of the target computing power resource from the target resource queue, and subtracting a first preset value from the resource weight of each resource information in the target resource queue;
[0019] Among them, the resource weight of each resource information in the multiple resource queues is positively correlated with the order in which the resource information is placed in the resource queue, the first preset value is the sum of the second preset value and the preset inertia factor of the target resource queue, and the target resource queue is the resource queue where the resource information of the target computing power resource is located.
[0020] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the resource scheduling method described in the first aspect above.
[0021] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the resource scheduling method described in the first aspect are implemented.
[0022] In a sixth aspect, an embodiment of the present application further provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps in the method described above.
[0023] In the resource scheduling method of this embodiment, it is sufficient to schedule the target computing resources corresponding to the resource information with the smallest resource weight in multiple resource queues to improve the resource scheduling efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0025] Figure 1 is a flow chart of a resource scheduling method provided in an embodiment of the present application;
[0026] Figure 2 is a schematic diagram of a resource scheduling method provided in an embodiment of the present application;
[0027] Figure 3 It is one of the inertial queue decision principle diagrams provided in the embodiments of the present application;
[0028] Figure 4 This is the second inertial queue decision principle diagram provided in the embodiment of the present application;
[0029] Figure 5 This is a principle diagram of a computing resource scarcity prediction model training provided by an embodiment of the present application;
[0030] Figure 6 This is one of the curve diagrams of the change of the computing power resource reuse ratio provided in the embodiment of the present application;
[0031] Figure 7 This is the second graph of the change of the computing power resource reuse ratio provided in the embodiment of the present application;
[0032] Figure 8 It is a structural diagram of a resource scheduling device provided in an embodiment of the present application;
[0033] Fig. 9 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0035] See also Figure 1, Figure 1 is a flow chart of a resource scheduling method provided in an embodiment of the present application, which is executed by a first electronic device, wherein the first electronic device may be a server, etc. Figure 1 As shown, the resource scheduling method provided in this embodiment includes the following steps:
[0036] Step 101: Schedule the target computing resources corresponding to the resource information with the smallest resource weight in multiple resource queues.
[0037] Among them, the resource weight of each resource information in multiple resource queues is positively correlated with the order in which the resource information is placed in the resource queue, that is, the earlier the order of placement (it can also be understood as the smaller / earlier the order of placement), the smaller the resource weight, the later the order of placement (it can also be understood as the larger / later the order of placement), the greater the resource weight, and the smaller the resource weight, the higher the priority of the resource being scheduled, that is, the easier it is to be scheduled. The resource queue is used to store resource information of resources, and each resource information has a corresponding resource weight, which can also be understood as the resource weight of the resource corresponding to the resource information. In this embodiment, during the resource scheduling process, the target computing power resources corresponding to the resource information with the smallest resource weight in the current multiple resource queues can be scheduled.
[0038] Step 102: deleting the resource information of the target computing power resource from the target resource queue, and subtracting a first preset value from the resource weight of each resource information in the target resource queue;
[0039] The first preset value is the sum of the second preset value and the preset inertia factor of the target resource queue, and the target resource queue is the resource queue where the resource information of the target computing power resource is located.
[0040] It should be understood that multiple resource queues can be pre-divided, and each resource queue has a corresponding preset inertia factor. The preset inertia factor can also be called a preset queue coefficient or a preset queue weight. The larger the preset inertia factor of a queue, the greater the priority of the queue, and the higher the resource scheduling (i.e., dequeue) priority. Exemplarily, each of the multiple resource queues has corresponding resource attribute information, and the preset inertia factors of the multiple resource queues can be determined in advance based on the resource attribute information of the multiple resource queues. For example, for processor (CPU) resources, the resource attribute information may include the number of cores, and the preset inertia factor can be determined based on the number of CPU cores. For example, the number of CPU cores is positively correlated with the preset inertia factor. It should be noted that the queue in the embodiment of the present application can be an inertia queue, that is, when the first element of the queue is dequeued, it will generate inertia for the elements waiting to be dequeued in the queue. After the first element of the queue is dequeued, the weights of other elements in the queue will be updated, that is, the dequeued element will generate inertia for other elements in the resource queue to which it belongs, so as to facilitate subsequent resource scheduling in the updated multiple resource queues. In this embodiment, the resource weight of the first element in the resource queue is the smallest resource weight of the elements in the resource queue.
[0041] In this embodiment, after each scheduling of the resource information with the smallest resource weight, the resource information of the target computing power resource can be deleted from the target resource queue, and the resource weight of each resource information in the target resource queue can be subtracted from the first preset value to reduce the resource weight of each resource information in the target resource queue, thereby increasing the possibility of scheduling the corresponding resources of each resource information in the target resource queue during the subsequent resource scheduling process. Moreover, the first preset value is the sum of the second preset value and the preset inertia factor of the target resource queue. The second preset value can be pre-set and can be set based on historical experience, etc., without specific limitation. For example, it can be set to 1, etc. The larger the preset inertia factor, the larger the first preset value. Then, for the resource weight of the resource in the resource queue where the scheduled target computing power resource is located, the larger the subtracted value is, the smaller the resource weight is, and the more likely it is to be scheduled in the subsequent scheduling process, that is, the higher the resource dequeue priority.
[0042] In the resource scheduling method of this embodiment, the target computing power resources corresponding to the resource information with the smallest resource weight in multiple resource queues can be scheduled to improve the resource scheduling efficiency. At the same time, after scheduling the target computing power resources corresponding to the resource information with the smallest resource weight, the resource information of the target computing power resources is deleted from the target resource queue, and the resource weight of each resource information in the target resource queue is subtracted from the first preset value to update the resource weight of each resource information in the target resource queue, so that in the subsequent resource scheduling process, the resource with the smallest resource weight is scheduled with the updated resource weight to improve the resource scheduling effect.
[0043] In some embodiments, before scheduling the target computing resources corresponding to the resource information with the smallest resource weight in the multiple resource queues, the method further includes:
[0044] Get the computing power resource reuse ratio;
[0045] Screen resources based on the computing power resource reuse ratio and determine multiple computing power resources;
[0046] According to the attribute information of multiple computing resources, the resource information of each computing resource in the multiple computing resources is placed in the corresponding resource queue, and according to the order in which the resource information of each computing resource in the multiple computing resources is placed in the corresponding resource queue, the resource information of the computing resources is assigned a corresponding resource weight.
[0047] It should be understood that the computing power resource reuse ratio may refer to the ratio of the number of computing power resources reused per unit time to the total number of computing power resources. The computing power resource reuse ratio may be used to screen resources first to determine multiple computing power resources, and multiple computing power resources may be understood as reusable resources. Since each resource queue has corresponding resource attribute information, the resource information of each computing power resource in the multiple computing power resources may be placed in the corresponding resource queue according to the attribute information of the multiple computing power resources. For example, there are three resource queues, and the corresponding CPU core numbers are 2 cores, 4 cores, and 8 cores, respectively. Multiple computing power resources are identified, and the resource information of the computing power resource with 2 cores is placed in the resource queue corresponding to 2 cores, the resource information of the computing power resource with 4 cores is placed in the resource queue corresponding to 4 cores, and the resource information of the computing power resource with 8 cores is placed in the resource queue corresponding to 8 cores. In addition, it should be noted that the order in which the resource information of the computing power resources is placed in the queue refers to the order in which it is placed in all queues of the multiple resource queues. For example, computing power resource A is first placed in resource queue 1, and computing power resource A is placed in the earliest order, that is, it ranks first in order, followed by computing power resource B in resource queue 2, and computing power resource B is placed in the second order, followed by computing power resource C in resource queue 3, and computing power resource C is placed in the third order, followed by computing power resource D in resource queue 1, and computing power resource D is placed in the fourth order, and so on. In this embodiment, the resource information of the computing power resources can be assigned corresponding resource weights according to the order in which the resource information of each computing power resource in the multiple computing power resources is placed in the corresponding resource queue. The earlier the order in which the computing power resources are placed, the smaller the resource weight assigned, and the higher the priority of the queue. Exemplarily, in the embodiment of the present application, computing power resources may include but are not limited to: CPU resources, memory resources, network bandwidth resources, disk resources, etc.
[0048] In this embodiment, resources can be screened according to the computing power resource utilization ratio, and the resource information of the screened multiple computing power resources can be placed in the corresponding resource queue, and resource weights can be assigned so that in the subsequent resource scheduling process, the computing power resources corresponding to the resource information with the smallest resource weight can be scheduled from the resource queue to improve the resource scheduling efficiency.
[0049] In some embodiments, the computing resource reuse ratio is adjusted by:
[0050] Monitor the scarcity of computing resources;
[0051] Adjust the computing power resource reuse ratio according to the scarcity of computing power resources.
[0052] It should be understood that the computing power resource reuse ratio in the embodiment of the present application is not fixed, and can be adjusted in the above manner. For example, illustratively, it can be dynamically adjusted, for example, a dynamic adjustment can be made once per preset interval duration. Specifically, the computing power resource shortage can be monitored per preset interval duration, and the computing power resource shortage can be used to adjust the computing power resource reuse ratio, so as to achieve a dynamic adjustment once per preset interval duration; it can also be adjusted dynamically in real time, that is, the computing power resource shortage can be monitored in real time, and the computing power resource shortage can be used to adjust the computing power resource reuse ratio, so as to achieve real-time dynamic adjustment of the computing power resource reuse ratio. Exemplarily, the initial value of the computing power resource reuse ratio can be pre-set to 0. It can be understood that, initially, no reuse resource screening can be performed. As the computing power resource shortage increases, the computing power resource usage ratio can be adjusted, reusable resources can be screened, and their resource information can be placed in the corresponding resource queue.
[0053] In this embodiment, the computing power resource shortage can be monitored and the computing power resource reuse ratio can be adjusted using the computing power resource shortage, so that the computing power resource reuse ratio is more adapted to the monitored computing power resource shortage, thereby improving the rationality of the obtained computing power resource reuse ratio.
[0054] In some embodiments, the computing power resource reuse ratio is adjusted according to the computing power resource scarcity, including at least one of the following:
[0055] When the computing power resource shortage is greater than the preset threshold, increase the computing power resource reuse ratio;
[0056] When the computing power resource shortage is less than or equal to the preset threshold, the computing power resource reuse ratio is reduced.
[0057] It should be understood that when the computing power resource shortage is greater than the preset threshold, the computing power resource shortage is large, which may indicate that the available computing power resources are in short supply or lack to a large extent, and resources are in short supply. At this time, the computing power resource reuse ratio can be adjusted to increase, so that more reused resources can be screened for subsequent resource scheduling, more resource reuse can be achieved, and sufficient resources can be provided as much as possible. When the computing power resource shortage is less than or equal to the preset threshold, the computing power resource shortage is small, which may indicate that the available computing power resources are in short supply or lack to a small extent, and the resource reuse demand is small or no resource reuse is required. At this time, the computing power resource reuse ratio can be adjusted to decrease, so that fewer or no reused resources can be screened to reduce resource waste.
[0058] In some embodiments, when the computing power resource shortage is greater than a preset threshold, increasing the computing power resource reuse ratio includes:
[0059] When the computing power resource shortage is greater than the preset threshold, if the computing power resource reuse ratio is less than or equal to the preset reuse ratio, the computing power resource reuse ratio will be increased exponentially;
[0060] When the computing power resource shortage is greater than the preset threshold, if the computing power resource reuse ratio is greater than the preset reuse ratio, the computing power resource reuse ratio increases linearly.
[0061] The preset threshold value can be understood as a preset scarcity threshold value (which can be a value in the range of [0, 1]), which can be set in advance according to experience or actual needs, and is not specifically limited. For example, by way of example, the preset threshold value can be 20%, etc. The preset reuse ratio can be understood as a preset scarcity limit value (which can be a value in the range of [0, 1]), which can be set in advance according to experience or actual needs, and is not specifically limited. For example, by way of example, the preset reuse ratio can be 0.6, etc.
[0062] In the embodiment of the present application, when the computing power resource shortage is relatively large, the computing power resource reuse ratio can be increased by adopting a corresponding growth method in combination with the size of the current computing power resource reuse ratio, that is, when the computing power resource shortage is greater than the preset threshold, if the computing power resource reuse ratio is less than or equal to the preset reuse ratio, it means that the computing power resource reuse is relatively small at this time, and an exponential growth method is adopted, and if the computing power resource reuse ratio is greater than the preset reuse ratio, it means that the computing power resource reuse is relatively large at this time, and a linear growth method is adopted. That is, in this embodiment, when the computing power resource shortage is greater than the preset threshold, for different computing power resource reuse ratios, different growth methods are adopted to increase the computing power resource reuse ratio, thereby improving the flexibility of adjusting the computing power resource reuse ratio.
[0063] In some embodiments, monitoring computing resource scarcity includes:
[0064] Obtain the first state characteristics of resources in the computing resource set at the current time;
[0065] According to the first state characteristics, the computing power resource shortage prediction model is used to predict the computing power resource shortage and obtain the computing power resource shortage.
[0066] It should be understood that the first state feature of a resource can be used to characterize the state of the resource at the current time. Exemplarily, the first state feature may include, but is not limited to: waiting time (exemplarily, average waiting time), computing power loss (consumption) features, etc. It should be noted that the computing power resource scarcity prediction model is a trained prediction model.
[0067] In this embodiment, the computing power resource shortage prediction model can be used to predict the computing power resource shortage based on the first state characteristics of the computing power resource concentration resources at the current time to obtain the computing power resource shortage, so as to improve the accuracy of the obtained computing power resource shortage.
[0068] In some embodiments, the computing resource scarcity prediction model is trained in the following way:
[0069] For each of the multiple time points in the preset historical time period, obtain the second state characteristics of the resources in the computing power resource concentration at the time point and the scarcity of the computing power resources annotated at the time point;
[0070] Model training is performed based on the second state characteristics at multiple time points and the annotated computing power resource shortages at multiple time points to obtain a computing power resource shortage prediction model.
[0071] It should be understood that the preset historical time period can be a historical time period pre-selected according to actual needs, etc., without specific limitation. For example, it can be a time period of nearly one month, etc. It should be understood that the second state characteristics of the resource at a point in time can be used to characterize the state of the resource at that point in time. Exemplarily, the second state characteristics may include, but are not limited to: waiting time (exemplarily, it can be the average waiting time), computing power loss (consumption) characteristics, etc. The marked computing power resource shortage can also be understood as the actual computing power resource shortage. There are many ways to mark, which are not specifically limited. For example, it can be marked by manual marking to obtain the marked computing power resource shortage.
[0072] In this embodiment, the traffic of the Internet service is affected by people's production and life, and will show obvious peaks and low peaks, periodicity and predictability. Therefore, on the basis of considering the state characteristics of computing power resources, the time dimension is also considered, that is, the second state characteristics of resources at multiple time points in a preset historical time period and the annotated computing power resource scarcity at multiple time points are used as training data sets to train the model and obtain a computing power resource scarcity prediction model to improve the model prediction performance. Subsequently, the resource scarcity is predicted by the trained model to improve the accuracy of the predicted computing power resource scarcity.
[0073] The process of the above method is described in detail below with reference to a specific embodiment.
[0074] like Figure 2 As shown, first, according to the computing power resource reuse ratio ε, resources can be screened from a number of computing power resources (exemplarily, resources used to complete at least one task), and after pattern recognition of the resource information (e.g., resource identification, etc.) of the screened computing power resources, they are placed in the corresponding resource queues (also called waiting queues or resource generation queues, which can be inertia queues) in multiple resource queues. Corresponding to the resource queue, there is a resource consumption end, which can also be a queue, which can be called a task waiting queue (which can be used to store task information of tasks to be processed, such as task identification, etc.), and any task in the task waiting queue needs to consume one or more computing power resources to execute and meet the conditions for dequeuing. Subsequently, a resource queue dequeue strategy (also called inertia queue decision) can be performed, that is, the computing power resources corresponding to the resource information are selected from multiple resource queues to complete resource scheduling to execute tasks. In addition, the computing power resource scarcity can be predicted based on the task profile (which can include the state characteristics of the computing power resources under the time dimension), and the computing power resource reuse ratio ε can be dynamically adjusted using the predicted computing power resource scarcity.
[0075] For inertial queue decision:
[0076] Inertia queue: a queue in which the first element of the queue will generate inertia for the waiting elements in the queue when it is dequeued. This queue is suitable for scenarios where multiple queues make decisions at the same time.
[0077] like Figure 3 As shown in the figure, each computing resource enters the inertial queue Q[i] after pattern recognition, i∈1,2,3,...,n, n is the total number of resource queues, and is assigned a priority weight (resource weight) of m+1, m is the total number of computing resources in all current resource queues. The smaller the value, the earlier the order of entering the queue, indicating a higher priority for leaving the queue. The matrix M(Q[i],j) identifies the priority weight of the jth computing resource in the queue Q[i]. Q[i] identifies the resource queue i, which can also be called the i-th resource queue.
[0078] Each decision is to remove the element with the smallest priority weight from the head of each queue, that is, min{M(Q[1],1),M(Q[2],1),...,M(Q[n],1)}. When an element is removed from the queue through a decision, the priority weight of all computing resources is reduced by the second preset value (such as Figure 3 The order decision is shown, for example, the second preset value is 1), and the priority weight of all computing resources in the queue where the dequeued element is located is subtracted from the preset inertia factor corresponding to the queue (such as Figure 4The decision based on the inertia queue is shown. For example, the inertia factor of a queue can be the number of computing resource cores corresponding to the queue divided by the total number of computing resource cores corresponding to multiple resource queues, that is, the normalized number of cores). Since the more computing resource cores, the higher the cost, the higher the dequeue priority should be. Therefore, the number of cores of different queues is proportional to the corresponding preset inertia factor and inversely proportional to the priority weight.
[0079] For the prediction of computing power shortage based on task profile:
[0080] Task profiles may include status characteristics of computing resources (for example, characteristics of computing resource consumption, etc.), characteristics of commonly used physical resources such as CPU and memory, and status characteristics of resources such as network bandwidth and disk (input and output (IO)). In the process of computing resource reuse, the resource characteristics used in the embodiments of the present application may mainly include but are not limited to the average waiting time of computing resources, and the loss of CPU and memory, etc. Collecting historical data on resource consumption and summarizing and analyzing them can be used in high-load task-based computing scheduling scenarios.
[0081] It should be noted that in addition to the characteristic dimensions of computing resources themselves, task portraits should also include characteristics of the time dimension. In particular, the traffic of Internet services will be affected by people's production and life, showing obvious peaks, periodicity, and predictability. For example, local life applications will have peaks at noon and evening, office applications will have peaks when clocking in and out, and e-commerce applications will have traffic peaks during the promotion phase that are expected to be several times the trough. If the scheduling system can capture this information and flexibly allocate resources according to the cluster and application status, it can achieve the "peak shaving and valley filling" effect of resource allocation.
[0082] Training data set: The average waiting time for computing power in the past month can be obtained, with time nodes accurate to seconds. Through manual labeling, the labeled computing power shortage level at each time point can be obtained (for example, level 1-5, the higher the level, the higher the computing power shortage). The computing power shortage degree is determined according to the computing power shortage level. The computing power shortage degree is a percentage. For example, it can be a random value divided based on the computing power shortage level. For example, if manual labeling gives a shortage level of 3, the corresponding shortage degree can be a random number between 40% and 60%.
[0083] Figure 5 A single feature computing resource shortage prediction model based on a time sliding window is given. Based on the collected data set, the following training process can be performed:
[0084] Bottom-up convolution: Based on the sliding window, the bottom feature sequence is convolved with a step size of 1. For each layer of feature sequence, if there are any parameters that are missing, they are filled with 0. The sliding window consists of a 1*3 weight vector;
[0085] Top-down gradient optimization: Based on the known shortage of annotated computing power members at the current time point, the weight of each sliding window is optimized from top to bottom. For the optimization method, refer to the gradient descent algorithm, etc.
[0086] Based on the above training process, the final training model, namely the computing power resource shortage prediction model, is obtained, which can be used for computing power resource shortage prediction.
[0087] For dynamic reuse of computing resources based on computing resource scarcity:
[0088] Dynamic reuse of computing resources means monitoring the scarcity of computing resources at each point in time through monitoring components and dynamically adjusting the computing power reuse ratio ε.
[0089] Considering the time loss of computing resources in scheduling transmission, the preset shortage threshold δ is exemplarily 20%. When the monitored computing resource shortage is greater than δ, if ε is less than the classification limit τ (preset reuse ratio), ε increases exponentially; if ε is greater than the classification limit τ, ε increases linearly; when the monitored computing resource shortage is less than or equal to δ, ε decreases exponentially.
[0090] Figure 6-7 Two dynamic change curves of computing power resource reuse ratio ε are given. When the given classification limit τ is 0.6, Figure 6 The left side shows the change curve of ε in the scenario where computing power resources are in short supply for a long time. Figure 6 The right side of shows the ε curve change diagram of the task obtaining the required computing power during the resource reuse acceleration stage. In the time period [0,a], computing power resources are in short supply, computing power shortage is at a high level for a long time, ε increases exponentially, and accelerated resource reuse is achieved; in the [a,b] period, ε is greater than the classification limit τ, indicating that the resource reuse speed tends to be stable, so linear growth can meet the reuse of sufficient resources; in the [b,∝] period, computing power resources are in oversupply, computing power shortage is low, and computing power reuse demand is small. At this time, ε is reduced exponentially to reduce resource waste. In addition, if Figure 7 As shown in the figure, in the time period [0,c], the computing power resources are in short supply, the computing power shortage is large, and the computing power resource utilization ratio ε increases exponentially. In the time period [c,∝], the computing power resources are in short supply, the computing power shortage is low, and the computing power reuse demand is small. At this time, ε is reduced exponentially to reduce resource waste. That is, when the computing power resource shortage is less than or equal to the preset threshold, the computing power resource reuse ratio can be reduced exponentially.
[0091] Through the above scheme of the embodiment of the present application, based on the pre-trained computing power resource scarcity prediction model, the dynamic reuse of computing power is superimposed to adapt to the actual scenario of needing to wait during peak hours and excess resources during trough hours, thereby improving resource utilization and reducing operating costs. In addition, the inertial queue decision can cope with different computing power reuse scheduling strategy scenarios, which is a universal acceleration framework that can improve the efficiency of decision-making.
[0092] like Figure 8 As shown, Figure 8 is a schematic diagram of a resource scheduling device provided in an embodiment of the present application. Figure 8 As shown, the resource scheduling device 800 includes:
[0093] The scheduling module 801 is used to schedule the target computing resources corresponding to the resource information with the smallest resource weight in multiple resource queues;
[0094] An updating module 802 is used to delete the resource information of the target computing power resource from the target resource queue, and to subtract a first preset value from the resource weight of each resource information in the target resource queue;
[0095] Among them, the resource weight of each resource information in multiple resource queues is positively correlated with the order in which the resource information is placed in the resource queue. The first preset value is the sum of the second preset value and the preset inertia factor of the target resource queue. The target resource queue is the resource queue where the resource information of the target computing power resource is located.
[0096] In some embodiments, the resource scheduling device 800 further includes:
[0097] The acquisition module is used to obtain the computing power resource reuse ratio;
[0098] The resource determination module is used to screen resources according to the computing power resource reuse ratio and determine multiple computing power resources;
[0099] A placement module is used to place the resource information of each computing resource among the multiple computing resources into a corresponding resource queue according to the attribute information of the multiple computing resources, and to assign corresponding resource weights to the resource information of the computing resources according to the order in which the resource information of each computing resource among the multiple computing resources is placed into the corresponding resource queue.
[0100] In some embodiments, the resource scheduling device 800 further includes:
[0101] Monitoring module, used to monitor the scarcity of computing resources;
[0102] The adjustment module is used to adjust the reuse ratio of computing power resources according to the scarcity of computing power resources.
[0103] In some embodiments, the adjustment module is specifically configured to:
[0104] When the computing power resource shortage is greater than the preset threshold, increase the computing power resource reuse ratio;
[0105] When the computing power resource shortage is less than or equal to the preset threshold, the computing power resource reuse ratio is reduced.
[0106] In some embodiments, when the computing power resource shortage is greater than a preset threshold, increasing the computing power resource reuse ratio includes:
[0107] When the computing power resource shortage is greater than the preset threshold, if the computing power resource reuse ratio is less than or equal to the preset reuse ratio, the computing power resource reuse ratio will be increased exponentially;
[0108] When the computing power resource shortage is greater than the preset threshold, if the computing power resource reuse ratio is greater than the preset reuse ratio, the computing power resource reuse ratio increases linearly.
[0109] In some embodiments, the monitoring module comprises:
[0110] A feature acquisition unit, used to acquire a first state feature of a resource in the computing resource set at a current time;
[0111] The scarcity determination unit is used to make a prediction based on the first state characteristics through a computing power resource scarcity prediction model to obtain the computing power resource scarcity.
[0112] In some embodiments, the computing resource scarcity prediction model is trained in the following way:
[0113] For each of the multiple time points in the preset historical time period, obtain the second state characteristics of the resources in the computing power resource concentration at the time point and the scarcity of the computing power resources annotated at the time point;
[0114] Model training is performed based on the second state characteristics at multiple time points and the annotated computing power resource shortages at multiple time points to obtain a computing power resource shortage prediction model.
[0115] The electronic device provided in this embodiment can implement each process of each embodiment of the above-mentioned resource scheduling method applied to the first electronic device. The technical features correspond one to one and can achieve the same technical effect. To avoid repetition, they will not be repeated here.
[0116] An embodiment of the present application also provides an electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor. When the program is executed by the processor, the various processes of the resource scheduling method embodiment described above applied to the first electronic device are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0117] The embodiment of the present application also provides a computer program product, including computer instructions. When the computer instructions are executed by a processor, the various processes in the above method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0118] For details, see Fig. 9 An embodiment of the present application further provides an electronic device, including a bus 901, a transceiver 902, an antenna 903, a bus interface 904, a processor 905 and a memory 906.
[0119] The processor 905 is used for:
[0120] Scheduling the target computing resources corresponding to the resource information with the smallest resource weight in multiple resource queues;
[0121] Deleting the resource information of the target computing power resource from the target resource queue, and subtracting a first preset value from the resource weight of each resource information in the target resource queue;
[0122] Among them, the resource weight of each resource information in multiple resource queues is positively correlated with the order in which the resource information is placed in the resource queue. The first preset value is the sum of the second preset value and the preset inertia factor of the target resource queue. The target resource queue is the resource queue where the resource information of the target computing power resource is located.
[0123] In some embodiments, the processor 905 is further configured to:
[0124] Get the computing power resource reuse ratio;
[0125] Screen resources based on the computing power resource reuse ratio and determine multiple computing power resources;
[0126] According to the attribute information of multiple computing resources, the resource information of each computing resource in the multiple computing resources is placed in the corresponding resource queue, and according to the order in which the resource information of each computing resource in the multiple computing resources is placed in the corresponding resource queue, the resource information of the computing resources is assigned a corresponding resource weight.
[0127] In some embodiments, the processor 905 is further configured to:
[0128] Monitor the scarcity of computing resources;
[0129] Adjust the computing power resource reuse ratio according to the scarcity of computing power resources.
[0130] In some embodiments, the processor 905 is specifically configured to:
[0131] When the computing power resource shortage is greater than the preset threshold, increase the computing power resource reuse ratio;
[0132] When the computing power resource shortage is less than or equal to the preset threshold, the computing power resource reuse ratio is reduced.
[0133] In some embodiments, when the computing power resource shortage is greater than a preset threshold, increasing the computing power resource reuse ratio includes:
[0134] When the computing power resource shortage is greater than the preset threshold, if the computing power resource reuse ratio is less than or equal to the preset reuse ratio, the computing power resource reuse ratio will be increased exponentially;
[0135] When the computing power resource shortage is greater than the preset threshold, if the computing power resource reuse ratio is greater than the preset reuse ratio, the computing power resource reuse ratio increases linearly.
[0136] In some embodiments, the processor 905 is specifically configured to:
[0137] A feature acquisition unit, used to acquire a first state feature of a resource in the computing resource set at a current time;
[0138] The scarcity determination unit is used to make a prediction based on the first state characteristics through a computing power resource scarcity prediction model to obtain the computing power resource scarcity.
[0139] In some embodiments, the computing resource scarcity prediction model is trained in the following way:
[0140] For each of the multiple time points in the preset historical time period, obtain the second state characteristics of the resources in the computing power resource concentration at the time point and the scarcity of the computing power resources annotated at the time point;
[0141] Model training is performed based on the second state characteristics at multiple time points and the annotated computing power resource shortages at multiple time points to obtain a computing power resource shortage prediction model.
[0142] exist Fig. 9 In the embodiment, the bus architecture (represented by bus 901) may include any number of interconnected buses and bridges, and bus 901 links various circuits including one or more processors represented by processor 905 and memory represented by memory 906. Bus 901 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 904 provides an interface between bus 901 and transceiver 902. Transceiver 902 may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. Data processed by processor 905 is transmitted on a wireless medium via antenna 903, and further, antenna 903 also receives data and transmits the data to processor 905.
[0143] The processor 905 is responsible for managing the bus 901 and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 906 can be used to store data used by the processor 905 when performing operations.
[0144] Optionally, the processor 905 may be a CPU, an ASIC, an FPGA or a CPLD.
[0145] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the resource scheduling method embodiment applied to the first electronic device is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the computer-readable storage medium is a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0146] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0147] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0148] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A resource scheduling method, characterized in that: The method comprises: Scheduling the target computing resources corresponding to the resource information with the smallest resource weight in multiple resource queues; Deleting the resource information of the target computing power resource from the target resource queue, and subtracting a first preset value from the resource weight of each resource information in the target resource queue; Among them, the resource weight of each resource information in the multiple resource queues is positively correlated with the order in which the resource information is placed in the resource queue, the first preset value is the sum of the second preset value and the preset inertia factor of the target resource queue, and the target resource queue is the resource queue where the resource information of the target computing power resource is located.
2. The method according to claim 1, characterized in that Before scheduling the target computing power resources corresponding to the resource information with the smallest resource weight in the multiple resource queues, the method further includes: Get the computing power resource reuse ratio; Perform resource screening according to the computing power resource reuse ratio to determine multiple computing power resources; According to the attribute information of the multiple computing resources, the resource information of each computing resource in the multiple computing resources is placed in a corresponding resource queue, and according to the order in which the resource information of each computing resource in the multiple computing resources is placed in the corresponding resource queue, the resource information of the computing resources is assigned a corresponding resource weight.
3. The method according to claim 2, characterized in that The computing power resource reuse ratio is adjusted in the following ways: Monitor the scarcity of computing resources; According to the scarcity of the computing power resources, the reuse ratio of the computing power resources is adjusted.
4. The method according to claim 3, characterized in that The adjusting the computing resource reuse ratio according to the computing resource scarcity includes at least one of the following: When the computing power resource shortage is greater than a preset threshold, increasing the computing power resource reuse ratio; When the computing power resource shortage is less than or equal to the preset threshold, the computing power resource reuse ratio is reduced.
5. The method according to claim 4, characterized in that When the computing power resource shortage is greater than a preset threshold, increasing the computing power resource reuse ratio includes: When the computing power resource shortage is greater than a preset threshold, if the computing power resource reuse ratio is less than or equal to a preset reuse ratio, exponentially increase the computing power resource reuse ratio; When the computing power resource shortage is greater than a preset threshold, if the computing power resource reuse ratio is greater than the preset reuse ratio, the computing power resource reuse ratio is linearly increased.
6. The method according to claim 3, characterized in that: The monitoring of computing power resource scarcity includes: Obtain the first state characteristics of resources in the computing resource set at the current time; According to the first state feature, the computing power resource shortage prediction model is used to perform a prediction to obtain the computing power resource shortage.
7. The method according to claim 6, characterized in that The computing power resource shortage prediction model is trained in the following way: For each of the multiple time points within the preset historical time period, obtain the second state characteristics of the resources in the computing power resource set at the time point and the scarcity of the computing power resources annotated at the time point; Model training is performed based on the second state characteristics at the multiple time points and the annotated computing power resource shortages at the multiple time points to obtain the computing power resource shortage prediction model.
8. A resource scheduling device, characterized in that: The device comprises: A scheduling module is used to schedule target computing resources corresponding to resource information with the smallest resource weight in multiple resource queues; An updating module, configured to delete the resource information of the target computing power resource from the target resource queue, and to subtract a first preset value from the resource weight of each resource information in the target resource queue; Among them, the resource weight of each resource information in the multiple resource queues is positively correlated with the order in which the resource information is placed in the resource queue, the first preset value is the sum of the second preset value and the preset inertia factor of the target resource queue, and the target resource queue is the resource queue where the resource information of the target computing power resource is located.
9. An electronic device, characterized in that: Including transceiver and processor, The processor is configured to: Scheduling the target computing resources corresponding to the resource information with the smallest resource weight in multiple resource queues; Deleting the resource information of the target computing power resource from the target resource queue, and subtracting a first preset value from the resource weight of each resource information in the target resource queue; Among them, the resource weight of each resource information in the multiple resource queues is positively correlated with the order in which the resource information is placed in the resource queue, the first preset value is the sum of the second preset value and the preset inertia factor of the target resource queue, and the target resource queue is the resource queue where the resource information of the target computing power resource is located.
10. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program implements the steps of the method according to any one of claims 1 to 7 when executed by the processor.
11. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any one of the methods of claims 1 to 7.
12. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 7.