Resource integration method, resource integration device, electronic device and readable storage medium

By obtaining the trigger method of resource integration and dynamically integrating resources, the problem of resource waste in the existing technology is solved, and the refined management and maximum utilization of resources are achieved.

CN118170530BActive Publication Date: 2024-11-15CHINA TOWER CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410143926.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-01
Publication Date
2024-11-15
Estimated Expiration
2044-02-01

AI Technical Summary

Technical Problem

The existing technology cannot achieve refined integration of resources, resulting in the problem of resource waste.

Method used

By obtaining the triggering methods of resource integration, including instruction triggering and timing task triggering, resources are dynamically integrated according to the resource usage of the algorithm to achieve refined resource management. Instructions trigger resource integration for a single algorithm, and timing tasks trigger resource integration for multiple algorithms, integrating at resource level.

Benefits of technology

Optimize resource utilization rate, avoid resource waste, and ensure dynamic integration and maximum utilization of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118170530B_ABST
    Figure CN118170530B_ABST
Patent Text Reader

Abstract

The present application discloses a resource integration method, a resource integration device, an electronic device and a readable storage medium, which belong to the field of computer technology. The method comprises: obtaining a triggering method for resource integration, wherein the triggering method for resource integration comprises one of the following: instruction triggering and scheduled task triggering, the instruction triggering is used to indicate the integration of resources occupied by a first algorithm, and the scheduled task triggering is used to indicate the integration of resources occupied by multiple second algorithms; when the triggering method is instruction triggering, the resources occupied by the first algorithm are integrated according to the first computing power resources of the first algorithm; when the triggering method is scheduled task triggering, the resources occupied by the second algorithms corresponding to different resource levels are integrated according to resource levels.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and in particular relates to a resource integration method, a resource integration device, an electronic device and a readable storage medium. Background Art

[0002] With the development of cloud computing and artificial intelligence, the demand for computing resources is increasing. Different types of computing resource pools use and integrate resources in different ways, resulting in different degrees of resource waste. In related technologies, once resources are allocated or occupied, they are no longer integrated according to actual conditions, that is, the refined integration of resources and the release of idle resources are no longer automatically completed, resulting in resource waste. Summary of the invention

[0003] The embodiments of the present application provide a resource integration method, a resource integration device, an electronic device and a readable storage medium, which can solve the problem that in the related technology, it is impossible to achieve refined resource integration, resulting in resource waste.

[0004] In a first aspect, an embodiment of the present application provides a resource integration method, the method comprising: obtaining a triggering method for resource integration, wherein the triggering method for resource integration comprises one of the following: instruction triggering and scheduled task triggering, the instruction triggering is used to indicate the integration of resources occupied by a first algorithm, and the scheduled task triggering is used to indicate the integration of resources occupied by multiple second algorithms; when the triggering method is instruction triggering, the resources occupied by the first algorithm are integrated according to the first computing power resources of the first algorithm; when the triggering method is scheduled task triggering, the resources occupied by the second algorithms corresponding to different resource levels are integrated according to the resource levels.

[0005] In the second aspect, an embodiment of the present application provides a resource integration device, which includes: an acquisition module, which is used to acquire a triggering method for resource integration, wherein the triggering method for resource integration includes one of the following: instruction triggering and scheduled task triggering, the instruction triggering is used to indicate the integration of resources occupied by a first algorithm, and the scheduled task triggering is used to indicate the integration of resources occupied by multiple second algorithms; a first integration module, which is used to integrate the resources occupied by the first algorithm according to the first computing power resources of the first algorithm when the triggering method is instruction triggering; and a second integration module, which is used to integrate the resources occupied by the second algorithms corresponding to different resource levels according to resource levels when the triggering method is scheduled task triggering.

[0006] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0007] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0008] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0009] In an embodiment of the present application, refined management of resource integration is achieved by obtaining a triggering method for resource integration. Among them, the triggering method for resource integration includes one of the following: instruction triggering and scheduled task triggering. Instruction triggering is used to indicate the integration of resources occupied by the first algorithm, and scheduled task triggering is used to indicate the integration of resources occupied by multiple second algorithms. When the triggering method is instruction triggering, the resources occupied by the first algorithm are integrated according to the first computing power resources of the first algorithm, so as to achieve resource integration for a single algorithm and maximize the resource utilization of the current algorithm; when the triggering method is scheduled task triggering, the resources occupied by the second algorithms corresponding to different resource levels are integrated according to the resource level, so as to achieve the integration of algorithm resources at different levels in sequence according to the resource level, so as to maximize the resource utilization of all algorithms. The integration strategies corresponding to the above two triggering methods realize dynamic integration of resources and refined integration based on resource levels in scenarios where business status and demand are constantly changing, thereby optimizing resource utilization and avoiding waste of resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is a flow chart of a resource integration method provided in an embodiment of the present application;

[0011] Figure 2 is another flow chart of a resource integration method provided in an embodiment of the present application;

[0012] Figure 3 This is another flow chart of a resource integration method provided in an embodiment of the present application;

[0013] Figure 4 This is another flow chart of a resource integration method provided in an embodiment of the present application;

[0014] Figure 5is a structural schematic diagram of a resource integration device provided in an embodiment of the present application;

[0015] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0016] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0017] In conjunction with the accompanying drawings, a resource integration method, a resource integration device, an electronic device, and a readable storage medium provided in an embodiment of the present application are described in detail below through specific embodiments and their application scenarios.

[0018] Figure 1 A resource integration method provided by an embodiment of the present application is shown, and the method can be executed by an electronic device, and the electronic device may include: a server and / or a terminal device. In other words, the method can be executed by software or hardware installed in the electronic device, and the method includes the following steps:

[0019] S110: Acquire a triggering method for resource integration.

[0020] The triggering method of resource integration includes one of the following: instruction triggering and scheduled task triggering, wherein the instruction triggering is used to indicate the integration of resources occupied by the first algorithm, and the scheduled task triggering is used to indicate the integration of resources occupied by multiple second algorithms.

[0021] It is understandable that the instruction trigger is to immediately integrate the resources occupied by the first algorithm. In other words, for the resource integration triggered by the instruction, it can be a scenario with high real-time requirements, and the resources occupied by the first algorithm need to be integrated immediately to meet the user's real-time requirements, thereby reducing resource occupation. Scheduled task triggering refers to the integration of resources occupied by multiple second algorithms at a preset time interval or at a predetermined time point.

[0022] It should be noted that the instruction trigger is a partial integration of a single algorithm, namely the first algorithm, and the scheduled task is an overall integration of multiple algorithms or all algorithms, namely multiple second algorithms. The multiple second algorithms may include the first algorithm or may not include the first algorithm.

[0023] In S110, the instruction trigger can respond to the change of the resources occupied by the first algorithm in time, so as to maintain the response speed and stability of the system where the first algorithm is located; the scheduled task trigger can maintain the good operation state of the system where multiple second algorithms are located through scheduled integration, avoiding excessive resource occupation, and the scheduled time can also be non-working time, so as to avoid affecting the normal operation of users in the system. Through different triggering methods, the needs of the production environment can be covered, which not only ensures the stability of the algorithm operation, but also improves the resource utilization rate and achieves the purpose of cost saving.

[0024] S120: When the triggering mode is instruction triggering, the resources occupied by the first algorithm are integrated according to the first computing power resources of the first algorithm.

[0025] It is understandable that instruction triggering is to integrate the resources occupied by a single algorithm. For example, in a certain business scenario, when a user cancels an algorithm analysis or needs to optimize the resources occupied by an algorithm or an order corresponding to an algorithm expires, if the algorithm is still running in the original occupied resources, it may lead to resource waste, so the resources occupied by the algorithm need to be optimized or integrated.

[0026] S130: When the triggering mode is a scheduled task trigger, the resources occupied by the second algorithm corresponding to different resource levels are integrated according to the resource levels.

[0027] It is understandable that in a multi-algorithm business scenario, multiple algorithms are deployed on different graphics processing unit (GPU) servers. Since each GPU server usually contains multiple GPU cards, there may be scenarios where multiple algorithms are scattered and deployed on a single GPU card on different servers. In this case, multiple GPU servers may have idle resources, which leads to low overall GPU resource utilization. In this case, resource integration can be performed through scheduled tasks. Scheduled task triggering is to integrate all resources in the resource pool as a whole, and complete the integration of algorithm resources at different levels in turn according to the resource level, so as to maximize the resource utilization of all algorithms and realize resource hierarchical adjustment.

[0028] In addition, the duration of scheduled tasks can be configured on demand according to the scale of resources and the actual business situation to ensure the stability and continuity of the business.

[0029] In an embodiment of the present application, refined management of resource integration is achieved by obtaining a triggering method for resource integration. Among them, the triggering method for resource integration includes one of the following: instruction triggering and scheduled task triggering. Instruction triggering is used to indicate the integration of resources occupied by the first algorithm, and scheduled task triggering is used to indicate the integration of resources occupied by multiple second algorithms. When the triggering method is instruction triggering, the resources occupied by the first algorithm are integrated according to the first computing power resources of the first algorithm, so as to achieve resource integration for a single algorithm and maximize the resource utilization of the current algorithm; when the triggering method is scheduled task triggering, the resources occupied by the second algorithms corresponding to different resource levels are integrated according to the resource level, so as to achieve the integration of algorithm resources at different levels in sequence according to the resource level, so as to maximize the resource utilization of all algorithms. The integration strategies corresponding to the above two triggering methods realize dynamic integration of resources and refined integration based on resource levels in scenarios where business status and demand are constantly changing, thereby optimizing resource utilization and avoiding waste of resources.

[0030] The following is a schematic illustration of the triggering mode for command triggering.

[0031] In one implementation, the resources occupied by the first algorithm are integrated according to the first computing power resources of the first algorithm, including: when the first computing power resource data of the first algorithm meets the real-time resource integration conditions, the resources occupied by the first algorithm are integrated. It can be understood that before resource integration, it is necessary to determine whether there is a situation of insufficient or excessive use of resources. When it is determined that resources are overused, it is necessary to integrate resources. If it is determined that resources are insufficient, it is not necessary to integrate resources to avoid affecting the operation of the business related to the algorithm. Among them, whether resources are overused can be determined by real-time resource integration conditions.

[0032] In one implementation, the first computing power resource data includes the actual number of analysis tasks and the number of occupied containers; the first computing power resource data of the first algorithm satisfies the real-time resource integration condition, including: the number of occupied containers is greater than the first threshold, and the actual number of analysis tasks is less than the product of the first difference and the second threshold, wherein the first difference is the difference between the number of occupied containers and 1, and the second threshold is the maximum analysis task threshold of the resource level corresponding to the first algorithm. It can be understood that the instruction trigger is used to instruct the integration of the resources occupied by the first algorithm. The instruction can be an instruction to stop analysis of the first algorithm. The instruction can carry the algorithm code, task ID, resource level supported by the algorithm, and algorithm task load threshold of the first algorithm. The actual number of analysis tasks and the number of occupied containers of the first algorithm are queried through the algorithm code. In another implementation, the real-time resource integration condition can be expressed by the following formula (1):

[0033] n ik ≥x and A i <(n-1)*a ik (1)

[0034] Among them, i represents the first algorithm, n ik represents the number of occupied containers of the first algorithm, x is the first threshold, A i represents the actual number of analysis tasks of the first algorithm, a ik represents the second threshold, that is, the maximum analysis task threshold of the resource level corresponding to the first algorithm, and k represents the resource level corresponding to the first algorithm.

[0035] It should be noted that the resources of the present application refer to GPU resources, wherein the relationship between the GPU server or GPU card and the container and algorithm is: the container is the encapsulation environment of the algorithm or business running on the GPU server or GPU card, in other words, the GPU server or GPU card runs the container, the algorithm is deployed in the container, and the algorithm is calculated by calling the GPU. Exemplarily, an algorithm deployed in a container can occupy 0.5 GPU card resources or an algorithm deployed in a container can occupy 2 GPU card resources, and the GPU card resources occupied by the algorithm deployed in each container can be the same or different. The present application can divide GPU resources into three levels, exemplarily, primary resources (8C 32G 16G), secondary resources (4C 16G 8G) and tertiary resources (1C 4G2G), wherein 8C in the primary resources is the number of GPU cores, 32G is the GPU memory capacity, and 16G is the memory capacity. The k in formula (1) can represent any one of the primary, secondary, and tertiary levels. In addition, the division of resource levels can be divided according to actual conditions, and the embodiment of the present application does not specifically limit the number of levels.

[0036] In the above formula, x can be 2, n ik ≥x can be expressed as n ik ≥2, that is, the number of occupied containers of the first algorithm needs to be greater than or equal to 2, A i <(n-1)*a ik , it can be understood that the product of the difference between the number of occupied containers minus 1 and the maximum analysis task threshold must be greater than the actual number of analysis tasks. Assume that each container can run 5 tasks, and the actual number of analysis tasks of the first algorithm is 11. If at this time, the first algorithm occupies 4 containers, that is, n ik is 4, then n is satisfied ik ≥2, n ik Greater than 2, where the resource level supported by these four containers is the second level, and the maximum analysis task threshold corresponding to the second level resource level is 5, then (n-1)*a ik It can be expressed as (4-1)*5=15, Ai Less than 15, meeting A i <(n-1)*a ik ,Therefore, the second algorithm meets the real-time resource integration condition.

[0037] Furthermore, in one implementation, the integration of resources occupied by the first algorithm may include: instructing the first algorithm to stop the first algorithm analysis task; and reducing the container occupied by the first algorithm according to the principle of real-time resource integration. That is, before performing resource integration, it is necessary to instruct the first algorithm to stop analysis first to avoid affecting the normal operation of the first algorithm, and then reduce the container occupied by the first algorithm according to the principle of real-time resource integration. Among them, in another implementation, reducing the container occupied by the first algorithm according to the principle of real-time resource integration may include the following steps:

[0038] Step 1: Determine the first quantity based on the principle of real-time resource integration.

[0039] It can be understood that the first number is the number of containers that need to be reduced.

[0040] In another implementation, the real-time resource integration principle may include one of the following:

[0041] (1) When the first ratio is an integer, the first number is determined as the difference between the number of occupied containers and the first ratio, wherein the first ratio is the quotient of the actual number of analysis tasks and the second threshold.

[0042] (2) When the first ratio is not an integer, the first number is determined to be the difference between the number of occupied containers and a first addition result, wherein the first addition result is the sum of a result of rounding up the first ratio and 1.

[0043] The above two real-time resource integration principles can be expressed by the following formula (2):

[0044]

[0045] Among them, N ik represents the first quantity, i represents the first algorithm, k represents the resource level corresponding to the first algorithm, and n ik represents the number of occupied containers of the first algorithm, A i represents the actual number of analysis tasks of the first algorithm, a ik represents the second threshold, that is, the maximum analysis task threshold of the resource level corresponding to the first algorithm, Represents the first ratio.

[0046] Step 2: Migrate and deploy the first subtask deployed in the reduced container to the unreduced container.

[0047] Among them, the reduced container is the first number of containers that occupy the least resources in the first container, the first container is the container for deploying the first algorithm analysis task corresponding to the first algorithm, the first container includes the reduced container and the unreduced container, and the first algorithm analysis task includes the first subtask.

[0048] It can be understood that resource integration is performed according to the principle of migrating containers with less resource usage to containers with more resource usage, that is, from the first containers occupied by the first algorithm, the first number of containers with the least resource usage are determined as the reduced containers. Exemplarily, assume that the first container for deploying the first algorithm analysis task corresponding to the first algorithm includes 4 containers, among which container A deploys 5 subtasks, and the GPU resources occupied by these 5 subtasks are 100M, container B deploys 6 subtasks, and the GPU resources occupied by these 6 subtasks are 80M, container C deploys 2 subtasks, and the GPU resources occupied by these 2 subtasks are 10M, and container D deploys 1 subtask, and the GPU resources occupied by this 1 subtask are 50M. If these 4 containers only deploy the first algorithm analysis task corresponding to the first algorithm, then, when the first number is 2, it can be determined that the reduced containers are container C and container D; if one or more of the 4 containers also deploy algorithm analysis tasks corresponding to other algorithms in addition to the first algorithm, it is necessary to determine the reduced container based on the sum of the resources occupied by each container deployment task. It should be noted that in this case, other algorithms need to be instructed to stop the corresponding algorithm analysis tasks.

[0049] Step 3: Delete the reduced container.

[0050] Step 4: Release the GPU resources occupied by the first subtask.

[0051] That is, after the migration deployment is completed, the reduced container can be deleted, and the resources occupied by the first subtask deployed on the reduced container can be released.

[0052] Figure 2 This is another flow chart of a resource integration method provided in an embodiment of the present application. Figure 2 The various embodiments corresponding to the instruction trigger are described in detail. Figure 2 As shown, the method may include the following steps.

[0053] S210: Receive an algorithm stop analysis instruction.

[0054] Receive the instruction from the upper system to stop the analysis of the current algorithm.

[0055] S220: Record the algorithm code and algorithm resource level of the algorithm.

[0056] Record the algorithm and its related information, determine the algorithm code, task ID, resource level supported by the algorithm, and algorithm task load threshold.

[0057] S230: Calculate the actual number of tasks of the current algorithm and the current number of containers.

[0058] The algorithm code of the algorithm is used in the database to query and calculate the current actual analysis task number and current algorithm container number of the algorithm. The total actual analysis task load of the algorithm is recorded as A i , i = 1, 2, 3..., the number of containers deployed by the current algorithm i is n ik , n ik ≥0.

[0059] S240: Determine whether the real-time integration condition is met.

[0060] This application classifies GPU cards into resource specifications when deploying algorithms, which can be divided into three-level resources (1C4G 2G), two-level resources (4C 16G 8G), and one-level resources (8C 32G 16G). The algorithm is tested to determine the level supported by each algorithm and the maximum task threshold at the supported resource specification level. The maximum analysis task threshold of the current algorithm i at different resource levels k, k = 1, 2, 3 is a ik Multiple containers of the same algorithm can be deployed at the same resource level when n ik ≥2 and A i <(n-1)*a ik When the condition is met, it indicates that the algorithm meets the conditions for resource integration and needs to be scaled down.

[0061] If the real-time integration condition is met, S250 is executed; if not, S280 is executed.

[0062] S250: Stop the algorithm analysis task and issue an algorithm stop instruction.

[0063] When the conditions for real-time resource integration are met, the algorithm analysis task is stopped first, and a stop analysis instruction is sent to the algorithm.

[0064] S260: Complete resource integration based on the principle of real-time resource integration.

[0065] According to the principle of real-time resource integration, the containers occupied by the current algorithm are reduced. The number of containers required for the actual analysis task load of the current algorithm is less than the number of existing containers, so the algorithm's tasks can be integrated into fewer containers through resource integration. The number of containers that the current algorithm needs to reduce through resource integration is N ik , N can be saved through real-time resource integration ik Containers are used to save resources.

[0066] S270: Send the original algorithm tasks to the integrated containers and delete the redundant containers.

[0067] S280: A stop analysis instruction is sent to the algorithm, and the algorithm stops analyzing.

[0068] Send the original algorithm tasks to the integrated container to allow the algorithm to run normally, then delete the redundant containers to release resources.

[0069] In this embodiment, the algorithm container of a single algorithm is reduced in size through real-time resource integration, so that the resource utilization of the current algorithm is maximized, thereby improving the resource utilization rate of the single algorithm.

[0070] The following is a schematic illustration of the triggering method for a scheduled task.

[0071] In one implementation, integrating the resources occupied by the second algorithms corresponding to different resource levels according to the resource levels may include the following steps:

[0072] Step 1: Determine the resource level corresponding to each of the second algorithms.

[0073] For the description of resource level, please refer to the description in the embodiment where the triggering mode is instruction triggering, which will not be repeated here.

[0074] Step 2: Summarize the second computing power resource data of each of the second algorithms corresponding to different resource levels respectively.

[0075] Exemplarily, the present application takes the resource level including three levels as an example for explanation. Assuming that there are 10 algorithms in total, among which the first resource level includes 3 second algorithms, the second resource level includes 2 second algorithms, and the third resource level includes 5 second algorithms, then each resource level only needs to summarize the second computing power resource data of the corresponding second algorithms.

[0076] Step 3: For each resource level, according to the second computing power resource data of each second algorithm corresponding to the resource level, the resources occupied by each second algorithm corresponding to the resource level are integrated.

[0077] In one implementation, step 3 may include: for each resource level, when the second computing resource data of each second algorithm corresponding to the resource level meets the timed resource integration condition, integrating the resources occupied by each second algorithm corresponding to the resource level. In other words, the resources occupied by the second algorithms at different levels are integrated in sequence according to the resource level.

[0078] Further, in one implementation, the second computing power resource data includes: the total number of second algorithms corresponding to the resource level and the total number of GPU cards occupied; the second computing power resource data of each of the second algorithms corresponding to the resource level meets the timed resource integration condition, including:

[0079] The difference between the total amount of GPU card occupied and the first rounding result is greater than 1; wherein the first rounding result is the result of rounding up the second ratio, the second ratio is the quotient of the number of algorithms of the second algorithm corresponding to the resource level and the third ratio, and the third ratio is the quotient of the total amount of GPU video memory and the amount of GPU video memory corresponding to the resource level.

[0080] It can be understood that the scheduled task trigger is used to indicate the integration of resources occupied by multiple second algorithms. Then, after the scheduled task is triggered, the second computing power resource data of all deployed algorithms can be queried and recorded, wherein the second computing power resource data can include GPU server information and algorithm service information. Among them, the GPU server information may include the server name, server IP, number of GPU cards, resource level of deployed algorithms, GPU video memory allocation, CPU allocation, memory allocation, total GPU video memory, total CPU, total memory, etc.; the algorithm service information may include the algorithm name, algorithm code, resource level of algorithm deployment, etc. Then, the total number of second algorithms corresponding to each level and the total number of GPU cards occupied are determined based on the GPU server information and algorithm service information of each algorithm. In another implementation method, the scheduled resource integration condition can be expressed by the following formula (3):

[0081]

[0082] Among them, k represents a certain resource level, N k Indicates the number of GPU cards occupied by an algorithm at a certain resource level, n k Indicates the total number of second algorithms corresponding to a certain resource level, m k In this embodiment of the application, the resource level is k, k = 1, 2, 3, and the number of containers deployed by algorithm i is n ik , the number of algorithms deployed at a certain resource level is the sum of the number of containers of each algorithm at that resource level, that is, ∑n ikTherefore, the number of GPU cards occupied by a certain level of algorithm is N k , the number of deployments of a resource level algorithm, that is, the total number of corresponding second algorithms, is n k , where n k =∑ i n ik Since the embodiment of the present application takes GPU memory as the main statistical basis, the total amount of GPU memory of the GPU card is recorded as Q, and the amount of GPU memory at a certain resource level is q k , k = 1, 2, 3, the maximum number of algorithms of a certain level that can be deployed on a GPU card is m k ,

[0083] In one implementation, the integration of resources occupied by each of the second algorithms corresponding to the resource level includes: instructing each of the second algorithms corresponding to the resource level to stop the second algorithm analysis task; and reducing the GPUs occupied by each of the second algorithms corresponding to the resource level according to the principle of scheduled resource integration. That is to say, before integrating the resources occupied by the algorithms corresponding to a certain resource level, it is necessary to instruct the algorithms at this level to stop the second algorithm analysis task, and then reduce the GPUs occupied by each of the second algorithms corresponding to the resource level according to the principle of scheduled resource integration. Among them, in another implementation, reducing the GPUs occupied by each of the second algorithms corresponding to the resource level according to the principle of scheduled resource integration may include the following steps:

[0084] Step 1: Determine the second quantity according to the real-time resource integration principle.

[0085] It can be understood that the second number is the number of GPUs that need to be reduced.

[0086] In another implementation, the timing resource integration principle may include one of the following:

[0087] (1) When the second ratio is an integer, the second number is determined as the quotient of the total number of GPU cards occupied and the third ratio.

[0088] (2) When the second ratio is not an integer, the second number is determined to be the difference between the total number of GPU cards occupied and a second addition result, wherein the second addition result is the sum of the first rounding result and 1.

[0089] The above two timing resource integration principles can be expressed by the following formula (4):

[0090]

[0091] Among them, M k represents the second quantity, Represents the second ratio, n k Indicates the total number of second algorithms corresponding to a certain resource level, m k represents the third ratio, represents the first rounding result. For the third ratio and the first rounding result, please refer to the specific description in formula (3), which will not be repeated here.

[0092] Step 2: Migrate and deploy the second subtask deployed on the second container to the third container.

[0093] The second container is a container on a reduced GPU, the third container is a container on an unreduced GPU, the reduced GPU is the second number of GPUs with the least occupied resources in the first GPU, the first GPU is a GPU that runs a second algorithm analysis task corresponding to the resource level, the first GPU includes the reduced GPU and the unreduced GPU, and the second algorithm analysis task includes the second subtask.

[0094] It can be understood that resource integration is performed according to the principle of migrating from a GPU with less resources to a GPU with more resources, that is, from the first GPU occupied by the second algorithm corresponding to a certain resource level, the GPU with the second number of least resource occupation is determined as the reduced GPU. Exemplarily, it is assumed that the GPUs that deploy the second algorithm analysis tasks of each second algorithm corresponding to the second resource level include 4 GPUs, wherein the container in GPU A deploys 5 subtasks, and these 5 subtasks occupy 100M GPU resources, the container in GPU B deploys 6 subtasks, and these 6 subtasks occupy 300M GPU resources, the container in GPU C deploys 2 subtasks, and these 2 subtasks occupy 200M GPU resources, and the container in GPU D deploys 1 subtask, and this 1 subtask occupies 10M GPU resources. If the containers in these 4 GPUs only deploy the second algorithm analysis tasks of each second algorithm corresponding to the second resource level, then, when the second number is 2, it can be determined that the reduced GPUs are GPU A and GPU D. If one or more of the four GPUs have deployed algorithms corresponding to other resource levels in addition to the second algorithm corresponding to the second resource level, it is necessary to determine the GPU to be reduced based on the total resource consumption of each GPU. In addition, in this case, it is necessary to instruct the algorithms corresponding to other resource levels to stop the corresponding algorithm analysis tasks.

[0095] Step 3: Delete the second container.

[0096] Step 4: Release the GPU resources occupied by the second subtask.

[0097] It is understandable that after migrating the second subtask deployed on the second container, the container corresponding to the reduced GPU, ie, the second container, may be deleted, and then the GPU resources occupied by the second subtask may be released.

[0098] Optionally, in order to maintain business stability, before deleting the second container and releasing the GPU resources occupied by the second subtask, the original task of the algorithm may be completed first, that is, the normal operation of the algorithm may be ensured before releasing the integrated resources.

[0099] Figure 3 This is another flow chart of a resource integration method provided in the embodiment of the present application. Figure 3 The various embodiments corresponding to the timing task triggering are described in detail, such as Figure 3 As shown, the method may include the following steps.

[0100] S310: triggering resource integration and transfer at a preset time interval.

[0101] Set the duration for triggering scheduled resource integration, and perform resource integration at a fixed time every T days. Optionally, T can be set to 14 days.

[0102] S320: Query and record all GPU server information and algorithm service information of the deployed algorithm.

[0103] Query and record the GPU server information and algorithm service information of all deployed algorithms in the resource pool. GPU server information includes server name, server IP, number of GPU cards, resource level of deployed algorithm, GPU video memory allocation, CPU allocation, memory allocation, total GPU video memory, total CPU, total memory, etc.; algorithm service information includes algorithm name, algorithm code, resource level of algorithm deployment, etc.

[0104] S330: Summarize the number of deployments of algorithms at different resource levels and the number of GPU cards.

[0105] For example, in this application, the resource level is recorded as k, k = 1, 2, 3, and the number of containers deployed by algorithm i is n ik , the number of algorithms deployed at a certain resource level is the sum of the number of containers of each algorithm at that resource level, that is, ∑n ik Therefore, the number of GPU cards occupied by a certain level of algorithm is N k , the number of deployments of a resource level algorithm is n k , where n k =∑ i n ik .

[0106] S340: Determine whether the conditions for timed integration are met.

[0107] Determine whether the conditions for timed resource integration are met. The algorithm mainly uses GPU memory during analysis, so this application uses GPU memory as the main statistical basis, and the total GPU memory of the GPU card is recorded as Q, and the GPU memory at a certain resource level is q k , k = 1, 2, 3, the maximum number of algorithms of a certain level that can be deployed on the entire GPU card is m k , when This indicates that the actual number of resources currently occupied by a certain level is greater than the number of resources that should be occupied, that is, overall resource integration is needed, and different resource levels should be calculated separately to determine the resource level that needs to be integrated.

[0108] If the conditions are met, S350 is executed; if the conditions are not met, resource integration is not required.

[0109] S350: Based on the principle of migrating servers with less resource usage to servers with more resource usage, containers are migrated according to resource levels.

[0110] When the conditions for scheduled resource integration are met, the number of GPU cards that can be integrated for all algorithms deployed at a certain resource level is M k ,in, According to the principle of migrating GPU servers with less resources to GPU servers with more resources, containers are migrated according to resource levels. After the level-by-level integration is completed, GPU resources can be saved∑ k M k , improving the overall resource utilization of all algorithms.

[0111] S360: Re-issue the algorithm task to the transferred container to ensure normal analysis of the algorithm.

[0112] After completing the integration of the overall resources, re-issue the algorithm tasks to the integrated container to ensure that all algorithms are analyzed normally.

[0113] S370: Delete redundant containers to release resources.

[0114] In this embodiment, resource integration of all algorithms is triggered by a scheduled task, and algorithm resources are integrated according to resource levels to maximize resource utilization of all algorithms.

[0115] Based on the above embodiments, the present application also provides another flow chart of a resource integration method, such as Figure 4 As shown, the method may include the following steps.

[0116] S410: issuing an instruction to stop algorithm analysis in real time.

[0117] When the customer does not need the algorithm for analysis or the order expires, the algorithm analysis task will be canceled. At this time, the platform can issue a stop analysis instruction. The algorithm stop analysis task contains information such as unique identification, algorithm name, algorithm code, resource deployment level, algorithm analysis method, and algorithm task load threshold.

[0118] S420: Scale down the container of a single algorithm through the real-time resource integration sub-process to complete the task transfer of the single algorithm.

[0119] Through the real-time resource integration sub-process, the algorithm container of a single algorithm that meets the conditions is reduced, and the task transfer of a single algorithm is completed. This operation uses task cancellation as a trigger condition, integrates resources in real time, maximizes the resource utilization of the current algorithm, and integrates local resources in the resource pool.

[0120] S430: Through the resource timing integration sub-process, all algorithms are integrated according to the timing tasks, and algorithm resource integration and algorithm task transfer are performed according to the resource level.

[0121] Through the resource timing integration sub-process, all algorithms are integrated according to the timing tasks, and algorithm resource integration and algorithm task transfer are performed according to the resource level to maximize the resource utilization of all algorithms. This operation uses the timing task as the trigger condition to integrate all resources in the resource pool, and the duration of the timing task is configurable.

[0122] S440: Send the original algorithm task to the integrated container.

[0123] After completing partial or overall resource integration, the original algorithm task is sent to the integrated container to ensure normal algorithm analysis.

[0124] S450: Delete redundant containers to release resources.

[0125] After the algorithm task is delivered, the redundant containers are deleted to release idle resources.

[0126] Figure 5 A schematic diagram showing the structure of a resource integration device provided by an embodiment of the present application is shown as follows: Figure 5 As shown, the resource integration device 500 may include: an acquisition module 510 , a first integration module 520 and a second integration module 530 .

[0127] In this embodiment, the acquisition module 510 is used to acquire a triggering method for resource integration, wherein the triggering method for resource integration includes one of the following: instruction triggering and scheduled task triggering, the instruction triggering is used to indicate the integration of resources occupied by the first algorithm, and the scheduled task triggering is used to indicate the integration of resources occupied by multiple second algorithms; the first integration module 520 is used to integrate the resources occupied by the first algorithm according to the first computing power resources of the first algorithm when the triggering method is instruction triggering; the second integration module 530 is used to integrate the resources occupied by the second algorithms corresponding to different resource levels according to resource levels when the triggering method is scheduled task triggering.

[0128] In one implementation, the resources occupied by the first algorithm are integrated according to the first computing power resources of the first algorithm, including: when the first computing power resource data of the first algorithm meets the real-time resource integration conditions, the resources occupied by the first algorithm are integrated.

[0129] In one implementation, the first computing power resource data includes the actual number of analysis tasks and the number of occupied containers; the first computing power resource data of the first algorithm meets the real-time resource integration conditions, including: the number of occupied containers is greater than a first threshold, and the actual number of analysis tasks is less than the product of a first difference and a second threshold, wherein the first difference is the difference between the number of occupied containers and 1, and the second threshold is the maximum analysis task threshold of the resource level corresponding to the first algorithm.

[0130] In one implementation, the integrating the resources occupied by the first algorithm includes: instructing the first algorithm to stop the first algorithm analysis task; and reducing the container occupied by the first algorithm according to the real-time resource integration principle.

[0131] In one implementation, reducing the container occupied by the first algorithm according to the real-time resource integration principle includes: determining a first quantity according to the real-time resource integration principle; migrating the first subtask deployed in the reduced container to an unreduced container, wherein the reduced container is the first number of containers that occupy the least resources in the first container, the first container is the container for deploying the first algorithm analysis task corresponding to the first algorithm, the first container includes the reduced container and the unreduced container, and the first algorithm analysis task includes the first subtask; deleting the reduced container; and releasing the GPU resources occupied by the first subtask.

[0132] In one implementation, the real-time resource integration principle includes one of the following: when the first ratio is an integer, determining the first number as the difference between the number of occupied containers and the first ratio, wherein the first ratio is the quotient of the actual number of analysis tasks and the second threshold; when the first ratio is not an integer, determining the first number as the difference between the number of occupied containers and a first addition result, wherein the first addition result is the sum of a result rounded up of the first ratio and 1.

[0133] In one implementation, the resources occupied by the second algorithms corresponding to different resource levels are integrated according to the resource level, including: determining the resource level corresponding to each second algorithm; respectively summarizing the second computing power resource data of each second algorithm corresponding to different resource levels; for each resource level, according to the second computing power resource data of each second algorithm corresponding to the resource level, integrating the resources occupied by each second algorithm corresponding to the resource level.

[0134] In one implementation, for each resource level, the resources occupied by each second algorithm corresponding to the resource level are integrated according to the second computing power resource data of each second algorithm corresponding to the resource level, including: for each resource level, when the second computing power resource data of each second algorithm corresponding to the resource level meets the timed resource integration conditions, the resources occupied by each second algorithm corresponding to the resource level are integrated.

[0135] In one implementation, the second computing power resource data includes: the total number of second algorithms corresponding to the resource level and the total number of GPU cards occupied; the second computing power resource data of each of the second algorithms corresponding to the resource level meets the timed resource integration conditions, including: the difference between the total number of GPU cards occupied and the first rounding result is greater than 1; wherein the first rounding result is the result of rounding up the second ratio, the second ratio is the quotient of the total number of second algorithms corresponding to the resource level and the third ratio, and the third ratio is the quotient of the total amount of GPU video memory and the amount of GPU video memory corresponding to the resource level.

[0136] In one implementation, the resources occupied by each of the second algorithms corresponding to the resource level are integrated, including: instructing each of the second algorithms corresponding to the resource level to stop the second algorithm analysis task; and reducing the GPU occupied by each of the second algorithms corresponding to the resource level according to the principle of timed resource integration.

[0137] In one implementation, the GPUs occupied by each of the second algorithms corresponding to the resource level are reduced according to the principle of scheduled resource integration, including: determining the second number according to the principle of scheduled resource integration; migrating the second subtask deployed on the second container to a third container, wherein the second container is a container on the reduced GPU, the third container is a container on the unreduced GPU, the reduced GPU is the second number of GPUs with the least occupied resources in the first GPU, the first GPU is a GPU running the second algorithm analysis task corresponding to the resource level, the first GPU includes the reduced GPU and the unreduced GPU, and the second algorithm analysis task includes the second subtask; deleting the second container; and releasing the GPU resources occupied by the second subtask.

[0138] In one implementation, the timing resource integration principle includes one of the following: when the second ratio is an integer, determining the second number as the quotient of the total number of GPU cards occupied and the third ratio; when the second ratio is not an integer, determining the second number as the difference between the total number of GPU cards occupied and a second addition result, wherein the second addition result is the sum of the first rounded result and 1.

[0139] The resource integration device provided in the embodiment of the present application can realize Figure 1-Figure 4 To avoid repetition, the various processes implemented in the illustrated method embodiment will not be described again here.

[0140] The resource integration device in the embodiment of the present application may be a device, or a component, an integrated circuit, or a chip in an electronic device. The embodiment of the present application does not specifically limit this.

[0141] The resource integration device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0142] Optional, such as Figure 6 As shown, the embodiment of the present application also provides an electronic device 600, including a processor 610, a memory 620, a program or instruction stored in the memory 620 and executable on the processor 610, and the program or instruction is executed by the processor 610 to implement the above Figure 1-Figure 4 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0143] The embodiment of the present application also provides a readable storage medium on which a program or instruction is stored. When the program or instruction is executed by a processor, the above Figure 1-Figure 4 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0144] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0145] The present application also provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the above Figure 1-Figure 4 To avoid repetition, the various processes of the illustrated method embodiment will not be described again here.

[0146] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0147] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0148] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0149] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A resource integration method, It is characterized in that include: Acquire a triggering method for resource integration, wherein the triggering method for resource integration includes one of the following: instruction triggering and scheduled task triggering, wherein the instruction triggering is used to indicate the integration of resources occupied by the first algorithm, and the scheduled task triggering is used to indicate the integration of resources occupied by multiple second algorithms; In the case where the triggering mode is instruction triggering, integrating the resources occupied by the first algorithm according to the first computing power resources of the first algorithm; In the case where the triggering mode is a timed task trigger, the resources occupied by the second algorithm corresponding to different resource levels are integrated according to the resource levels; The integrating the resources occupied by the first algorithm includes: Instructing the first algorithm to stop the first algorithm analysis task; According to the principle of real-time resource integration, determine the first quantity; Migrate and deploy the first subtask deployed in the reduced container to the unreduced container, wherein the reduced container is the first number of containers that occupy the least resources in the first container, the first container is the container for deploying the first algorithm analysis task corresponding to the first algorithm, the first container includes the reduced container and the unreduced container, and the first algorithm analysis task includes the first subtask; Deleting the reduced container; Release the GPU resources occupied by the first subtask.

2. The method according to claim 1, It is characterized in that The integrating the resources occupied by the first algorithm according to the first computing power resource of the first algorithm includes: When the first computing power resource data of the first algorithm meets the real-time resource integration conditions, the resources occupied by the first algorithm are integrated.

3. The method according to claim 2, It is characterized in that The first computing power resource data includes the actual number of analysis tasks and the number of occupied containers; The first computing power resource data of the first algorithm meets the real-time resource integration condition, including: The number of occupied containers is greater than a first threshold, and the actual number of analysis tasks is less than the product of a first difference and a second threshold, wherein the first difference is the difference between the number of occupied containers and 1, and the second threshold is the maximum analysis task threshold of the resource level corresponding to the first algorithm.

4. The method according to claim 3, It is characterized in that The real-time resource integration principle includes one of the following: In the case where the first ratio is an integer, determining the first number as a difference between the number of occupied containers and the first ratio, wherein the first ratio is a quotient of the actual number of analysis tasks and the second threshold; When the first ratio is not an integer, the first number is determined to be the difference between the number of occupied containers and a first addition result, wherein the first addition result is the sum of a result of rounding up the first ratio and 1.

5. The method according to claim 1, It is characterized in that The integrating the resources occupied by the second algorithms corresponding to different resource levels respectively according to the resource levels includes: Determine the resource level corresponding to each of the second algorithms; respectively summarizing the second computing power resource data of each of the second algorithms corresponding to different resource levels; For each resource level, the resources occupied by each of the second algorithms corresponding to the resource level are integrated according to the second computing power resource data of each of the second algorithms corresponding to the resource level.

6. The method according to claim 5, It is characterized in that The step of integrating, for each resource level, the resources occupied by each of the second algorithms corresponding to the resource level according to the second computing power resource data of each of the second algorithms corresponding to the resource level, includes: For each resource level, when the second computing resource data of each of the second algorithms corresponding to the resource level meets the timed resource integration condition, the resources occupied by each of the second algorithms corresponding to the resource level are integrated.

7. The method according to claim 6, It is characterized in that The second computing power resource data includes: the total number of second algorithms corresponding to the resource level and the total number of GPU cards occupied; The second computing power resource data of each of the second algorithms corresponding to the resource level meets the timed resource integration condition, including: The difference between the total amount of GPU cards occupied and the first rounding result is greater than 1; Among them, the first rounding result is the result of rounding up the second ratio, the second ratio is the quotient of the total number of second algorithms corresponding to the resource level and the third ratio, and the third ratio is the quotient of the total amount of GPU video memory and the GPU video memory corresponding to the resource level.

8. The method according to claim 7, It is characterized in that The integrating the resources occupied by each of the second algorithms corresponding to the resource level includes: Instructing each of the second algorithms corresponding to the resource level to stop a second algorithm analysis task; According to the principle of scheduled resource integration, the GPU occupied by each of the second algorithms corresponding to the resource level is reduced.

9. The method according to claim 8, It is characterized in that The reducing the GPUs occupied by each of the second algorithms corresponding to the resource level according to the principle of timed resource integration includes: Determining a second quantity according to the timing resource integration principle; Migrate and deploy the second subtask deployed on the second container to the third container, wherein the second container is a container on the reduced GPU, the third container is a container on the unreduced GPU, the reduced GPU is the second number of GPUs with the least occupied resources in the first GPU, the first GPU is a GPU running the second algorithm analysis task corresponding to the resource level, the first GPU includes the reduced GPU and the unreduced GPU, and the second algorithm analysis task includes the second subtask; deleting the second container; Release the GPU resources occupied by the second subtask.

10. The method according to claim 9, It is characterized in that The timing resource integration principle includes one of the following: When the second ratio is an integer, determining the second number as a quotient of the total number of occupied GPU cards and the third ratio; When the second ratio is not an integer, the second number is determined to be the difference between the total number of GPU cards occupied and a second addition result, wherein the second addition result is the sum of the first rounding result and 1.

11. A resource integration device, It is characterized in that include: An acquisition module, used for acquiring a triggering mode for resource integration, wherein the triggering mode for resource integration includes one of the following: instruction triggering and scheduled task triggering, wherein the instruction triggering is used to indicate the integration of resources occupied by the first algorithm, and the scheduled task triggering is used to indicate the integration of resources occupied by multiple second algorithms; A first integration module, configured to integrate the resources occupied by the first algorithm according to the first computing power resources of the first algorithm when the triggering mode is instruction triggering; A second integration module is used to integrate the resources occupied by the second algorithm corresponding to different resource levels according to resource levels when the trigger mode is a scheduled task trigger; In the first integration module, the resources occupied by the first algorithm are integrated, including: Instructing the first algorithm to stop the first algorithm analysis task; According to the principle of real-time resource integration, determine the first quantity; Migrate and deploy the first subtask deployed in the reduced container to the unreduced container, wherein the reduced container is the first number of containers that occupy the least resources in the first container, the first container is the container for deploying the first algorithm analysis task corresponding to the first algorithm, the first container includes the reduced container and the unreduced container, and the first algorithm analysis task includes the first subtask; Deleting the reduced container; Release the GPU resources occupied by the first subtask.

12. An electronic device, It is characterized in that It comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the resource integration method as described in any one of claims 1 to 10.

13. A readable storage medium, It is characterized in that The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the resource integration method according to any one of claims 1 to 10 are implemented.