Resource allocation method, apparatus, device, storage medium and program product

By constructing a pre-defined probability model and resource allocation strategy, the resource allocation in the IoT system is optimized, solving the problems of excessive scheduling latency and response time, and enabling real-time processing of time-sensitive tasks.

CN118827385BActive Publication Date: 2025-12-09CHINA MOBILE M2M +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410890508.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2025-12-09
Estimated Expiration
2044-07-03

AI Technical Summary

Technical Problem

In existing technologies, resource allocation in IoT systems is based on task arrival time, resulting in excessive scheduling delays and response times, which cannot meet real-time requirements.

Method used

By acquiring historical time-sensitive task information, a pre-defined probability model is constructed to calculate the arrival probability and estimated processing time of future time-sensitive tasks, reserve computing resources, and formulate resource allocation strategies, priority ranking, and decision-making models to optimize resource allocation.

Benefits of technology

Reduce waiting time for future time-sensitive tasks, meet the real-time requirements of time-sensitive tasks, and improve resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118827385B_ABST
    Figure CN118827385B_ABST
Patent Text Reader

Abstract

The application discloses a resource allocation method, device, equipment, storage medium and program product. The method comprises the following steps: acquiring a plurality of historical time-sensitive task information in a preset historical time period; determining a preset probability model based on the plurality of historical time-sensitive task information; calculating a prediction parameter corresponding to a future time-sensitive task matched with a historical time-sensitive task attribute by using the preset probability model; calculating reserved computing resources of the future time-sensitive task in a future preset time period according to an arrival probability and an estimated processing time; and formulating a resource allocation strategy according to a preset quality index, a resource utilization efficiency and the reserved computing resources. According to the embodiment of the application, the scheduling delay and the response time can be reduced, and the real-time requirement of the task can be met.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of resource processing, and particularly relates to a resource allocation method and device, equipment, a storage medium and a program product. BACKGROUND

[0002] With the development of Internet of Things technology, Internet of Things technology is applied in various fields, such as mobile intelligent Internet of Things fields or industrial Internet of Things fields. Whether in the mobile intelligent Internet of Things field or the industrial Internet of Things field, communication and coordination between large-scale mobile devices, sensors and Internet of Things nodes are involved, and in these fields, resource allocation is the key to the operation of the Internet of Things.

[0003] In the related art, a server or an electronic device usually allocates resources according to the order of task arrival time, and executes tasks by using the allocated resources, but this may cause long scheduling delay and response time, prolong the task processing time, and cannot meet the real-time requirement. SUMMARY

[0004] The embodiments of the application provide a resource allocation method, device, equipment, storage medium and program product, which can reduce the scheduling delay and response time, and meet the real-time requirement of tasks.

[0005] In one aspect, the embodiments of the application provide a resource allocation method, which comprises:

[0006] obtaining a plurality of historical time-sensitive task information in a preset historical time period, wherein the historical time-sensitive task information comprises historical time-sensitive task attributes and historical time-sensitive task processing time;

[0007] determining a preset probability model based on the plurality of historical time-sensitive task information;

[0008] calculating a prediction parameter corresponding to a future time-sensitive task matched with the historical time-sensitive task attributes by using the preset probability model, wherein the prediction parameter comprises an arrival probability of the future time-sensitive task in a future preset time period and an estimated processing time of the future time-sensitive task;

[0009] calculating reserved computing resources of the future time-sensitive task in the future preset time period according to the arrival probability and the estimated processing time;

[0010] formulating a resource allocation strategy according to a preset quality index, resource utilization efficiency and the reserved computing resources

[0011] Optionally, the determining of the preset probability model based on the plurality of historical time-sensitive task information comprises:

[0012] counting the historical time-sensitive task information to obtain a total number of arrived tasks of the historical time-sensitive task information in a preset historical time period and a task type corresponding to each of the historical time-sensitive task information;

[0013] determining a basic probability model based on the task type;

[0014] determining a probability parameter type according to the basic probability model;

[0015] calculating a probability parameter corresponding to the basic probability model based on the total number of arrived tasks and the probability parameter type;

[0016] constructing a preset probability model based on the probability parameter.

[0017] Optionally, the determining of the basic probability model based on the task type comprises:

[0018] in a case where the task type is a continuous time-sensitive task, the basic probability model is determined as an exponential distribution probability model;

[0019] in a case where the task type is an independent time-sensitive task, the basic probability model is determined as a Poisson distribution probability model;

[0020] in a case where the task type is a continuous independent time-sensitive task, the basic probability model is determined as a combination model of the exponential distribution probability model and the Poisson distribution probability model.

[0021] Optionally, the probability parameter comprises a first probability, and the first probability is used to represent a probability of arriving at at least one time-sensitive task in a first preset time period.

[0022] The calculating of the probability parameter corresponding to the basic probability model based on the total number of arrived tasks and the probability parameter type comprises:

[0023] in a case where the basic probability model is determined as the exponential distribution probability model, a task arrival frequency per unit time is calculated according to the total number of arrived tasks;

[0024] a first probability is calculated based on the task arrival frequency.

[0025] Optionally, the probability parameter comprises a second probability, and the second probability is used to represent a number of tasks of a time-sensitive task that is arrived averagely in a second preset time interval.

[0026] The calculating of the probability parameter corresponding to the basic probability model based on the total number of arrived tasks and the probability parameter type comprises:

[0027] In a case where the base probability model is determined as a second base probability model, the total number of tasks is classified according to a second preset time interval to obtain an average number of historical time-sensitive tasks in each second preset time interval;

[0028] A second probability is calculated based on the average number.

[0029] Optionally, after the reserved computing resources of the future time-sensitive tasks in a future preset time period are calculated according to the arrival probability and the expected processing time, the method further comprises:

[0030] A first weight is assigned to a preset quality indicator, a second weight is assigned to resource utilization efficiency, and a third weight is assigned to the reserved computing resources;

[0031] According to the first weight, the second weight and the third weight, the future time-sensitive tasks in the future preset time period are prioritized to obtain an execution order of the future time-sensitive tasks;

[0032] Total computing resources in the future preset time period are obtained;

[0033] In a case where the total computing resources are not less than the reserved computing resources, the total computing resources are allocated according to the execution order and the reserved computing resources to obtain a first resource allocation strategy.

[0034] Optionally, in a case where the total computing resources are less than the reserved computing resources, the method further comprises:

[0035] A difference computing resource is calculated based on the total computing resources and the reserved computing resources;

[0036] A task quality indicator of the future time-sensitive tasks is determined according to the difference computing resource, the task quality indicator including any one of a response time, a task completion time and reliability;

[0037] A decision parameter of a server is determined based on the task quality indicator, the decision parameter including a computing resource variable parameter, a target function and a constraint variable;

[0038] A preset decision model is constructed based on the decision parameter;

[0039] The preset decision model is solved by using a preset solver to obtain a second resource allocation strategy;

[0040] The first resource allocation strategy and the second resource allocation strategy are combined to obtain a new resource allocation strategy.

[0041] Optionally, the preset solver is pre-provided with a solving algorithm, and the solving algorithm comprises at least one of a linear programming algorithm, an integer programming algorithm, a dynamic programming algorithm, a genetic algorithm and a simulated annealing algorithm.

[0042] In another aspect, an embodiment of the present application provides a resource allocation apparatus, the apparatus comprising:

[0043] An acquisition module is configured to acquire a plurality of historical time-sensitive task information in a preset historical time period, wherein the historical time-sensitive task information comprises historical time-sensitive task attributes and historical time-sensitive task processing time;

[0044] A determination module is configured to determine a preset probability model based on the plurality of historical time-sensitive task information;

[0045] A first calculation module is configured to calculate, by using the preset probability model, a prediction parameter corresponding to a future time-sensitive task matching the historical time-sensitive task attributes, wherein the prediction parameter comprises an arrival probability of the future time-sensitive task in a future preset time period and an estimated processing time of the future time-sensitive task;

[0046] A second calculation module is configured to calculate reserved computing resources of the future time-sensitive task in the future preset time period according to the arrival probability and the estimated processing time.

[0047] In another aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor and a memory storing computer program instructions;

[0048] The processor executes the computer program instructions to implement the resource allocation method of the first aspect.

[0049] In another aspect, an embodiment of the present application provides a computer storage medium, the computer readable storage medium storing computer program instructions, and the computer program instructions are executed by a processor to implement the resource allocation method of the first aspect.

[0050] In another aspect, an embodiment of the present application provides a computer program product, and instructions in the computer program product are executed by a processor of an electronic device to enable the electronic device to perform the resource allocation method of the first aspect.

[0051] The resource allocation method, device, equipment, storage medium and program product provided by the embodiments of the present application can, when the computing resources of the electronic device need to be allocated, calculate the arrival probability of the historical time-sensitive task information of the historical time-sensitive task by counting the historical time-sensitive task information of the historical time-sensitive task, determine the preset probability model through the arrival probability, and make the electronic device calculate the arrival probability of the time-sensitive task corresponding to each task attribute in the future time period through the preset probability model, so that the electronic device reserves the computing resources when the future time-sensitive task arrives, that is, reserves the computing resources, and then formulates the resource allocation strategy of the electronic device when the future time-sensitive task arrives according to the preset quality index, resource utilization efficiency and reserved computing resources, makes good preparations for the future time-sensitive task in advance, ensures that the future time-sensitive task can be executed immediately when the future time-sensitive task arrives, reduces the waiting time of the future time-sensitive task, and meets the real-time requirement of the time-sensitive task. BRIEF DESCRIPTION OF DRAWINGS

[0052] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings used in the embodiments of the present application will be briefly introduced. Those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0053] Figure 1 is a flowchart of a resource allocation method provided by an embodiment of the present application;

[0054] Figure 2 is a flowchart of a preset probability model determination method provided by an embodiment of the present application;

[0055] Figure 3 is a flowchart of a resource allocation strategy formulation method provided by an embodiment of the present application;

[0056] Figure 4 is a flowchart of a resource allocation strategy formulation method provided by another embodiment of the present application;

[0057] Figure 5 is a structural diagram of a resource allocation device provided by another embodiment of the present application;

[0058] Figure 6 is a structural diagram of an electronic device provided by another embodiment of the present application. DETAILED DESCRIPTION

[0059] The features and exemplary embodiments of the various aspects of the present application will be described in detail below with reference to the drawings. For the purpose of clarity, the description is divided into the following sections: technical field, brief description of the drawings, detailed description of the embodiments, and conclusion. It should be noted that the specific embodiments described herein are intended to be illustrative only and are not to be limiting of the present application. The present application can be implemented in ways other than those specifically described herein without departing from the spirit of the present application. The following description is presented to enable any person skilled in the art to make and use the present application.

[0060] It should be noted that the relational terms herein, such as first and second, and the like, are used solely to distinguish one from another entity or action without necessarily requiring or implying any actual relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0061] To solve the problems in the prior art, the embodiments of the present application provide a resource allocation method, device, equipment, storage medium and program product.

[0062] In the embodiments of the present application, when it is necessary to allocate the computing resources of the electronic device, the historical time-sensitive task information of the historical time-sensitive task is counted to calculate the arrival probability of the historical time-sensitive task information, and a preset probability model is determined according to the arrival probability. The electronic device calculates the arrival probability of the time-sensitive task corresponding to each task attribute in a future time period through the preset probability model, so as to reserve the computing resources of the electronic device when the future time-sensitive task arrives, that is, to reserve the computing resources. Then, a resource allocation strategy of the electronic device when the future time-sensitive task arrives is formulated according to the preset quality index, resource utilization efficiency and reserved computing resources, the future time-sensitive task is planned in advance, it is ensured that the future time-sensitive task can be executed immediately when it arrives, the waiting time of the future time-sensitive task is reduced, and the real-time requirement of the time-sensitive task is met.

[0063] Firstly, the resource allocation method provided by the embodiments of the present application is introduced below.

[0064] Figure 1 A flowchart of the resource allocation method provided by an embodiment of the present application is shown. As shown in FIG. 1, the resource allocation method provided by the embodiment of the present application includes the following steps. Figure 1As shown, the resource allocation method includes the following steps S101-S105:

[0065] S101, obtain a plurality of historical time-sensitive task information in a preset historical time period.

[0066] In one embodiment, when the electronic device allocates computing resources to the received tasks, the electronic device divides the tasks into time-sensitive tasks and non-time-sensitive tasks, and for time-sensitive tasks, the response time and the computing time need to be paid attention to, so when allocating computing resources, the time-sensitive tasks are given priority.

[0067] As a specific example, taking an industrial Internet of Things system as an example, the time-sensitive task can be a control signal, and the non-time-sensitive task can be data analysis and data statistics. For time-sensitive tasks, very short computing time and response time are required to respond to control signals to ensure the normal operation of the industrial Internet of Things system, but some time-sensitive tasks exhibit randomness within a certain period, so historical time-sensitive task information received by the electronic device in a preset historical time period can be used for prediction, so that there are enough computing resources to execute time-sensitive tasks when the time-sensitive tasks arrive, thereby reducing the waiting time of the time-sensitive tasks and meeting the real-time requirements of the time-sensitive tasks.

[0068] In this embodiment, the historical time-sensitive task information can include historical time-sensitive task attributes and historical time-sensitive task processing time.

[0069] It is worth noting that the historical time-sensitive task information can also include system load.

[0070] The following is a specific example:

[0071] Taking an industrial Internet of Things system as an example, in S101, the timestamp data of each task can be obtained, i.e., the creation time of the task arriving at the system is recorded; the task type of the task can also be obtained; the task attribute can include the priority, i.e., the priority of the time-sensitive task, the historical time-sensitive task processing time can be the time for the electronic device to process the time-sensitive task; the system load can record the CPU utilization and memory usage when the electronic device processes the historical time-sensitive task, and can also be the running state of the electronic device and the length of the waiting queue.

[0072] In one specific embodiment, the preset historical time period can be one day or one month.

[0073] S102, determine a preset probability model based on the plurality of historical time-sensitive task information.

[0074] In one embodiment, the preset probability model can calculate the arrival probability of the time-sensitive task information corresponding to each task attribute based on historical time-sensitive task information.

[0075] That is, the arrival probability of the historical time-sensitive task is calculated through the historical time-sensitive task information, and the arrival probability of the time-sensitive task corresponding to the task attribute in the future time period is predicted through the arrival probability, so that the electronic device reserves the computing resources and ensures the real-time processing of the time-sensitive task.

[0076] Referring to Figure 2 Specifically, S102 can include:

[0077] S1021, data statistics is performed on the historical time-sensitive task information to obtain the total number of arrived tasks of the historical time-sensitive task information in a preset historical time period and the task type corresponding to each historical time-sensitive task information;

[0078] S1022, determining a basic probability model based on the task type;

[0079] S1023, determining a probability parameter type according to the basic probability model;

[0080] S1024, calculating a probability parameter corresponding to the basic probability model based on the total number of arrived tasks and the probability parameter type;

[0081] S1025, constructing a preset probability model based on the probability parameter.

[0082] In one embodiment, a plurality of historical time-sensitive tasks can be generated in a preset historical time period. In order to calculate the arrival probability of the historical time-sensitive task corresponding to each task attribute, data statistics is performed on the historical time-sensitive task to obtain the total number of arrived tasks of the historical time-sensitive task information in the preset historical time period and the task type corresponding to each historical time-sensitive task information, wherein the total number of arrived tasks can be all historical time-sensitive tasks received by the electronic device in the preset historical time period; the task type can be a continuous time-sensitive task, an independent time-sensitive task, or a continuous independent time-sensitive task.

[0083] It is worth noting that the task type can be determined according to a comparison table stored in the electronic device, for example, in the data storage library of the electronic device, the user can specify in the electronic device which time-sensitive tasks are continuous independent time-sensitive tasks, which time-sensitive tasks are continuous time-sensitive tasks, and which time-sensitive tasks are independent time-sensitive tasks, and then the electronic device generates and stores the comparison table according to the task type specified by the user, or manually inputs the electronic table into the data storage library of the electronic device, which is not limited herein.

[0084] As an example, in a temperature control system, the temperature data collection task is a time-sensitive task, the humidity data collection task is also a time-sensitive task, and the environment data collection task is a time-sensitive task, wherein the environment data includes temperature data and humidity data, the temperature collection and the humidity collection are continuous independent time-sensitive tasks, and the heating or cooling task is an independent time-sensitive task.

[0085] This requires different probability models to predict the probability of collecting environment data tasks at a future time; so that the electronic device has sufficient computing resources to ensure the real-time performance of collecting environment data tasks.

[0086] In addition, after determining the task type corresponding to each historical time-sensitive task, a basic probability model suitable for the task type is determined according to the task type, so as to determine the probability parameter type according to the basic probability model, determine the probability parameter corresponding to each task attribute according to the probability parameter type and the total number of arrivals, build a preset probability model according to the probability parameter, and use the preset probability model to predict the arrival probability of the time-sensitive task corresponding to each task attribute in a future time period.

[0087] In some embodiments, S1022 can specifically include:

[0088] In the case of a continuous time-sensitive task, the basic probability model is determined as an exponential distribution probability model;

[0089] In the case of an independent time-sensitive task, the basic probability model is determined as a Poisson distribution probability model;

[0090] In the case of a continuous time-sensitive task, the basic probability model is determined as a combination model of the exponential distribution probability model and the Poisson distribution probability model.

[0091] Specifically, the exponential distribution probability model can be used to describe the time interval of independent time-sensitive tasks, which occur continuously and independently at a constant average rate. In the exponential distribution probability model, the probability parameter type is the task arrival frequency.

[0092] The Poisson distribution probability model can be used to describe the number of occurrences of independent time-sensitive tasks in a period of time, that is, in the Poisson distribution probability model, the probability parameter type is the number of task arrivals per unit time.

[0093] The combination model can be a combination of the Poisson distribution probability model and the exponential distribution probability model, that is, for continuous independent time-sensitive tasks, both the task arrival frequency and the number of task arrivals per unit time are calculated.

[0094] In one specific embodiment, the probability parameter comprises a first probability, the first probability being used to represent a probability of arriving at at least one time-sensitive task within a first preset time period, and S1024 can specifically comprise:

[0095] In a case where the basic probability model is determined as an exponential distribution probability model, a task arrival frequency per unit time is calculated according to the total number of arrived tasks;

[0096] The first probability is calculated based on the task arrival frequency.

[0097] In this embodiment, in a case where the basic probability model is determined as an exponential distribution probability model, the probability parameter type is a task arrival frequency, and therefore when the first probability is calculated, the number of arrived time-sensitive tasks within the first preset time period needs to be calculated, that is, the number of historical time-sensitive tasks per unit time is counted to obtain the task arrival frequency, and then the mean value of the task arrival frequency is calculated to obtain the average task arrival frequency, which is taken as the task arrival frequency of the time-sensitive task.

[0098] In this embodiment, after the task arrival frequency is obtained, the first probability is calculated by using formula (1), which is as follows:

[0099] P(t) = 1 - e^(-μ*t) (1)

[0100] wherein P(t) represents the first probability of arriving at at least one time-sensitive task within time t, and μ represents the task arrival frequency.

[0101] By using the exponential distribution probability model, the arrival probability of continuous time-sensitive tasks can be determined, so as to predict the arrival probability of time-sensitive tasks of the same task type as the historical time-sensitive tasks to arrive at the electronic device within a future time period, and facilitate the electronic device to reserve computing resources to process time-sensitive tasks of the task type.

[0102] In another optional embodiment, the probability parameter comprises a second probability, the second probability being used to represent the average number of arrived time-sensitive tasks within a second preset time interval, and S1024 can further comprise:

[0103] In a case where the basic probability model is determined as a second basic probability model, the total number of tasks is classified according to the second preset time interval to obtain the average number of arrived historical time-sensitive tasks within each second preset time interval;

[0104] The second probability is calculated based on the average number of arrived tasks.

[0105] In the embodiment, when the base probability model is determined as the second base probability model, the preset historical time period is divided according to the second preset time interval, and the average number of historical sensitive tasks in each second preset time interval is counted, that is, the average arrival rate of each second preset time interval is calculated as an example, when the preset historical time period is one day, the second preset time interval can be one hour, when the preset historical time period is one month, the second preset time interval can be one day, which is not limited here.

[0106] After obtaining the average arrival rate, the second probability is calculated according to the following formula (2):

[0107] P(k)=(e^(-λ)*λ^k) / k! (2)

[0108] Wherein, P(k) is the second probability of k time sensitive tasks in each second preset time interval, and λ is the average arrival rate.

[0109] The Poisson distribution probability model can be used to calculate the arrival probability of the task type of independent time sensitive tasks, and the second probability is obtained by the number of task arrivals of independent historical time sensitive tasks, which can predict the arrival probability of time sensitive tasks of the same task type in the future time period, so as to facilitate the reservation of computing resources to process time sensitive tasks.

[0110] In one specific embodiment, for the task type of continuous independent time sensitive tasks, the mean value is calculated according to the first probability and the second probability to obtain the accurate arrival probability when the combination model is used to calculate the arrival probability of time sensitive tasks. The calculation method of the first probability and the second probability is consistent with the above, which will not be described here.

[0111] S103, using the preset probability model to calculate the prediction parameter corresponding to the future time sensitive task matched with the historical time sensitive task attribute.

[0112] In the embodiment, after the preset probability model is determined by the historical time sensitive task information, the prediction parameter corresponding to the future sensitive task matched with the historical time sensitive task attribute can be calculated by the preset probability model, which facilitates the electronic device to reserve sufficient computing resources to process time sensitive tasks in the future time period.

[0113] As an example, the prediction parameter can include the arrival probability of the future time sensitive task in the future preset time period and the predicted processing time of the future time sensitive task.

[0114] For example, the historical time-sensitive task is to control heating, the arrival probability of 1:00 to 4:00 in a day is 0.8, and the historical time-sensitive task processing time is 3 ms. Therefore, the arrival probability of 1:00 to 4:00 in a future day can be calculated as 0.8 by the preset probability model, and the expected processing time is 3 ms.

[0115] In S104, the reserved computing resources of the future time-sensitive task in the future preset time period are calculated according to the arrival probability and the expected processing time.

[0116] In the embodiment, the arrival probability and the expected processing time of the future time-sensitive task can be used to calculate the computing resources of the electronic device that need to be occupied by the future time-sensitive task when it arrives in the future time period. At this time, the historical computing resources can be calculated by means of the historical system load and the historical time-sensitive task processing time, and the historical computing resources are used as the reserved computing resources, so that the electronic device can reserve the computing resources capable of executing the future time-sensitive task when allocating the computing resources.

[0117] At this time, the electronic device needs to reserve the computing resources for the time-sensitive task of controlling heating from 1:00 to 4:00, so as to ensure the normal execution of the time-sensitive task of controlling heating from 1:00 to 4:00.

[0118] It should be noted that the computing resources can be servers, virtual machines or containers in the electronic device, which are not limited herein.

[0119] In one embodiment, in order to reasonably arrange the total computing resources of the server or the electronic device, after S104, the method further includes:

[0120] In S105, a resource allocation strategy is formulated according to the preset quality index, the resource utilization efficiency and the reserved computing resources.

[0121] In a specific embodiment, the preset quality index can include response time, task completion time and reliability, and the resource utilization efficiency can be the efficiency and utilization rate of the electronic device when using the computing resources.

[0122] For the preset quality index, a specific example is used for explanation. For example, in an online transaction system, the preset quality index includes fast response and processing of transaction requests. Therefore, the response time in the preset quality index has certain requirements, and therefore more computing resources need to be allocated to the time-sensitive task of transaction request in the online transaction system to ensure that the transaction can be completed in time.

[0123] For the resource utilization efficiency, for example, in a cloud computing environment, the resource utilization efficiency can be monitored to evaluate and calculate the load and resource utilization rate of the cloud computing server.

[0124] When the computing resources of the electronic device need to be allocated, the arrival probability of the historical time-sensitive task information of the historical time-sensitive task is calculated by counting the historical time-sensitive task information, the preset probability model is determined by the arrival probability, the electronic device calculates the arrival probability of the time-sensitive task corresponding to each task attribute in the future time period through the preset probability model, so that the electronic device reserves the computing resources when the future time-sensitive task arrives, that is, the computing resources are reserved, and then the resource allocation strategy of the electronic device when the future time-sensitive task arrives is formulated according to the preset quality index, the resource utilization efficiency and the reserved computing resources, the future time-sensitive task is planned in advance, the future time-sensitive task can be executed immediately when the future time-sensitive task arrives, the waiting time of the future time-sensitive task is reduced, and the real-time performance of the time-sensitive task is met.

[0125] In one specific embodiment, referring to Figure 3 , the resource allocation strategy can include a first resource allocation strategy, and S105 can include the following steps:

[0126] S1051, respectively, a first weight is allocated to the preset quality index, a second weight is allocated to the resource utilization efficiency, and a third weight is allocated to the reserved computing resources.

[0127] S1052, according to the first weight, the second weight and the third weight, the priority of the plurality of future time-sensitive tasks in the future preset time period is sorted, and the execution order of the future time-sensitive tasks is obtained.

[0128] S1053, the total computing resources of the electronic device in the future time period are obtained.

[0129] S1054, in the case that the total computing resources are not less than the reserved computing resources, the total computing resources are allocated according to the execution order and the reserved computing resources, and the first resource allocation strategy is obtained.

[0130] In this embodiment, after obtaining the arrival probability of the future time-sensitive task in the future time period, the electronic device needs to formulate a resource allocation strategy for the computing resources of the electronic device according to the reserved computing resources, the preset quality index and the resource utilization efficiency in the future time period, so as to ensure that the time-sensitive task has enough computing resources for processing in the future time period.

[0131] When formulating the resource allocation strategy, the priority of the plurality of future time-sensitive tasks in the future time period needs to be sorted according to the first weight, the second weight and the third weight, so as to determine which future time-sensitive task to execute first and ensure the normal operation of each future time-sensitive task.

[0132] For example, on a certain day in the future, there are three future time-sensitive tasks to be executed from 7:00 to 9:00 on the day, which are a first future time-sensitive task, a second time-sensitive task and a third time-sensitive task, wherein the comprehensive weight of the first future time-sensitive task is 0.8, the comprehensive weight of the second future time-sensitive task is 0.6, and the comprehensive weight of the third future time-sensitive task is 0.9. At this time, the execution order is the third time-sensitive task, the first time-sensitive task and the second time-sensitive task, wherein the comprehensive weight is the sum of the first weight, the second weight and the third weight.

[0133] In addition, after obtaining the execution order, it is also necessary to determine whether the total computing resource of the electronic device meets the demand of the reserved computing resource in the future time period. In the case that the total computing resource is not less than the reserved computing resource, the resource allocation can be performed according to the execution order and the reserved computing resource to obtain a first resource allocation strategy.

[0134] Referring to Figure 4 In another optional embodiment, in the case that the total computing resource is less than the reserved computing resource, S105 can further include the following steps:

[0135] S401, calculating a difference computing resource based on the total computing resource and the reserved computing resource.

[0136] S402, determining a task quality index of the future time-sensitive task according to the difference computing resource.

[0137] S403, determining a decision parameter of the server based on the task quality index, wherein the decision parameter includes a computing resource variable parameter, a target function and a constraint variable.

[0138] S404, constructing a preset decision model based on the decision parameter.

[0139] S405, solving the preset decision model by using a preset solver to obtain a second resource allocation strategy.

[0140] S406, combining the first resource allocation strategy and the second resource allocation strategy to obtain a new resource allocation strategy.

[0141] In this embodiment, in the case that the total computing resource is less than the reserved computing resource, other computing resources need to be called to ensure the implementation of the future time-sensitive task. At this time, the difference computing resource that needs to be called is calculated according to the total computing resource and the reserved computing resource, and the decision parameter of the electronic device that needs to call other computing resources is defined through the difference computing resource to determine whether the called other computing resources meet the execution requirements of the future time-sensitive task.

[0142] In a specific embodiment, the task quality indicator includes any one of a response time, a task completion time and a reliability, the decision parameter includes a resource variable parameter, a target function and a constraint variable, wherein the resource variable parameter is used to represent a usage state of the allocated device, the constraint variable is used to represent at least one constraint condition of an allocation limit condition, a task arrival rate, a task processing time and a task priority of the future time-sensitive task, and the target function can be a final optimization target determined according to the constraint variable. For example, when the constraint condition is a resource utilization rate, the target function can be defined as maximizing the resource utilization rate, and when the constraint variable is a task response time, the target function can be defined as a minimum task response time. The above are only illustrative examples, and the constraint variable is not limited herein, and other computing resource requirements that can be met by the electronic device can be used.

[0143] After obtaining the decision parameter, a preset decision model is constructed according to the decision parameter, and the preset decision model is solved by a preset solver. The other computing resources called are determined by the preset decision model, and a corresponding second resource allocation strategy is obtained. Then, a new resource allocation strategy is formulated by combining the first resource allocation strategy and the second resource allocation strategy, thereby ensuring real-time processing of the time-sensitive task.

[0144] In a specific embodiment, a solving algorithm is pre-set in the preset solver, and the solving algorithm can include at least one of a linear programming algorithm, an integer programming algorithm, a dynamic programming algorithm, a genetic algorithm and a simulated annealing algorithm.

[0145] The preset solver can calculate the variable value that makes the target function reach a maximum value or a minimum value by using a calculation and search algorithm, thereby obtaining an optimal decision scheme. Therefore, the other computing resources that meet the reserved computing resource requirements can be obtained by using the above solving algorithm, and a second resource allocation strategy can be formulated according to the other computing resources, thereby ensuring timely implementation of the time-sensitive task.

[0146] Referring to Figure 5 The embodiments of the present application also provide a resource allocation device 500, which can include:

[0147] The acquisition module 501 is configured to acquire a plurality of historical time-sensitive task information in a preset historical time period, and the historical time-sensitive task information includes historical time-sensitive task attributes and historical time-sensitive task processing time.

[0148] The determination module 502 is configured to determine a preset probability model based on the plurality of historical time-sensitive task information.

[0149] The first calculation module 503 is configured to calculate, by using a preset probability model, a prediction parameter corresponding to a future time-sensitive task matching a historical time-sensitive task attribute, the prediction parameter including an arrival probability of the future time-sensitive task in a future preset time period and an estimated processing time of the future time-sensitive task.

[0150] The second calculation module 504 is configured to calculate reserved computing resources of the future time-sensitive task in the future preset time period according to the arrival probability and the estimated processing time.

[0151] As an optional implementation, the determination module 502 can further include:

[0152] The statistical unit is configured to statistically process the historical time-sensitive task information to obtain a total number of arrived tasks of the historical time-sensitive task information in a preset historical time period and a task type corresponding to each historical time-sensitive task information.

[0153] The first determination unit is configured to determine a basic probability model based on the task type.

[0154] The second determination unit is configured to determine a probability parameter type according to the basic probability model.

[0155] The calculation unit is configured to calculate a probability parameter corresponding to the basic probability model based on the total number of arrived tasks and the probability parameter type.

[0156] The construction unit is configured to construct the preset probability model based on the probability parameter.

[0157] As an optional implementation, the first determination unit can be further configured to:

[0158] In a case where the task type is a continuous time-sensitive task, the basic probability model is determined as an exponential distribution probability model.

[0159] In a case where the task type is an independent time-sensitive task, the basic probability model is determined as a Poisson distribution probability model.

[0160] In a case where the task type is a continuous independent time-sensitive task, the basic probability model is determined as a combination model of the exponential distribution probability model and the Poisson distribution probability model.

[0161] As an optional implementation, the probability parameter includes a first probability, the first probability being used to represent a probability of arriving at at least one time-sensitive task in a first preset time period, and the calculation unit can be further configured to:

[0162] The calculation of the probability parameter corresponding to the basic probability model based on the number of arrivals and the probability parameter type includes:

[0163] In a case where the basic probability model is determined as an exponential distribution probability model, a task arrival frequency per unit time is calculated according to a total number of arrived tasks;

[0164] The first probability is calculated based on the task arrival frequency.

[0165] As an optional implementation, the probability parameter includes a second probability, the second probability being used to represent a number of tasks of the time-sensitive task that are arrived averagely within a second preset time interval; the calculation unit can be further used for:

[0166] The probability parameter corresponding to the basic probability model is calculated based on the number of arrivals and the type of probability parameter, including:

[0167] In a case where the basic probability model is determined as a second basic probability model, the total number of tasks is classified according to the second preset time interval, to obtain an average number of arrived historical time-sensitive tasks within each second preset time interval;

[0168] The second probability is calculated based on the average number of arrivals.

[0169] As an optional implementation, the method further includes a formulating module, the formulating module being specifically used for:

[0170] The resource allocation strategy includes a first resource allocation strategy, the resource allocation strategy being formulated according to the preset quality indicator, the resource utilization efficiency and the reserved computing resource, including:

[0171] The first weight is respectively allocated to the preset quality indicator, the second weight is allocated to the resource utilization efficiency, and the third weight is allocated to the reserved computing resource;

[0172] According to the first weight, the second weight and the third weight, a priority of a plurality of future time-sensitive tasks within a future preset time period is sorted, to obtain an execution order of the future time-sensitive tasks;

[0173] A total computing resource of the electronic device within the future time period is obtained;

[0174] In a case where the total computing resource is not less than the reserved computing resource, the total computing resource is allocated according to the execution order and the reserved computing resource, to obtain the first resource allocation strategy.

[0175] As an optional implementation, the formulating module is further specifically used for:

[0176] In a case where the total computing resource is less than the reserved computing resource, the resource allocation strategy is formulated according to the preset quality indicator, the resource utilization efficiency and the reserved computing resource, further including:

[0177] A difference computing resource is calculated based on the total computing resource and the reserved computing resource;

[0178] The task quality index of the future time-sensitive task is determined according to the difference calculation resource, and the task quality index includes any one of a response time, a task completion time and reliability;

[0179] The decision parameter of the server is determined based on the task quality index, and the decision parameter includes a calculation resource variable parameter, a target function and a constraint variable;

[0180] The preset decision model is constructed based on the decision parameter;

[0181] The preset decision model is solved by using a preset solver to obtain a second resource allocation strategy;

[0182] The first resource allocation strategy and the second resource allocation strategy are combined to obtain a new resource allocation strategy.

[0183] As an optional implementation manner, the formulating module is further configured to:

[0184] The solving algorithm includes at least one of a linear programming algorithm, an integer programming algorithm, a dynamic programming algorithm, a genetic algorithm and a simulated annealing algorithm.

[0185] Figure 6 A hardware structure schematic diagram of an electronic device provided by an embodiment of the present application is shown.

[0186] The electronic device can include a processor 601 and a memory 502 having computer program instructions stored therein.

[0187] Specifically, the processor 601 can include a central processing unit (CPU), or a specific integrated circuit (ASIC), or can be configured as one or more integrated circuits that implement one or more embodiments of the present application.

[0188] The memory 602 can include a mass storage for data or instructions. By way of example and not limitation, the memory 602 can include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In one example, the memory 602 can include a removable or non-removable (or fixed) medium, or the memory 602 is a non-volatile solid-state memory. The memory 602 can be internal or external to the integrated gateway disaster recovery device.

[0189] In one example, the memory 602 can be a Read Only Memory (ROM). In one example, the ROM can be a mask programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or a flash memory, or a combination of two or more of these.

[0190] The memory 602 can include a read only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions that, when executed (e.g., by one or more processors), are operable to perform the operations described with reference to the resource allocation method according to the first aspect of the present disclosure.

[0191] The processor 601 implements the resource allocation method in the illustrated embodiments by reading and executing computer program instructions stored in the memory 602. Figure 1

[0192] In one example, the electronic device can further include a communication interface 603 and a bus 604. Wherein, as shown, the processor 601, the memory 602, the communication interface 603 are connected through the bus 604 and complete the communication between each other. Figure 6

[0193] The communication interface 603 is mainly used to realize the communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0194] ​​Bus 604 includes a hardware, software, or both that couples components of electronic device to each other. As an example and not by way of limitation, bus can include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand™ interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association local (VLB) bus, or another suitable bus or a combination of two or more of these. Where appropriate, bus 604 can include one or more buses. Although this application describes and shows a particular bus, this application contemplates any suitable bus or interconnect.

[0195] The electronic device can perform the resource allocation method in the embodiments of the present application, thereby achieving the combination Figures 1-4 The described resource allocation method and apparatus.

[0196] In addition, in combination with the resource allocation method in the above embodiments, the embodiments of the present application can provide a computer storage medium to implement. The computer storage medium has computer program instructions stored thereon; the computer program instructions are executed by a processor to implement any one of the resource allocation methods in the above embodiments.

[0197] In an optional embodiment, in combination with the resource allocation method in the above embodiments, the embodiments of the present application can provide a computer program product to implement, the instructions in the computer program product are executed by the processor of the electronic device, so that the electronic device can implement any one of the resource allocation methods in the above embodiments.

[0198] It needs to be clear that the present application is not limited to the specific configurations and processes described above and shown in the drawings. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after understanding the spirit of the present application.

[0199] The functional blocks shown in the structural block diagrams above can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, functional cards, and the like. When implemented in software, the elements of the present application are program or code segments that are used to perform the required tasks. The program or code segments can be stored in a machine-readable medium, or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. A "machine-readable medium" includes any medium that can store or transport information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memory, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, and the like. The code segments can be downloaded via computer networks such as the Internet, intranets, and the like.

[0200] It is also necessary to note that the exemplary embodiments mentioned in the present application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in an order different from the embodiments, or several steps can be performed simultaneously.

[0201] The above describes the aspects of the present application with reference to flowcharts and / or block diagrams of methods, apparatuses (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each block in the flowcharts and / or block diagrams and the combination of blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus enable the implementation of the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each block in the block diagrams and / or flowcharts and the combination of blocks in the block diagrams and / or flowcharts can also be implemented by special hardware that performs specified functions or acts, or can be implemented by a combination of special hardware and computer instructions.

[0202] The above is only a specific embodiment of the present application, and those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, modules and units can refer to the corresponding processes in the foregoing method embodiments, which will not be described here. It should be understood that the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be covered within the protection scope of the present application.

Claims

1. A resource allocation method characterized by, The method comprises the following steps: obtaining a plurality of historical time-sensitive task information in a preset historical time period, wherein the historical time-sensitive task information comprises historical time-sensitive task attributes and historical time-sensitive task processing time; determining a preset probability model based on the plurality of historical time-sensitive task information; calculating a prediction parameter corresponding to a future time-sensitive task matching the historical time-sensitive task attributes by using the preset probability model, wherein the prediction parameter comprises an arrival probability of the future time-sensitive task in a future preset time period and an estimated processing time of the future time-sensitive task; calculating reserved computing resources of the future time-sensitive task in the future preset time period according to the arrival probability and the estimated processing time.

2. The method of claim 1, wherein, The method comprises the following steps: performing data statistics on the historical time-sensitive task information to obtain a total number of arrived tasks and a task type corresponding to each historical time-sensitive task information in a preset historical time period; determining a basic probability model based on the task type; determining a probability parameter type according to the basic probability model; calculating a probability parameter corresponding to the basic probability model based on the total number of arrived tasks and the probability parameter type; constructing a preset probability model based on the probability parameter.

3. The method of claim 2, wherein, The method comprises the following steps: in the case that the task type is a continuous time-sensitive task, the basic probability model is determined as an exponential distribution probability model; in the case that the task type is an independent time-sensitive task, the basic probability model is determined as a Poisson distribution probability model; in the case that the task type is a continuous independent time-sensitive task, the basic probability model is determined as a combination model of the exponential distribution probability model and the Poisson distribution probability model.

4. The method of claim 3, wherein, The probability parameter comprises a first probability, and the first probability is used to represent a probability of arrival of at least one time-sensitive task in a first preset time period; The method comprises the following steps: in the case that the basic probability model is determined as an exponential distribution probability model, calculating a task arrival frequency per unit time according to the total number of arrived tasks; calculating a first probability based on the task arrival frequency.

5. The method according to claim 3 or 4, characterized in that, The probability parameter comprises a second probability, and the second probability is used to represent a number of tasks of a time-sensitive task arrived on average in a second preset time interval; The method comprises the following steps: in the case that the basic probability model is determined as a second basic probability model, classifying the total number of tasks according to a second preset time interval to obtain an average number of arrived historical time-sensitive tasks in each second preset time interval; calculating a second probability based on the average number of arrived tasks.

6. The method of claim 1, wherein, After the step of calculating reserved computing resources of the future time-sensitive task in the future preset time period according to the arrival probability and the estimated processing time, the method further comprises the following steps: The first weight is respectively assigned to a preset quality index, the second weight is assigned to resource utilization efficiency, and the third weight is assigned to the reserved computing resource; The future time-sensitive tasks are prioritized according to the first weight, the second weight and the third weight, so as to obtain an execution order of the future time-sensitive tasks; Total computing resources in the future preset time period are obtained; In the case that the total computing resources are not less than the reserved computing resources, the total computing resources are allocated according to the execution order and the reserved computing resources, so as to obtain a first resource allocation strategy.

7. The method of claim 6, wherein, In the case that the total computing resources are less than the reserved computing resources, the method further comprises: The difference computing resource is calculated based on the total computing resources and the reserved computing resources; The task quality index of the future time-sensitive task is determined according to the difference computing resource, the task quality index comprising any one of response time, task completion time and reliability; The decision parameter of the server is determined based on the task quality index, the decision parameter comprising a computing resource variable parameter, a target function and a constraint variable; The preset decision model is constructed based on the decision parameter; The preset decision model is solved by using a preset solver, so as to obtain a second resource allocation strategy; The first resource allocation strategy and the second resource allocation strategy are combined, so as to obtain a new resource allocation strategy.

8. The method of claim 7, wherein, The preset solver is pre-provided with a solving algorithm, the solving algorithm comprising at least one of linear programming algorithm, integer programming algorithm, dynamic programming algorithm, genetic algorithm and simulated annealing algorithm.

9. A resource allocation apparatus characterized by comprising: The device comprises: An acquisition module is configured to acquire a plurality of historical time-sensitive task information in a preset historical time period, the historical time-sensitive task information comprising historical time-sensitive task attributes and historical time-sensitive task processing time; A determination module is configured to determine a preset probability model based on the plurality of historical time-sensitive task information; A first calculation module is configured to calculate a prediction parameter corresponding to a future time-sensitive task matching the historical time-sensitive task attributes by using the preset probability model, the prediction parameter comprising an arrival probability of the future time-sensitive task in a future preset time period and an estimated processing time of the future time-sensitive task; A second calculation module is configured to calculate a reserved computing resource of the future time-sensitive task in the future preset time period according to the arrival probability and the estimated processing time.

10. An electronic device, comprising: The device comprises a processor and a memory storing computer program instructions; The processor executes the computer program instructions to implement the resource allocation method according to any one of claims 1-8.

11. A computer readable storage medium, characterized in that, The computer program instructions are stored on the computer readable storage medium, and the computer program instructions are executed by the processor to implement the resource allocation method according to any one of claims 1-8.

12. A computer program product, characterised in that, The instructions in the computer program product are executed by the processor of the electronic device, so that the electronic device executes the resource allocation method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Resource prediction model training method and device, equipment and medium

    CN117251295A

  • Multivariate computing power comprehensive management scheduling method and system for intelligent computing center

    CN117950868A