Resource allocation optimization method and device based on dynamic programming

Through the resource allocation optimization method based on dynamic programming, the AI ​​model is used to quantify device parameters and optimize resource allocation in heterogeneous GPU server clusters, solving the problem of inefficient resource allocation in heterogeneous environments, and achieving efficient and economical Resource configuration and cost optimization of AI applications.

CN118939413APending Publication Date: 2024-11-12GUANGDONG SOUTHERN PLANNING & DESIGNING INST OF TELECOM CONSULTATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410932710.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In heterogeneous GPU server clusters, it is difficult to achieve accurate and effective allocation of resource allocation by AI models, and traditional methods cannot meet complexity and computing resource requirements, resulting in inefficient resource allocation.

Method used

The resource allocation optimization method based on dynamic programming is adopted to quantify the target parameters of the equipment through the AI ​​model, determine the optimal operating parameters and resource configuration, optimize resource allocation, and improve the resource allocation accuracy and reliability of parallel operation of multiple devices.

Benefits of technology

It realizes efficient resource allocation of AI models in diversified devices, improves the accuracy and reliability of data allocation on multiple device pipelines, and provides a cost optimization solution for AI applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939413A_ABST
    Figure CN118939413A_ABST
Patent Text Reader

Abstract

The invention discloses a resource allocation optimization method and device based on dynamic planning, and the method comprises the steps: carrying out the quantification operation of parameters of each device based on an AI model, obtaining corresponding operation parameters, such as operation cost, thereby carrying out the optimization of the operation parameters (such as operation efficiency) of the AI model in diversified devices, and achieving the optimization of resource allocation. And according to the operation parameter, the equipment parameter and the operation condition corresponding to each piece of equipment, determining the optimal operation parameter when the plurality of pieces of equipment operate at the same time, so that the accuracy of resource allocation when the plurality of equipment assembly lines operate in parallel can be improved; according to the optimal operation parameters and operation conditions when all the devices operate at the same time and the operation parameters when each piece of data is subjected to parallel processing on each device, the optimal computing power resource which can be achieved when all the data is subjected to parallel processing on all the devices is determined; the accuracy and reliability of computing power resource allocation when the data runs on the multiple equipment assembly lines are improved, and therefore an efficient and economical resource allocation solution is provided for AI model application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of resource allocation, and in particular to a resource allocation optimization method and device based on dynamic programming. Background Art

[0002] With the rapid growth in computing power demand for computer applications such as artificial intelligence (AI) and big data, and the diversification of computing power application scenarios (for example, AI+education, AI+finance, etc.), the use of heterogeneous GPU servers containing different GPU types has become increasingly popular.

[0003] However, practice shows that because AI models have grown significantly in size and complexity and require a lot of computing resources for training and reasoning, their deployment in heterogeneous GPU server clusters faces unique challenges, especially in optimizing resource allocation. If traditional resource allocation methods continue to be applied to resource allocation in heterogeneous environments, accurate and effective allocation is often not achieved. Therefore, it is particularly important to propose a new method for resource allocation in heterogeneous environments to achieve a technical solution for accurate and effective resource allocation. Summary of the invention

[0004] The present invention provides a resource allocation optimization method and device based on dynamic programming, which can realize accurate and effective resource allocation.

[0005] A first aspect of an embodiment of the present invention discloses a resource allocation optimization method based on dynamic programming, the method comprising:

[0006] Based on the AI ​​model, a target parameter of each device that needs to participate in resource allocation is quantified to obtain the operating parameters of the AI ​​model when the device is running, where the target parameters of each device at least include the computing power parameters of the device and / or the bandwidth parameters of the device;

[0007] Determine, according to the operating parameters corresponding to each of the devices, the predetermined device parameters of each of the devices, and the predetermined operating conditions, the optimal operating parameters when the target devices to be resource allocated among all the devices are operating simultaneously;

[0008] Based on the optimal operating parameters when all the target devices are running simultaneously, the operating conditions and the operating parameters of each of the multiple data determined in advance when being processed in parallel on each of the devices, the optimal resources that can be achieved when all the data are processed in parallel on all the target devices are determined.

[0009] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the quantization operation is performed on the target parameters of each device that needs to participate in resource allocation based on the AI ​​model to obtain the operating parameters of the AI ​​model when the device is running, including:

[0010] For any device that needs to participate in resource allocation, based on the AI ​​model, a quantization operation is performed on each target parameter of the device to obtain an operating parameter of the target parameter when the AI ​​model is running on the device;

[0011] According to the operating parameters corresponding to all the target parameters, the operating parameters of the AI ​​model when the device is running are determined.

[0012] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the determining, according to the operating parameters corresponding to each of the devices in all of the devices, the predetermined device parameters of each of the devices, and the predetermined operating conditions, the optimal operating parameters of the target devices that need resource allocation in all of the devices when they are operating simultaneously includes:

[0013] Determine the device parameters of the current device to be allocated resources among all the devices from the device parameters corresponding to all the devices, and judge whether the device parameters of the current device meet the predetermined operating conditions;

[0014] When it is determined that the device parameters of the current device meet the operating conditions, determining whether the current device needs to be selected;

[0015] When it is determined that the current device needs to be selected, obtaining optimal operating parameters of devices in a first device group when they are simultaneously operating under the operating conditions, the first device group being all devices in all the devices for which resource allocation has been completed;

[0016] Based on the optimal operating parameters of the devices in the first device group when running simultaneously, the operating parameters corresponding to the current device and the operating conditions, the optimal operating parameters of all target devices that need resource allocation among the devices when running simultaneously are determined, and all the target devices include the current device and all devices in the first device group.

[0017] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the method further includes:

[0018] When it is determined that the current device does not need to be selected, the optimal operating parameters of the devices in the first device group when they are running simultaneously under the operating conditions are obtained as the optimal operating parameters when all target devices that need resource allocation among the devices are running simultaneously, wherein all the target devices include all devices in the first device group.

[0019] As an optional implementation manner, in the first aspect of the embodiment of the present invention, determining the optimal operating parameters of the target devices that need resource allocation in all the devices when they are running simultaneously according to the optimal operating parameters of the devices in the first device group when they are running simultaneously, the operating parameters corresponding to the current device, and the operating conditions, includes:

[0020] Analyzing the optimal operating parameters of the devices in the first device group when they are running under target operating conditions according to the operating conditions, the optimal operating parameters of the devices in the first device group when they are running simultaneously, and the operating parameters corresponding to the current device, wherein the target operating conditions are determined by the operating conditions and the device parameters of the current device;

[0021] Comparing the optimal operating parameters of the devices in the first device group when operating under the target operating conditions with the optimal operating parameters of the devices in the first device group when operating under the operating conditions simultaneously, to obtain an operation comparison result;

[0022] When the operation comparison result is used to indicate that the optimal operation parameters of the devices in the first device group when operating under the target operation conditions are less than or equal to the optimal operation parameters of the devices in the first device group when operating under the operation conditions simultaneously, determining that the optimal operation parameters of the devices in the first device group when operating under the target operation conditions are the optimal operation parameters of all the target devices to which resource allocation is required among the devices when operating simultaneously;

[0023] When the operation comparison result is used to indicate that the optimal operating parameters of the devices in the first device group when operating under the target operating conditions are greater than the optimal operating parameters of the devices in the first device group when operating simultaneously under the operating conditions, it is determined that the optimal operating parameters of the devices in the first device group when operating simultaneously under the operating conditions are the optimal operating parameters of all the target devices that require resource allocation among the devices when operating simultaneously.

[0024] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the device parameter of each of the devices is the rental fee of the device, the operation parameter corresponding to each of the devices is the operation time cost corresponding to the device, the operation condition is the expected rental fee corresponding to the current device, and the expected rental fee corresponding to the current device is less than the expected rental fees corresponding to all of the devices;

[0025] The step of determining whether the device parameters of the current device meet the predetermined operating conditions includes:

[0026] Determining whether the rental fee of the current device is less than or equal to the expected rental fee corresponding to the current device;

[0027] When the judgment result is no, determining that the device parameters of the current device do not meet the operating conditions;

[0028] When the judgment result is yes, it is determined that the device parameters of the current device meet the operating conditions.

[0029] As an optional implementation, in the first aspect of the embodiment of the present invention, the optimal operating parameter is the optimal operating time cost. When the rental fee of the current device is less than or equal to the expected rental fee corresponding to the current device and the current device needs to be selected, the calculation formula for the optimal operating time cost corresponding to all the target devices is:

[0030] DP [i][j] =min(DP [i-1][j] ,DP [i-1][j-ri] +t i );

[0031] Wherein, j is the expected rental fee corresponding to the current device, and the current device is the i-th device that needs resource allocation among all the devices; r i The rental cost of the current equipment; i DP is the running time cost corresponding to the current device; [i-1][j-ri] is the optimal operating time cost when the devices in the first device group are operating simultaneously under the condition that the rental cost of the current device is deducted from the expected rental cost corresponding to the current device; DP [i-1][j] is the optimal operating time cost when the devices in the first device group are operating simultaneously under the condition that the rental fee of the current device is not deducted from the expected rental fee corresponding to the current device; DP [i][j] The optimal runtime cost when all target devices that need resource allocation among the devices are running simultaneously;

[0032] When the rental fee of the current device is less than or equal to the expected rental fee corresponding to the current device and the current device does not need to be selected, the calculation formula for the optimal operating time cost corresponding to all the target devices is:

[0033] DP [i][j] =DP [i-1][j] ;

[0034] Among them, DP [i-1][j] is the optimal running time cost when the devices in the first device group are running simultaneously.

[0035] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the determining the optimal resources that can be achieved when all the data are processed in parallel on all the target devices according to the optimal operating parameters when all the target devices are running simultaneously, the operating conditions, and the predetermined operating parameters of each of the multiple data when they are processed in parallel on each of the devices, includes:

[0036] Determine the number of branches for parallel processing of all the data according to the expected rental fees corresponding to all the devices and the running time cost of each of the predetermined plurality of data when the data is run in parallel on each of the devices;

[0037] According to the expected rental fees corresponding to all the devices, the number of branches, and the optimal running time cost when all the target devices are running simultaneously, determine the optimal computing power that can be achieved when all the data are processed in parallel on all the target devices, and the optimal resource corresponding to all the data is the optimal computing power corresponding to all the data;

[0038] The calculation formula for the optimal computing power that can be achieved when all the data are processed in parallel on all the target devices is:

[0039] Value = min(DP [i][Rmax / n] ),n∈N;

[0040] Wherein, Value is the optimal computing power that can be achieved when all the data are processed in parallel on all the target devices under the condition of the expected rental fee corresponding to all the devices; Rmax is the expected rental fee corresponding to all the devices; n is the number of branches for all the data to be processed in parallel; N is the maximum number of branches when all the data are running in parallel on each device; DP [i][Rmax / n] The optimal runtime cost when all the data are executed on all the target devices simultaneously.

[0041] A second aspect of an embodiment of the present invention discloses a resource allocation optimization device based on dynamic programming, the device comprising:

[0042] A quantization module is used to quantify the target parameters of each device that needs to participate in resource allocation based on the AI ​​model to obtain the operating parameters of the AI ​​model when the device is running, and the target parameters of each device at least include the computing power parameters of the device and / or the bandwidth parameters of the device;

[0043] A determination module, configured to determine the optimal operating parameters of the target devices to be resource allocated among all the devices when they are operating simultaneously, based on the operating parameters corresponding to each of the devices, the predetermined device parameters of each of the devices, and the predetermined operating conditions;

[0044] The determination module is also used to determine the optimal resources that can be achieved when all the data are processed in parallel on all the target devices based on the optimal operating parameters when all the target devices are running simultaneously, the operating conditions, and the operating parameters of each of the multiple data determined in advance when they are processed in parallel on each device.

[0045] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the quantization module performs a quantization operation on the target parameters of each device that needs to participate in resource allocation based on the AI ​​model, and obtains the specific manner of the operating parameters of the AI ​​model when the device is running, including:

[0046] For any device that needs to participate in resource allocation, based on the AI ​​model, a quantization operation is performed on each target parameter of the device to obtain an operating parameter of the target parameter when the AI ​​model is running on the device;

[0047] According to the operating parameters corresponding to all the target parameters, the operating parameters of the AI ​​model when the device is running are determined.

[0048] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the specific manner in which the determination module determines the optimal operating parameters of the target devices that need resource allocation in all the devices when they are running simultaneously, according to the operating parameters corresponding to each of the devices in all the devices, the predetermined device parameters of each of the devices, and the predetermined operating conditions, includes:

[0049] Determine the device parameters of the current device to be allocated resources among all the devices from the device parameters corresponding to all the devices, and judge whether the device parameters of the current device meet the predetermined operating conditions;

[0050] When it is determined that the device parameters of the current device meet the operating conditions, determining whether the current device needs to be selected;

[0051] When it is determined that the current device needs to be selected, obtaining optimal operating parameters of devices in a first device group when they are simultaneously operating under the operating conditions, the first device group being all devices in all the devices for which resource allocation has been completed;

[0052] Based on the optimal operating parameters of the devices in the first device group when running simultaneously, the operating parameters corresponding to the current device and the operating conditions, the optimal operating parameters of all target devices that need resource allocation among the devices when running simultaneously are determined, and all the target devices include the current device and all devices in the first device group.

[0053] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the specific manner in which the determination module determines the optimal operating parameters of the target devices that need resource allocation among all the devices when they operate simultaneously according to the operating parameters corresponding to each of the devices among all the devices, the predetermined device parameters of each of the devices, and the predetermined operating conditions, further includes:

[0054] When it is determined that the current device does not need to be selected, the optimal operating parameters of the devices in the first device group when they are running simultaneously under the operating conditions are obtained as the optimal operating parameters when all target devices that need resource allocation among the devices are running simultaneously, wherein all the target devices include all devices in the first device group.

[0055] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the specific manner in which the determination module determines the optimal operating parameters of the target devices that need resource allocation in all the devices when they are running simultaneously, according to the optimal operating parameters of the devices in the first device group when they are running simultaneously, the operating parameters corresponding to the current device, and the operating conditions, includes:

[0056] Analyzing the optimal operating parameters of the devices in the first device group when they are running under target operating conditions according to the operating conditions, the optimal operating parameters of the devices in the first device group when they are running simultaneously, and the operating parameters corresponding to the current device, wherein the target operating conditions are determined by the operating conditions and the device parameters of the current device;

[0057] Comparing the optimal operating parameters of the devices in the first device group when operating under the target operating conditions with the optimal operating parameters of the devices in the first device group when operating under the operating conditions simultaneously, to obtain an operation comparison result;

[0058] When the operation comparison result is used to indicate that the optimal operation parameters of the devices in the first device group when operating under the target operation conditions are less than or equal to the optimal operation parameters of the devices in the first device group when operating under the operation conditions simultaneously, determining that the optimal operation parameters of the devices in the first device group when operating under the target operation conditions are the optimal operation parameters of all the target devices to which resource allocation is required among the devices when operating simultaneously;

[0059] When the operation comparison result is used to indicate that the optimal operating parameters of the devices in the first device group when operating under the target operating conditions are greater than the optimal operating parameters of the devices in the first device group when operating simultaneously under the operating conditions, it is determined that the optimal operating parameters of the devices in the first device group when operating simultaneously under the operating conditions are the optimal operating parameters of all the target devices that require resource allocation among the devices when operating simultaneously.

[0060] As an optional implementation, in the second aspect of the embodiment of the present invention, the device parameter of each of the devices is the rental fee of the device, the operating parameter corresponding to each of the devices is the operating time cost corresponding to the device, the operating condition is the expected rental fee corresponding to the current device, and the expected rental fee corresponding to the current device is less than the expected rental fees corresponding to all of the devices;

[0061] The specific manner in which the determination module determines whether the device parameters of the current device meet the predetermined operating conditions includes:

[0062] Determining whether the rental fee of the current device is less than or equal to the expected rental fee corresponding to the current device;

[0063] When the judgment result is no, determining that the device parameters of the current device do not meet the operating conditions;

[0064] When the judgment result is yes, it is determined that the device parameters of the current device meet the operating conditions.

[0065] As an optional implementation, in the second aspect of the embodiment of the present invention, the optimal operating parameter is the optimal operating time cost. When the rental fee of the current device is less than or equal to the expected rental fee corresponding to the current device and the current device needs to be selected, the calculation formula for the optimal operating time cost corresponding to all the target devices is:

[0066] DP [i][j] =min(DP [i-1][j] ,DP [i-1][j-ri] +t i );

[0067] Wherein, j is the expected rental fee corresponding to the current device, and the current device is the i-th device that needs resource allocation among all the devices; r i The rental cost of the current equipment; i DP is the running time cost corresponding to the current device; [i-1][j-ri] is the optimal operating time cost when the devices in the first device group are operating simultaneously under the condition that the rental cost of the current device is deducted from the expected rental cost corresponding to the current device; DP [i-1][j] is the optimal operating time cost when the devices in the first device group are operating simultaneously under the condition that the rental fee of the current device is not deducted from the expected rental fee corresponding to the current device; DP [i][j] The optimal runtime cost when all target devices that need resource allocation among the devices are running simultaneously;

[0068] When the rental fee of the current device is less than or equal to the expected rental fee corresponding to the current device and the current device does not need to be selected, the calculation formula for the optimal operating time cost corresponding to all the target devices is:

[0069] DP [i][j] =DP [i-1][j] ;

[0070] Among them, DP [i-1][j] is the optimal running time cost when the devices in the first device group are running simultaneously.

[0071] As an optional implementation manner, in the second aspect of the embodiment of the present invention, determining the optimal resources that can be achieved when all the data are processed in parallel on all the target devices according to the optimal operating parameters when all the target devices are running simultaneously, the operating conditions, and the predetermined operating parameters of each of the multiple data when they are processed in parallel on each of the devices, includes:

[0072] Determine the number of branches for parallel processing of all the data according to the expected rental fees corresponding to all the devices and the running time cost of each of the predetermined plurality of data when the data is run in parallel on each of the devices;

[0073] According to the expected rental fees corresponding to all the devices, the number of branches, and the optimal running time cost when all the target devices are running simultaneously, determine the optimal computing power that can be achieved when all the data are processed in parallel on all the target devices, and the optimal resource corresponding to all the data is the optimal computing power corresponding to all the data;

[0074] The calculation formula for the optimal computing power that can be achieved when all the data are processed in parallel on all the target devices is:

[0075] Value = min(DP [i][Rmax / n] ),n∈N;

[0076] Wherein, Value is the optimal computing power that can be achieved when all the data are processed in parallel on all the target devices under the condition of the expected rental fee corresponding to all the devices; Rmax is the expected rental fee corresponding to all the devices; n is the number of branches for all the data to be processed in parallel; N is the maximum number of branches when all the data are running in parallel on each device; DP [i][Rmax / n] The optimal runtime cost when all the data are executed on all the target devices simultaneously.

[0077] The third aspect of the present invention discloses another resource allocation optimization device based on dynamic programming, the device comprising:

[0078] A storage device storing executable program code;

[0079] a processor coupled to the storage device;

[0080] The processor calls the executable program code stored in the storage device to execute the resource allocation optimization method based on dynamic programming disclosed in the first aspect of the present invention.

[0081] The fourth aspect of the present invention discloses a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the resource allocation optimization method based on dynamic programming disclosed in the first aspect of the present invention.

[0082] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0083] In an embodiment of the present invention, based on an AI model, a target parameter of each device that needs to participate in resource allocation is quantified to obtain the operating parameters of the AI ​​model when the device is running, such as the operating cost, so as to optimize the operating parameters of the AI ​​model in diversified devices, such as the operating efficiency, and determine the optimal operating parameters of the target devices that need resource allocation in all devices when they are running simultaneously according to the operating parameters corresponding to each device in all devices, the predetermined device parameters of each device, and the predetermined operating conditions, which can improve the accuracy of resource allocation when multiple device pipelines are running in parallel, and then determine the optimal resources that can be achieved when all data are processed in parallel on all target devices according to the optimal operating parameters and operating conditions when all target devices are running simultaneously and the predetermined operating parameters of each of the multiple data when they are processed in parallel on each device, which improves the accuracy and reliability of resource allocation when data is running on multiple device pipelines, thereby providing an efficient and economical resource allocation solution for AI model applications, and further opening up a new perspective for cost optimization of AI applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0085] Figure 1 It is a flowchart of a resource allocation optimization method based on dynamic programming disclosed in an embodiment of the present invention;

[0086] Figure 2 It is a schematic diagram of the time cost distribution of an AI model disclosed in an embodiment of the present invention when running on multiple pipelines in parallel;

[0087] Figure 3 It is a structural schematic diagram of a resource allocation optimization device based on dynamic programming disclosed in an embodiment of the present invention;

[0088] Figure 4 It is a structural schematic diagram of another resource allocation optimization device based on dynamic programming disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0089] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0090] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or equipment that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or equipment.

[0091] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0092] The present invention discloses a resource allocation optimization method and device based on dynamic programming. Based on an AI model, the target parameters of each device that needs to participate in resource allocation are quantified to obtain the operating parameters of the AI ​​model when the device is running, such as the operating cost, so as to optimize the operating parameters of the AI ​​model in diversified devices, such as the operating efficiency, and determine the accuracy of the target device allocation that needs to be resource allocated in all devices according to the operating parameters corresponding to each device in all devices, the device parameters of each device determined in advance, and the operating conditions determined in advance. Then, according to the optimal operating parameters and operating conditions when all target devices are running at the same time, and the operating parameters of each of the predetermined multiple data when each data is processed in parallel on each device, the optimal resources that can be achieved when all data are processed in parallel on all target devices are determined, which improves the accuracy and reliability of resource allocation when data is running on multiple device pipelines, thereby opening up a new perspective for cost optimization of AI applications. The following are detailed descriptions.

[0093] Embodiment 1

[0094] See also Figure 1 , Figure 1 : is a flow chart of a resource allocation optimization method based on dynamic programming disclosed in an embodiment of the present invention. Figure 1 The described method can be implemented by a resource allocation device, and the resource allocation device can exist independently or be integrated in a resource allocation system, a resource allocation server or a resource allocation platform. Figure 1 As shown, the resource allocation optimization method based on dynamic programming may include the following operations:

[0095] 101. Based on the AI ​​model, quantify the target parameters of each device that needs to participate in resource allocation to obtain the operating parameters of the AI ​​model when the device is running. The target parameters of each device include at least the computing power parameters of the device and / or the bandwidth parameters of the device.

[0096] In an embodiment of the present invention, the target parameters of each device also include but are not limited to other parameters such as the memory capacity, storage type (such as SSD or HDD), processor type (such as CPU model) and network connection type (such as WIFI, ZigBee) of the device. In this way, the more types of devices are included, the more conducive it is to improve the evaluation accuracy of the operating parameters of the corresponding devices, thereby helping to improve the accuracy of the allocation of the optimal operating parameters of the device pipeline parallel and the optimal computing resources of the data parallel. Among them, the operating parameters corresponding to each device include the operating cost, and further, the operating performance; the optimal operating parameters include the optimal operating cost, and further, the optimal operating performance. Further optionally, in the process of quantifying the target parameters of the device, the operating characteristics of the AI ​​model are also taken into consideration to more accurately evaluate the performance of different devices in specific AI tasks and provide key decision support for subsequent optimization. Among them, the AI ​​model can be any model, such as a computing power-intensive AI model.

[0097] In the embodiment of the present invention, optionally, before performing parameter optimization, the target parameters of each device may be recorded in a table form, that is, a basic information query table is constructed to facilitate query and application of the parameters.

[0098] 102. Determine optimal operating parameters when target devices requiring resource allocation among all devices are operating simultaneously, based on operating parameters corresponding to each device among all devices, predetermined device parameters of each device, and predetermined operating conditions.

[0099] In the embodiment of the present invention, optionally, Figure 2 is a schematic diagram of the time cost distribution of an AI model disclosed in an embodiment of the present invention when running on multiple pipelines in parallel, such as Figure 2 As shown, it includes multiple parallel pipelines, each parallel pipeline is composed of multiple target devices, and the present application is described based on one of the parallel pipelines.

[0100] 103. Determine the optimal resources that can be achieved when all data are processed in parallel on all target devices based on the optimal operating parameters and operating conditions when all target devices are running simultaneously and the predetermined operating parameters when each of the multiple data is processed in parallel on each device.

[0101] It can be seen that implementation Figure 1The described resource allocation optimization method based on dynamic programming is based on an AI model, and quantifies the target parameters of each device that needs to participate in resource allocation to obtain the operating parameters of the AI ​​model when the device is running, such as the operating cost, so as to optimize the operating parameters of the AI ​​model in diversified devices, such as the operating efficiency, and determine the optimal operating parameters of the target devices that need resource allocation in all devices when they are running simultaneously according to the operating parameters corresponding to each device in all devices, the predetermined device parameters of each device, and the predetermined operating conditions, which can improve the accuracy of resource allocation when multiple device pipelines are running in parallel, and then determine the optimal resources that can be achieved when all data are processed in parallel on all target devices according to the optimal operating parameters and operating conditions when all target devices are running at the same time and the predetermined operating parameters of each of the multiple data when they are processed in parallel on each device, which improves the accuracy and reliability of resource allocation when data is running on multiple device pipelines, thereby opening up a new perspective for cost optimization of AI applications.

[0102] In the embodiment of the present invention, optionally, based on the AI ​​model, a quantization operation is performed on the target parameters of each device that needs to participate in resource allocation to obtain the operating parameters of the AI ​​model when the device is running, including:

[0103] For any device that needs to participate in resource allocation, based on the AI ​​model, a quantization operation is performed on each target parameter of the device to obtain the operating parameters of the target parameter of the AI ​​model when the device is running; based on the operating parameters corresponding to all target parameters, the operating parameters of the AI ​​model when the device is running are determined.

[0104] It can be seen that the embodiment of the present invention comprehensively determines the operating parameters of the AI ​​model when it is running on the device based on the quantization result of the AI ​​model performing a quantization operation on each parameter of the device, and can reflect the unified evaluation standard of the time consumption differences of different devices when performing AI tasks, so as to achieve comparison and evaluation of the operating parameter costs of various devices under a common framework, and realize the accuracy and reliability of determining the corresponding operating parameters of the device.

[0105] In the embodiment of the present invention, optionally, determining the optimal operating parameters of the target devices that need resource allocation among all the devices when they are operating simultaneously according to the operating parameters corresponding to each device among all the devices, the predetermined device parameters of each of the devices, and the predetermined operating conditions includes:

[0106] Determine the device parameters of the current device to be allocated resources among all the devices from the device parameters corresponding to all the devices, and judge whether the device parameters of the current device meet the predetermined operating conditions;

[0107] When it is determined that the device parameters of the current device meet the operating conditions, determining whether the current device needs to be selected;

[0108] When it is determined that the current device needs to be selected, obtaining optimal operating parameters of devices in a first device group when they are simultaneously operating under the operating conditions, the first device group being all devices in all devices for which resource allocation has been completed;

[0109] Determine, based on the optimal operating parameters of the devices in the first device group when they are operating simultaneously, the operating parameters and operating conditions corresponding to the current device, the optimal operating parameters of the target devices that need resource allocation among all the devices when they are operating simultaneously, and all the target devices include the current device and all the devices in the first device group;

[0110] Further optionally, when it is determined that the current device does not need to be selected, the optimal operating parameters of the devices in the first device group when they are running simultaneously under the operating conditions are obtained as the optimal operating parameters of the target devices that require resource allocation among all devices when they are running simultaneously, wherein all target devices include all devices in the first device group.

[0111] In the embodiment of the present invention, optionally, when it is determined that the corresponding operating condition is not met, the resource allocation process corresponding to the current device is terminated, and the resource allocation calculation for the next device is continued.

[0112] Further optionally, the device parameter of each device is the rental fee of the device, the operating parameter corresponding to each device is the operating time cost corresponding to the device, the above operating condition is the expected rental fee corresponding to the current device, and the expected rental fee corresponding to the current device is less than the expected rental fees corresponding to all devices; wherein, optionally, judging whether the device parameter of the current device meets the predetermined operating condition includes:

[0113] Determine whether the rental fee of the current equipment is less than or equal to the expected rental fee corresponding to the current equipment;

[0114] When the judgment result is no, it is determined that the device parameters of the current device do not meet the operating conditions;

[0115] When the judgment result is yes, it is determined that the device parameters of the current device meet the operating conditions.

[0116] It can be seen that in the embodiment of the present invention, for a device that currently needs to be allocated resources, when its device parameters meet the corresponding operating conditions and the device needs to be selected, the operating parameters and operating conditions corresponding to the current device are combined with the optimal operating parameters corresponding to all devices that have completed resource classification to determine the optimal operating parameters when all devices are running at the same time, such as the optimal operating time cost, which can improve the accuracy of determining the optimal operating parameters; if the current device does not need to be selected, the original optimal operating parameters continue to be used, ensuring the accuracy of optimal resource allocation during subsequent data parallelism.

[0117] In the embodiment of the present invention, further optionally, determining the optimal operating parameters of the target devices to be resource allocated among all the devices when they are running simultaneously according to the optimal operating parameters of the devices in the first device group when they are running simultaneously, the operating parameters and operating conditions corresponding to the current device, includes:

[0118] Analyzing the optimal operating parameters of the devices in the first device group when they are operated under target operating conditions according to the operating conditions, the optimal operating parameters of the devices in the first device group when they are operated simultaneously, and the operating parameters corresponding to the current device; the target operating conditions are determined by the operating conditions and the device parameters of the current device;

[0119] Comparing the optimal operating parameters of the devices in the first device group when they are operating under the target operating conditions with the optimal operating parameters of the devices in the first device group when they are operating under the operating conditions simultaneously, to obtain an operation comparison result;

[0120] When the operation comparison result is used to indicate that the optimal operation parameters of the devices in the first device group when operating under the target operation conditions are less than or equal to the optimal operation parameters of the devices in the first device group when the operation conditions are simultaneously operated, determining that the optimal operation parameters of the devices in the first device group when operating under the target operation conditions are the optimal operation parameters of the target devices that need to be allocated resources among all the devices when operating simultaneously;

[0121] When the operation comparison result is used to indicate that the optimal operating parameters of the devices in the first device group when operating under the target operating conditions are greater than the optimal operating parameters of the devices in the first device group when the operating conditions are simultaneously operated, it is determined that the optimal operating parameters of the devices in the first device group when the operating conditions are simultaneously operated are the optimal operating parameters of the target devices that require resource allocation among all devices when they are simultaneously operated.

[0122] In the embodiment of the present invention, optionally, the above-mentioned optimal operating parameter is the optimal operating time cost. When the rental cost of the current device is less than or equal to the expected rental cost corresponding to the current device and the current device needs to be selected, the calculation formula of the optimal operating time cost corresponding to all target devices is:

[0123] DP [i][j] =min(DP [i-1][j],DP [i-1][j-ri] +t i );

[0124] Among them, j is the expected rental fee corresponding to the current device, and the current device is the i-th device that needs resource allocation among all devices; r i is the current equipment rental cost; i is the running time cost corresponding to the current device; DP [i-1][j-ri] DP is the optimal operating time cost when the devices in the first device group are running simultaneously under the condition that the rental cost of the current device is deducted from the expected rental cost corresponding to the current device; [i-1][j] DP is the optimal operating time cost when the devices in the first device group are running simultaneously without deducting the rental cost of the current device from the expected rental cost corresponding to the current device; [i][j] The optimal runtime cost when the target devices that need resource allocation in the device are running simultaneously;

[0125] When the rental cost of the current device is less than or equal to the expected rental cost of the current device and the current device does not need to be selected, the calculation formula for the optimal running time cost of all target devices is:

[0126] DP [i][j] =DP [i-1][j] ;

[0127] Among them, DP [i-1][j] is the optimal operating time cost when the devices in the first device group operate simultaneously.

[0128] It can be seen that in the embodiment of the present invention, when it is necessary to select the current device, the optimal operating parameters (such as the optimal operating time cost) of all devices to which resources have been allocated are calculated under the condition of adding the parameters of the current device (such as the rental fee and the operating time cost), and the optimal operating parameters are compared with the optimal operating parameters under the condition of not adding the parameters of the current device. The smaller optimal operating parameter of the two is determined as the optimal operating parameter for all devices to run simultaneously when the current device is added, thereby improving the accuracy and reliability of determining the optimal operating parameters for all devices to run simultaneously when the current device is added, which is beneficial to improving the analysis accuracy of parallel processing of multiple data blocks on multiple devices, and further beneficial to improving the accuracy of allocation of optimal resources for parallel data processing.

[0129] In the embodiment of the present invention, further optionally, according to the optimal operating parameters and operating conditions when all target devices are running simultaneously and the operating parameters of each of the predetermined multiple data when being processed in parallel on each device, determining the optimal resources that can be achieved when all data are processed in parallel on all target devices includes:

[0130] Determine the number of branches for parallel processing of all data according to the expected rental fees corresponding to all devices and the running time cost of each of the predetermined multiple data when running in parallel on each device;

[0131] Based on the expected rental fees, number of branches, and optimal runtime costs of all target devices when running simultaneously, determine the optimal computing power that can be achieved when all data is processed in parallel on all target devices. The optimal resource for all data is the optimal computing power for all data.

[0132] The calculation formula for the optimal computing power that can be achieved when all data is processed in parallel on all target devices is:

[0133] Value = min(DP [i][Rmax / n] ),n∈N;

[0134] Among them, Value is the optimal computing power that can be achieved when all data are processed in parallel on all the target devices; Rmax is the expected rental fee corresponding to all devices; the current device is the i-th device that needs resource allocation among all devices; n is the number of branches for all data to be processed in parallel; N is the maximum number of branches when all data are running in parallel on each device; DP [i][Rmax / n] The optimal runtime cost for all said data when running on all target devices simultaneously.

[0135] In the embodiment of the present invention, optionally, Figure 2 As shown, the data is loaded and preprocessed, divided into multiple data, and the number of data parallel branches is determined based on the expected rental fees corresponding to all devices and the running time cost (the same) of each data when it is parallel on each target device, as shown in Figure 2 As shown, it is divided into 2 branches, and the number of branches is the same as the number of data blocks. Then, based on the expected rental fees corresponding to all devices, the number of branches, and the optimal running time cost when all target devices are running at the same time, the optimal computing power that can be achieved when all data is processed in parallel on all target devices is determined, including the transmission time-consuming computing power, the calculation time-consuming computing power, and further, the parameter synchronization time-consuming computing power of multiple data on each pipeline.

[0136] It can be seen that after obtaining the optimal running time cost of the parallel pipeline of all devices, the embodiment of the present invention comprehensively determines the optimal allocation of computing power that can be achieved when all data blocks are processed in parallel on the pipeline composed of all devices based on the optimal running time cost, the expected rental fee and the running time cost of a single data on each device. It not only takes into account the performance and cost of a single device, but also comprehensively considers the overall computing power requirements and budget constraints under the data parallel architecture, thereby providing a resource allocation solution that is both efficient and economical for the application of AI models.

[0137] Embodiment 2

[0138] See also Figure 3 , Figure 3 is a schematic diagram of a resource allocation optimization device based on dynamic programming disclosed in an embodiment of the present invention. Figure 3 As shown, the resource allocation optimization device based on dynamic programming may include:

[0139] A quantization module 201 is used to quantify the target parameters of each device that needs to participate in resource allocation based on the AI ​​model to obtain the operating parameters of the AI ​​model when the device is running. The target parameters of each device include at least the computing power parameters of the device and / or the bandwidth parameters of the device.

[0140] A determination module 202, configured to determine the optimal operating parameters of the target devices to be resource allocated among all the devices when they are operating simultaneously, based on the operating parameters corresponding to each device among all the devices, the predetermined device parameters of each device, and the predetermined operating conditions;

[0141] The determination module 202 is also used to determine the optimal resources that can be achieved when all data are processed in parallel on all target devices based on the optimal operating parameters and operating conditions when all target devices are running simultaneously and the operating parameters of each of the multiple data determined in advance when they are processed in parallel on each device.

[0142] It can be seen that implementation Figure 3 The described resource allocation optimization device based on dynamic programming is based on an AI model, and performs quantification operations on the target parameters of each device that needs to participate in resource allocation to obtain the operating parameters of the AI ​​model when the device is running, such as the operating cost, so as to optimize the operating parameters of the AI ​​model in diversified devices, such as the operating efficiency, and determine the optimal operating parameters of the target devices that need resource allocation in all devices when they are running simultaneously according to the operating parameters corresponding to each device in all devices, the predetermined device parameters of each device, and the predetermined operating conditions, which can improve the accuracy of resource allocation when multiple device pipelines are running in parallel, and then determine the optimal resources that can be achieved when all data are processed in parallel on all target devices according to the optimal operating parameters and operating conditions when all target devices are running at the same time and the predetermined operating parameters of each of the multiple data when processed in parallel on each device, which improves the accuracy and reliability of resource allocation when data is running on multiple device pipelines, thereby opening up a new perspective for cost optimization of AI applications.

[0143] In the implementation of the present invention, optionally, the quantization module 201 performs a quantization operation on the target parameters of each device that needs to participate in resource allocation based on the AI ​​model, and obtains the specific manner of the operating parameters of the AI ​​model when the device is running, including:

[0144] For any device that needs to participate in resource allocation, based on the AI ​​model, a quantization operation is performed on each target parameter of the device to obtain the operating parameters of the target parameter of the AI ​​model when the device is running; based on the operating parameters corresponding to all target parameters, the operating parameters of the AI ​​model when the device is running are determined.

[0145] It can be seen that implementation Figure 3 The described device can also comprehensively determine the operating parameters of the AI ​​model when it is running on the device based on the quantization results of the quantization operation performed by the AI ​​model on each parameter of the device, and can reflect the unified evaluation standards for the time consumption differences of different devices when performing AI tasks, so as to achieve comparison and evaluation of the operating parameter costs of various devices under a common framework, and realize the accuracy and reliability of determining the corresponding operating parameters of the equipment.

[0146] In the embodiment of the present invention, further optionally, the specific manner in which the determination module 202 determines the optimal operating parameters when the target devices that need resource allocation among all the devices are running simultaneously according to the operating parameters corresponding to each device among all the devices, the predetermined device parameters of each of the devices, and the predetermined operating conditions includes:

[0147] Determine the device parameters of the current device to be allocated resources among all the devices from the device parameters corresponding to all the devices, and judge whether the device parameters of the current device meet the predetermined operating conditions;

[0148] When it is determined that the device parameters of the current device meet the operating conditions, determining whether the current device needs to be selected;

[0149] When it is determined that the current device needs to be selected, obtaining optimal operating parameters of devices in a first device group when they are simultaneously operating under the operating conditions, the first device group being all devices in all devices for which resource allocation has been completed;

[0150] According to the optimal operating parameters of the devices in the first device group when they are running simultaneously, the operating parameters and operating conditions corresponding to the current device, the optimal operating parameters of the target devices that need resource allocation among all devices when they are running simultaneously are determined, and all target devices include the current device and all devices in the first device group.

[0151] Further optionally, the specific manner in which the determination module 202 determines the optimal operating parameters when the target devices to be resource allocated among all the devices are running simultaneously according to the operating parameters corresponding to each device among all the devices, the predetermined device parameters of each of the devices, and the predetermined operating conditions, further includes:

[0152] When it is determined that the current device does not need to be selected, the optimal operating parameters of the devices in the first device group when they are running simultaneously under the operating conditions are obtained as the optimal operating parameters of the target devices that need resource allocation among all devices when they are running simultaneously, wherein all target devices include all devices in the first device group.

[0153] In the embodiment of the present invention, further optionally, the device parameter of each of the devices is the rental fee of the device, the operating parameter corresponding to each of the devices is the operating time cost corresponding to the device, the operating condition is the expected rental fee corresponding to the current device, and the expected rental fee corresponding to the current device is less than the expected rental fees corresponding to all of the devices;

[0154] The specific manner in which the determination module 202 determines whether the device parameters of the current device meet the predetermined operating conditions includes:

[0155] Determining whether the rental fee of the current device is less than or equal to the expected rental fee corresponding to the current device;

[0156] When the judgment result is no, determining that the device parameters of the current device do not meet the operating conditions;

[0157] When the judgment result is yes, it is determined that the device parameters of the current device meet the operating conditions.

[0158] It can be seen that implementation Figure 3 The described device can also determine the optimal operating parameters when all devices are running simultaneously, such as the optimal operating time cost, by combining the operating parameters and operating conditions corresponding to the current device with the optimal operating parameters corresponding to all devices that have completed resource classification when the device currently needs to allocate resources and its device parameters meet the corresponding operating conditions and the device needs to be selected. This can improve the accuracy of determining the optimal operating parameters; if the current device does not need to be selected, the original optimal operating parameters continue to be used, ensuring the accuracy of optimal resource allocation during subsequent data parallelism.

[0159] In the embodiment of the present invention, further optionally, the specific manner in which the determination module 202 determines the optimal operating parameters of the target devices to be resource allocated among all the devices when they are simultaneously operating according to the optimal operating parameters of the devices in the first device group when they are simultaneously operating, the operating parameters and operating conditions corresponding to the current device, includes:

[0160] Analyzing the optimal operating parameters of the devices in the first device group when they are operated under target operating conditions according to the operating conditions, the optimal operating parameters of the devices in the first device group when they are operated simultaneously, and the operating parameters corresponding to the current device; the target operating conditions are determined by the operating conditions and the device parameters of the current device;

[0161] Comparing the optimal operating parameters of the devices in the first device group when they are operating under the target operating conditions with the optimal operating parameters of the devices in the first device group when they are operating under the operating conditions simultaneously, to obtain an operation comparison result;

[0162] When the operation comparison result is used to indicate that the optimal operation parameters of the devices in the first device group when operating under the target operation conditions are less than or equal to the optimal operation parameters of the devices in the first device group when the operation conditions are simultaneously operated, determining that the optimal operation parameters of the devices in the first device group when operating under the target operation conditions are the optimal operation parameters of the target devices that need to be allocated resources among all the devices when operating simultaneously;

[0163] When the operation comparison result is used to indicate that the optimal operating parameters of the devices in the first device group when operating under the target operating conditions are greater than the optimal operating parameters of the devices in the first device group when the operating conditions are simultaneously operated, it is determined that the optimal operating parameters of the devices in the first device group when the operating conditions are simultaneously operated are the optimal operating parameters of the target devices that require resource allocation among all devices when they are simultaneously operated.

[0164] In the embodiment of the present invention, optionally, the above-mentioned optimal operating parameter is the optimal operating time cost. When the rental cost of the current device is less than or equal to the expected rental cost corresponding to the current device and the current device needs to be selected, the calculation formula of the optimal operating time cost corresponding to all target devices is:

[0165] DP [i][j] =min(DP [i-1][j] ,DP [i-1][j-ri] +t i );

[0166] Among them, j is the expected rental fee corresponding to the current device, and the current device is the i-th device that needs resource allocation among all devices; r i is the current equipment rental cost; i is the running time cost corresponding to the current device; DP [i-1][j-ri] DP is the optimal operating time cost when the devices in the first device group are running simultaneously under the condition that the rental cost of the current device is deducted from the expected rental cost corresponding to the current device; [i-1][j] DP is the optimal operating time cost when the devices in the first device group are running simultaneously without deducting the rental cost of the current device from the expected rental cost corresponding to the current device; [i][j]The optimal runtime cost when the target devices that need resource allocation in the device are running simultaneously;

[0167] When the rental cost of the current device is less than or equal to the expected rental cost of the current device and the current device does not need to be selected, the calculation formula for the optimal running time cost of all target devices is:

[0168] DP [i][j] =DP [i-1][j] ;

[0169] Among them, DP [i-1][j] is the optimal operating time cost when the devices in the first device group operate simultaneously.

[0170] It can be seen that implementation Figure 3 The described device can also, when it is necessary to select the current device, calculate the optimal operating parameters (such as optimal operating time cost) of all devices to which resources have been allocated under the condition of adding the parameters of the current device (such as rental fees and operating time costs), and compare them with the optimal operating parameters under the condition of not adding the parameters of the current device. The smaller of the two optimal operating parameters is determined as the optimal operating parameter for all devices to run simultaneously when the current device is added, thereby improving the accuracy and reliability of determining the optimal operating parameters for all devices to run simultaneously when the current device is added, which is beneficial to improving the analysis accuracy of parallel processing of multiple data blocks on multiple devices, and further beneficial to improving the accuracy of allocation of optimal resources for parallel data processing.

[0171] In the embodiment of the present invention, optionally, the determination module 202 determines the specific manner of the optimal resources that can be achieved when all data are processed in parallel on all target devices according to the optimal operating parameters and operating conditions when all target devices are running simultaneously and the operating parameters of each of the predetermined multiple data when they are processed in parallel on each device, including:

[0172] Determine the number of branches for parallel processing of all data according to the expected rental fees corresponding to all devices and the running time cost of each of the predetermined multiple data when running in parallel on each device;

[0173] Based on the expected rental fees, number of branches, and optimal runtime costs of all target devices when running simultaneously, determine the optimal computing power that can be achieved when all data is processed in parallel on all target devices. The optimal resource for all data is the optimal computing power for all data.

[0174] The calculation formula for the optimal computing power that can be achieved when all data is processed in parallel on all target devices is:

[0175]

[0176] Among them, Value is the optimal computing power that can be achieved when all data are processed in parallel on all the target devices; Rmax is the expected rental fee corresponding to all devices; the current device is the i-th device that needs resource allocation among all devices; n is the number of branches for all data to be processed in parallel; N is the maximum number of branches when all data are running in parallel on each device; The optimal runtime cost for all said data when running on all target devices simultaneously.

[0177] It can be seen that implementation Figure 3 The described device can also, after obtaining the optimal running time cost of all device pipelines in parallel, comprehensively determine the optimal computing power allocation plan that can be achieved when all data blocks are processed in parallel on the pipeline composed of all devices based on the optimal running time cost, the expected rental fee and the running time cost of a single data on each device. It not only takes into account the performance and cost of a single device, but also comprehensively considers the overall computing power requirements and budget constraints under the data parallel architecture, thereby providing a resource allocation solution for the application of AI models that is both efficient and economical.

[0178] Embodiment 3

[0179] See also Figure 4 , Figure 4 is another resource allocation optimization device based on dynamic programming disclosed in an embodiment of the present invention. Figure 4 As shown, the resource allocation optimization device based on dynamic programming may include:

[0180] A storage device 301 storing executable program codes;

[0181] A processor 302 coupled to the storage 301;

[0182] Furthermore, it may also include an input interface 303 and an output interface 304 coupled to the processor 302;

[0183] The processor 302 calls the executable program code stored in the storage 301 to execute the steps of the resource allocation optimization method based on dynamic programming described in the first embodiment.

[0184] Embodiment 4

[0185] An embodiment of the present invention discloses a computer storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute the steps of the resource allocation optimization method based on dynamic programming described in the first embodiment.

[0186] Embodiment 5

[0187] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps in the resource allocation optimization method based on dynamic programming described in the first embodiment.

[0188] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0189] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, a magnetic disk storage, a magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0190] Finally, it should be noted that the resource allocation optimization method and device based on dynamic programming disclosed in the embodiment of the present invention only discloses the preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, ordinary technicians in this field should understand that it is still possible to modify the technical solutions recorded in the aforementioned embodiments, or to replace some of the technical features therein by equivalents. However, these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A resource allocation optimization method based on dynamic programming, characterized in that: The method comprises: Based on the AI ​​model, a target parameter of each device that needs to participate in resource allocation is quantified to obtain the operating parameters of the AI ​​model when the device is running, where the target parameters of each device at least include the computing power parameters of the device and / or the bandwidth parameters of the device; Determine, according to the operating parameters corresponding to each of the devices, the predetermined device parameters of each of the devices, and the predetermined operating conditions, the optimal operating parameters when the target devices to be resource allocated among all the devices are operating simultaneously; Based on the optimal operating parameters when all the target devices are running simultaneously, the operating conditions and the operating parameters of each of the multiple data determined in advance when being processed in parallel on each of the devices, the optimal resources that can be achieved when all the data are processed in parallel on all the target devices are determined.

2. The resource allocation optimization method based on dynamic programming according to claim 1, characterized in that: The step of determining the optimal operating parameters of the target devices to be resource allocated among all the devices when they are operating simultaneously according to the operating parameters corresponding to each of the devices among all the devices, the predetermined device parameters of each of the devices, and the predetermined operating conditions includes: Determine the device parameters of the current device to be allocated resources among all the devices from the device parameters corresponding to all the devices, and judge whether the device parameters of the current device meet the predetermined operating conditions; When it is determined that the device parameters of the current device meet the operating conditions, determining whether the current device needs to be selected; When it is determined that the current device needs to be selected, obtaining optimal operating parameters of devices in a first device group when they are simultaneously operating under the operating conditions, the first device group being all devices in all the devices for which resource allocation has been completed; Based on the optimal operating parameters of the devices in the first device group when running simultaneously, the operating parameters corresponding to the current device and the operating conditions, the optimal operating parameters of all target devices that need resource allocation among the devices when running simultaneously are determined, and all the target devices include the current device and all devices in the first device group.

3. The resource allocation optimization method based on dynamic programming according to claim 2 is characterized in that: The method further comprises: When it is determined that the current device does not need to be selected, the optimal operating parameters of the devices in the first device group when they are running simultaneously under the operating conditions are obtained as the optimal operating parameters of all target devices that need resource allocation among the devices when they are running simultaneously, wherein all the target devices include all devices in the first device group.

4. The resource allocation optimization method based on dynamic programming according to claim 3 is characterized in that: The determining, according to the optimal operating parameters of the devices in the first device group when they are operating simultaneously, the operating parameters corresponding to the current device, and the operating condition, the optimal operating parameters of the target devices to which resource allocation is required among all the devices when they are operating simultaneously, includes: Analyzing the optimal operating parameters of the devices in the first device group when they are running under target operating conditions according to the operating conditions, the optimal operating parameters of the devices in the first device group when they are running simultaneously, and the operating parameters corresponding to the current device, wherein the target operating conditions are determined by the operating conditions and the device parameters of the current device; Comparing the optimal operating parameters of the devices in the first device group when operating under the target operating conditions with the optimal operating parameters of the devices in the first device group when operating under the operating conditions simultaneously, to obtain an operation comparison result; When the operation comparison result is used to indicate that the optimal operation parameters of the devices in the first device group when operating under the target operation conditions are less than or equal to the optimal operation parameters of the devices in the first device group when operating under the operation conditions simultaneously, determining that the optimal operation parameters of the devices in the first device group when operating under the target operation conditions are the optimal operation parameters of all the target devices to which resource allocation is required among the devices when operating simultaneously; When the operation comparison result is used to indicate that the optimal operating parameters of the devices in the first device group when operating under the target operating conditions are greater than the optimal operating parameters of the devices in the first device group when operating simultaneously under the operating conditions, it is determined that the optimal operating parameters of the devices in the first device group when operating simultaneously under the operating conditions are the optimal operating parameters of all the target devices that require resource allocation among the devices when operating simultaneously.

5. The resource allocation optimization method based on dynamic programming according to claim 4 is characterized in that: The equipment parameter of each of the equipment is the rental fee of the equipment, the operation parameter corresponding to each of the equipment is the operation time cost corresponding to the equipment, the operation condition is the expected rental fee corresponding to the current equipment, and the expected rental fee corresponding to the current equipment is less than the expected rental fees corresponding to all of the equipment; The step of determining whether the device parameters of the current device meet the predetermined operating conditions includes: Determining whether the rental fee of the current device is less than or equal to the expected rental fee corresponding to the current device; When the judgment result is no, determining that the device parameters of the current device do not meet the operating conditions; When the judgment result is yes, it is determined that the device parameters of the current device meet the operating conditions.

6. The resource allocation optimization method based on dynamic programming according to claim 5, characterized in that: The optimal operation parameter is the optimal operation time cost. When the rental cost of the current device is less than or equal to the expected rental cost corresponding to the current device and the current device needs to be selected, the calculation formula for the optimal operation time cost corresponding to all the target devices is: Wherein, j is the expected rental fee corresponding to the current device, and the current device is the i-th device that needs resource allocation among all the devices; r i is the rental cost of the current equipment; i is the running time cost corresponding to the current device; is the optimal operating time cost when the devices in the first device group are operating simultaneously under the condition that the rental cost of the current device is deducted from the expected rental cost corresponding to the current device; DP [i-1][j] is the optimal operating time cost when the devices in the first device group are operating simultaneously under the condition that the rental fee of the current device is not deducted from the expected rental fee corresponding to the current device; DP [i][j] The optimal runtime cost when all target devices that need resource allocation among the devices are running simultaneously; When the rental fee of the current device is less than or equal to the expected rental fee corresponding to the current device and the current device does not need to be selected, the calculation formula for the optimal operating time cost corresponding to all the target devices is: DP [i][j] =DP [i-1][j] ; Among them, DP [i-1][j] is the optimal running time cost when the devices in the first device group are running simultaneously.

7. The resource allocation optimization method based on dynamic programming according to claim 5 or 6, characterized in that: The determining, based on the optimal operating parameters when all the target devices are running simultaneously, the operating conditions, and the predetermined operating parameters when each of the plurality of data is processed in parallel on each of the devices, the optimal resources that can be achieved when all the data are processed in parallel on all the target devices comprises: Determine the number of branches for parallel processing of all the data according to the expected rental fees corresponding to all the devices and the running time cost of each of the predetermined plurality of data when the data is run in parallel on each of the devices; According to the expected rental fees corresponding to all the devices, the number of branches, and the optimal running time cost when all the target devices are running simultaneously, determine the optimal computing power that can be achieved when all the data are processed in parallel on all the target devices, and the optimal resource corresponding to all the data is the optimal computing power corresponding to all the data; The calculation formula for the optimal computing power that can be achieved when all the data are processed in parallel on all the target devices is: Wherein, Value is the optimal computing power that can be achieved when all the data are processed in parallel on all the target devices under the condition of the expected rental fees corresponding to all the devices; Rmax is the expected rental fees corresponding to all the devices; n is the number of branches for all the data to be processed in parallel; N is the maximum number of branches when all the data are run in parallel on each device; The optimal runtime cost when all the data are executed on all the target devices simultaneously.

8. A resource allocation optimization device based on dynamic programming, characterized in that: The device comprises: A quantization module is used to quantify the target parameters of each device that needs to participate in resource allocation based on the AI ​​model to obtain the operating parameters of the AI ​​model when the device is running, and the target parameters of each device at least include the computing power parameters of the device and / or the bandwidth parameters of the device; A determination module, configured to determine the optimal operating parameters of the target devices to be resource allocated among all the devices when they are operating simultaneously, based on the operating parameters corresponding to each of the devices, the predetermined device parameters of each of the devices, and the predetermined operating conditions; The determination module is also used to determine the optimal resources that can be achieved when all the data are processed in parallel on all the target devices based on the optimal operating parameters when all the target devices are running simultaneously, the operating conditions, and the operating parameters of each of the multiple data determined in advance when they are processed in parallel on each device.

9. A resource allocation optimization device based on dynamic programming, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the resource allocation optimization method based on dynamic programming as described in any one of claims 1-7.

10. A computer storage medium storing computer instructions, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the resource allocation optimization method based on dynamic programming as described in any one of claims 1 to 7.