Resource migration method and device, electronic equipment and storage medium
By dynamically evaluating online resource utilization and setting thresholds, the automated migration of online and offline resources is achieved, and the problems of unbalanced resource allocation and difficulty in isolation in Kubernetes clusters are solved, and resource utilization and management efficiency are improved.
Patent Information
- Application Number
- CN202411296745.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-14
AI Technical Summary
In Kubernetes clusters, resource utilization fluctuations in online and offline applications lead to uneven resource allocation, and it is difficult for the existing technology to achieve automated management and isolation of online and offline resources.
By obtaining the utilization rate of online resources, setting the first and second thresholds, dynamically determining the resource status, and transferring or recycling resources based on the status, automatically migrating resources, and optimizing resource allocation using queue tags and preset differences.
It improves resource utilization, solves resource isolation problems, simplifies resource management, and reduces operation and maintenance complexity and manual management costs.
Smart Images

Figure CN119311368A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a resource migration method, device, electronic device and storage medium. Background Art
[0002] Kubernetes is an open source container orchestration platform for automating the deployment, expansion, and management of containerized applications. Enterprise Kubernetes clusters usually run two types of applications: online applications and offline applications. Online applications have long running times, tidal characteristics in service traffic and resource utilization, and are latency-sensitive, such as search recommendation services and e-commerce transaction services. Offline applications have time-divided running times and are usually scheduled and executed at night. During running, resource utilization is high, latency is not sensitive, fault tolerance is high, and retries are possible, such as jobs in big data scenarios. Since online service resource utilization has more obvious fluctuations, resource usage during the day will decrease at night, while offline services will use more resources at night. In related technologies, online and offline services are usually deployed together to utilize idle resources in different time periods of online applications. This can easily lead to problems such as mutual influence between online and offline services and unbalanced resource allocation during the deployment process. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a resource migration method, device, electronic device and storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a resource migration method is provided, comprising acquiring online resources running on a first resource platform, and determining an online resource utilization rate of the online resources; determining a resource status of the first resource platform based on the online resource utilization rate, a first threshold, and a second threshold, wherein the first threshold is used to determine whether the first resource platform needs to transfer resources based on the online resource utilization rate, and the second threshold is used to determine whether the first resource platform needs to recycle resources based on the online resource utilization rate, and the first threshold is less than the second threshold; in response to the resource status being a transfer status, determining a resource transfer amount, and migrating the resources of the first resource platform to the second resource platform according to the resource transfer amount; in response to the resource status being a recycle status, determining a resource recycle amount, and migrating the resources of the second resource platform to the first resource platform according to the resource recycle amount.
[0005] In one embodiment, the resource status of the first resource platform is determined based on the online resource utilization, the first threshold and the second threshold, including: in response to the online resource utilization being less than the first threshold, determining that the resource status of the first resource platform is a transfer status; in response to the online resource utilization being greater than the second threshold, determining that the resource status of the first resource platform is a recycling status.
[0006] In one embodiment, the resource status of the first resource platform is determined based on the online resource utilization, the first threshold and the second threshold, including: in response to multiple online resource utilizations being greater than the first threshold within a preset time period, and the difference between each online resource utilization and the first threshold being less than the preset difference, determining that the resource status of the first resource platform is a transfer status; in response to multiple online resource utilizations being less than the second threshold within a preset time period, and the difference between the second threshold and each online resource utilization being less than the preset difference, determining that the resource status of the first resource platform is a recycling status.
[0007] In one embodiment, in response to the resource status being a transfer status, determining a resource transfer amount, and migrating resources of the first resource platform to the second resource platform according to the resource transfer amount, includes: determining the resource transfer amount based on total resources of the first resource platform, the first threshold, and a preset difference; in response to the idle resources of the first resource platform being greater than the resource transfer amount, migrating the resources of the first resource platform to the second resource platform according to the resource transfer amount.
[0008] In one embodiment, in response to the resource status being a recycling status, determining a resource recycling amount, and migrating resources of the second resource platform to the first resource platform according to the resource recycling amount, includes: determining the resource recycling amount based on a historical resource transfer amount of the first resource platform; in response to the idle resources of the second resource platform being greater than the resource recycling amount, migrating the resources of the second resource platform to the first resource platform according to the resource recycling amount.
[0009] In one embodiment, obtaining online resources running on a first resource platform includes: obtaining multiple queues, each queue having a resource tag, the resource tags including a first resource tag and a second resource tag, the first resource tag indicating that the queue performs an online task, and the second resource tag indicating that the queue performs an offline task; based on the queue having the first resource tag, determining the online resources of the first resource platform.
[0010] According to a second aspect of an embodiment of the present disclosure, a resource migration device is provided, comprising an acquisition unit, configured to acquire online resources running on a first resource platform, and determine an online resource utilization rate of the online resources; a determination unit, configured to determine a resource status of the first resource platform based on the online resource utilization rate, a first threshold value, and a second threshold value, wherein the first threshold value is used to determine whether the first resource platform needs to transfer resources based on the online resource utilization rate, and the second threshold value is used to determine whether the first resource platform needs to recycle resources based on the online resource utilization rate, and the first threshold value is less than the second threshold value; a processing unit, configured to determine a resource transfer amount in response to the resource status being a transfer state, and migrate the resources of the first resource platform to the second resource platform according to the resource transfer amount; and determine a resource recovery amount in response to the resource status being a recovery state, and migrate the resources of the second resource platform to the first resource platform according to the resource recovery amount.
[0011] In one embodiment, based on the online resource utilization, the first threshold and the second threshold, the determination unit determines the resource status of the first resource platform in the following manner: in response to the online resource utilization being less than the first threshold, determining that the resource status of the first resource platform is a transfer status; in response to the online resource utilization being greater than the second threshold, determining that the resource status of the first resource platform is a recycling status.
[0012] In one embodiment, based on the online resource utilization, the first threshold and the second threshold, the determination unit determines the resource status of the first resource platform in the following manner: in response to multiple online resource utilizations being greater than the first threshold within a preset time period, and the difference between each online resource utilization and the first threshold being less than the preset difference, the resource status of the first resource platform is determined to be a transfer status; in response to multiple online resource utilizations being less than the second threshold within a preset time period, and the difference between the second threshold and each online resource utilization being less than the preset difference, the resource status of the first resource platform is determined to be a recycling status.
[0013] In one embodiment, in response to the resource status being a transfer status, a resource transfer amount is determined, and the processing unit migrates the resources of the first resource platform to the second resource platform according to the resource transfer amount in the following manner: the resource transfer amount is determined based on the total resources of the first resource platform, the first threshold, and a preset difference; in response to the idle resources of the first resource platform being greater than the resource transfer amount, the resources of the first resource platform are migrated to the second resource platform according to the resource transfer amount.
[0014] In one embodiment, in response to the resource status being a recycling status, the resource recycling amount is determined, and the processing unit migrates the resources of the second resource platform to the first resource platform according to the resource recycling amount in the following manner: determining the resource recycling amount based on the historical resource transfer amount of the first resource platform; in response to the idle resources of the second resource platform being greater than the resource recycling amount, migrating the resources of the second resource platform to the first resource platform according to the resource recycling amount.
[0015] In one embodiment, the acquisition unit acquires online resources running on the first resource platform in the following manner: acquire multiple queues, each queue having a resource tag, the resource tag including a first resource tag and a second resource tag, the first resource tag indicating that the queue executes an online task, and the second resource tag indicating that the queue executes an offline task; based on the queue having the first resource tag, determine the online resources of the first resource platform.
[0016] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor executable instructions; wherein the processor is configured to: execute the resource migration method described in the first aspect or any one of the implementations of the first aspect.
[0017] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, in which instructions are stored. When the instructions in the storage medium are executed by a processor, the processor is enabled to execute the resource migration method described in the first aspect or any one of the embodiments of the first aspect.
[0018] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: obtaining the online resource utilization rate of the online resources running on the first resource platform, determining the resource status based on the online resource utilization rate, the first threshold value and the second threshold value, and then determining to transfer resources or recycle resources based on the resource status. It realizes resource transfer or resource recycling through dynamic decision-making, thereby improving the utilization rate of resources.
[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0021] Figure 1 The invention is a flowchart of a resource migration method according to an exemplary embodiment.
[0022] Figure 2The present invention is a flowchart showing a method for determining resource status according to an exemplary embodiment.
[0023] Figure 3 The present invention is a flowchart showing a method for determining resource status according to an exemplary embodiment.
[0024] Figure 4 The diagram is a schematic diagram of a resource migration method according to an exemplary embodiment.
[0025] Figure 5 The figure is a flow chart of a method for acquiring online resources according to an exemplary embodiment.
[0026] Figure 6 The diagram is a schematic diagram showing a method for acquiring online resources according to an exemplary embodiment.
[0027] Figure 7 The diagram is a schematic diagram showing a method for determining online resources according to an exemplary embodiment.
[0028] Figure 8 The present invention is a flow chart showing a method for determining a resource transfer amount according to an exemplary embodiment.
[0029] Fig. 9 The present invention is a flowchart showing a method for determining a resource recovery amount according to an exemplary embodiment.
[0030] Fig.10 The figure is a flowchart of a queue configuration method according to an exemplary embodiment.
[0031] Fig.11 The figure is a flow chart of a resource migration method according to an exemplary embodiment.
[0032] Fig.12 The diagram is a block diagram of a resource migration device according to an exemplary embodiment.
[0033] Fig.13 It is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0034] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure.
[0035] Kubernetes is an open source container orchestration platform for automating the deployment, expansion, and management of containerized applications. An enterprise's Kubernetes cluster usually runs two major types of applications: online applications and offline applications. Online applications have long running times, tidal characteristics in service traffic and resource utilization, and are latency-sensitive, such as search recommendation services and e-commerce transaction services. Offline applications run in intervals and are usually scheduled for execution at night. During operation, resource utilization is high, latency is not sensitive, fault tolerance is high, and retries are possible, such as jobs in big data scenarios. Since online service resource utilization has more obvious fluctuations, resource usage during the day will decrease at night, and offline services will use more resources at night.
[0036] In related technologies, the k8s scheduler is usually used to schedule the containers of offline applications and online applications on machines with relatively idle machine resources. However, this method is difficult to develop and implement, and complex to operate and maintain. In particular, the hybrid deployment process has the resource isolation problem of online and offline services affecting each other. In related technologies, namespace management and resource isolation are usually performed manually, which is not convenient for managing the mapping relationship between enterprise organizations, tenants, and applications, and cannot achieve automated resource management.
[0037] In view of this, the present disclosure proposes a resource migration method, which is convenient for managing resources and resource allocation through queues, and solves the problem of resource isolation in the scenario of mixed online and offline resource deployment.
[0038] In the embodiments of the present disclosure, the terms "first resource platform", "online resource pool" and the like can be used interchangeably. The terms "second resource platform", "offline resource pool" and the like can be used interchangeably.
[0039] Figure 1 FIG. 1 is a flow chart of a resource migration method according to an exemplary embodiment. Figure 1 As shown, the method includes steps S11 to S14.
[0040] In step S11, online resources running on the first resource platform are acquired, and online resource utilization rates of the online resources are determined.
[0041] In the embodiment of the present disclosure, the first resource platform can be understood as an online resource pool running online applications or online services. Online resources running on the first resource platform are obtained, and online resource utilization of the online resources is determined. The online resource utilization can be calculated as follows: online resource utilization = (currently allocated resources / total resource size of the online resource pool).
[0042] In the embodiment of the present disclosure, the calculation of online resource utilization is described in conjunction with Table 1.
[0043]
[0044] Table 1
[0045] Based on the above data, online resource utilization = (allocated resources of the root.online.a queue + allocated resources of the root.online.b queue + allocated resources of the root.online.c queue) / total resource size of the online resource pool. The total resource size of the online resource pool is the total resources of all machines under the label machine (total memory resources of all machines, total processor resources of all machines). For example, in Table 1, the maximum value of the online queue resources is max: {memory: 600G, vcore: 2400}, and the maximum value of the offline queue resources is max: {memory: 1200G, vcore: 4800}.
[0046] In step S12, the resource status of the first resource platform is determined based on the online resource utilization, the first threshold and the second threshold.
[0047] In the embodiment of the present disclosure, the first threshold is used to determine whether the first resource platform needs to transfer resources based on the online resource utilization, and the first threshold is expressed as a percentage value of the resource. The second threshold is used to determine whether the first resource platform needs to recycle resources based on the online resource utilization, and the second threshold is expressed as a percentage value of the resource. The first threshold is less than the second threshold.
[0048] In the embodiment of the present disclosure, the resource status of the first resource platform is determined based on the online resource utilization, the first threshold and the second threshold. Exemplarily, if the online resource utilization is less than the first threshold, the resources of the first resource platform can be migrated to the second resource platform. If the online resource utilization is greater than the second threshold, the resources of the second resource platform can be migrated to the first resource platform.
[0049] In step S13, in response to the resource state being a transfer state, a resource transfer amount is determined, and the resources of the first resource platform are migrated to the second resource platform according to the resource transfer amount.
[0050] In the disclosed embodiment, the resource status includes a transfer status and a recycling status. In response to the resource status being a transfer status, the resource transfer amount is determined. The resources of the first resource platform are migrated to the second resource platform according to the resource transfer amount. The transfer status can be understood as the arrival of the online service trough in the online resource pool, and the utilization rate of the online resources decreases, so it is necessary to determine the resource transfer amount, and migrate the resources of the first resource platform to the second resource platform according to the resource transfer amount.
[0051] In step S14, in response to the resource state being a recycling state, a resource recycling amount is determined, and resources of the second resource platform are migrated to the first resource platform according to the resource recycling amount.
[0052] In the disclosed embodiment, when the resource status is the recycling status, it can be understood that there are many online services in the online resource pool, so the second resource platform is required to migrate the resources to the first resource platform according to the resource recycling amount.
[0053] In the embodiment of the present disclosure, in response to the resource status being a transfer status or a recycling status, the resources on the first resource platform and the second resource platform are migrated, thereby realizing automatic management of resources. The resource management problem is solved based on dynamic resource measurement and statistical methods.
[0054] In the embodiment of the present disclosure, the resource status of the first resource platform may be determined in the following manner. Figure 2 FIG. 1 is a flow chart showing a method for determining resource status according to an exemplary embodiment. Figure 2 As shown, the method includes steps S21 to S22b.
[0055] In step S21, the resource status of the first resource platform is determined based on the online resource utilization, the first threshold and the second threshold.
[0056] In step S22a, in response to the online resource utilization being less than a first threshold, it is determined that the resource state of the first resource platform is a transfer state.
[0057] In the embodiment of the present disclosure, when the online resource utilization rate is less than the first threshold, the resources should be migrated from the first resource platform to the second resource platform. Therefore, the resource status of the first resource platform is determined to be a transfer status.
[0058] In step S22b, in response to the online resource utilization being greater than the second threshold, it is determined that the resource state of the first resource platform is a recycling state.
[0059] In the embodiment of the present disclosure, when the online resource utilization rate is greater than the second threshold, the resources should be migrated from the second resource platform to the first resource platform. Therefore, the resource state of the first resource platform is determined to be a recycling state.
[0060] For example, the first threshold is 30% and the second threshold is 80%. When the online resource utilization is lower than the first threshold by 30% in one check, the resource status of the first resource platform is determined to be a transferred resource. When the online resource utilization is higher than the second threshold by 80% in one check, the resources of the first resource platform are determined to be recycled resources. The above data are for illustrative purposes only and are not specifically limited.
[0061] In the embodiment of the present disclosure, in response to the online resource utilization being less than the first threshold, the resource state of the first resource platform is determined to be a transfer state. In response to the online resource utilization being greater than the second threshold, the resource state of the first resource platform is determined to be a recycling state. In addition to determining the resource state in the above manner, the resource state can also be determined by using a preset difference.
[0062] Figure 3 FIG. 1 is a flow chart showing a method for determining resource status according to an exemplary embodiment. Figure 3 As shown, the method includes steps S31 to S32b.
[0063] In step S31, the resource status of the first resource platform is determined based on the online resource utilization, the first threshold and the second threshold.
[0064] In step S32a, in response to the fact that multiple online resource utilizations are greater than a first threshold within a preset time period, and the difference between each online resource utilization and the first threshold is less than a preset difference, it is determined that the resource state of the first resource platform is a transfer state.
[0065] In the embodiment of the present disclosure, the preset difference can be understood as a safety value set for resource migration during the resource migration process, which is between the first threshold and the second threshold and is used to reduce the adjustment frequency when the resource approaches the first threshold or the second threshold.
[0066] In the embodiment of the present disclosure, the online resource utilization is greater than the first threshold, and the difference between the online resource utilization and the first threshold is less than the preset difference, which can be understood as the online resource utilization is less than (first threshold + preset difference) and the online resource utilization is greater than the first threshold.
[0067] In the disclosed embodiment, in order to avoid resource migration errors, when multiple online resource utilizations are greater than a first threshold within a preset time period and the difference between each online resource utilization and the first threshold is less than a preset difference, the resource status is determined to be a transfer status.
[0068] For example, the preset difference is 10% and the first threshold is 30%. The online resource utilization is checked every 5 minutes. If the utilization is lower than 40% and higher than 30% for 5 consecutive checks, the resource status is determined to be a transfer status. The above data is for illustrative purposes only and is not specifically limited.
[0069] In step S32b, in response to the fact that the utilization rates of multiple online resources are all less than the second threshold within the preset time period, and the difference between the second threshold and each online resource utilization rate is less than the preset difference, it is determined that the resource state of the first resource platform is a recycling state.
[0070] In the embodiment of the present disclosure, the online resource utilization is less than the second threshold, and the difference between the second threshold and the online resource utilization is less than the preset difference. It can be understood that when the online resource utilization is greater than (the second threshold - the preset difference) and less than the second threshold, the resource status is determined to be a recycling status.
[0071] In the embodiment of the present disclosure, in order to avoid resource migration errors, when the utilization rates of multiple online resources in a preset time period are all less than a second threshold, and the difference between the second threshold and each online resource utilization rate is less than a preset difference, the resource status is determined to be a transfer status.
[0072] For example, the preset difference is 10% and the second threshold is 80%. The online resource utilization is checked every 5 minutes. If the utilization is more than 70% and less than 80% for 5 consecutive checks, the resource status is determined to be a transfer status. The above data is only for illustrative purposes and is not specifically limited.
[0073] Exemplary, combined Figure 4 Describes resource migration. Figure 4 FIG. 1 is a schematic diagram of a resource migration method according to an exemplary embodiment. Figure 4 As shown, the low water mark can be the first threshold, the high water mark can be the second threshold, and the safety water level can be the preset difference. In the online resource pool, from top to bottom, the resource utilization rate changes from low to high. When the online resource utilization rate is less than the low water mark, that is, the online resource utilization rate is above the low water mark, or the online resource utilization rate is located in the safety buffer zone between the low water mark and the safety water level, it can be understood that the current online task utilization rate is reduced, and the resource state is determined to be a transfer state. Transferable resources can be migrated from the online resource pool to the offline resource pool in unallocated resources. When the online resource utilization rate is greater than the high water mark, that is, the online resource utilization rate is below the low water mark, or the online resource utilization rate is located in the safety buffer zone between the high water mark and the safety water level, it can be understood that the current online task utilization rate is increased, and the resource state is determined to be a recycling state. Recyclable resources can be migrated from the offline resource pool to the online resource pool in unallocated resources. Among them, the recyclable resources can be the transferred resources of the last online resource pool.
[0074] In the disclosed embodiment, by dividing the online and offline resource pools, designing resource high water mark and resource low water mark models, and monitoring the resource usage of the online resource pool, if the high water mark is reached, resource recycling is triggered, and if it is lower than the low water mark, resource transfer is triggered, and the risk of frequent resource transfer and recycling in a period of time is reduced based on complex rule judgment. Resource reuse is achieved, resource utilization is improved, and the problem of resource isolation in offline colocation scenarios is solved.
[0075] In the disclosed embodiment, online resources running on the first resource platform may be acquired in the following manner. Figure 5 FIG. 1 is a flow chart showing a method for obtaining online resources according to an exemplary embodiment. Figure 5 As shown, the method includes steps S41 to S42.
[0076] In step S41, multiple queues are obtained.
[0077] In the embodiment of the present disclosure, each queue has a resource tag, wherein the resource tag includes a first resource tag and a second resource tag. The first resource tag identifies that the queue executes an online task, and the second resource tag identifies that the queue executes an offline task.
[0078] In the disclosed embodiment, a multi-level queue can be formed according to resource usage scenarios and departments, wherein the multi-level queue includes a first-level queue, a second-level queue, and a third-level queue. Figure 6 FIG. 1 is a schematic diagram showing a method for obtaining online resources according to an exemplary embodiment. Figure 6 As shown in the figure, the first-level queue is the root queue. The second-level corresponds to the resource usage scenario, which is divided into online scenarios and offline scenarios. Therefore, two scenario queues are divided, namely online queues and offline queues. Among them, the services running in the online queue have a long running time, the service traffic and resource utilization have tidal characteristics, are sensitive to latency, and have extremely high service requirements, such as message flow services, e-commerce transaction services, etc. The offline queue runs for a long time. Offline applications consume more resources, but the job level is not high, the latency is not sensitive, the fault tolerance rate is high, and interruptions generally allow re-running, such as batch jobs in big data scenarios. The second level can also include resource pool reserved queues, which reserve resources to ensure the addition of new queues or the allocation of resources to other queues, which is equivalent to the concept of resource pools. Three-level or four-level queues. The third or fourth level corresponds to the company's organizational structure. The third-level queue can correspond to each department under the company's organizational structure. At the same time, the third-level queue can also be further divided based on the organizational structure, that is, the fourth-level queue can correspond to each team under the department. Therefore, the level can be divided into three or four levels of queues according to the actual situation.
[0079] In the disclosed embodiment, a department combination and namespace are created for the department. A common form of multi-tenancy is to share a cluster resource among multiple teams within an organization, and each team can operate one or more services. Namespaces are used to isolate and manage resources in a single cluster. In the disclosed embodiment, namespaces and tenants are created at the department level. One namespace for one department, which can be created through kubectlcreatenamespacenamepace_online_a. Among them, namepace_online_a indicates that it corresponds to the department a queue under the online queue. One department, one tenant. Tenants can be created through kubectlcreateserviceaccountuser_a-nnamepace_online_a. It can be understood that a dedicated service account is created for each tenant, and specific permissions are assigned to these accounts to enable operations in their respective namespaces.
[0080] For example, the tenants and namespaces of a department are described in conjunction with Table 2.
[0081] Tenant Name Department Name Namespace Name user_a a namepace_online_a user_a a namepace_offline_a user_b b namepace_online_b user_b b namepace_offline_b user_c c namepace_online_c user_c c namepace_offline_c
[0082] Table 2
[0083] If the department name is a, create a tenant name of user_a and a namespace name of namepace_online_a. Online is the first resource tag, which identifies the online tag. Create a tenant name of user_a and a namespace name of namepace_offline_a. Offline is the second resource tag, which identifies the offline tag. The same applies to the following departments b and c.
[0084] In the embodiment of the present disclosure, the application is automatically assigned to a specific queue in Apache Yuni Korn based on the placement rules, so that the application in the namespace can be assigned to the specified queue. The automatic assignment of queues is described in conjunction with Table 3.
[0085] The namespace where the application is submitted queue namepace_online_a root.online.a namepace_offline_a root.offline.a namepace_online_b root.online.b namepace_offline_b root.offline.b namepace_online_c root.online.c namepace_offline_c root.offline.c
[0086] Table 3
[0087] In the embodiment of the present disclosure, when an application is submitted to YuniKorn in the namespace_online_a, according to placementRules, YuniKorn recognizes that the application belongs to the namespace_online_a, so according to this rule, YuniKorn will automatically assign the application to the root.online.a queue. The same is true for the namespaces submitted by other applications, which will not be elaborated in this disclosure.
[0088] In the embodiment of the present disclosure, to ensure that only the user_a tenant account can submit applications to the root.online.a and root.offline.a queues, the user_b tenant account can submit applications to the root.online.b and root.offline.b queues, or other equivalent tenant accounts can submit applications to the corresponding queues, verification is performed by configuring an access control list. As shown in Table 4,
[0089]
[0090]
[0091] Table 4
[0092] Configure the tenant account user_a for the queues root.online.a and root.offline.a, thereby ensuring that only the user_a tenant account can submit to the root.online.a and root.offline.a queues. The same is true for other queues, which will not be described in detail in this disclosure.
[0093] In the disclosed embodiment, if the tenant of department a submits application xxx and specifies namespace namespace_online_a and user_a, then through the queue configuration placement rule of YuniKorn, application xxx will be automatically submitted to the tenant's queue root.online.a queue. And through the access control list, it is verified to ensure that only the authorized user user_a can submit tasks to the root.online.a queue, thus ensuring the convenience of tenant management and security.
[0094] In step S42, online resources of the first resource platform are determined based on the queue having the first resource tag.
[0095] In the present disclosure, Figure 7 Explain the online resources that determine the first asset platform. Figure 7 FIG. 1 is a schematic diagram showing a method for determining online resources according to an exemplary embodiment. Figure 7As shown, KubernetesNode is a workload physical machine in the cluster that runs containerized applications, referred to as Node. Nodes are divided into two types, placed in two different Node resource pools, online resource pools and offline resource pools, and Nodes are represented by labels. Add label to Node through commands. For example, add the online label to the xxxNode node through the following command, which represents the Node in the online resource pool. For example, it can be kubectllabelnodesxxxnode-label=online. Based on the above command, labels are specified for queues, all online queues specify online labels, all online queues use Node node resources labeled with online labels, and offline queues specify offline labels use Node node resources labeled with offline labels. Then, based on the queue with the first resource label, the online resource of the first resource is determined.
[0096] The first resource tag and the online tag in the above embodiments of the present disclosure may be used interchangeably, and the offline tag may be the second resource tag.
[0097] In the disclosed embodiment, since the resources of the department queue change in real time, other queues can reuse resources when the queue resources are idle, and can exceed the requested resource usage when the resources are busy. Therefore, the following resource metering methods can be used for such resource usage changes. GB*min: how many GB of memory are used in a single minute. Vcore*min: how many Vcores of CPU resources are used in a single minute.
[0098] An exemplary combination is described in Table 5.
[0099] Queue Name cpu usage resources Memory usage resources time root.online.a 20 30 2024-08-05 00:00 root.offline.a 30 10 2024-08-05 00:00 root.offline.b 20 30 2024-08-05 00:00 root.offline.b 30 10 2024-08-05 00:00 root.online.c 40 30 2024-08-05 00:00 root.offline.c 20 10 2024-08-05 00:00
[0100] Table 5
[0101] In the disclosed embodiment, the resource usage information is collected by setting a timer for scheduling every minute, and the allocated resource information of the department sub-queue in the queue is obtained through the interface provided by Apache Yuni Korn. That is, the memory resources and processor (Central Processing Unit, CPU) resources actually allocated to the queue in the current minute. If the minute time is 2024-08-05 00:00, the actual resources allocated to the online queue online at the same time are obtained, such as memory resources of 30GB and cpu resources of 20vcore, and the data is written into the analysis database for statistical resource usage within a certain time range.
[0102] In the disclosed embodiment, a multi-scenario queue organization model is implemented based on the Apache Yuni Korn queue feature, and multi-level queues are divided based on usage scenarios and company organizations to achieve efficient tenant resource management and scenario isolation. Tenants are created through actual company organizations, namespaces are based on queue structure rules, and placement rules for application queues are designed, so that users can automatically assign tasks to corresponding queues by specifying namespaces. The queue access control rules are configured to ensure that only the correct tenants can access the queue, and the automated management of tenants, applications, and queue resources is achieved through the design of the above rules and processes, which improves user efficiency and reduces manual maintenance and management costs, and increases the administrator's control granularity over resources. A tenant queue resource collection, queue dynamic resource metering, and statistical method are implemented to solve the problem of tenant resource quantification in tenant resource management, thereby achieving automated management of tenant resources.
[0103] In the disclosed embodiment, the resource transfer amount may be determined in the following manner, and the resources of the first resource platform may be migrated to the second resource platform according to the resource transfer amount.
[0104] Figure 8 FIG. 1 is a flow chart showing a method for determining a resource transfer amount according to an exemplary embodiment. Figure 8 As shown, the method includes steps S51 to S52.
[0105] In step S51, the resource transfer amount is determined based on the total resources of the first resource platform, the first threshold and the preset difference.
[0106] In the disclosed embodiment, the amount of resource transfer can be determined by the total resources of the first resource platform × (1-first threshold-preset difference). For example, when the first threshold is 30% and the preset difference is 10%, the amount of resource transfer = the total resources of the first resource platform × (1-30%-10%) = the total resources of the first resource platform × 60%. Exemplarily, in combination with Table 1, taking the data in Table 1 as an example, the amount of resource transfer is {memory: 600G × 60%, vcore: 2400 × 60%} = {memory: 360G, vcore: 1440}.
[0107] In step S52, in response to the idle resources of the first resource platform being greater than the resource transfer amount, the resources of the first resource platform are migrated to the second resource platform according to the resource transfer amount.
[0108] In the embodiment of the present disclosure, before migrating resources of the first resource platform to the second resource platform according to the resource transfer amount, it is necessary to determine that the idle resources of the first resource platform are greater than the resource transfer amount. In conjunction with Table 2, the determination of whether the idle resources of the first resource platform are greater than the resource transfer amount is described.
[0109]
[0110] Table 6
[0111] In the disclosed embodiment, the node resource usage and the number of running nodes (pods) whose machine label is online in Table 6 are obtained. Table 6 is sorted as a whole according to the positive order of memory usage, the number of pods, and the positive order of processor usage. The available memory resources and available processor resources of each node are accumulated from the sorted list until the resource transfer amount is exceeded. At this time, the traversed node is the machine list of resources to be released. And the resources of the first resource platform are migrated to the second resource platform according to the resource transfer amount.
[0112] In the embodiment of the present disclosure, the resources of the first resource platform can be migrated to the second resource platform according to the resource transfer amount in the following manner: Mark the node as unschedulable to prevent new pods from being scheduled to the node, and execute the command kubectl cordon <node-name>. By kubectl drain <node-name>--ignore-daemonsets --delete-local-data evicts all pods on the node. via kubectl labelnodes <node-name> <label-key>=offline Update the node label to "offline". Resume the node scheduling and mark the node as schedulable kubectluncordon <node-name>. Update the maximum queue values of the online queue and offline queue. After all transfer nodes have completed the above resource migration operations, update the maximum queue values of the online queue and offline queue.
[0113] Exemplarily, the resources before and after the transfer are described in conjunction with Table 7.
[0114] Based on the above operation, the resource transfer amount is determined to be {memory: 360G, vcore: 1440}. Therefore, the total resources of the online resource pool after the transfer = the total resources of the online resource pool before the transfer – the resources corresponding to the resource transfer amount. The total resources of the offline resource pool after the transfer = the total resources of the offline resource pool before the transfer + the resources corresponding to the resource transfer amount.
[0115]
[0116] Table 7
[0117] In the disclosed embodiment, the maximum value of the online queue = the total resources after the online resource pool transfer = max:{memory:240G, vcore:960}, the maximum value of the offline queue = the total resources after the offline resource pool transfer = max:{memory:1560G, vcore:6240}. After the total memory resources are updated, the resources available to the queue will change.
[0118] In the disclosed embodiment, based on the automated migration of resources, process automation is achieved, idle resources in the resource pool are effectively utilized, resource utilization is improved, and resource reuse is achieved.
[0119] In the disclosed embodiment, the resource recovery amount may be determined in the following manner, and the resources of the first resource platform may be migrated to the second resource platform according to the resource recovery amount. Fig. 9 FIG. 1 is a flow chart showing a method for determining resource recovery amount according to an exemplary embodiment. Fig. 9 As shown, the method includes steps S61 to S62.
[0120] In step S61, the resource recovery amount is determined based on the historical resource transfer amount of the first resource platform.
[0121] In the embodiment of the present disclosure, the resource recovery amount is the historical resource transfer amount, for example, the last resource transfer amount, and the resource recovery amount is determined based on the resources of the last resource transfer amount, for example, {memory: 360G, vcore: 1440} mentioned in the above embodiment.
[0122] In step S62, in response to the idle resources of the second resource platform being greater than the resource recovery amount, the resources of the second resource platform are migrated to the first resource platform according to the resource recovery amount.
[0123] In the embodiment of the present disclosure, the resources of the second resource platform are migrated to the first resource platform according to the resource recovery amount.
[0124] Table 8 describes the migration process.
[0125]
[0126] Table 8
[0127] In the disclosed embodiment, the node resource usage and the number of running nodes (pods) with the machine label online in Table 8 are obtained. Table 8 is sorted as a whole in the order of memory usage, the number of pods, and the processor usage. The available memory resources and available processor resources of each node are accumulated from the sorted list until the resource recovery amount is exceeded. At this time, the traversed nodes are the machine list of resources to be released. And the resources of the first resource platform are migrated to the second resource platform according to the resource transfer amount.
[0128] In the embodiment of the present disclosure, the resources of the second resource platform can be migrated to the first resource platform according to the resource recovery amount in the following manner: Mark the node as unschedulable to prevent new pods from being scheduled to the node, and execute the command kubectl cordon <node-name>. By kubectl drain <node-name>--ignore-daemonsets --delete-local-data evicts all pods on the node. via kubectl labelnodes <node-name> <label-key>=online updates the node label to "online". <node-name>Resume the scheduling of the node and mark the node as schedulable. Update the maximum queue values of the online queue and the offline queue. The maximum queue values of the online queue and the offline queue are explained in conjunction with Table 9.
[0129]
[0130] Table 9
[0131] Based on Table 9, if the amount of resources recycled this time is {memory:360G, vcore:1440}, then based on the total resources after recycling of the online resource pool = the total resources of the online resource pool before recycling + the resources corresponding to the amount of resources recycled, the total resources after recycling of the offline resource pool = the total resources of the offline resource pool before recycling – the resources corresponding to the amount of resources recycled, it can be seen that the maximum value of the online queue = the total resources after recycling of the online resource pool = max:{memory:600G, vcore:2400}, and the maximum value of the offline queue = the total resources after recycling of the offline resource pool = max:{memory:1200G, vcore:4800}. After the total memory resources are updated, the resources available to the queue will change.
[0132] In the disclosed embodiment, a scheduled scanning offline data processing map-reduce (MapReduce MR) or large-scale data processing engine (Apache Spark) job queue and an offline ad hoc query job queue task are also provided. The execution time of the task is obtained through k8s. If the maximum threshold of the task running time is exceeded, the maximum duration of the task is analyzed through historical data. If the threshold is exceeded, the task is abnormal due to full nodes or data skew, and the task needs to be killed through the Kubernetesapi to avoid the task occupying resources for a long time.
[0133] In the disclosed embodiment, based on the automated migration of resources, process automation is achieved, idle resources in the resource pool are effectively utilized, resource utilization is improved, and resource reuse is achieved.
[0134] The present disclosure embodiments are combined with Fig.10 The queue determination method is described. Fig.10 FIG. 1 is a flowchart of a method for configuring a queue according to an exemplary embodiment. Fig.10 As shown, it includes step 1, designing a queue organization model based on scenarios and organizations, creating resource queues, and users submitting applications. Step 2, creating tenants based on departments, creating namespaces based on queue levels, and specifying the correct users and namespaces. Step 3, configuring the placement rules of the queue after application submission, and configuring the access control list of the application queue for security verification and automatic queue placement.
[0135] The present disclosure embodiments are combined with Fig.11 Describe the resource migration method. Fig.11 FIG. 1 is a flow chart of a resource migration method according to an exemplary embodiment. Fig.11 As shown, it includes step 4, dividing the node resource pool, specifying the online node label for the online queue, and specifying the offline node label for the offline queue. Among them, the node is associated with the resource pool, the queue is associated with the node, and the node, resource pool, and queue are associated. Step 5, configure quotas for the queue. Step 6, configure dynamic resource waterlines, set transfer and recovery trigger rules, and monitor the online resource pool usage rate. Step 7, trigger resource transfer, and update the queue to take effect. Step 8, trigger resource recovery, and update the queue to take effect. Step 9, design resource metering methods, and collect department queue resource usage information. Resource information storage and analysis, department resource usage quantification, used for resource cost quantification. Step 10, task killing, used to ensure task execution.
[0136] In the disclosed embodiment, the Apache Yuni Korn queue feature implements a multi-scenario queue organization model, divides multi-level queues based on usage scenarios and company organizations, and realizes efficient tenant resource management and scenario isolation. By organizing and creating tenants, creating namespaces based on queue structure rules, designing application queue placement rules, and enabling users to specify namespaces, tasks can be automatically assigned to corresponding queues, and at the same time, queue access control rules are configured to ensure that only the correct tenants can access the queues. Through the design of the above rules and processes, the automatic management of tenant, application, and queue resources is realized, which improves user efficiency and reduces manual maintenance and management costs, and increases the administrator's control granularity of resources. A tenant queue resource collection, queue dynamic resource metering and statistical method are implemented to solve the problem of tenant resource quantification in tenant resource management. The overall automatic management of tenant resources is realized. By dividing online and offline resource pools, designing resource high water mark and resource low water mark models, by monitoring the resource usage of online resource pools, if the high water mark is triggered, resource recovery is triggered, if it is lower than the low water mark, resource transfer is triggered, and complex rules are designed to reduce the risk of frequent resource transfer and recovery in a period of time. Resource reuse is achieved through resource transfer and recycling based on dynamic decision-making, which improves resource utilization and solves the problem of resource isolation in offline colocation scenarios.
[0137] Based on the same concept, the embodiment of the present disclosure also provides a resource migration device 100.
[0138] It is understandable that the resource migration device 100 provided in the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function in order to realize the above functions. In combination with the units and algorithm steps of each example disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present disclosure.
[0139] Fig.12 FIG. 1 is a block diagram of a resource migration device 100 according to an exemplary embodiment. Fig.12 The device includes an acquisition unit 101, a determination unit 102 and a processing unit 103.
[0140] The acquisition unit 101 is used to acquire online resources running on the first resource platform and determine online resource utilization of the online resources.
[0141] Determination unit 102 is used to determine the resource status of the first resource platform based on the online resource utilization, the first threshold and the second threshold. The first threshold is used to determine whether the first resource platform needs to transfer resources based on the online resource utilization. The second threshold is used to determine whether the first resource platform needs to recycle resources based on the online resource utilization. The first threshold is less than the second threshold.
[0142] Processing unit 103 is used to determine the resource transfer amount in response to the resource status being a transfer state, and migrate the resources of the first resource platform to the second resource platform according to the resource transfer amount; in response to the resource status being a recycling state, determine the resource recycling amount, and migrate the resource recycling amount of the second resource platform to the first resource platform according to the resource recycling amount.
[0143] In one embodiment, based on the online resource utilization, the first threshold and the second threshold, the determination unit 102 determines the resource status of the first resource platform in the following manner: in response to the online resource utilization being less than the first threshold, the resource status of the first resource platform is determined to be a transfer status; in response to the online resource utilization being greater than the second threshold, the resource status of the first resource platform is determined to be a recycling status.
[0144] In one embodiment, based on the online resource utilization, the first threshold and the second threshold, the determination unit 102 determines the resource status of the first resource platform in the following manner: in response to multiple online resource utilizations being greater than the first threshold within a preset time period, and the difference between each online resource utilization and the first threshold being less than the preset difference, the resource status of the first resource platform is determined to be a transfer status; in response to multiple online resource utilizations being less than the second threshold within a preset time period, and the difference between the second threshold and each online resource utilization being less than the preset difference, the resource status of the first resource platform is determined to be a recycling status.
[0145] In one embodiment, in response to the resource status being a transfer status, the resource transfer amount is determined, and the processing unit 103 migrates the resources of the first resource platform to the second resource platform according to the resource transfer amount in the following manner: the resource transfer amount is determined based on the total resources of the first resource platform, the first threshold, and a preset difference; in response to the idle resources of the first resource platform being greater than the resource transfer amount, the resources of the first resource platform are migrated to the second resource platform according to the resource transfer amount.
[0146] In one embodiment, in response to the resource status being a recycling status, the resource recycling amount is determined, and the processing unit 103 migrates the resources of the second resource platform to the first resource platform according to the resource recycling amount in the following manner: the resource recycling amount is determined based on the historical resource transfer amount of the first resource platform; in response to the idle resources of the second resource platform being greater than the resource recycling amount, the resources of the second resource platform are migrated to the first resource platform according to the resource recycling amount.
[0147] In one embodiment, the acquisition unit 101 acquires online resources running on the first resource platform in the following manner: acquire multiple queues, each queue having a resource tag, the resource tag including a first resource tag and a second resource tag, the first resource tag indicating that the queue executes an online task, and the second resource tag indicating that the queue executes an offline task; based on the queue with the first resource tag, determine the online resources of the first resource platform.
[0148] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0149] like Fig.13 As shown, Fig.13 : is a schematic diagram of an electronic device provided by an embodiment of the present invention. One embodiment of the present invention provides an electronic device 200. Among them, the electronic device 200 includes a memory 201, a processor 202, and an input / output (I / O) interface 203. Among them, the memory 201 is used to store instructions. The processor 202 is used to call the instructions stored in the memory 201 to execute the file merging method of the embodiment of the present invention. Among them, the processor 202 is connected to the memory 201 and the I / O interface 203 respectively, for example, it can be connected through a bus system and / or other forms of connection mechanisms (not shown). The memory 201 can be used to store programs and data, including the program of the file merging method involved in the embodiment of the present invention, and the processor 202 executes various functional applications and data processing of the electronic device 200 by running the program stored in the memory 201.
[0150] In the embodiment of the present invention, the processor 202 can be implemented in at least one hardware form of a digital signal processor (Digital Signal Processing, DSP), a field programmable gate array (Field-Programmable Gate Array, FPGA), and a programmable logic array (Programmable Logic Array, PLA). The processor 202 can be a central processing unit (Central Processing Unit, CPU) or one or a combination of other forms of processing units with data processing capabilities and / or instruction execution capabilities.
[0151] The memory 201 in the embodiment of the present invention may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), flash memory, hard disk drive (HDD) or solid-state drive (SSD).
[0152] In the embodiment of the present invention, the I / O interface 203 may be used to receive input instructions (such as digital or character information, and key signal input related to user settings and function control of the electronic device 200), and may also output various information to the outside (such as images or sounds). In the embodiment of the present invention, the I / O interface 203 may include one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a mouse, a joystick, a trackball, a microphone, a speaker, and a touch panel.
[0153] It is to be understood that, although the operations are described in a specific order in the drawings in the embodiments of the present invention, it should not be understood as requiring to perform these operations in the specific order shown or in a serial order, or requiring to perform all the operations shown to obtain the desired results. In certain environments, multitasking and parallel processing may be advantageous.
[0154] The methods and devices involved in the embodiments of the present invention can be implemented using standard programming techniques, using rule-based logic or other logic to implement various method steps. It should also be noted that the words "device" and "module" used herein and in the claims are intended to include implementations using one or more lines of software code and / or hardware implementations and / or devices for receiving input.
[0155] Any steps, operations or procedures described herein may be performed or implemented using one or more hardware or software modules, either alone or in combination with other devices. In one embodiment, the software module is implemented using a computer program product including a computer-readable medium containing computer program code, which can be executed by a computer processor to perform any or all of the described steps, operations or procedures.
[0156] The foregoing description of the implementation of the present invention has been given for purposes of illustration and description. The foregoing description is not intended to be exhaustive nor to limit the invention to the exact form disclosed, and various variations and modifications are possible in accordance with the above teachings or may be obtained from the practice of the invention. These embodiments are selected and described in order to illustrate the principles of the invention and its practical application, so that those skilled in the art can utilize the invention in various embodiments and with various modifications suitable for the particular use contemplated. < / node-name> < / node-name>
Claims
1. A resource migration method, characterized in that: include: Acquire online resources running on the first resource platform, and determine online resource utilization of the online resources; Determining a resource state of the first resource platform based on the online resource utilization, a first threshold, and a second threshold, wherein the first threshold is used to determine whether the first resource platform needs to transfer resources based on the online resource utilization, and the second threshold is used to determine whether the first resource platform needs to reclaim resources based on the online resource utilization, and the first threshold is less than the second threshold; In response to the resource state being a transfer state, determining a resource transfer amount, and migrating resources of the first resource platform to a second resource platform according to the resource transfer amount; In response to the resource state being a recycling state, a resource recycling amount is determined, and resources of the second resource platform are migrated to the first resource platform according to the resource recycling amount.
2. The method according to claim 1, characterized in that The determining the resource status of the first resource platform based on the online resource utilization, the first threshold, and the second threshold includes: In response to the online resource utilization being less than the first threshold, determining that the resource state of the first resource platform is a transfer state; In response to the online resource utilization being greater than the second threshold, it is determined that the resource state of the first resource platform is a recycling state.
3. The method according to claim 1 or 2, characterized in that: The determining the resource status of the first resource platform based on the online resource utilization, the first threshold, and the second threshold includes: In response to the fact that the utilization rates of multiple online resources are all greater than the first threshold within a preset time period, and the difference between each online resource utilization rate and the first threshold is less than a preset difference, determining that the resource state of the first resource platform is a transfer state; In response to the fact that the utilization rates of multiple online resources are all less than the second threshold within a preset time period, and the difference between the second threshold and each online resource utilization rate is less than a preset difference, it is determined that the resource state of the first resource platform is a recycling state.
4. The method according to claim 1, characterized in that: In response to the resource state being a transfer state, determining a resource transfer amount, and migrating resources of the first resource platform to the second resource platform according to the resource transfer amount, includes: Determine the resource transfer amount based on the total resources of the first resource platform, the first threshold and a preset difference; In response to the idle resources of the first resource platform being greater than the resource transfer amount, the resources of the first resource platform are migrated to the second resource platform according to the resource transfer amount.
5. The method according to claim 1, characterized in that In response to the resource state being a recycling state, determining a resource recycling amount, and migrating resources of the second resource platform to the first resource platform according to the resource recycling amount, includes: Determining the resource recovery amount based on the historical resource transfer amount of the first resource platform; In response to the idle resources of the second resource platform being greater than the resource recovery amount, the resources of the second resource platform are migrated to the first resource platform according to the resource recovery amount.
6. The method according to claim 4, characterized in that Access online resources running on the First Resource Platform, including: Acquire multiple queues, each queue having a resource tag, the resource tag including a first resource tag and a second resource tag, the first resource tag indicating that the queue executes an online task, and the second resource tag indicating that the queue executes an offline task; Based on the queue having the first resource tag, online resources of the first resource platform are determined.
7. A resource migration device, characterized in that: include: An acquisition unit, configured to acquire online resources running on the first resource platform and determine online resource utilization of the online resources; a determining unit, configured to determine a resource state of the first resource platform based on the online resource utilization, a first threshold, and a second threshold, wherein the first threshold is used to determine whether the first resource platform needs to transfer resources based on the online resource utilization, and the second threshold is used to determine whether the first resource platform needs to reclaim resources based on the online resource utilization, and the first threshold is less than the second threshold; a processing unit, configured to determine a resource transfer amount in response to the resource state being a transfer state, and migrate resources of the first resource platform to a second resource platform according to the resource transfer amount; In response to the resource state being a recycling state, a resource recycling amount is determined, and resources of the second resource platform are migrated to the first resource platform according to the resource recycling amount.
8. The device according to claim 7, characterized in that Based on the online resource utilization, the first threshold and the second threshold, the determining unit determines the resource status of the first resource platform in the following manner: In response to the online resource utilization being less than the first threshold, determining that the resource state of the first resource platform is a transfer state; In response to the online resource utilization being greater than the second threshold, it is determined that the resource state of the first resource platform is a recycling state.
9. The device according to claim 7 or 8, characterized in that Based on the online resource utilization, the first threshold and the second threshold, the determining unit determines the resource status of the first resource platform in the following manner: In response to the fact that the utilization rates of multiple online resources are all greater than the first threshold within a preset time period, and the difference between each online resource utilization rate and the first threshold is less than a preset difference, determining that the resource state of the first resource platform is a transfer state; In response to the fact that the utilization rates of multiple online resources are all less than the second threshold within a preset time period, and the difference between the second threshold and each online resource utilization rate is less than a preset difference, it is determined that the resource state of the first resource platform is a recycling state.
10. The device according to claim 7, characterized in that In response to the resource state being a transfer state, determining a resource transfer amount, the processing unit migrates the resources of the first resource platform to the second resource platform according to the resource transfer amount in the following manner: Determine the resource transfer amount based on the total resources of the first resource platform, the first threshold and a preset difference; In response to the idle resources of the first resource platform being greater than the resource transfer amount, the resources of the first resource platform are migrated to the second resource platform according to the resource transfer amount.
11. The device according to claim 7, characterized in that In response to the resource state being a recycling state, determining a resource recycling amount, the processing unit migrates resources of the second resource platform to the first resource platform according to the resource recycling amount in the following manner: Determining the resource recovery amount based on the historical resource transfer amount of the first resource platform; In response to the idle resources of the second resource platform being greater than the resource recovery amount, the resources of the second resource platform are migrated to the first resource platform according to the resource recovery amount.
12. The device according to claim 10, characterized in that The acquisition unit acquires the online resources running on the first resource platform in the following manner: Acquire multiple queues, each queue having a resource tag, the resource tag including a first resource tag and a second resource tag, the first resource tag indicating that the queue executes an online task, and the second resource tag indicating that the queue executes an offline task; Based on the queue having the first resource tag, online resources of the first resource platform are determined.
13. An electronic device, characterized in that: include: processor: a memory for storing processor-executable instructions; The processor is configured to: execute the resource migration method according to any one of claims 1 to 6.
14. A storage medium, characterized in that: The storage medium stores instructions, and when the instructions in the storage medium are executed by a processor, the processor is enabled to execute the resource migration method according to any one of claims 1 to 6.