Computing resource planning method, electronic device, and storage device
By dynamically adjusting the computing resource allocation plan, the problem of static or random allocation of computing resource in the prior art is solved, and the algorithm execution effect and rationality of computing resources are improved.
Patent Information
- Application Number
- CN202110512004.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-11
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-05-11
AI Technical Summary
The prior art is difficult to ensure the execution effect of algorithms, and the allocation of computing resources is static or random, and cannot meet the dynamic needs of different algorithms.
A computing resource planning method is proposed. By obtaining the resource planning scheme and actual resource consumption of the algorithm set in the first cycle, based on these information and algorithm attributes, the computing resource allocation scheme is dynamically adjusted to meet the needs of different algorithms.
By dynamically adjusting the allocation of computing resources, the algorithm execution effect is improved and the rationality and utilization rate of computing resources are enhanced.
Smart Images

Figure CN113407335B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information technology, and in particular to a computing resource planning method, an electronic device, and a storage device. Background Art
[0002] With the development of electronic information technology, various algorithms have been 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, and behavior analysis can make surveillance cameras suitable for different scenarios. As we all know, algorithm execution depends on computing resources. However, currently computing resources are either statically allocated to algorithms or randomly allocated to algorithms, which makes it difficult to ensure the execution effect of the algorithm. In view of this, how to improve the execution effect of the algorithm has become a topic of great research value. Summary of the invention
[0003] The main technical problem solved by the present application is to provide a computing resource planning method, an electronic device, and a storage device, which can improve the algorithm execution effect.
[0004] In order to solve the above problems, the first aspect of the present application provides a computing resource planning method, including: obtaining a first resource planning scheme and actual resource consumption of an algorithm set in a first cycle; wherein the algorithm set includes several algorithms, and the first resource planning scheme includes schemes for using computing resources in the first cycle respectively planned for the several algorithms; based on the first resource planning scheme, the actual resource consumption and attribute information of the several algorithms, obtaining a second resource planning scheme for the algorithm set; wherein the second resource planning scheme includes schemes for using computing resources in a second cycle respectively planned for the several algorithms, and the second cycle is after the first cycle.
[0005] In order to solve the above problem, the second aspect of the present application provides an electronic device, including a memory and a processor coupled to each other, the memory stores program instructions, and the processor is used to execute the program instructions to implement the computing resource planning method in the above first aspect.
[0006] In order to solve the above-mentioned problem, the third aspect of the present application provides a storage device storing program instructions that can be executed by a processor, and the program instructions are used for the computing resource planning method in the above-mentioned first aspect.
[0007] The above scheme obtains the first resource planning scheme and actual resource consumption of the algorithm set in the first cycle, and the algorithm set includes several algorithms. The first resource planning scheme includes schemes for using computing resources in the first cycle planned for the several algorithms respectively. On this basis, based on the first resource planning scheme, the actual resource consumption and attribute information of the several algorithms, the second resource planning scheme of the algorithm set is obtained, and the second resource planning scheme includes schemes for using computing resources in the second cycle after the first cycle planned for the several algorithms respectively. Therefore, computing resources can be dynamically planned for several algorithms in the algorithm set in each cycle, which can greatly improve the rationality of the computing resources planned for the algorithms and improve the algorithm execution effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 It is a flowchart of an embodiment of a computing resource planning method of the present application;
[0009] Figure 2 It is a state diagram of an embodiment of the computing resource planning method of the present application;
[0010] Figure 3 yes Figure 1 A schematic diagram of a flow chart of an embodiment of step S12;
[0011] Figure 4 is a state diagram of an embodiment of obtaining a candidate resource planning scheme;
[0012] Figure 5 It is a flowchart of another embodiment of the computing resource planning method of the present application;
[0013] Figure 6 It is a schematic diagram of the framework of an embodiment of the computing resource planning device of the present application;
[0014] Figure 7 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0015] Figure 8 It is a schematic diagram of the framework of an embodiment of the storage device of the present application. DETAILED DESCRIPTION
[0016] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0017] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0018] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0019] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of the computing resource planning method of the present application. Specifically, it may include the following steps:
[0020] Step S11: Obtain the first resource planning scheme and actual resource consumption of the algorithm set in the first cycle.
[0021] In the embodiment of the present disclosure, the algorithm set includes several algorithms, and the first resource planning scheme includes schemes for using computing resources in the first cycle that are respectively planned for the several algorithms.
[0022] In an implementation scenario, several algorithms in the algorithm set can be set according to the actual application scenario. For example, in a video surveillance scenario, several algorithms may include but are not limited to: crowd flow analysis algorithm, traffic recognition algorithm, face analysis algorithm, behavior analysis algorithm, etc., which are not limited here. Other situations can be deduced by analogy, and examples are not given one by one here. It should be noted that different algorithms can meet different application needs. Taking the aforementioned video surveillance scenario as an example, the crowd flow analysis algorithm can meet the application needs of crowd flow analysis in places such as scenic spots, shopping malls, and stations; and the behavior analysis algorithm can meet the application needs of abnormal behavior analysis such as climbing and throwing objects from high places in places such as parks and communities; the traffic recognition algorithm can meet the application needs of behavior analysis such as motor vehicle passing and driving in places such as checkpoints and roads, and so on, and examples are not given one by one here.
[0023] In an implementation scenario, computing resources may include, but are not limited to: edge computing resources, cloud computing resources, local computing resources, etc., which are not limited here. It should be noted that cloud computing resources include resources such as servers built specifically to support algorithm sets, while edge computing resources include the remaining resources of servers that are not built specifically to support algorithm sets, and local computing resources include the computing resources of the front-end device (such as a surveillance camera) itself, for example, the CPU (Central Processing Unit), GPU (Graphics Processing Unit), memory, etc. of the front-end device, which are not limited here.
[0024] In an implementation scenario, the first cycle can be the period length required for several algorithms contained in the algorithm set to be executed several times (e.g., 1 time, 2 times, 3 times, etc.); or, the first cycle can also be set to a fixed duration (e.g., 1 hour, 2 hours, 3 hours, etc.), which is not limited here.
[0025] In an implementation scenario, as described above, the first resource planning scheme includes schemes for using computing resources in the first cycle that are planned for several algorithms. Specifically, the first resource planning scheme may include the execution order of several algorithms in the first cycle. Taking the algorithm set including a pedestrian 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 pedestrian flow analysis algorithm and the traffic recognition algorithm are executed, the face analysis algorithm and the behavior analysis algorithm are executed in parallel; or, the first resource planning scheme may also include: executing the pedestrian flow analysis algorithm, the traffic recognition algorithm, the face analysis algorithm, and the behavior analysis algorithm in sequence; or, the first resource planning scheme may also include: executing the pedestrian flow analysis algorithm, the traffic recognition algorithm, the face analysis algorithm, and the behavior analysis algorithm in parallel, which is not limited here. In addition, the first resource planning scheme may also include pre-allocated computing resources per unit time (e.g., seconds) for each algorithm in the algorithm set. Still taking the algorithm set including the human flow analysis algorithm, the traffic recognition algorithm, the face analysis algorithm and the behavior analysis algorithm as an example, the first resource planning scheme may include: pre-allocating 10% of GPU computing resources, 10% of edge computing resources and 10% of cloud computing resources for the human flow analysis algorithm per second, pre-allocating 15% of GPU computing resources, 20% of edge computing resources and 15% of cloud computing resources for the traffic recognition algorithm per second, pre-allocating 5% of GPU computing resources, 15% of edge computing resources and 20% of cloud computing resources for the 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 the behavior analysis algorithm per second, without limitation here. It should be noted that the specific example of the above-mentioned first resource planning scheme is only a possible situation in the actual application process, and does not limit the first resource planning scheme that may appear in the actual application process.
[0026] In one implementation scenario, as mentioned above, the first resource planning scheme may also include computing resources pre-allocated per unit time for each algorithm in the algorithm set. During the actual execution of the algorithm set in the first cycle, the computing resources actually consumed per unit time by the algorithm 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 per second for the human traffic analysis algorithm. When monitoring the human traffic analysis algorithm in the first cycle, it can be obtained that the computing resources actually consumed include: 11% of GPU computing resources, 9% of edge computing resources, and 12% of cloud computing resources are actually consumed per second. Other algorithms can be deduced in the same way, and examples are not given one by one here. Therefore, in order to improve the accuracy of computing resource planning, the computing resources actually consumed by the algorithm set per unit time in the first cycle can be obtained to obtain the actual resource consumption.
[0027] In a specific implementation scenario, as mentioned above, the computing resources actually consumed by the algorithm per unit time may deviate from the pre-allocated computing resources. In the actual process, several algorithms can be executed in the order of execution of several algorithms included in the first resource planning scheme in the first cycle.
[0028] In another specific implementation scenario, please refer to Figure 2 , Figure 2 1 is a schematic diagram of a state of an embodiment of the computing resource planning method of the present application. Figure 2 As shown, in order to improve the accuracy of the actual resource consumption, a computing power monitoring device can be set. Through the computing power monitoring device, on the one hand, the computing resources actually consumed by different algorithms per unit time can be monitored in real time to obtain the actual resource consumption in the first cycle. On the other hand, the monitored actual consumption can be fed back to the electronic device used to implement the computing resource planning method of the present application, so that the electronic device can perform computing resource planning for the next cycle based on the actual resource consumption. In addition, it should be noted that, as mentioned above, the first resource planning scheme can include the execution sequence of several algorithms in the first cycle, so the algorithm that is not executed temporarily can wait in the algorithm waiting sequence. For example, in the case where the first resource planning scheme includes: the parallel execution of the human flow analysis algorithm and the traffic recognition algorithm, after the human flow analysis algorithm and the traffic recognition algorithm are executed, the face analysis algorithm and the behavior analysis algorithm are executed in parallel, the human flow analysis algorithm and the traffic recognition algorithm can be executed in parallel first. In this process, the face analysis algorithm and the behavior analysis algorithm can wait in the algorithm waiting sequence. After the human flow analysis algorithm and the traffic recognition algorithm are executed, the face analysis algorithm and the behavior analysis algorithm can be taken out from the algorithm waiting sequence and the two are executed in parallel. Other situations can be deduced by analogy, and examples are not given one by one here.
[0029] Step S12: Based on the first resource planning scheme, actual resource consumption and attribute information of several algorithms, a second resource planning scheme of the algorithm set is obtained.
[0030] In the embodiment of the present disclosure, the second resource planning scheme includes schemes for using computing resources in a second cycle that are planned for several algorithms respectively, and the second cycle is after the first cycle.
[0031] In an implementation scenario, similar to the first cycle, the second cycle can be the cycle duration required for several algorithms contained in the algorithm set to be executed several times (e.g., 1 time, 2 times, 3 times, etc.); or, the second cycle can also be set to a fixed duration (e.g., 1 hour, 2 hours, 3 hours, etc.), which is not limited here. It should be noted that in order to improve the consistency of computing resource planning, the specific meanings of the first cycle and the second cycle can be consistent, such as the first cycle and the second cycle can both be the cycle duration required for several algorithms contained in the algorithm set to be executed several times (e.g., 1 time, 2 times, 3 times, etc.), or, the first cycle and the second cycle can both be a fixed duration (e.g., 1 hour, 2 hours, 3 hours, etc.), which is not limited here.
[0032] In another implementation scenario, the second cycle can specifically be the N cycles after the first cycle, such as the week after the first cycle can be used as the second cycle, or the second cycle after the first cycle can be used as the second cycle, or the third cycle after the first cycle can be used as the second cycle, without limitation here.
[0033] In an implementation scenario, similar to the first resource planning scheme, the second resource planning scheme may include: the execution order of several algorithms in the second cycle, which can be specifically referred to the relevant description of the first resource planning scheme, which will not be repeated here. In addition, the second resource planning scheme may also include: the computing resources pre-allocated per unit time (e.g., seconds) for each algorithm in the algorithm set, which can be specifically referred to the relevant description of the first resource planning scheme, which will not be repeated here.
[0034] In an implementation scenario, the attribute information may include, but is not limited to, algorithm call frequency and algorithm demand degree. The algorithm call frequency indicates the number of times the algorithm is called per unit time. Taking the example of several algorithms including the pedestrian flow analysis algorithm, the traffic recognition algorithm, the face analysis algorithm and the behavior analysis algorithm, the algorithm call frequency of the pedestrian flow analysis algorithm may be 30 times / second, the algorithm call frequency of the traffic recognition algorithm may be 50 times / second, the algorithm call frequency of the face analysis algorithm may be 10 times / second, and the algorithm call frequency of the behavior analysis algorithm may be 35 times / second, which are not limited here. The algorithm demand degree indicates the user's demand degree for different algorithms. Taking the example of several algorithms including the pedestrian flow analysis algorithm, the traffic recognition algorithm, the face analysis algorithm and the behavior analysis algorithm, the algorithm demand degree of the pedestrian flow analysis algorithm may be 30 times / second, which is "very needed", 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 are not limited here. In addition, in order to quantify the degree of algorithm requirements, 10 can be used to represent "very necessary", 7 can be used to represent "necessary", 4 can be used to represent "slightly necessary", and 0 can be used to represent "not necessary", and there is no limitation here.
[0035] In another implementation scenario, in addition to the algorithm call frequency and algorithm demand, the algorithm attribute information may also include other algorithm attributes. For example, a certain algorithm (such as a human flow analysis algorithm) is basically in a low-frequency call state throughout its life cycle, but it will be called at a high frequency in some special seasons (such as the Spring Festival). Other algorithm attributes can be set according to actual application needs and are not limited here.
[0036] In an implementation scenario, in order to reduce the load of the planning and computing resource process, the planned resource consumption of the algorithm set in the first cycle can be obtained based on the first resource planning scheme, and when the deviation between the actual resource consumption and the planned resource consumption meets the preset conditions, based on the first resource planning scheme and the actual resource consumption, several candidate resource planning schemes of the algorithm set in the second cycle are predicted, and based on the attribute information of several algorithms, the second resource planning scheme is selected from several candidate resource planning schemes. The specific process can be referred to the relevant description in the following public embodiments, which will not be repeated here. Therefore, it is possible to avoid performing computing resource planning when the deviation between the actual resource consumption and the planned resource consumption does not meet the preset conditions, which can help reduce the load of the planning and computing resource process and improve the reliability of the planning and computing planning process.
[0037] In another implementation scenario, in order to dynamically adjust the resource planning scheme throughout the entire life cycle, the planned resource consumption of the algorithm set in the first cycle can also be obtained based on the first resource planning scheme, and the deviation between the actual resource consumption and the planned resource consumption is no longer compared. Instead, it is directly based on the first resource planning scheme and the actual resource consumption. Predict a number of candidate resource planning schemes for the algorithm set in the second cycle, and select the second resource planning scheme from a number of candidate resource planning schemes based on the attribute information of the several algorithms. The specific process can be found in the relevant description in the following public embodiments, which will not be repeated here. Therefore, being able to dynamically adjust the resource planning scheme according to the actual situation throughout the life cycle is conducive to continuously improving the matching degree between the resource planning scheme and the actual situation, thereby being able to improve the algorithm execution effect throughout the life cycle.
[0038] 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 cycle can be monitored, and the second cycle can be used as the new first cycle, and the second resource planning scheme of the second cycle can be used as the first resource planning scheme of the new first cycle to re-execute the above steps S11 and S12, so as to obtain the second resource planning scheme of the subsequent cycle. For example, after obtaining the resource planning scheme and actual resource consumption of the T1 cycle, the resource planning scheme of the T2 cycle can be obtained based on this, and the actual resource consumption of the T2 cycle can be monitored, and then the resource planning scheme of the T3 cycle can be obtained based on the resource planning scheme and actual resource consumption of the T2 cycle. This cycle can be repeated, and the resource planning scheme can be dynamically adjusted according to the actual situation, which is conducive to continuously improving the matching degree between the resource planning scheme and the actual situation, thereby improving the algorithm execution effect throughout the life cycle.
[0039] The above scheme obtains the first resource planning scheme and actual resource consumption of the algorithm set in the first cycle, and the algorithm set includes several algorithms. The first resource planning scheme includes schemes for using computing resources in the first cycle planned for the several algorithms respectively. On this basis, based on the first resource planning scheme, the actual resource consumption and attribute information of the several algorithms, the second resource planning scheme of the algorithm set is obtained, and the second resource planning scheme includes schemes for using computing resources in the second cycle after the first cycle planned for the several algorithms respectively. Therefore, computing resources can be dynamically planned for several algorithms in the algorithm set in each cycle, which can greatly improve the rationality of the computing resources planned for the algorithms and improve the algorithm execution effect.
[0040] See also Figure 3 , Figure 3 yes Figure 1The flowchart of step S12 in the embodiment of FIG. 1 may specifically include the following steps:
[0041] Step S31: Based on the first resource planning scheme, obtain the planned resource consumption of the algorithm set in the first cycle.
[0042] As described in the aforementioned disclosed embodiments, the first resource planning scheme may further include computing resources pre-allocated per unit time (e.g., seconds) for each algorithm in the algorithm set. Therefore, based on the computing resources pre-allocated per unit time (e.g., seconds) for each algorithm in the algorithm set, the planned resource consumption of the algorithm set in the first cycle may be obtained.
[0043] In an implementation scenario, the actual resource consumption includes the first total amount of computing resources actually consumed by several algorithms within a unit time of the first cycle, and the planned resource consumption includes the second total amount of computing resources expected to be consumed by several algorithms within a unit time of the first cycle. For ease of description, the algorithm set including the pedestrian flow analysis algorithm, the traffic recognition algorithm, the face analysis algorithm and the behavior analysis algorithm is still taken as an example. According to statistics, the first total amount of computing resources actually consumed by the above algorithms within a unit time of the first cycle can be recorded as S1, and the second total amount of computing resources expected to be consumed by the above algorithms within a unit time of the first cycle can be recorded as S2. Other situations can be deduced by analogy, and no examples are given here one by one.
[0044] In an implementation scenario, the actual resource consumption may include a first total amount of computing resources actually consumed by the various algorithms in a unit time of the first cycle, and the planned resource consumption may include a second total amount of computing resources expected to be consumed by the various algorithms in a unit time of the first cycle. For ease of description, taking the algorithm set including a crowd flow analysis algorithm, a traffic recognition algorithm, a face analysis algorithm, and a behavior analysis algorithm as an example, the first total amount of computing resources actually consumed by the crowd flow analysis algorithm in a unit time of the first cycle can be recorded as The first total amount of computing resources actually consumed by the traffic recognition algorithm in the first cycle can be recorded as The first total amount of computing resources actually consumed by the face analysis algorithm in the first cycle can be recorded as The first total amount of computing resources actually consumed by the behavior analysis algorithm in the first cycle can be recorded as Similarly, the first total amount of computing resources that the traffic flow analysis algorithm is expected to consume per unit time in the first cycle can be recorded as The first total amount of computing resources that the traffic identification algorithm is expected to consume per unit time in the first cycle can be recorded as The first total amount of computing resources that the face analysis algorithm is expected to consume per unit time in the first cycle can be recorded as The first total amount of computing resources that the behavior analysis algorithm is expected to consume per unit time in the first cycle can be recorded as The same can be said for other situations, which will not be listed here one by one.
[0045] Step S32: Determine whether the deviation between the actual resource consumption and the planned resource consumption meets the preset conditions. If so, execute step S33; otherwise, execute step S35.
[0046] In an implementation scenario, when the actual resource consumption includes a first total amount of computing resources actually consumed by several algorithms within a unit time of a first cycle, and the planned resource consumption includes a second total amount of computing resources expected to be consumed by several algorithms within a unit time of the first cycle, the deviation value between the first total amount and the second total amount can be calculated as a proportion of the second total amount (i.e., |S1-S2| / S2) to obtain the deviation situation. Accordingly, the preset condition can be set to: the proportion is greater than a preset threshold, and the preset threshold can be set according to actual conditions, for example, it can be set to 10% to 15%, such as it can be specifically set to 10%, 11%, 12%, 13%, 14%, 15%, etc., which are not limited here.
[0047] In another implementation scenario, when the actual resource consumption situation may include a first total amount of computing resources actually consumed by several algorithms in a unit time of a first cycle, and the planned resource consumption situation may include a second total amount of computing resources expected to be consumed by several algorithms in a unit time of the first cycle, the proportion of the deviation value between the first total amount and the second total amount of each algorithm in the second total amount may be calculated to obtain the deviation of each algorithm. Accordingly, the preset condition may be set as: the proportion corresponding to any algorithm is greater than a preset threshold. The specific method of setting the preset threshold can be referred to the above description, which will not be repeated here.
[0048] It can be seen from this that when the deviation meets the preset conditions, it can be considered that the deviation between the actual resource consumption and the planned resource consumption is large, so it is necessary to dynamically adjust the resource planning scheme in subsequent cycles. Conversely, when the deviation does not meet the preset conditions, it can be considered that the deviation between the actual resource consumption and the planned resource consumption is within an acceptable range, so there is no need to dynamically adjust the resource planning scheme in subsequent cycles, and the current resource planning scheme can be used.
[0049] Step S33: Based on the first resource planning scheme and the actual resource consumption, several candidate resource planning schemes of the algorithm set in the second period are predicted.
[0050] Specifically, in order to improve the accuracy and efficiency of resource planning, the first resource planning scheme and the actual resource consumption can be input into the neural network for prediction to obtain several 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 can also include at least one of the following: the execution order of several algorithms in the second cycle, and the pre-allocated computing resources per unit time (e.g., seconds) for each algorithm in the algorithm set. For details, please refer to the relevant description in the aforementioned public embodiment, which will not be repeated here.
[0051] 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), etc., which are not limited here.
[0052] In another implementation scenario, in order to facilitate data processing, the neural network may further include a convolution layer and a pooling layer. The first resource planning scheme and the actual resource consumption may be respectively input into the convolution layer to extract data feature information, and then processed by the pooling layer to reduce the dimension of the extracted data feature information. In addition, in order to improve the learning rate, the input data may be normalized to a range of 0 to 1 before inputting into the convolution layer. Figure 4 , Figure 4 1 is a schematic diagram of the state of obtaining a candidate resource planning solution. Figure 4 As shown, for the convenience of description, the first resource planning scheme after dimensionality reduction can be recorded as h t-1 , the actual resource consumption after dimensionality reduction can be recorded as x t , the state information of LSTM can be recorded as S t-1 On this basis, the above h t-1 、x t and S t-1 Input LSTM for prediction, and use the LSTM forget gate function F to predict the first resource planning solution h after dimensionality reduction. t-1 Perform selective forgetting and combine the processing result with the state information S t-1 Multiply (i.e. Figure 4 ∏), and the actual resource consumption after dimensionality reduction can be recorded as x through the LSTM memory gate function i t Selectively memorize and add the processing result to the above multiplication result (i.e. Figure 4 ∑), and the addition result is exported to the state information S at the next moment tOn this basis, the derived gate function O uses the tanh activation function to reduce the dimension of the first resource planning scheme h t-1 Scaling is performed to calculate several candidate resource planning schemes h for the second cycle t .
[0053] Step S34: Based on the attribute information of the plurality of algorithms, a second resource planning scheme is selected from a plurality of candidate resource planning schemes.
[0054] Specifically, the utility of the candidate resource planning schemes can be obtained based on the attribute information of several algorithms, and the utility includes the total utility value of several algorithms when executing the candidate resource planning schemes. On this basis, a candidate resource planning scheme can be selected as the second resource planning scheme based on the utility of several candidate resource planning schemes. The above method obtains the utility of the candidate resource planning schemes based on the attribute information of several algorithms, and the utility includes the total utility value of several algorithms when executing the candidate resource planning schemes, and selects a candidate resource planning scheme as the second resource planning scheme based on the utility of several candidate resource planning schemes, that is, the second resource planning scheme is selected according to the total utility value of several algorithms under each candidate resource planning scheme, which is conducive to improving the accuracy and reliability of the second resource planning scheme.
[0055] In an implementation scenario, the candidate resource planning scheme with the largest total utility value can be specifically selected as the second resource planning scheme. Taking N candidate resource planning schemes as an example, by comparing the total utility values, it can be obtained that the total utility value of the i-th candidate resource planning scheme is the largest, and the i-th candidate resource planning scheme can be used as the second resource planning scheme for the second cycle. Other situations can be deduced by analogy, and no examples are given here one by one.
[0056] In an implementation scenario, as mentioned above, the attribute information may specifically include the algorithm call frequency and the algorithm requirement degree. On this basis, the first total utility value of the algorithm call frequency for several algorithm request candidate resource planning schemes can be obtained, and the second total utility value of the algorithm requirement degree for several algorithm request candidate resource planning schemes can be obtained, so that the first total utility value and the second total utility value can be weighted by using the first weight corresponding to the algorithm call frequency and the second weight corresponding to the algorithm requirement degree, respectively, to obtain the total utility value of several algorithms when executing the candidate resource planning scheme. In the above method, by obtaining the first total utility value of the algorithm call frequency for several algorithm request candidate resource planning schemes and the second total utility value of the algorithm requirement degree for several algorithm request candidate resource planning schemes, and using the first weight corresponding to the algorithm call frequency and the second weight corresponding to the algorithm requirement degree to weight the first total utility value and the second total utility value respectively to obtain the total utility value, a resource planning scheme with more scene adaptability and user experience can be selected from the perspectives of algorithm call frequency and algorithm requirement degree.
[0057] In a specific implementation scenario, the first total utility value is the sum of the normalized utility values of the algorithm call frequency for several algorithms requesting candidate resource planning solutions respectively. Still taking the algorithm set including the pedestrian flow analysis algorithm, the traffic recognition algorithm, the face analysis algorithm and the behavior analysis algorithm as an example, the first total utility value is the sum of the normalized utility value of the algorithm call frequency for the pedestrian flow analysis algorithm requesting candidate resource planning solutions, the normalized utility value of the traffic recognition algorithm requesting candidate resource planning solutions, the normalized utility value of the face analysis algorithm requesting candidate resource planning solutions, and the normalized utility value of the behavior analysis algorithm requesting candidate resource planning solutions. Other situations can be deduced by analogy, and examples are not given one by one here.
[0058] In another specific implementation scenario, the second total utility value is the sum of the normalized utility values of the algorithm demand levels for the candidate resource planning solutions requested by several algorithms respectively. Still taking the algorithm set including the pedestrian flow analysis algorithm, the traffic recognition algorithm, the face analysis algorithm and the behavior analysis algorithm as an example, the second total utility value is the sum of the normalized utility value of the algorithm demand levels for the candidate resource planning solutions requested by the pedestrian flow analysis algorithm, the normalized utility value of the candidate resource planning solutions requested by the traffic recognition algorithm, the normalized utility value of the candidate resource planning solutions requested by the face analysis algorithm and the normalized utility value of the candidate resource planning solutions requested by the behavior analysis algorithm. Other situations can be deduced by analogy and will not be given one by one here.
[0059] In another specific implementation scenario, in order to further improve the accuracy of the total utility value, the total cost value of several algorithms when executing the candidate resource planning scheme can be obtained, and the first total utility value and the second total utility value are weighted and summed using the first weight and the second weight to obtain the third total utility value of several algorithms when executing the candidate resource planning scheme. On this basis, the difference between the third total utility value and the total cost value can be used as the total utility value. The above method, by obtaining the total cost value of several algorithms when executing the candidate resource planning scheme, and using the first weight and the second weight to weight and sum the first total utility value and the second total utility value, obtains the third total utility value of several algorithms when executing the candidate resource planning scheme, and then uses the difference between the third total utility value and the total cost value as the total utility value, which can help improve the accuracy of the total utility value.
[0060] It should be noted that the utility value can include two aspects: algorithm execution speed and algorithm execution accuracy. Specifically, it can be measured by the ratio between the algorithm execution speed and algorithm execution accuracy and the computing resources required by the algorithm, that is, the fewer computing resources the algorithm consumes, the faster the algorithm execution speed, the higher the algorithm execution accuracy, and the higher the utility value; conversely, the more computing resources the algorithm consumes, the slower the algorithm execution speed, the lower the algorithm execution accuracy, and the lower the utility value. In contrast to the utility value, the cost value represents the negative impact of resource planning on algorithm execution. For example, the impact of the algorithm execution sequence included in the resource planning on the algorithm execution speed and algorithm execution accuracy, such as a 10% slowdown in speed and a 5% reduction in accuracy, is not limited here.
[0061] In addition, when the attribute information includes the algorithm call frequency and the algorithm requirement degree, the sum of the first weight corresponding to the algorithm call frequency and the second weight corresponding to the algorithm requirement degree may be 1. The specific values may be set according to the actual application situation. For example, when the algorithm call frequency has a greater impact on the total utility value, the first weight may be set slightly larger, such as the first weight may be set to 0.6 and the second weight may be set to 0.4; or, when the algorithm requirement degree has a greater impact on the total utility value, the second weight may be set slightly larger, such as the first weight may be set to 0.4 and the second weight may be set to 0.6. This is not limited here.
[0062] In another implementation scenario, in order to improve the comprehensiveness of the attribute information, the attribute information may also include other algorithm attributes in addition to the algorithm call frequency and the algorithm demand degree. For details, please refer to the relevant description in the aforementioned public embodiment, which will not be repeated here. On this basis, the third total utility value of other algorithm attributes for several algorithm request candidate resource planning schemes can also be obtained, so that the first total utility value, the second total utility value, and the third total utility value can be weighted using the first weight corresponding to the algorithm call frequency, the second weight corresponding to the algorithm demand degree, and the third weight corresponding to other algorithm attributes, respectively, to obtain the total utility value of several algorithms when executing the candidate resource planning scheme.
[0063] In a specific implementation scenario, similar to the first total utility value and the second total utility value, the third total utility value is the sum of the normalized utility values of other algorithm attributes for requesting candidate resource planning solutions for several algorithms respectively. Still taking the algorithm set including pedestrian flow analysis algorithm, traffic recognition algorithm, face analysis algorithm and behavior analysis algorithm as an example, the third total utility value is the sum of the normalized utility values of other algorithm attributes for requesting candidate resource planning solutions for the pedestrian flow analysis algorithm, the normalized utility values for requesting candidate resource planning solutions for the traffic recognition algorithm, the normalized utility values for requesting candidate resource planning solutions for the face analysis algorithm and the normalized utility values for requesting candidate resource planning solutions for the behavior analysis algorithm. Other situations can be deduced by analogy, and examples are not given one by one here.
[0064] In another specific implementation scenario, as mentioned above, the total cost value of several algorithms when executing the candidate resource planning scheme can be obtained, and the first total utility value, the second total utility value, and the third total utility value are weighted and summed using the first weight, the second weight, and the third weight, respectively, to obtain the third total utility value of several algorithms when executing the candidate resource planning scheme, and the 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, please refer to the above-mentioned related description, which will not be repeated here.
[0065] In addition, when the attribute information includes the algorithm call frequency, the algorithm requirement degree and other algorithm attributes, the sum of the first weight, the second weight and the third weight is 1. The specific values can be set according to the actual application situation. For example, when the algorithm call frequency has a greater impact on the total utility value, the first weight can be set to be slightly larger, such as setting the first weight to 0.6, setting the second weight to 0.2, and setting the third weight to 0.2; or, when the algorithm requirement degree has a greater impact on the total utility value, the second weight can be set to be slightly larger, such as setting the first weight to 0.2, setting the second weight to 0.6, and setting the third weight to 0.2; or, when other algorithm attributes have a greater impact on the total utility value, the third weight can be set to be slightly larger, such as setting the first weight to 0.2, setting the second weight to 0.2, and setting the third weight to 0.6, which is not limited here.
[0066] For the convenience of description, taking the algorithm set containing N algorithms as an example, the algorithm call frequency in the attribute information is recorded as k, the algorithm demand degree in the attribute information is recorded as q, and the other algorithm attributes in the attribute information are recorded as o. The normalized utility value of the algorithm call frequency k for the i-th algorithm requesting the j-th candidate resource planning solution is recorded as The normalized utility value of the algorithm demand degree q for the i-th algorithm requesting the j-th candidate resource planning solution is recorded as The normalized utility value of other algorithm attributes o for the i-th algorithm requesting the j-th candidate resource planning solution is recorded as Then the total utility value F corresponding to the jth candidate resource planning scheme is j It can be expressed as:
[0067]
[0068] In the above formula (1), W k represents the first weight, W q represents the second weight, W o represents the third weight, represents the first total utility value, represents the second total utility value, represents the third total utility value, ∑ i∈N E i,j Represents the total cost. On the basis that the sum of the first weight, the second weight and the third weight is 1, it can be judged whether each candidate resource planning scheme is equal to N (that is, the total number of several algorithms). If so, the candidate resource planning scheme can be considered to be the best scheme among several candidate resource planning schemes, that is, it can be used as the second resource planning scheme. If there is no candidate resource planning scheme with a total utility value equal to N, the candidate resource planning scheme with the largest total utility value can be used as the second resource planning scheme.
[0069] Step S35: Use the first resource planning solution as the second resource planning solution of the algorithm set in the second cycle.
[0070] As mentioned above, when the deviation does not meet the preset conditions, it can be considered that the deviation between the actual resource consumption and the planned resource consumption is within an acceptable range. Therefore, there is no need to dynamically adjust the resource planning scheme in subsequent cycles, and the current resource planning scheme (i.e., the first resource planning scheme) can be used.
[0071] Different from the aforementioned embodiment, based on the first resource planning scheme, the planned resource consumption of the algorithm set in the first period is obtained, and when the deviation between the actual resource consumption and the planned resource consumption meets the preset conditions, based on the first resource planning scheme and the actual resource consumption, several candidate resource planning schemes of the algorithm set in the second period are predicted, and on this basis, based on the attribute information of several algorithms, the second resource planning scheme is selected from several candidate resource planning schemes. Therefore, the resource planning scheme can be dynamically adjusted according to the actual situation throughout the life cycle, which is conducive to continuously improving the matching degree between the resource planning scheme and the actual situation, thereby improving the algorithm execution effect throughout the life cycle.
[0072] See also Figure 5 , Figure 5 This is a flow chart of another embodiment of the computing resource planning method of the present application. Specifically, it may include the following steps:
[0073] Step S501: Obtain the first resource planning scheme and actual resource consumption of the algorithm set in the Tth period.
[0074] In the embodiment of the present disclosure, the algorithm set includes several algorithms, and the first resource planning scheme includes schemes for using computing resources in the Tth period respectively planned for the several algorithms. For details, please refer to the relevant description in the above disclosed embodiment, which will not be repeated here.
[0075] Step S502: Input the first resource planning scheme and the actual resource consumption into the neural network for prediction, and obtain a number of candidate resource planning schemes Y = {X1, X2, ..., Xn} of the algorithm set in the T+1th cycle.
[0076] In the embodiment of the present disclosure, the candidate resource planning schemes include schemes for using computing resources in the T+1th cycle respectively planned by several algorithms. For details, please refer to the relevant description in the above disclosed embodiment, which will not be repeated here.
[0077] Step S503: Based on the attribute information of several algorithms, the utility of each candidate resource planning solution is obtained respectively.
[0078] In the embodiment of the present disclosure, the utility condition includes: the total utility value of several algorithms when executing the candidate resource planning scheme. For details, please refer to the relevant description in the above-mentioned embodiment of the disclosure, which will not be repeated here.
[0079] Step S504: Select the candidate resource planning scheme with the largest total utility value as the second resource planning scheme.
[0080] In the embodiment of the present disclosure, the second resource planning scheme includes schemes for using computing resources in the T+1th period that are planned for several algorithms respectively. For details, please refer to the relevant description in the aforementioned disclosed embodiment, which will not be repeated here.
[0081] Step S505: Make a computing power allocation decision based on the second resource planning solution.
[0082] Specifically, the second resource planning scheme can be parsed to obtain the planned resource consumption of several algorithms in the T+1 period and the execution sequence of several algorithms, so that several algorithms can be executed based on the parsed second resource planning scheme in the T+1 period.
[0083] Step S506: Based on the analyzed second resource planning solution, execute several algorithms in the T+1th cycle.
[0084] For details, please refer to the relevant description in the aforementioned disclosed embodiments, which will not be repeated here.
[0085] Step S507: Determine whether the deviation between the planned resource consumption and the actual resource consumption in the T+1th cycle meets the preset conditions. If so, execute step S508; otherwise, execute step S510.
[0086] As described in the aforementioned disclosed embodiments, when the deviation meets the preset conditions, it can be considered that the deviation between the actual resource consumption and the planned resource consumption in the T+1th period is large, so it is necessary to dynamically adjust the resource planning scheme in the subsequent T+2th period. Conversely, when the deviation does not meet the preset conditions, it can be considered that the deviation between the actual resource consumption and the planned resource consumption in the T+1th period is within an acceptable range, so there is no need to dynamically adjust the resource planning scheme in the subsequent T+2th period, and the resource planning scheme of the T+1th period can be used.
[0087] Step S508: Increase T by 1.
[0088] Specifically, add 1 to T, and it is now the T+2th cycle.
[0089] Step S509: re-execute step S501 and subsequent steps.
[0090] Specifically, since the deviation between the actual resource consumption and the planned resource consumption in the T+1th cycle is relatively large, it is necessary to re-execute the above step S501 and subsequent steps to dynamically adjust the resource planning scheme in the subsequent T+2th cycle.
[0091] Step S510: increase T by 1.
[0092] Specifically, add 1 to T, and it is now the T+2th cycle.
[0093] Step S511: Re-execute step S506.
[0094] Specifically, since the deviation between the actual resource consumption and the planned resource consumption in the T+1 period is within an acceptable range, there is no need to dynamically adjust the resource planning scheme in the subsequent T+2 period, and the resource planning scheme of the T+1 period can be used in the T+2 period.
[0095] Different from the aforementioned embodiments, by cycling back and forth throughout the entire life cycle, the resource planning scheme can be dynamically adjusted according to actual conditions, which is conducive to continuously improving the matching degree between the resource planning scheme and the actual conditions, thereby improving the algorithm execution effect throughout the entire life cycle.
[0096] See also Figure 6 , Figure 6 It is a schematic diagram of a framework of an embodiment of a computing resource planning device 60 of the present application. The computing resource planning device 60 includes a first cycle information acquisition module 61, which is used to obtain a first resource planning scheme and actual resource consumption of an algorithm set in a first cycle; wherein the algorithm set includes several algorithms, and the first resource planning scheme includes schemes for using computing resources in the first cycle respectively planned for the several algorithms, and the computing resource planning device 60 includes a second cycle scheme planning module 62, which is used to obtain a second resource planning scheme for the algorithm set based on the first resource planning scheme, the actual resource consumption and the attribute information of the several algorithms; wherein the second resource planning scheme includes schemes for using computing resources in the second cycle respectively planned for the several algorithms, and the second cycle is after the first cycle.
[0097] The above scheme obtains the first resource planning scheme and actual resource consumption of the algorithm set in the first cycle, and the algorithm set includes several algorithms. The first resource planning scheme includes schemes for using computing resources in the first cycle planned for the several algorithms respectively. On this basis, based on the first resource planning scheme, the actual resource consumption and attribute information of the several algorithms, the second resource planning scheme of the algorithm set is obtained, and the second resource planning scheme includes schemes for using computing resources in the second cycle after the first cycle planned for the several algorithms respectively. Therefore, computing resources can be dynamically planned for several algorithms in the algorithm set in each cycle, which can greatly improve the rationality of the computing resources planned for the algorithms and improve the algorithm execution effect.
[0098] In some disclosed embodiments, the second-cycle scheme planning module 62 includes a planned consumption acquisition submodule, which is used to obtain the planned resource consumption of the algorithm set in the first cycle based on the first resource planning scheme. The second-cycle scheme planning module 62 includes a candidate scheme prediction submodule, which is used to predict several candidate resource planning schemes of the algorithm set in the second cycle based on the first resource planning scheme and the actual resource consumption when the deviation between the actual resource consumption and the planned resource consumption meets the preset conditions. The second-cycle scheme planning module 62 includes a second-cycle scheme selection submodule, which is used to select a second resource planning scheme from several candidate resource planning schemes based on the attribute information of several algorithms.
[0099] Different from the aforementioned embodiment, based on the first resource planning scheme, the planned resource consumption of the algorithm set in the first period is obtained, and when the deviation between the actual resource consumption and the planned resource consumption meets the preset conditions, based on the first resource planning scheme and the actual resource consumption, several candidate resource planning schemes of the algorithm set in the second period are predicted, and on this basis, based on the attribute information of several algorithms, the second resource planning scheme is selected from several candidate resource planning schemes. Therefore, the resource planning scheme can be dynamically adjusted according to the actual situation throughout the life cycle, which is conducive to continuously improving the matching degree between the resource planning scheme and the actual situation, thereby improving the algorithm execution effect throughout the life cycle.
[0100] In some disclosed embodiments, the second-cycle scheme selection submodule includes a utility status acquisition unit, which is used to obtain the utility status of the candidate resource planning schemes based on the attribute information of several algorithms; wherein the utility status includes: the total utility value of several algorithms when executing the candidate resource planning schemes, and the second-cycle scheme selection submodule includes a planning scheme selection unit, which is used to select a candidate resource planning scheme as the second resource planning scheme based on the utility status of several candidate resource planning schemes.
[0101] Different from the aforementioned embodiment, the utility of the candidate resource planning scheme is obtained based on the attribute information of several algorithms, and the utility includes the total utility value of several algorithms when executing the candidate resource planning scheme, and based on the utility of several candidate resource planning schemes, one candidate resource planning scheme is selected as the second resource planning scheme, that is, the second resource planning scheme is selected according to the total utility value of several algorithms under each candidate resource planning scheme, which is conducive to improving the accuracy and reliability of the second resource planning scheme.
[0102] In some disclosed embodiments, the algorithm call frequency and the algorithm requirement degree; the utility situation acquisition unit includes a first utility acquisition sub-unit, which is used to obtain a first total utility value of the algorithm call frequency for several algorithms requesting candidate resource planning schemes, and the utility situation acquisition unit includes a second utility acquisition sub-unit, which is used to obtain a second total utility value of the algorithm requirement degree for several algorithms requesting candidate resource planning schemes, and the utility situation acquisition unit includes a total utility value calculation sub-unit, which is used to use a first weight corresponding to the algorithm call frequency and a second weight corresponding to the algorithm requirement degree to weight the first total utility value and the second total utility value respectively, so as to obtain the total utility value of several algorithms when executing the candidate resource planning schemes.
[0103] Different from the aforementioned embodiment, by obtaining the first total utility value of the algorithm calling frequency for several algorithm request candidate resource planning schemes and the second total utility value of the algorithm requirement degree for several algorithm request candidate resource planning schemes, and using the first weight corresponding to the algorithm calling frequency and the second weight corresponding to the algorithm requirement degree to weight the first total utility value and the second total utility value respectively to obtain the total utility value, it is possible to select a resource planning scheme with better scenario adaptability and user experience from the perspectives of algorithm calling frequency and algorithm requirement degree.
[0104] In some disclosed embodiments, the utility situation acquisition unit also includes a total cost value acquisition sub-unit, which is used to obtain the total cost values of several algorithms when executing the candidate resource planning scheme. The total utility value calculation sub-unit is specifically used to use the first weight and the second weight to perform weighted summation on the first total utility value and the second total utility value to obtain a third total utility value of the several algorithms when executing the candidate resource planning scheme, and use the difference between the third total utility value and the total cost value as the total utility value.
[0105] Different from the aforementioned embodiment, by obtaining total cost values of several algorithms when executing candidate resource planning schemes, and using the first weight and the second weight to perform weighted summation on the first total utility value and the second total utility value, a third total utility value of several algorithms when executing candidate resource planning schemes is obtained, and the difference between the third total utility value and the total cost value is used as the total utility value, which can help improve the accuracy of the total utility value.
[0106] In some disclosed embodiments, the first total utility value is the sum of the normalized utility values of the algorithm call frequency for the candidate resource planning solutions requested by the several algorithms; and / or, the second total utility value is the sum of the normalized utility values of the algorithm demand degree for the candidate resource planning solutions requested by the several algorithms; and / or, the sum of the first weight and the second weight is 1
[0107] In some disclosed embodiments, the planning scheme selection unit is specifically configured to select a candidate resource planning scheme with the largest total utility value as the second resource planning scheme.
[0108] Different from the above-mentioned embodiment, by selecting the candidate resource planning scheme with the largest total utility value as the second resource planning scheme, it is helpful to fully improve the execution effect of several algorithms in the second cycle.
[0109] In some disclosed embodiments, the candidate plan prediction submodule is specifically used to input the first resource planning plan and the actual resource consumption situation into the neural network for prediction to obtain several candidate resource planning plans.
[0110] Different from the aforementioned embodiment, by inputting the first resource planning scheme and the actual resource consumption situation into a neural network for prediction, a number of candidate resource planning schemes are obtained, which can help improve the accuracy and efficiency of resource planning.
[0111] In some disclosed embodiments, the second period plan module 62 further includes a plan update submodule for using the first resource plan as the second resource plan of the algorithm set in the second period when the deviation does not satisfy a preset condition.
[0112] Different from the aforementioned embodiments, it is possible to avoid performing computing resource planning when the deviation between the actual resource consumption and the planned resource consumption does not meet the preset conditions, thereby being helpful in reducing the load of the computing resource planning process and improving the reliability of the computing planning process.
[0113] In some disclosed embodiments, the actual resource consumption includes: a first total amount of computing resources actually consumed by several algorithms within a unit time of a first cycle, the planned resource consumption includes: a second total amount of computing resources expected to be consumed by several algorithms within a unit time of the first cycle, the deviation includes: the proportion of the deviation value between the first total amount and the second total amount in the second total amount, and the preset condition includes: the proportion is greater than a preset threshold.
[0114] See also Figure 7 , Figure 7 1 is a schematic diagram of a framework of an embodiment of an electronic device 70 of the present application. The electronic device 70 includes a memory 71 and a processor 72 coupled to each other, the memory 71 stores program instructions, and the processor 72 is used to execute the program instructions to implement the steps in any of the above computing resource planning method embodiments.
[0115] Specifically, the processor 72 is used to control itself and the memory 71 to implement the steps in any of the above-mentioned computing resource planning method embodiments. The processor 72 can also be called a CPU (Central Processing Unit). The processor 72 may be an integrated circuit chip with signal processing capabilities. The processor 72 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 72 can be implemented by multiple integrated circuit chips.
[0116] The above scheme can dynamically plan computing resources for several algorithms in the algorithm set in each cycle, thereby being helpful to greatly improve the rationality of the computing resources planned for the algorithm and to improve the algorithm execution effect.
[0117] See also Figure 8 , Figure 8 The schematic diagram of the framework of an embodiment of the storage device 80 of the present application. The storage device 80 stores program instructions 801 that can be executed by a processor, and the program instructions 801 are used to implement the steps in any of the above computing resource planning method embodiments.
[0118] The above scheme can dynamically plan computing resources for several algorithms in the algorithm set in each cycle, thereby being helpful to greatly improve the rationality of the computing resources planned for the algorithm and to improve the algorithm execution effect.
[0119] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0120] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0121] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0122] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
Claims
1. A computing resource planning method, characterized in that: include: Obtaining a first resource planning scheme and actual resource consumption of an algorithm set in a first cycle; wherein the algorithm set includes several algorithms, and the first resource planning scheme includes schemes for using computing resources in the first cycle that are respectively planned for the several algorithms; Based on the first resource planning scheme, obtaining the planned resource consumption of the algorithm set in the first period; Based on the first resource planning scheme and the actual resource consumption, predict and obtain several candidate resource planning schemes of the algorithm set in the second period; Based on the attribute information of the several algorithms, a second resource planning scheme for the algorithm set is selected from the several candidate resource planning schemes; wherein the attribute information includes: algorithm call frequency and algorithm demand degree, and the second resource planning scheme includes schemes for using computing resources in a second period planned for the several algorithms respectively, and the second period is after the first period.
2. The method according to claim 1, characterized in that The several candidate resource planning schemes are predicted when the deviation between the actual resource consumption and the planned resource consumption meets a preset condition; or, whether the deviation between the actual resource consumption and the planned resource consumption meets a preset condition is predicted based on the first resource planning scheme and the actual resource consumption, to obtain several candidate resource planning schemes of the algorithm set in the second period.
3. The method according to claim 1, characterized in that The selecting the second resource planning scheme from the plurality of candidate resource planning schemes based on the attribute information of the plurality of algorithms comprises: Based on the attribute information of the several algorithms, the utility of the candidate resource planning scheme is obtained; wherein the utility includes: the total utility value of the several algorithms when the candidate resource planning scheme is executed; Based on the utility of the several candidate resource planning solutions, one of the candidate resource planning solutions is selected as the second resource planning solution.
4. The method according to claim 2, characterized in that: The utility of the candidate resource planning schemes is obtained based on the attribute information of the plurality of algorithms, including: Obtaining a first total utility value of the algorithm calling frequency for requesting the candidate resource planning solutions for the plurality of algorithms; and, Obtaining a second total utility value of the algorithm requirement degree for requesting the candidate resource planning solutions from the plurality of algorithms; The first total utility value and the second total utility value are weighted respectively using the first weight corresponding to the algorithm call frequency and the second weight corresponding to the algorithm demand degree to obtain the total utility values of the several algorithms when executing the candidate resource planning schemes.
5. The method according to claim 4, characterized in that Before performing weighted processing on the first total utility value and the second total utility value using the first weight corresponding to the algorithm call frequency and the second weight corresponding to the algorithm demand degree to obtain the total utility values of the plurality of algorithms when executing the candidate resource planning scheme, the method further includes: Obtaining total cost values of the plurality of algorithms when executing the candidate resource planning solutions; The first total utility value and the second total utility value are weighted by using the first weight corresponding to the algorithm call frequency and the second weight corresponding to the algorithm demand degree to obtain the total utility values of the several algorithms when executing the candidate resource planning schemes, including: Using the first weight and the second weight to perform weighted summation on the first total utility value and the second total utility value, to obtain a third total utility value when the plurality of algorithms execute the candidate resource planning schemes; The difference between the third total utility value and the total cost value is taken as the total utility value.
6. The method according to claim 4, characterized in that The first total utility value is the sum of the normalized utility values of the algorithm call frequency for the several algorithms to respectively request the candidate resource planning solutions; And / or, the second total utility value is the sum of normalized utility values of the algorithm demand degree for the candidate resource planning solutions respectively requested by the several algorithms; And / or, the sum of the first weight and the second weight is 1.
7. The method according to claim 3, characterized in that The selecting one of the candidate resource planning schemes as the second resource planning scheme based on the utility of the plurality of candidate resource planning schemes comprises: The candidate resource planning scheme with the largest total utility value is selected as the second resource planning scheme.
8. The method according to claim 1, characterized in that The predicting of several 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 includes: The first resource planning scheme and the actual resource consumption situation are input into a neural network for prediction to obtain the several candidate resource planning schemes.
9. The method according to claim 1, characterized in that: The plurality of candidate resource planning schemes are predicted when the deviation between the actual resource consumption and the planned resource consumption meets a preset condition, and the method further includes: When the deviation does not satisfy the preset condition, the first resource planning scheme is used as the second resource planning scheme of the algorithm set in the second period.
10. The method according to claim 1, characterized in that The several candidate resource planning schemes are predicted when the deviation between the actual resource consumption and the planned resource consumption meets the preset conditions, the actual resource consumption includes: the first total amount of computing resources actually consumed by the several algorithms within the unit time of the first cycle, the planned resource consumption includes: the second total amount of computing resources expected to be consumed by the several algorithms within the unit time of the first cycle, the deviation includes: the proportion of the deviation value between the first total amount and the second total amount in the second total amount, and the preset conditions include: the proportion is greater than a preset threshold.
11. An electronic device, characterized in that: It comprises a memory and a processor coupled to each other, the memory stores program instructions, and the processor is used to execute the program instructions to implement the computing resource planning method according to any one of claims 1 to 10.
12. A storage device, characterized in that: Program instructions that can be executed by a processor are stored, and the program instructions are used to implement the computing resource planning method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Dynamic adjustment method and device for virtualized storage resources
CN104679444A
Task scheduling method, computer equipment and storage medium
CN112328378A