Computing resource planning method, electronic equipment and storage device
1. A method of computing resource planning, comprising:
acquiring a first resource planning scheme and an actual resource consumption condition of an algorithm set in a first period; wherein the set of algorithms includes a plurality of algorithms, and the first resource planning scheme includes schemes that use computing resources in the first period, which are respectively planned for the plurality of algorithms;
obtaining a second resource planning scheme of the algorithm set based on the first resource planning scheme, the actual resource consumption condition and the attribute information of the plurality of algorithms; wherein the second resource planning scheme comprises a scheme for using computing resources in a second period, which is planned for the plurality of algorithms respectively, and the second period is after the first period.
2. The method according to claim 1, wherein the deriving a second resource planning scenario of the set of algorithms based on the first resource planning scenario, the actual resource consumption, and the attribute information of the plurality of algorithms comprises:
obtaining the planned resource consumption condition of the algorithm set in the first period based on the first resource planning scheme;
under the condition that the deviation condition between the actual resource consumption condition and the planned resource consumption condition meets a preset condition, predicting and obtaining a plurality of candidate resource planning schemes of the algorithm set in the second period based on the first resource planning scheme and the actual resource consumption condition;
and selecting the second resource planning scheme from the candidate resource planning schemes based on the attribute information of the algorithms.
3. The method according to claim 2, wherein the selecting the second resource planning scheme from the candidate resource planning schemes based on the attribute information of the plurality of algorithms comprises:
obtaining the utility condition of the candidate resource planning scheme based on the attribute information of the plurality of algorithms; wherein the utility conditions include: a total utility value of the plurality of algorithms in the case of executing the candidate resource planning solution;
and selecting one candidate resource planning scheme as the second resource planning scheme based on the utility conditions of the candidate resource planning schemes.
4. The method of claim 3, wherein the attribute information comprises: algorithm calling frequency and algorithm demand degree; the obtaining the utility condition of the candidate resource planning scheme based on the attribute information of the plurality of algorithms includes:
acquiring a first total utility value of the algorithm calling frequency for the plurality of algorithms to request the candidate resource planning scheme; and the number of the first and second groups,
acquiring a second total utility value of the algorithm demand degree to the plurality of algorithms requesting the candidate resource planning scheme;
and respectively carrying out weighting processing on the first total utility value and the second total utility value by utilizing a first weight value corresponding to the algorithm calling frequency and a second weight value corresponding to the algorithm demand degree to obtain the total utility values of the algorithms under the condition of executing the candidate resource planning scheme.
5. The method according to claim 4, wherein before the weighting processing is performed on the first total utility value and the second total utility value by using the first weight value corresponding to the algorithm calling frequency and the second weight value corresponding to the algorithm demand degree, respectively, to obtain the total utility value of the plurality of algorithms under the condition of executing the candidate resource planning scheme, the method further comprises:
obtaining a total cost value of the plurality of algorithms in the case of executing the candidate resource planning scheme;
the weighting processing is respectively performed on the first total utility value and the second total utility value by using the first weight value corresponding to the algorithm calling frequency and the second weight value corresponding to the algorithm demand degree, so as to obtain the total utility values of the algorithms under the condition of executing the candidate resource planning scheme, and the method comprises the following steps:
carrying out weighted summation on the first total utility value and the second total utility value by utilizing the first weight value and the second weight value to obtain a third total utility value of the plurality of algorithms under the condition of executing the candidate resource planning scheme;
and taking the difference value between the third total utility value and the total cost value as the total utility value.
6. The method of claim 4, wherein the first total utility value is a sum of normalized utility values of the algorithm invocation frequency respectively requesting the candidate resource planning solution for the plurality of algorithms;
and/or the second total utility value is the sum of normalized utility values of the algorithm demand degrees respectively requesting the candidate resource planning schemes for the plurality of algorithms;
and/or the sum of the first weight and the second weight is 1.
7. The method of claim 3, wherein selecting one of the candidate resource plans as the second resource plan based on the utility of the candidate resource plans comprises:
and selecting the candidate resource planning scheme with the maximum total utility value as the second resource planning scheme.
8. The method of claim 2, wherein predicting a number of candidate resource plans for the set of algorithms at the second period based on the first resource plan and the actual resource consumption comprises:
and inputting the first resource planning scheme and the actual resource consumption condition into a neural network for prediction to obtain a plurality of candidate resource planning schemes.
9. The method of claim 2, further comprising:
and taking the first resource planning scheme as a second resource planning scheme of the algorithm set in the second period under the condition that the deviation condition does not meet the preset condition.
10. The method of claim 2, wherein the actual resource consumption comprises: the plurality of algorithms actually consume a first total amount of computing resources per unit time of the first cycle, and the projected resource consumption comprises: the plurality of algorithms are expected to consume a second total amount of computing resources per unit time of the first cycle, and the bias condition includes: the proportion of the deviation value between the first total amount and the second total amount in the second total amount, wherein the preset conditions include: the ratio is greater than a preset threshold.
11. An electronic device comprising a memory and a processor coupled to each other, the memory storing program instructions, the processor being configured to execute the program instructions to implement the method of computing resource planning of any of claims 1 to 10.
12. A storage device storing program instructions executable by a processor to perform the method of computing resource planning of any of claims 1 to 10.
Background
With the development of electronic information technology, various algorithms are developed to meet different application scenarios and different application requirements. For example, in the field of video surveillance, different algorithms such as traffic recognition, face analysis, behavior analysis, etc. may make surveillance cameras suitable for use in different scenes. As is well known, algorithm execution depends on computing resources, however, at present, the computing resources are allocated to the algorithms either statically or randomly, and it is difficult to ensure the execution effect of the algorithms. Therefore, how to improve the algorithm execution effect becomes a topic with great research value.
Disclosure of Invention
The technical problem mainly solved by the application is to provide a computing resource planning method, an electronic device and a storage device, which can improve the algorithm execution effect.
In order to solve the above problem, a first aspect of the present application provides a method for computing resource planning, including: acquiring a first resource planning scheme and an actual resource consumption condition of an algorithm set in a first period; the algorithm set comprises a plurality of algorithms, and the first resource planning scheme comprises a scheme which is respectively planned for the plurality of algorithms and uses computing resources in a first period; obtaining a second resource planning scheme of the algorithm set based on the first resource planning scheme, the actual resource consumption condition and attribute information of a plurality of algorithms; the second resource planning scheme comprises a scheme which is respectively planned for a plurality of algorithms and uses computing resources in a second period, and the second period is after the first period.
In order to solve the above problem, a second aspect of the present application provides an electronic device, which includes a memory and a processor coupled to each other, the memory storing program instructions, and the processor being configured to execute the program instructions to implement the method for computing resource planning in the first aspect.
In order to solve the above problem, a third aspect of the present application provides a storage device storing program instructions executable by a processor, the program instructions being used for the method for computing resource planning in the first aspect.
According to the scheme, a first resource planning scheme and an actual resource consumption condition of the algorithm set in a first period are obtained, the algorithm set comprises a plurality of algorithms, the first resource planning scheme comprises a scheme which is planned for the plurality of algorithms respectively and uses computing resources in the first period, on the basis, a second resource planning scheme of the algorithm set is obtained based on the first resource planning scheme, the actual resource consumption condition and attribute information of the plurality of algorithms, the second resource planning scheme comprises a scheme which is planned for the plurality of algorithms respectively and uses the computing resources in a second period after the first period, and therefore the computing resources can be planned for the plurality of algorithms in the algorithm set dynamically in each period, the reasonability of the computing resources planned for the algorithms can be greatly improved, and the algorithm execution effect can be improved.
Drawings
FIG. 1 is a schematic flow chart diagram illustrating an embodiment of a computing resource planning method of the present application;
FIG. 2 is a state diagram of an embodiment of a computing resource planning method of the present application;
FIG. 3 is a flowchart illustrating an embodiment of step S12 in FIG. 1;
FIG. 4 is a state diagram of one embodiment of a candidate resource projection scheme;
FIG. 5 is a schematic flow chart diagram illustrating another embodiment of a computing resource planning method of the present application;
FIG. 6 is a block diagram of an embodiment of a computing resource planning apparatus of the present application;
FIG. 7 is a block diagram of an embodiment of an electronic device of the present application;
FIG. 8 is a block diagram of an embodiment of a memory device according to the present application.
Detailed Description
The following describes in detail the embodiments of the present application with reference to the drawings attached hereto.
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, interfaces, techniques, etc. in order to provide a thorough understanding of the present application.
The terms "system" and "network" are often used interchangeably herein. The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship. Further, the term "plurality" herein means two or more than two.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a computing resource planning method according to an embodiment of the present application. Specifically, the method may include the steps of:
step S11: and acquiring a first resource planning scheme and an actual resource consumption condition of the algorithm set in a first period.
In the disclosed embodiment, the set of algorithms includes a plurality of algorithms, and the first resource planning scheme includes schemes for using the computing resources in the first period, which are respectively planned for the plurality of algorithms.
In one implementation scenario, several algorithms in the algorithm set may be set according to the actual application scenario. For example, in a video surveillance scenario, several algorithms may include, but are not limited to: a people flow analysis algorithm, a traffic recognition algorithm, a face analysis algorithm, a behavior analysis algorithm, etc., which are not limited herein. Other cases may be analogized, and no one example is given here. It should be noted that different algorithms can meet different application requirements. Still taking the video monitoring scene as an example, the people flow analysis algorithm can meet the application requirements of places such as scenic spots, malls, stations and the like on people flow analysis; the behavior analysis algorithm can meet the application requirements of places such as parks and communities on abnormal behavior analysis such as climbing and high-altitude parabolic behavior; the traffic recognition algorithm can meet the application requirements of places such as a gate, a road and the like on behavior analysis of motor vehicles, such as passing vehicles, driving and the like, and so on, which are not illustrated one by one.
In one implementation scenario, the computing resources may include, but are not limited to: edge computing resources, cloud computing resources, local computing resources, and the like, without limitation. It should be noted that the cloud computing resources include resources such as servers configured specifically for supporting the algorithm set, the edge computing resources include resources remaining from servers not configured specifically for supporting the algorithm set, and the local computing resources include computing resources of the front-end device (e.g., a monitoring camera), such as a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a memory, and the like of the front-end device, which is not limited herein.
In one implementation scenario, the first period may be a period duration required for a plurality of algorithms included in the algorithm set to perform a plurality of times (e.g., 1 time, 2 times, 3 times, etc.); alternatively, the first period may be set to a fixed time period (e.g., 1 hour, 2 hours, 3 hours, etc.), which is not limited herein.
In one implementation scenario, as previously described, the first resource planning scheme includes schemes that use computing resources during a first period that are respectively planned for a number of algorithms. Specifically, the first resource planning scheme may include an execution order of the algorithms in the first cycle. Taking an algorithm set including a people flow analysis algorithm, a traffic recognition algorithm, a face analysis algorithm and a behavior analysis algorithm as an example, the first resource planning scheme may include: the pedestrian flow analysis algorithm and the traffic recognition algorithm are executed in parallel, and after the execution of the pedestrian flow analysis algorithm and the traffic recognition algorithm is finished, the face analysis algorithm and the behavior analysis algorithm are executed in parallel; alternatively, the first resource planning scheme may also include: sequentially and respectively executing a human flow analysis algorithm, a traffic recognition algorithm, a human face analysis algorithm and a behavior analysis algorithm; alternatively, the first resource planning scheme may further include: the method includes executing a human flow analysis algorithm, a traffic recognition algorithm, a human face analysis algorithm and a behavior analysis algorithm in parallel, which is not limited herein. Additionally, the first resource planning scheme may also include pre-allocating computing resources per unit time (e.g., seconds) for each algorithm in the set of algorithms. Still taking the example that the algorithm set includes a people flow analysis algorithm, a traffic recognition algorithm, a face analysis algorithm, and a behavior analysis algorithm, the first resource planning scheme may include: the method includes pre-allocating 10% of GPU computing resources, 10% of edge computing resources and 10% of cloud computing resources for a human traffic analysis algorithm per second, pre-allocating 15% of GPU computing resources, 20% of edge computing resources and 15% of cloud computing resources for a traffic identification algorithm per second, pre-allocating 5% of GPU computing resources, 15% of edge computing resources and 20% of cloud computing resources for a human face analysis algorithm per second, and pre-allocating 10% of GPU computing resources, 20% of edge computing resources and 5% of cloud computing resources for a behavior analysis algorithm per second, which is not limited herein. It should be noted that, the specific example of the first resource planning scheme is only one possible situation in the actual application process, and the first resource planning scheme that may occur in the actual application process is not limited thereby.
In one implementation scenario, as described above, the first resource planning scheme may further include computing resources pre-allocated to each algorithm in the algorithm set per unit time, during the first period of actual execution of the algorithm set, the computing resources actually consumed by the algorithm per unit time may deviate from the pre-allocated computing resources, for example, in the first resource planning scheme, 10% of GPU computing resources, 10% of edge computing resources, and 10% of cloud computing resources are pre-allocated to the human traffic analysis algorithm per second, and monitoring the computing resources that can be actually consumed by the human traffic analysis algorithm in the first period includes: the GPU computing resources are actually consumed 11%, the edge computing resources are actually consumed 9%, and the cloud computing resources are actually consumed 12% per second, and other algorithms can be analogized to the above, which is not exemplified here. Therefore, in order to improve the accuracy of the calculation resource planning, the calculation resources actually consumed by the algorithm set in the unit time of the first period can be obtained, and the actual resource consumption condition is obtained.
In a specific implementation scenario, as described above, the calculation resources actually consumed by the algorithm in unit time may deviate from the pre-allocated calculation resources, and the algorithms may be executed according to the execution sequence of the algorithms included in the first resource planning scheme in the first period in the actual process.
In another specific implementation scenario, please refer to fig. 2 in combination, and fig. 2 is a state diagram illustrating an embodiment of a computing resource planning method according to the present application. As shown in fig. 2, in order to improve the accuracy of the actual resource consumption condition, a computational power monitoring device may be provided, on one hand, the computational resources actually consumed in different algorithms in unit time may be monitored in real time by the computational power monitoring device to obtain the actual resource consumption condition in the first period, and on the other hand, the monitored actual resource consumption condition may be fed back to the electronic device for implementing the computational resource planning method of the present application, so that the electronic device may plan the computational resources in the next period based on the actual resource consumption condition. In addition, it should be noted that, as described above, the first resource planning scheme may include an execution order of several algorithms in the first period, so that an algorithm that is not executed temporarily may wait in the algorithm waiting sequence. For example, in a first resource planning scheme, comprising: the pedestrian flow analysis algorithm and the traffic recognition algorithm are executed in parallel, the pedestrian flow analysis algorithm and the traffic recognition algorithm can be executed in parallel firstly under the condition that the human face analysis algorithm and the behavior analysis algorithm are executed in parallel after the execution of the pedestrian flow analysis algorithm and the traffic recognition algorithm is finished, in the process, the human face analysis algorithm and the behavior analysis algorithm can wait in an algorithm waiting sequence, and the human face analysis algorithm and the behavior analysis algorithm can be taken out of the algorithm waiting sequence and executed in parallel after the execution of the pedestrian flow analysis algorithm and the traffic recognition algorithm is finished. Other cases may be analogized, and no one example is given here.
Step S12: and obtaining a second resource planning scheme of the algorithm set based on the first resource planning scheme, the actual resource consumption condition and the attribute information of the plurality of algorithms.
In an embodiment of the disclosure, the second resource planning scheme includes a scheme for using computing resources in a second period, which is planned for the plurality of algorithms respectively, and the second period is after the first period.
In one implementation scenario, similar to the first period, the second period may be a period duration required for the execution of a plurality of algorithms included in the algorithm set to be completed for a plurality of times (e.g., 1 time, 2 times, 3 times, etc.); alternatively, the second period may be set to a fixed time period (e.g., 1 hour, 2 hours, 3 hours, etc.), which is not limited herein. It should be noted that, in order to improve the consistency of the computing resource planning, the specific meanings of the first period and the second period may be kept consistent, for example, the first period and the second period may be both the period duration required by a plurality of algorithms included in the algorithm set to complete several times (e.g., 1 time, 2 times, 3 times, etc.), or the first period and the second period may both be a fixed duration (e.g., 1 hour, 2 hours, 3 hours, etc.), which is not limited herein.
In another implementation scenario, the second period may specifically be the last N periods of the first period, for example, the last one period of the first period may be used as the second period, or the second period after the first period may be used as the second period, or the third period after the first period may be used as the second period, which is not limited herein.
In one implementation scenario, similar to the first resource planning scheme, the second resource planning scheme may include: the execution sequence of the algorithms in the second period may specifically refer to the description related to the first resource planning scheme, and is not described herein again. In addition, the second resource planning scheme may further include: for the calculation resources pre-allocated to each algorithm unit time (e.g., second) in the algorithm set, reference may be specifically made to the related description of the first resource planning scheme, which is not described herein again.
In one implementation scenario, the attribute information may include, but is not limited to: algorithm invocation frequency and algorithm demand level. The algorithm calling frequency represents the number of times of calling the algorithm in unit time, and still takes a plurality of algorithms including a people flow analysis algorithm, a traffic recognition algorithm, a face analysis algorithm and a behavior analysis algorithm as examples, the algorithm calling frequency of the people flow analysis algorithm can be 30 times/second, the algorithm calling frequency of the traffic recognition algorithm can be 50 times/second, the algorithm calling frequency of the face analysis algorithm can be 10 times/second, and the algorithm calling frequency of the behavior analysis algorithm can be 35 times/second, which is not limited herein; the algorithm demand degree represents the demand degree of the user for different algorithms, and still taking several algorithms including a people flow analysis algorithm, a traffic recognition algorithm, a face analysis algorithm and a behavior analysis algorithm as examples, the algorithm demand degree of the people flow analysis algorithm may be "very needed" 30 times/second, the algorithm demand degree of the traffic recognition algorithm may be "very needed", the algorithm demand degree of the face analysis algorithm may be "needed", and the algorithm demand degree of the behavior analysis algorithm may be "slightly needed", which is not limited herein. In addition, in order to quantify the degree of algorithm requirement, "required" may be represented by 10, "required" may be represented by 7, "slightly required" may be represented by 4, and "not required" may be represented by 0, which is not limited herein.
In another implementation scenario, the attribute information of the algorithm may include other algorithm attributes in addition to algorithm invocation frequency and algorithm demand level, for example, an algorithm (e.g., a people flow analysis algorithm) is essentially in a low frequency invocation state during the full life cycle, but may exhibit high frequency invocation during some special time periods (e.g., spring festival). Other algorithm attributes may be specifically set according to actual application requirements, and are not limited herein.
In an implementation scenario, in order to reduce a load in a process of planning and calculating resources, a planned resource consumption situation of an algorithm set in a first period may be obtained based on a first resource planning scheme, and a plurality of candidate resource planning schemes of the algorithm set in a second period are predicted and obtained based on the first resource planning scheme and an actual resource consumption situation under the condition that a deviation situation between the actual resource consumption situation and the planned resource consumption situation satisfies a preset condition, and a second resource planning scheme is selected and obtained from the plurality of candidate resource planning schemes based on attribute information of the plurality of algorithms. The specific process may refer to the related description in the following disclosed embodiments, and is not repeated herein. Therefore, the method can avoid planning the computing resources under the condition that the deviation condition between the actual resource consumption condition and the planned resource consumption condition does not meet the preset condition, thereby being beneficial to reducing the load of the process of planning the computing resources and improving the reliability of the process of planning, computing and planning.
In another implementation scenario, in order to dynamically adjust the resource planning scheme in the full life cycle, the planned resource consumption situation of the algorithm set in the first cycle may be obtained based on the first resource planning scheme, the deviation between the actual resource consumption situation and the planned resource consumption situation is not compared, but a plurality of candidate resource planning schemes of the algorithm set in the second cycle are obtained by prediction based on the first resource planning scheme and the actual resource consumption situation, and the second resource planning scheme is selected from the plurality of candidate resource planning schemes based on the attribute information of the plurality of algorithms. The specific process may refer to the related description in the following disclosed embodiments, and is not repeated herein. Therefore, the resource planning scheme can be dynamically adjusted according to the actual situation in the whole life cycle, and the matching degree between the resource planning scheme and the actual situation is favorably and continuously improved, so that the algorithm execution effect can be improved in the whole life cycle.
In an implementation scenario, after obtaining the second resource planning scheme of the algorithm set, the actual resource consumption of the algorithm set in the second period may be monitored, and the second period is used as a new first period, and the second resource planning scheme of the second period is used as a new first resource planning scheme of the first period, so as to re-execute the above steps S11 and S12, so that the second resource planning scheme of the subsequent period may be obtained. For example, after the resource planning scheme and the actual resource consumption situation of the T1 cycle are obtained, the resource planning scheme of the T2 cycle can be obtained based on the resource planning scheme and the actual resource consumption situation of the T2 cycle, and then the resource planning scheme of the T3 cycle can be obtained based on the resource planning scheme and the actual resource consumption situation of the T2 cycle.
According to the scheme, a first resource planning scheme and an actual resource consumption condition of the algorithm set in a first period are obtained, the algorithm set comprises a plurality of algorithms, the first resource planning scheme comprises a scheme which is planned for the plurality of algorithms respectively and uses computing resources in the first period, on the basis, a second resource planning scheme of the algorithm set is obtained based on the first resource planning scheme, the actual resource consumption condition and attribute information of the plurality of algorithms, the second resource planning scheme comprises a scheme which is planned for the plurality of algorithms respectively and uses the computing resources in a second period after the first period, and therefore the computing resources can be planned for the plurality of algorithms in the algorithm set dynamically in each period, the reasonability of the computing resources planned for the algorithms can be greatly improved, and the algorithm execution effect can be improved.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating an embodiment of step S12 in fig. 1. The method specifically comprises the following steps:
step S31: and obtaining the planned resource consumption condition of the algorithm set in the first period based on the first resource planning scheme.
As described in the foregoing disclosure, the first resource planning scheme may further include pre-allocated computing resources for each algorithm in the algorithm set per unit time (e.g., second), so that the planned resource consumption of the algorithm set in the first period may be obtained based on the pre-allocated computing resources for each algorithm in the algorithm set per unit time (e.g., second).
In one implementation scenario, the actual resource consumption scenario includes a first total amount of computing resources actually consumed by the algorithms during the unit time of the first cycle, and the projected resource consumption scenario includes a second total amount of computing resources expected to be consumed by the algorithms during the unit time of the first cycle. For convenience of description, still taking the algorithm set including the people flow analysis algorithm, the traffic recognition algorithm, the face analysis algorithm, and the behavior analysis algorithm as an example, the first total amount of the computing resources actually consumed by the above algorithms in the unit time of the first period may be denoted as S1 through statistics, the second total amount of the computing resources expected to be consumed by the above algorithms in the unit time of the first period may be denoted as S2, and the other cases may be similar to the above, which is not illustrated here.
In one implementation scenario, the actual resource consumption scenario may include a first total amount of computing resources actually consumed respectively by the algorithms during the unit time of the first cycle, and the projected resource consumption scenario may include a second total amount of computing resources expected to be consumed respectively by the algorithms during the unit time of the first cycle. For convenience of description, the algorithm set including the people flow analysis algorithm, the traffic recognition algorithm, the face analysis algorithm and the behavior analysis algorithm is still taken as an example, and the people flow analysis algorithm is performed in the first periodMay be recorded as a first total amount of computing resources actually consumed per unit timeThe first total amount of computing resources actually consumed by the traffic identification algorithm in the unit time of the first period can be recorded asThe first total amount of computing resources actually consumed by the face analysis algorithm in the unit time of the first period can be recorded asThe first total amount of computing resources actually consumed by the behavior analysis algorithm in the unit time of the first period can be recorded asSimilarly, the first total amount of computing resources expected to be consumed by the people flow analysis algorithm in the unit time of the first period can be recorded asThe first total amount of computing resources expected to be consumed by the traffic identification algorithm in the unit time of the first period can be recorded asThe first total amount of computing resources expected to be consumed by the face analysis algorithm in the unit time of the first period can be recorded asThe first total amount of computing resources expected to be consumed by the behavior analysis algorithm in the unit time of the first cycle can be recorded asOther cases may be analogized, and no one example is given here.
Step S32: and judging whether the deviation condition between the actual resource consumption condition and the planned resource consumption condition meets the condition of a preset condition, if so, executing the step S33, otherwise, executing the step S35.
In one implementation scenario, in the case that the actual resource consumption situation includes a first total amount of computing resources actually consumed by several algorithms in the unit time of the first cycle, and the planned resource consumption situation includes a second total amount of computing resources expected to be consumed by several algorithms in the unit time of the first cycle, a ratio of a deviation value between the first total amount and the second total amount in the second total amount (i.e., | S1-S2|/S2) may be calculated, resulting in the deviation situation, and accordingly, the preset condition may be set as: the occupancy is greater than the preset threshold, and the preset threshold may be set according to actual situations, for example, may be set to 10% to 15%, such as may be specifically set to 10%, 11%, 12%, 13%, 14%, 15%, and the like, and is not limited herein.
In another implementation scenario, in the case that the actual resource consumption situation may include a first total amount of the computing resources actually and respectively consumed by the algorithms in the unit time of the first period, and the planned resource consumption situation may include a second total amount of the computing resources respectively consumed by the algorithms in the unit time of the first period, a proportion of a deviation value between the first total amount and the second total amount of each algorithm in the second total amount may be calculated respectively, so as to obtain a deviation situation of each algorithm, and accordingly, the preset condition may be set as: the occupation ratio corresponding to any algorithm is larger than a preset threshold value. The preset threshold setting method may specifically refer to the foregoing description, and is not described herein again.
Therefore, under the condition that the deviation condition meets the preset condition, the deviation between the actual resource consumption condition and the planned resource consumption condition is considered to be large, so that the resource planning scheme needs to be dynamically adjusted in the subsequent period, and on the contrary, under the condition that the deviation condition does not meet the preset condition, the deviation between the actual resource consumption condition and the planned resource consumption condition can be considered to be within an acceptable range, so that the resource planning scheme does not need to be dynamically adjusted in the subsequent period, and the current resource planning scheme can be used.
Step S33: and predicting a plurality of candidate resource planning schemes of the algorithm set in the second period based on the first resource planning scheme and the actual resource consumption condition.
Specifically, in order to improve the accuracy and efficiency of resource planning, the first resource planning scheme and the actual resource consumption condition may be input to the neural network for prediction, so as to obtain a plurality of candidate resource planning schemes. It should be noted that, similar to the first resource planning scheme and the second resource planning scheme, the candidate resource planning scheme may also include at least one of the following: the execution sequence of the plurality of algorithms in the second period is a computing resource pre-allocated to each algorithm in the algorithm set in unit time (e.g., second), which may specifically refer to the related description in the foregoing disclosed embodiments, and is not described herein again.
In one implementation scenario, the neural network may include, but is not limited to: LSTM (Long Short-Term Memory), CNN (Convolutional Neural Network), RNN (Recurrent Neural Network), and the like, which are not limited herein.
In another implementation scenario, in order to facilitate data processing, the neural network may further include a convolutional layer and a pooling layer, and the first resource planning scheme and the actual resource consumption condition may be input into the convolutional layer respectively to extract data feature information, and then processed by the pooling layer to perform dimension reduction on the extracted data feature information. In addition, in order to increase the learning rate, the input data may be normalized to be in the range of 0 to 1 before the convolutional layer is input. Referring to fig. 4, fig. 4 is a state diagram illustrating an embodiment of obtaining a candidate resource planning scheme. As shown in FIG. 4, for convenience of description, the first resource planning scheme after dimensionality reduction can be denoted as ht-1The actual resource consumption after dimensionality reduction can be recorded as xtThe state information of LSTM can be denoted as St-1On the basis of the above, h can bet-1、xtAnd St-1Inputting LSTM for prediction, and performing dimension reduction on the first resource planning scheme h through a forgetting gate function F of the LSTMt-1Selectively forgetting, and processing result and state information St-1The actual resource consumption after multiplication (i.e. n in FIG. 4) and dimension reduction by the memory gate function i of LSTM can be noted as xtSelectively memorizes the processing result, adds the result of the multiplication to the processing result (i.e., sigma in FIG. 4), and derives the addition result to the state information S of the next timet. On the basis, a first resource planning scheme h after the gate function O is subjected to dimensionality reduction through the tanh activation function pair is derivedt-1Scaling, and calculating to obtain a plurality of candidate resource planning schemes h of the second periodt。
Step S34: and selecting a second resource planning scheme from the candidate resource planning schemes based on the attribute information of the algorithms.
Specifically, utility conditions of the candidate resource planning schemes may be obtained based on attribute information of the plurality of algorithms, and the utility conditions include total utility values of the plurality of algorithms in a case where the candidate resource planning schemes are executed, and on this basis, one candidate resource planning scheme may be selected as the second resource planning scheme based on the utility conditions of the plurality of candidate resource planning schemes. In the above manner, the utility conditions of the candidate resource planning schemes are obtained based on the attribute information of the plurality of algorithms, and the utility conditions include the total utility values of the plurality of algorithms under the condition of executing the candidate resource planning schemes, and one candidate resource planning scheme is selected as the second resource planning scheme based on the utility conditions of the plurality of candidate resource planning schemes, that is, the second resource planning scheme is selected and obtained according to the total utility values of the plurality of algorithms under each candidate resource planning scheme, which is beneficial to improving the accuracy and reliability of the second resource planning scheme.
In an implementation scenario, the candidate resource planning scheme with the maximum total utility value may be specifically selected as the second resource planning scheme. Taking N candidate resource planning schemes as an example, the total utility value of the ith candidate resource planning scheme can be obtained by comparing the total utility values, and then the ith candidate resource planning scheme can be used as the second resource planning scheme of the second period. Other cases may be analogized, and no one example is given here.
In an implementation scenario, as described above, the attribute information may specifically include an algorithm calling frequency and an algorithm requirement degree, and on this basis, a first total utility value of the algorithm calling frequency for the plurality of algorithm request candidate resource planning schemes may be obtained, and a second total utility value of the algorithm requirement degree for the plurality of algorithm request candidate resource planning schemes may be obtained, so that the first total utility value and the second total utility value may be weighted by using a first weight value corresponding to the algorithm calling frequency and a second weight value corresponding to the algorithm requirement degree, respectively, and a total utility value of the plurality of algorithms in a case of executing the candidate resource planning schemes is obtained. According to the method, the first total utility value of the algorithm calling frequency to the plurality of algorithm request candidate resource planning schemes and the second total utility value of the algorithm demand degree to the plurality of algorithm request candidate resource planning schemes are obtained, the first weight corresponding to the algorithm calling frequency and the second weight corresponding to the algorithm demand degree are used for weighting the first total utility value and the second total utility value respectively to obtain the total utility value, and the resource planning scheme with better scene adaptivity and user experience can be selected from the angles of the algorithm calling frequency, the algorithm demand degree and the like.
In a specific implementation scenario, the first total utility value is a sum of normalized utility values of the algorithm invocation frequency for respective requests of the candidate resource planning schemes by the plurality of algorithms. Still taking the example that the algorithm set comprises a people flow analysis algorithm, a traffic recognition algorithm, a face analysis algorithm and a behavior analysis algorithm, the first total utility value is the sum of the normalized utility value of the algorithm calling frequency for requesting the candidate resource planning scheme by the people flow analysis algorithm, the normalized utility value of requesting the candidate resource planning scheme by the traffic recognition algorithm, the normalized utility value of requesting the candidate resource planning scheme by the people flow analysis algorithm and the normalized utility value of requesting the candidate resource planning scheme by the behavior analysis algorithm. Other cases may be analogized, and no one example is given here.
In another specific implementation scenario, the second total utility value is a sum of normalized utility values of the algorithm demand levels for the plurality of algorithms respectively requesting the candidate resource planning solution. Still taking the example that the algorithm set includes a pedestrian flow analysis algorithm, a traffic recognition algorithm, a face analysis algorithm and a behavior analysis algorithm, the second total utility value is the sum of the normalized utility value of the algorithm demand degree for the candidate resource planning scheme requested by the pedestrian flow analysis algorithm, the normalized utility value for the candidate resource planning scheme requested by the traffic recognition algorithm, the normalized utility value for the candidate resource planning scheme requested by the pedestrian face analysis algorithm and the normalized utility value for the candidate resource planning scheme requested by the behavior analysis algorithm. Other cases may be analogized, and no one example is given here.
In another specific implementation scenario, in order to further improve the accuracy of the total utility value, the total cost value of the algorithms in the case of executing the candidate resource planning scheme may be obtained, and the first total utility value and the second total utility value are weighted and summed by using the first weight and the second weight to obtain a third total utility value of the algorithms in the case of executing the candidate resource planning scheme, on this basis, a difference between the third total utility value and the total cost value may be used as the total utility value. In the above manner, the total cost values of the algorithms under the condition of executing the candidate resource planning scheme are obtained, and the first total utility value and the second total utility value are subjected to weighted summation by using the first weight and the second weight, so that the third total utility values of the algorithms under the condition of executing the candidate resource planning scheme are obtained, and the difference value between the third total utility value and the total cost value is used as the total utility value, which is beneficial to improving the accuracy of the total utility value.
It should be noted that the utility value may include both the algorithm execution speed and the algorithm execution accuracy. Specifically, the calculation resource consumption of the algorithm is reduced, and meanwhile, the algorithm execution speed is increased, the algorithm execution accuracy is increased, and the utility value is increased; on the contrary, the more computing resources the algorithm consumes, and the slower the algorithm execution speed is, the lower the algorithm execution accuracy is, and the lower the utility value is. The cost value represents a negative influence of the resource planning on the algorithm execution, for example, the algorithm execution sequence included in the resource planning has an influence on the algorithm execution speed and the algorithm execution accuracy, for example, the speed is reduced by 10%, the accuracy is reduced by 5%, and the like, which is not limited herein.
In addition, in a case where the attribute information includes an algorithm calling frequency and an algorithm demand degree, a sum of a first weight corresponding to the algorithm calling frequency and a second weight corresponding to the algorithm demand degree may be 1. The specific numerical value may be set according to an actual application situation, for example, in a case that the algorithm calling frequency has a large influence on the total utility value, the first weight value may be set to be slightly larger, for example, the first weight value may be set to 0.6, and the second weight value may be set to 04; or, in a case that the influence of the algorithm requirement degree on the total utility value is large, the second weight value may be set to be slightly larger, for example, the first weight value may be set to be 0.4, and the second weight value may be set to be 0.6, which is not limited herein.
In another implementation scenario, in order to improve comprehensiveness of the attribute information, the attribute information may further include other algorithm attributes except for algorithm invocation frequency and algorithm demand degree, which may specifically refer to relevant descriptions in the foregoing disclosed embodiments and are not described herein again. On the basis, third total utility values of the candidate resource planning schemes requested by the algorithms through other algorithm attributes can be obtained, so that the first weight corresponding to the algorithm calling frequency, the second weight corresponding to the algorithm demand degree and the third weight corresponding to the other algorithm attributes are used for weighting the first total utility value, the second total utility value and the third total utility value respectively, and the total utility values of the algorithms under the condition of executing the candidate resource planning schemes are obtained.
In a specific implementation scenario, similar to the first total utility value and the second total utility value, the third total utility value is a sum of normalized utility values of other algorithm attributes respectively requesting candidate resource planning schemes for several algorithms. Still taking the example that the algorithm set includes the pedestrian flow analysis algorithm, the traffic recognition algorithm, the face analysis algorithm and the behavior analysis algorithm, the third total utility value is the sum of the normalized utility value of other algorithm attributes for requesting the candidate resource planning scheme by the pedestrian flow analysis algorithm, the normalized utility value for requesting the candidate resource planning scheme by the traffic recognition algorithm, the normalized utility value for requesting the candidate resource planning scheme by the pedestrian face analysis algorithm and the normalized utility value for requesting the candidate resource planning scheme by the behavior analysis algorithm. Other cases may be analogized, and no one example is given here.
In another specific implementation scenario, as described above, the total cost values of the algorithms in the case of executing the candidate resource planning scheme may be obtained, the first total utility value, the second total utility value, and the third total utility value are respectively weighted and summed by using the first weight, the second weight, and the third weight, so as to obtain the third total utility value of the algorithms in the case of executing the candidate resource planning scheme, and a difference between the third total utility value and the total cost value is used as the total utility value. For the specific meaning of the cost value, reference may be made to the above description, and further description is omitted here.
In addition, under the condition that the attribute information comprises algorithm calling frequency, algorithm demand degree and other algorithm attributes, the sum of the first weight, the second weight and the third weight is 1. The specific numerical value may be set according to an actual application situation, for example, in a case where the influence of the algorithm calling frequency on the total utility value is large, the first weight value may be set to be slightly larger, for example, the first weight value may be set to 0.6, the second weight value may be set to 0.2, and the third weight value may be set to 0.2; or, under the condition that the influence of the algorithm demand degree on the total utility value is large, the second weight value can be set slightly larger, for example, the first weight value can be set to 0.2, the second weight value can be set to 0.6, and the third weight value can be set to 0.2; or, in a case that the influence of other algorithm attributes on the total utility value is large, the third weight value may be set to be slightly larger, for example, the first weight value may be set to be 0.2, the second weight value may be set to be 0.2, and the third weight value may be set to be 0.6, which is not limited herein.
For convenience of description, taking an example that the algorithm set comprises N algorithms in total, the algorithm calling frequency in the attribute information is recorded as k, the algorithm demand degree in the attribute information is recorded as q, other algorithm attributes in the attribute information are recorded as o, and the normalized utility value of the algorithm calling frequency k for the jth candidate resource planning scheme requested by the ith algorithm is recorded asThe normalized utility value of the algorithm demand degree q to the ith algorithm request jth candidate resource planning scheme is recorded asThe normalized utility value of the ith algorithm request jth candidate resource planning scheme is recorded as the other algorithm attribute oThe total utility value F corresponding to the jth candidate resource planning schemejCan be expressed as:
in the above formula (1), WkDenotes a first weight, WqRepresents a second weight, WoA third weight value is represented which is,a first value of the total utility is indicated,a second value of the total utility is represented,represents the third total utility value, Σi∈NEi,jRepresenting the total cost value. On the basis that the sum of the first weight, the second weight and the third weight is 1, whether each candidate resource planning scheme is equal to N (i.e., the total number of several algorithms) or not can be respectively judged, if yes, the candidate resource planning scheme can be considered as the optimal scheme among the several candidate resource planning schemes, that is, the candidate resource planning scheme can be used as the second resource planning scheme, and if no candidate resource planning scheme with the total utility value equal to N exists, the candidate resource planning scheme with the maximum total utility value can be used as the second resource planning scheme.
Step S35: and taking the first resource planning scheme as a second resource planning scheme of the algorithm set in the second period.
As described above, when the deviation condition does not satisfy the preset condition, it can be considered that the deviation between the actual resource consumption condition and the planned resource consumption condition is within the acceptable range, so that the resource planning scheme does not need to be dynamically adjusted in the subsequent period, and the current resource planning scheme (i.e., the first resource planning scheme) can be used.
Different from the embodiment, the method includes obtaining a planned resource consumption condition of an algorithm set in a first period based on a first resource planning scheme, predicting and obtaining a plurality of candidate resource planning schemes of the algorithm set in a second period based on the first resource planning scheme and an actual resource consumption condition under the condition that a deviation condition between the actual resource consumption condition and the planned resource consumption condition meets a preset condition, and on the basis, selecting and obtaining a second resource planning scheme from the plurality of candidate resource planning schemes based on attribute information of a plurality of algorithms, so that the resource planning scheme can be dynamically adjusted according to the actual condition in the whole life cycle, the matching degree between the resource planning scheme and the actual condition is favorably and continuously improved, and the algorithm execution effect can be improved in the whole life cycle.
Referring to fig. 5, fig. 5 is a schematic flowchart illustrating a computing resource planning method according to another embodiment of the present application. Specifically, the method may include the steps of:
step S501: and acquiring a first resource planning scheme and an actual resource consumption condition of the algorithm set in the T-th period.
In the embodiment of the present disclosure, the algorithm set includes a plurality of algorithms, and the first resource planning scheme includes a scheme for using computing resources in the tth period, which is respectively planned for the plurality of algorithms. Reference may be made to the related description in the foregoing embodiments, which are not repeated herein.
Step S502: inputting the first resource planning scheme and the actual resource consumption condition into a neural network for prediction to obtain a plurality of candidate resource planning schemes Y { X1, X2, …, Xn } of the algorithm set in the T +1 th period.
In the embodiment of the disclosure, the candidate resource planning schemes include schemes that use computing resources in the T +1 th period and are respectively planned for a plurality of algorithms. Reference may be made to the related description in the foregoing embodiments, which are not repeated herein.
Step S503: and respectively obtaining the utility condition of each candidate resource planning scheme based on the attribute information of a plurality of algorithms.
In the embodiment of the present disclosure, the utility condition includes: the total utility value of several algorithms in the case of executing a candidate resource planning solution. Reference may be made to the related description in the foregoing embodiments, which are not repeated herein.
Step S504: and selecting the candidate resource planning scheme with the maximum total utility value as a second resource planning scheme.
In the embodiment of the present disclosure, the second resource planning scheme includes a scheme for using computing resources in the T +1 th period, which is respectively planned for a plurality of algorithms. Reference may be made to the related description in the foregoing embodiments, which are not repeated herein.
Step S505: and performing a calculation power distribution decision based on the second resource planning scheme.
Specifically, the second resource planning scheme may be analyzed, and the planning resource consumption conditions of the plurality of algorithms in the T +1 th period and the execution sequence of the plurality of algorithms may be obtained, so that the plurality of algorithms may be executed based on the analyzed second resource planning scheme in the T +1 th period.
Step S506: and executing a plurality of algorithms in the T +1 th period based on the analyzed second resource planning scheme.
Reference may be made to the related description in the foregoing embodiments, which are not repeated herein.
Step S507: and judging whether the deviation condition between the planned resource consumption condition and the actual resource consumption condition of the T +1 th period meets a preset condition, if so, executing the step S508, and otherwise, executing the step S510.
As described in the foregoing disclosure, when the deviation condition satisfies the preset condition, it may be considered that the deviation between the actual resource consumption condition and the planned resource consumption condition in the T +1 th period is relatively large, so that the resource planning scheme needs to be dynamically adjusted in the subsequent T +2 th period, otherwise, when the deviation condition does not satisfy the preset condition, it may be considered that the deviation between the actual resource consumption condition and the planned resource consumption condition in the T +1 th period is within an acceptable range, so that the resource planning scheme does not need to be dynamically adjusted in the subsequent T +2 th period, and the resource planning scheme in the T +1 th period may be used.
Step S508: t is added by 1.
Specifically, if T is increased by 1, this is the T +2 th cycle.
Step S509: step S501 and subsequent steps are re-executed.
Specifically, since the deviation between the actual resource consumption situation and the planned resource consumption situation in the T +1 th cycle is large, the step S501 and the subsequent steps need to be executed again to dynamically adjust the resource planning scheme in the subsequent T +2 th cycle.
Step S510: t is added by 1.
Specifically, if T is increased by 1, this is the T +2 th cycle.
Step S511: step S506 is re-executed.
Specifically, since the deviation between the actual resource consumption situation and the planned resource consumption situation in the T +1 th cycle is within the acceptable range, the resource planning scheme does not need to be dynamically adjusted in the subsequent T +2 th cycle, and the resource planning scheme in the T +1 th cycle can be used in the T +2 th cycle.
Different from the embodiment, the resource planning scheme can be dynamically adjusted according to the actual situation by circulating in the whole life cycle, so that the matching degree between the resource planning scheme and the actual situation is favorably and continuously improved, and the algorithm execution effect can be improved in the whole life cycle.
Referring to fig. 6, fig. 6 is a block diagram of an embodiment of a computing resource planning apparatus 60 according to the present application. The computing resource planning device 60 includes a first period information obtaining module 61, configured to obtain a first resource planning scheme and an actual resource consumption condition of the algorithm set in a first period; the algorithm set comprises a plurality of algorithms, the first resource planning scheme comprises a scheme which is planned for the plurality of algorithms respectively and uses computing resources in a first period, and the computing resource planning device 60 comprises a second period scheme planning module 62 which is used for obtaining a second resource planning scheme of the algorithm set based on the first resource planning scheme, the actual resource consumption condition and attribute information of the plurality of algorithms; the second resource planning scheme comprises a scheme which is respectively planned for a plurality of algorithms and uses computing resources in a second period, and the second period is after the first period.
According to the scheme, a first resource planning scheme and an actual resource consumption condition of the algorithm set in a first period are obtained, the algorithm set comprises a plurality of algorithms, the first resource planning scheme comprises a scheme which is planned for the plurality of algorithms respectively and uses computing resources in the first period, on the basis, a second resource planning scheme of the algorithm set is obtained based on the first resource planning scheme, the actual resource consumption condition and attribute information of the plurality of algorithms, the second resource planning scheme comprises a scheme which is planned for the plurality of algorithms respectively and uses the computing resources in a second period after the first period, and therefore the computing resources can be planned for the plurality of algorithms in the algorithm set dynamically in each period, the reasonability of the computing resources planned for the algorithms can be greatly improved, and the algorithm execution effect can be improved.
In some disclosed embodiments, the second periodic scheme planning module 62 includes a planning consumption obtaining sub-module configured to obtain a planning resource consumption situation of the algorithm set in the first period based on the first resource planning scheme, the second periodic scheme planning module 62 includes a candidate scheme predicting sub-module configured to predict a plurality of candidate resource planning schemes of the algorithm set in the second period based on the first resource planning scheme and the actual resource consumption situation under a condition that a deviation situation between the actual resource consumption situation and the planning resource consumption situation satisfies a preset condition, and the second periodic scheme planning module 62 includes a second periodic scheme selecting sub-module configured to select the second resource planning scheme among the plurality of candidate resource planning schemes based on attribute information of the plurality of algorithms.
Different from the embodiment, the method includes obtaining a planned resource consumption condition of an algorithm set in a first period based on a first resource planning scheme, predicting and obtaining a plurality of candidate resource planning schemes of the algorithm set in a second period based on the first resource planning scheme and an actual resource consumption condition under the condition that a deviation condition between the actual resource consumption condition and the planned resource consumption condition meets a preset condition, and on the basis, selecting and obtaining a second resource planning scheme from the plurality of candidate resource planning schemes based on attribute information of a plurality of algorithms, so that the resource planning scheme can be dynamically adjusted according to the actual condition in the whole life cycle, the matching degree between the resource planning scheme and the actual condition is favorably and continuously improved, and the algorithm execution effect can be improved in the whole life cycle.
In some disclosed embodiments, the second period scheme selection sub-module includes a utility condition obtaining unit, configured to obtain utility conditions of the candidate resource planning schemes based on attribute information of the plurality of algorithms; wherein the utility conditions include: and under the condition of executing the candidate resource planning schemes, the total utility value of the plurality of algorithms, and the second periodic scheme selection submodule comprises a planning scheme selection unit which is used for selecting one candidate resource planning scheme as a second resource planning scheme based on the utility conditions of the plurality of candidate resource planning schemes.
Different from the foregoing embodiment, the utility conditions of the candidate resource planning schemes are obtained based on the attribute information of the plurality of algorithms, and the utility conditions include the total utility values of the plurality of algorithms under the condition of executing the candidate resource planning schemes, and one candidate resource planning scheme is selected as the second resource planning scheme based on the utility conditions of the plurality of candidate resource planning schemes, that is, the second resource planning scheme is selected and obtained according to the total utility values of the plurality of algorithms under each candidate resource planning scheme, which is beneficial to improving the accuracy and reliability of the second resource planning scheme.
In some disclosed embodiments, the algorithm invocation frequency and the algorithm desirability level; the utility condition obtaining unit comprises a first utility obtaining subunit used for obtaining a first total utility value of the algorithm calling frequency for the plurality of algorithm request candidate resource planning schemes, the utility condition obtaining unit comprises a second utility obtaining subunit used for obtaining a second total utility value of the algorithm demand degree for the plurality of algorithm request candidate resource planning schemes, and the utility condition obtaining unit comprises a total utility value operator unit used for respectively weighting the first total utility value and the second total utility value by utilizing a first weight value corresponding to the algorithm calling frequency and a second weight value corresponding to the algorithm demand degree to obtain the total utility value of the plurality of algorithms under the condition of executing the candidate resource planning schemes.
Different from the foregoing embodiment, the resource planning method and the resource planning system can select a resource planning scheme with better scene adaptivity and user experience from the aspects of the algorithm calling frequency and the algorithm demand degree by obtaining a first total utility value of the algorithm calling frequency for a plurality of algorithm request candidate resource planning schemes and a second total utility value of the algorithm demand degree for a plurality of algorithm request candidate resource planning schemes, and performing weighting processing on the first total utility value and the second total utility value by using a first weight corresponding to the algorithm calling frequency and a second weight corresponding to the algorithm demand degree to obtain the total utility value.
In some disclosed embodiments, the utility condition obtaining unit further includes a total cost value obtaining subunit, configured to obtain a total cost value of the plurality of algorithms when the candidate resource planning scheme is executed, and the total utility value operator unit is specifically configured to perform weighted summation on the first total utility value and the second total utility value by using the first weight and the second weight, to obtain a third total utility value of the plurality of algorithms when the candidate resource planning scheme is executed, and to use a difference between the third total utility value and the total cost value as the total utility value.
Different from the foregoing embodiment, the total cost value of the algorithms in the case of executing the candidate resource planning scheme is obtained, and the first total utility value and the second total utility value are weighted and summed by using the first weight and the second weight to obtain the third total utility value of the algorithms in the case of executing the candidate resource planning scheme, so that the difference between the third total utility value and the total cost value is used as the total utility value, which is beneficial to improving the accuracy of the total utility value.
In some disclosed embodiments, the first total utility value is a sum of normalized utility values of the algorithm invocation frequency for a number of algorithms respectively requesting candidate resource planning solutions; and/or the second total utility value is the sum of normalized utility values of algorithm demand degrees respectively requesting candidate resource planning schemes for a plurality of algorithms; and/or the sum of the first weight and the second weight is 1
In some disclosed embodiments, the planning scheme selecting unit is specifically configured to select the candidate resource planning scheme with the largest total utility value as the second resource planning scheme.
Different from the foregoing embodiments, by selecting the candidate resource planning scheme with the maximum total utility value as the second resource planning scheme, the execution effect of the algorithms in the second period can be improved sufficiently.
In some disclosed embodiments, the candidate scheme prediction sub-module is specifically configured to input the first resource planning scheme and the actual resource consumption condition into the neural network for prediction, so as to obtain a plurality of candidate resource planning schemes.
Different from the embodiment, the first resource planning scheme and the actual resource consumption condition are input into the neural network for prediction to obtain a plurality of candidate resource planning schemes, so that the accuracy and efficiency of resource planning can be improved.
In some disclosed embodiments, the second periodic plan module 62 further includes a plan update sub-module configured to aggregate the first resource plan as a second resource plan of the algorithm set in the second period if the deviation condition does not satisfy the preset condition.
Different from the embodiment, the method can avoid planning the computing resources under the condition that the deviation condition between the actual resource consumption condition and the planned resource consumption condition does not meet the preset condition, thereby being beneficial to reducing the load of the process of planning the computing resources and improving the reliability of the process of planning, computing and planning.
In some disclosed embodiments, the actual resource consumption conditions include: the planning of the resource consumption condition includes the following steps: a second amount of computational resources expected to be consumed by the plurality of algorithms per unit time of the first cycle, the bias comprising: the proportion of the deviation value between the first total amount and the second total amount in the second total amount is as follows, and the preset conditions comprise: the occupancy is greater than a preset threshold.
Referring to fig. 7, fig. 7 is a schematic diagram of a frame of an embodiment of an electronic device 70 according to the present application. The electronic device 70 comprises a memory 71 and a processor 72 coupled to each other, the memory 71 storing program instructions, and the processor 72 executing the program instructions to implement the steps in any of the above-mentioned embodiments of the computing resource planning method.
In particular, the processor 72 is configured to control itself and the memory 71 to implement the steps of any of the above-described embodiments of the computational resource planning method. The processor 72 may also be referred to as a CPU (Central Processing Unit). The processor 72 may be an integrated circuit chip having signal processing capabilities. The Processor 72 may also be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. Additionally, processor 72 may be commonly implemented by a plurality of integrated circuit chips.
According to the scheme, the calculation resources can be dynamically planned for the algorithms in the algorithm set in each period, so that the reasonability of the calculation resources planned for the algorithms can be greatly improved, and the algorithm execution effect can be improved.
Referring to fig. 8, fig. 8 is a schematic diagram of a memory device 80 according to an embodiment of the present disclosure. The memory device 80 stores program instructions 801 that can be executed by the processor, the program instructions 801 being for implementing the steps in any of the above-described embodiments of the computing resource planning method.
According to the scheme, the calculation resources can be dynamically planned for the algorithms in the algorithm set in each period, so that the reasonability of the calculation resources planned for the algorithms can be greatly improved, and the algorithm execution effect can be improved.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some interfaces, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:基于禁忌搜索优化算法的全比较数据分发方法