Resource allocation method, apparatus and device, and storage medium
By converting the tag attributes of idle resources in the resource cluster into native attributes, the problem of high complexity in resource invocation is solved, and efficient resource invocation and utilization are improved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2026-01-05
- Publication Date
- 2026-07-30
AI Technical Summary
In existing technologies, the complexity and efficiency of calling idle resources in resource clusters are high, mainly because offline business platforms need to manually adjust configuration parameters to adapt to renamed idle resources.
The resource allocation device converts the tagged resource attributes of idle resources into native resource attributes that are compatible with the mixed deployment cluster, and sends them to the mixed deployment cluster. The mixed deployment cluster can directly identify and call up idle resources, thus achieving native attribute matching of resources.
It reduces the complexity of accessing idle resources, improves the efficiency of accessing idle resources, and increases resource utilization in the resource cluster.
Smart Images

Figure CN2026070537_30072026_PF_FP_ABST
Abstract
Description
A resource allocation method, apparatus, device, and storage medium
[0001] This application claims priority to Chinese Patent Application No. 2025101184462, filed on January 23, 2025, entitled “A method, apparatus, device and storage medium for resource allocation”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of computer technology, and in particular to a resource allocation method, apparatus, device, and storage medium. Background Technology
[0003] With the rise of various online services, the demand for various resources, such as Graphics Processing Unit (GPU) resources, is increasing. Therefore, numerous resource clusters, such as GPU resource clusters, have been established. Online service platforms can utilize the native resource attributes of these clusters to process user-submitted online requests. However, as resource costs continue to rise, the resource utilization rate of these clusters is becoming increasingly important. For example, by identifying and utilizing idle resources within the cluster, offline service platforms can leverage these idle resources to process offline requests, thereby improving the resource utilization rate of the clusters.
[0004] As can be seen, a resource cluster typically contains idle resources and online resources. Online resources refer to those currently being used to process online business, while idle resources refer to those not currently being used to process online business. To distinguish between online and idle resources in a resource cluster, idle resources are renamed. However, when an offline business platform calls idle resources, it requires manual adjustments to the platform's configuration parameters to invoke the renamed idle resources. This results in high complexity and low efficiency in calling idle resources. Summary of the Invention
[0005] This application provides a resource allocation method, apparatus, device, and storage medium that can reduce the complexity of accessing idle resources and improve the efficiency of accessing idle resources.
[0006] This application provides a resource allocation method, which is executed by a resource allocation device, and the method includes:
[0007] Obtain the tag resource attributes and mixed deployment cluster identifiers corresponding to N idle resources in the resource cluster; each tag resource attribute marks the corresponding idle resource for processing offline services, and each mixed deployment cluster identifier indicates the mixed deployment cluster associated with the corresponding idle resource, where N is a positive integer;
[0008] Based on the mixed-deployment cluster identifier and tag resource attribute corresponding to the above N idle resources, the native resource attributes corresponding to the above N idle resources are generated; each native resource attribute is adapted to the mixed-deployment cluster associated with the corresponding idle resource;
[0009] Based on the mixed-deployment cluster identifiers corresponding to the aforementioned N idle resources, the native resource attributes of each idle resource are sent to the corresponding mixed-deployment cluster; the aforementioned mixed-deployment cluster is used to call the corresponding idle resource to process offline services based on the received native resource attributes.
[0010] This application provides a resource allocation method, which is executed by resource node devices in a resource cluster. The method includes:
[0011] Obtain the tag resource attributes and mixed deployment cluster identifiers corresponding to N idle resources in the resource cluster; each tag resource attribute marks the corresponding idle resource for processing offline services, and each mixed deployment cluster identifier indicates the mixed deployment cluster associated with the corresponding idle resource, where N is a positive integer;
[0012] The resource allocation device sends the tag resource attributes and mixed-deployment cluster identifiers corresponding to the above N idle resources to the resource allocation device. The resource allocation device is used to send the original resource attributes of each idle resource to the corresponding mixed-deployment cluster according to the mixed-deployment cluster identifiers corresponding to the above N idle resources. Each original resource attribute is generated by the resource allocation device based on the mixed-deployment cluster identifier and tag resource attributes of the corresponding idle resource. The mixed-deployment cluster is used to call the corresponding idle resource to process offline services according to the received original resource attributes.
[0013] One embodiment of this application provides a resource allocation device, which is deployed in a resource allocation equipment and includes:
[0014] The first acquisition module is used to acquire the tag resource attributes and mixed cluster identifiers corresponding to N idle resources in the resource cluster. Each tag resource attribute marks the corresponding idle resource for processing offline services, and each mixed cluster identifier indicates the mixed cluster associated with the corresponding idle resource. N is a positive integer.
[0015] The generation module is used to generate the native resource attributes corresponding to the above N idle resources based on the mixed-deployment cluster identifier and tag resource attributes corresponding to the above N idle resources respectively; each native resource attribute is adapted to the mixed-deployment cluster associated with the corresponding idle resource;
[0016] The first sending module is used to send the original resource attributes of each idle resource to the corresponding mixed cluster according to the mixed cluster identifier corresponding to the above N idle resources; the above mixed cluster is used to call the corresponding idle resource to process offline services according to the received original resource attributes.
[0017] One embodiment of this application provides a resource allocation device, which is deployed in a resource node device in a resource cluster, including:
[0018] The second acquisition module is used to acquire the tag resource attributes and mixed cluster identifiers corresponding to N idle resources in the resource cluster. Each tag resource attribute marks the corresponding idle resource for processing offline services, and each mixed cluster identifier indicates the mixed cluster associated with the corresponding idle resource. N is a positive integer.
[0019] The second sending module is used to send the tag resource attributes and mixed-deployment cluster identifiers corresponding to the aforementioned N idle resources to the resource allocation device; the resource allocation device is used to send the native resource attributes of each idle resource to the corresponding mixed-deployment cluster according to the mixed-deployment cluster identifiers corresponding to the aforementioned N idle resources; each native resource attribute is generated by the resource allocation device based on the mixed-deployment cluster identifier and tag resource attributes of the corresponding idle resource; the mixed-deployment cluster is used to call the corresponding idle resource to process offline services according to the received native resource attributes.
[0020] One embodiment of this application provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method described above.
[0021] One embodiment of this application provides a computer storage medium storing a computer program, which, when executed by a processor, performs the steps of the above-described method.
[0022] One aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0023] In this application, a resource allocation device converts the tag resource attributes corresponding to N idle resources into native resource attributes adapted to the corresponding mixed-deployment clusters. The native resource attributes of the idle resources are then sent to the corresponding mixed-deployment clusters, meaning the mixed-deployment clusters can directly identify the native resource attributes of the received idle resources. Since the mixed-deployment clusters are registered with their respective connected offline service platforms, they are compatible with these platforms. This means the offline service platforms can directly identify the native resource attributes of the received idle resources, allowing them to directly call the corresponding idle resources to process offline services without needing to adapt configuration parameters. This reduces the complexity of idle resource invocation and improves idle resource invocation efficiency. Attached Figure Description
[0024] Figure 1 is a schematic diagram of a resource allocation system provided in this application;
[0025] Figure 2 is a flowchart illustrating a resource allocation method provided in this application;
[0026] Figure 3 is a flowchart illustrating another resource allocation method provided in this application;
[0027] Figure 4 is a schematic diagram of a scenario for reporting idle resources provided in this application;
[0028] Figure 5 is a schematic diagram of another scenario for distributing offline services provided in this application;
[0029] Figure 6 is a flowchart illustrating another resource allocation method provided in this application;
[0030] Figure 7 is a schematic diagram of a scenario for obtaining idle resources provided in this application;
[0031] Figure 8 is a structural schematic diagram of a resource allocation device provided in this application;
[0032] Figure 9 is a structural schematic diagram of another resource allocation device provided in this application;
[0033] Figure 10 is a structural schematic diagram of a computer device provided in this application. Detailed Implementation
[0034] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0035] To facilitate understanding, the following is a brief explanation of some of the terms used in this application:
[0036] (1) Resource cluster: can refer to a cluster used to provide resources. The resources provided by the resource cluster can be used to process online or offline business. For ease of distinction, the resources provided by the resource cluster can be called candidate resources.
[0037] The resource cluster may include one or more resource node devices, and each resource node device may provide one or more candidate resources of one or more resource types. The resource types may include GPU type, Central Processing Unit (CPU) type, memory type, cache type, and disk type.
[0038] Among them, candidate resources of CPU type can be called CPU resources, candidate resources of GPU type can be called GPU resources, candidate resources of memory type can be called memory resources, candidate resources of cache type can be called cache resources, and candidate resources of disk type can be called disk resources.
[0039] The resource cluster can include GPU resource clusters and CPU resource clusters. A GPU resource cluster can refer to a cluster capable of providing GPU resources, CPU resources, and storage resources; that is, the candidate resources in a GPU resource cluster can be used to process GPU tasks. A CPU resource cluster can refer to a cluster capable of providing CPU resources and storage resources; that is, the candidate resources in a CPU resource cluster can be used to process CPU tasks. Storage resources can refer to at least one of the aforementioned disk resources, cache resources, and memory resources.
[0040] GPU services can refer to services that require serial processing, including both offline and online GPU services; CPU services can refer to services that require parallel processing, including both offline and online CPU services.
[0041] It should be noted that GPU online services and CPU online services can be collectively referred to as online services. Online services refer to services that require real-time response to user requests and interaction with users. For example, GPU online services may include real-time rendering of game graphics and online image recognition services; CPU online services may include real-time product browsing and online data transmission services.
[0042] It should be noted that GPU offline services and CPU offline services can be collectively referred to as offline services. Offline services refer to services that do not require real-time response to user requests and can be executed in the background or during off-peak hours. For example, GPU offline services may include offline model training services and offline video transcoding services; CPU offline services may include data backup services and offline data computing services.
[0043] (2) Mixed Deployment Cluster: This can refer to a cluster used to receive offline services. A mixed deployment cluster used to receive GPU offline services can be called a GPU mixed deployment cluster, and a mixed deployment cluster used to receive CPU offline services can be called a CPU mixed deployment cluster. A cluster architecture that includes both mixed deployment clusters and resource clusters can be called a two-layer cluster architecture. For example, it could be a system architecture composed of two layers of Kubernetes (k8s) clusters. Both the mixed deployment cluster and the resource cluster can refer to a Kubernetes cluster, a resource scheduling and management platform used for container orchestration. In other words, a resource cluster can be a Kubernetes cluster, and a mixed deployment cluster can be a Kubernetes cluster.
[0044] (3) Tag Resource Attributes: Also known as mixed-use resource attributes, these attributes indicate whether idle resources are used for offline services and specify the resource type of the idle resources. Tag resource attributes may include a mixed-use resource type tag, indicating whether the idle resources are used for offline services and specifying the resource type of the idle resources. Tag resource attributes may also include the amount of idle resources, indicating the amount of idle resources.
[0045] (4) Native Resource Attributes: In a mixed-deployment cluster, native resource attributes are used to indicate the resource type of idle resources; in a resource cluster, native resource attributes are used to indicate the resource type of online resources. Specifically, native resource attributes may include a native resource type label, which indicates the resource type (idle resource or online resource).
[0046] In a resource cluster, to distinguish between idle and online resources, the resource attributes of idle resources are represented by tagged resource attributes, while the resource attributes of online resources are represented by native resource attributes. Since a mixed-deployment cluster can only recognize the native resource attributes of idle resources, the resource attributes of idle resources are represented by native resource attributes in a mixed-deployment cluster.
[0047] The design concept of the embodiments of this application will be briefly introduced below.
[0048] Currently, with the rise of various online businesses, the demand for various resources is increasing, leading to the establishment of numerous resource clusters. Online business platforms can utilize the native resource attributes of candidate resources to call upon resources within these clusters to process user-submitted online business requests. However, online business exhibits a "tidal" phenomenon, meaning that the resource requirements of online businesses vary across different time periods. For example, an online business platform might be a social media platform. During off-hours, the platform experiences higher user numbers, resulting in higher resource requirements for its online services during these times; conversely, during peak hours, the platform experiences lower user numbers, leading to higher resource requirements. Therefore, deploying candidate resources in the resource cluster based solely on the time periods when the online business platform requires the most resources might result in some candidate resources remaining unused, leading to low resource utilization within the resource cluster.
[0049] To improve resource utilization in a resource cluster, idle resources can be identified and used by the offline business platform to process offline tasks. After identifying idle resources in the resource cluster, they are renamed to distinguish between online and idle resources; that is, the original resource attributes of the idle resources are renamed.
[0050] For example, a resource node device may have 30 CPU resources for processing units. 19 of these CPU resources are currently being used to handle online services, while the remaining 11 are idle. These 19 used CPU resources can be called online CPU resources, and the remaining 11 are called idle CPU resources. To distinguish between online and idle CPU resources in the resource cluster, the 11 idle CPU resources can be renamed. This involves adding or modifying fields in the original resource attributes of the idle CPU resources to indicate that they can be used for offline services. However, the offline service platform cannot recognize these renamed idle resources. Therefore, manual adjustments to the offline service platform's configuration parameters are required to invoke these renamed idle resources (i.e., idle CPU resources), resulting in high complexity and low efficiency in invoking idle resources.
[0051] Based on this, in this application, a resource allocation device converts the tag resource attributes corresponding to N idle resources into native resource attributes adapted to the corresponding mixed deployment clusters. The native resource attributes of the idle resources are then sent to the corresponding mixed deployment clusters, meaning the mixed deployment clusters can directly identify the native resource attributes of the received idle resources. Since the mixed deployment clusters are registered with their respective connected offline service platforms, they are compatible with these platforms. This means the offline service platforms connected to the mixed deployment clusters can directly identify the native resource attributes of the received idle resources. Consequently, the offline service platforms can directly call the corresponding idle resources to process offline services based on their native resource attributes, without needing to adapt the configuration parameters of the offline service platforms. This reduces the complexity of calling idle resources and improves their efficiency.
[0052] In addition, among the N idle resources, at least two of the idle resources are associated with different mixed-distribution clusters. That is, the N idle resources are sent to multiple mixed-distribution clusters. Each mixed-distribution cluster can independently call the corresponding idle resource to process offline services based on the received native resource attributes. The mixed-distribution clusters do not interfere with each other. That is, each mixed-distribution cluster can receive the native resource attributes of the idle resources it needs without being aware of the existence of other mixed-distribution clusters, thereby achieving cluster-level isolation of idle resources and improving the utilization rate of resources in the resource cluster.
[0053] First, the resource allocation system implementing this application is introduced, as shown in Figure 1. This resource allocation system includes a resource allocation device 10, a resource cluster 11, and a mixed-distribution cluster. The number of mixed-distribution clusters in the resource allocation system of this application can be multiple. As shown in Figure 1, taking a resource allocation system including two mixed-distribution clusters as an example, the resource allocation system can also include mixed-distribution cluster 12 and mixed-distribution cluster 13.
[0054] Resource cluster 11 may include one or more resource node devices. The number of resource node devices is not limited here. As shown in Figure 1, taking resource cluster 11 with two resource node devices as an example, resource cluster 11 may include resource node device 111 and resource node device 112. It is understood that resource node device 111 and resource node device 112 are connected via a network to facilitate data exchange between the various resource node devices.
[0055] It is understandable that resource cluster 11 can mine idle resources in resource node devices, obtain the tag resource attributes and mixed cluster identifiers corresponding to N idle resources, and send them to resource allocation device 10.
[0056] In one embodiment, each resource node device in the resource cluster can be equipped with a mixed deployment agent component. Each resource node device can obtain the tag resource attributes and mixed deployment cluster identifier of the idle resources in its own resource node device through the deployed mixed deployment agent component, and send the obtained tag resource attributes and mixed deployment cluster identifier of the idle resources to the resource allocation device.
[0057] In one embodiment, a mixed deployment agent component is deployed in a master resource node device in the resource cluster. The mixed deployment agent component mines all resource node devices in the resource cluster to obtain the idle resources in each resource node device, and generates the tag resource attributes and mixed deployment cluster identifier of the idle resources in each resource node device.
[0058] The primary resource node device can refer to the resource node device with the strongest performance in the resource cluster. The device performance can be determined based on the amount of resources provided, data processing efficiency, etc.
[0059] Understandably, the resource allocation device 10 can generate the original resource attributes corresponding to the N idle resources based on the mixed deployment cluster identifier and tag resource attributes corresponding to the N idle resources respectively; and based on the mixed deployment cluster identifier of each idle resource, it can synchronously send the original resource attributes of each idle resource to the corresponding mixed deployment cluster.
[0060] Each hybrid cluster can include one or more hybrid node devices; the number of hybrid node devices in each hybrid cluster is not limited. As shown in Figure 1, hybrid clusters 12 and 13, each including two hybrid node devices, are used as examples. Hybrid cluster 12 can include hybrid node devices 121 and 122. It is understood that hybrid node devices 121 and 122 are network-connected to allow data exchange between the various hybrid node devices in hybrid cluster 12. Hybrid cluster 13 can include hybrid node devices 131 and 132. It is understood that hybrid node devices 131 and 132 are network-connected to allow data exchange between the various hybrid node devices in hybrid cluster 13.
[0061] It should be noted that each mixed deployment cluster can register on the offline business platform it is connected to. For example, mixed deployment cluster 12 can register on the offline business platform 14 it is connected to, and mixed deployment cluster 13 can register on the offline business platform 15 it is connected to.
[0062] It should be noted that different offline service platforms are used to receive different offline services. For example, offline service platform 14 is used to receive service information for GPU offline services, and offline service platform 15 is used to receive service information for CPU offline services. The service information may include service type, service name, and data to be processed.
[0063] It should be noted that the offline service platform can generate processing requests based on service information such as the service type, service name, and data to be processed. The mixed deployment cluster can receive processing requests from the offline service platform it is connected to, and determine the native resource attributes of the idle resources used to process the offline service based on the processing requests. The mixed deployment cluster can then call upon the corresponding idle resources to process the offline service based on the native resource attributes.
[0064] In one embodiment, the hybrid deployment cluster may include a forwarding device, which can be used to receive processing requests sent by connected offline service platforms. Based on the service processing volume of each hybrid node device in the cluster, the forwarding device sends the processing request to the hybrid node device with the lowest service processing volume. The service processing volume can be determined by the number of processing requests currently being processed by the hybrid node device. Thus, when the number of processing requests for offline services is large, multiple hybrid node devices can work collaboratively, rationally allocating offline services according to their respective service processing volumes, thereby improving the overall service processing efficiency of the hybrid deployment cluster.
[0065] In one embodiment, the mixed-deployment cluster can directly receive offline services submitted by users and, based on native resource attributes, call the corresponding idle resources to process the received offline services.
[0066] In one embodiment, each hybrid cluster can identify the native resource attributes of idle resources. That is, each hybrid cluster can determine the resource type of idle resources based on the native resource attributes of idle resources, and invoke idle resources based on the resource type of idle resources.
[0067] Specifically, taking the existence of idle resources A1, A2, and A3 in resource node device 111 as an example, resource node device 111 can obtain the tag resource attributes and mixed-deployment cluster identifier corresponding to its idle resources A1, A2, and A3 through the mixed-deployment proxy component. Resource node device 111 can then report the tag resource attributes and mixed-deployment cluster identifier corresponding to idle resources A1, A2, and A3 to resource allocation device 10. Resource allocation device 10 generates the native resource attributes corresponding to idle resources A1, A2, and A3 based on the mixed-deployment cluster identifier and tag resource attributes. If the mixed-deployment cluster identifiers corresponding to idle resources A1 and A2 both indicate mixed-deployment cluster 12, then resource allocation device 10 can synchronously send the native resource attributes corresponding to idle resources A1 and A2 to mixed-deployment node devices 121 and 122 in mixed-deployment cluster 12. If the mixed cluster identifier of idle resource A3 indicates mixed cluster 13, then resource allocation device 10 can synchronously send the original resource attributes of idle resource A3 to mixed node device 131 and mixed node device 132 in mixed cluster 13.
[0068] Furthermore, taking the offline service platform 14 as an example, the offline service platform 14 can receive service information of offline service B1 sent by the terminal. The offline service platform 14 can determine the resources used to process the offline service B1, as well as the resource type and resource usage of the aforementioned resources, based on service information such as service type, service name, and data to be processed. The offline service platform 14 can generate a processing request carrying the resource type and resource usage of the aforementioned resources, as well as the service information of offline service B1, and send the processing request to the mixed-deployment node device 121. The mixed-deployment node device 121 can process offline service B1 based on this processing request. Specifically, if a resource of type GPU can be used to process offline service B1, and the resource usage of this resource is 3; simultaneously, the native resource type label of idle resource A1 is GPU, and the idle resource usage of idle resource A1 is 3; the native resource type label of idle resource A2 is CPU, and the idle resource usage of idle resource A2 is 3; then the mixed-deployment node device 121 can determine that idle resource A1 is used to process offline service B1. The mixed-deployment node device 121 can generate a call request based on the native resource tag of idle resource A1, the amount of resources called in the processing request, and the service information of offline service B1. The mixed-deployment node device 121 can send the call request to the resource node device 111. The resource node device 111 can call the idle resource A1 to process offline service B1 based on the call request.
[0069] The offline service platform 15 can receive service information for offline service B2 sent by the terminal. The process by which the offline service platform 15 determines the resources used to process offline service B2, as well as the resource type and resource usage, can be referenced to the process described above for the offline service platform 14 determining the resources used to process offline service B1, as well as the resource type and resource usage, and will not be elaborated here. The offline service platform 15 can send a processing request carrying the resource type, resource usage, and service information of offline service B2 to the mixed-deployment node device 131. The process by which the mixed-deployment node device 131 processes offline service B2 based on the processing request can be referenced to the process described above for the mixed-deployment node device 121 processing offline service B1 based on the processing request, and will not be elaborated here.
[0070] Understandably, the mixed-deployment node device, resource node device, and resource allocation device 10 can be a single physical server, a server cluster or distributed system consisting of at least two physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud memory, network services, cloud communication, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0071] It is understandable that terminals can refer to in-vehicle terminals, smartphones, tablets, laptops, desktop computers, smart speakers, speakers with screens, smart TVs, smartwatches, etc., but are not limited to these.
[0072] Further, please refer to Figure 2, which is a flowchart illustrating a resource allocation method provided in an embodiment of this application. As shown in Figure 2, this method can be executed by the resource allocation device in Figure 1. The method may include the following steps:
[0073] S101. Obtain the tag resource attributes and mixed deployment cluster identifiers corresponding to the N idle resources in the resource cluster. It should be noted that the resource cluster includes idle resources and online resources. Online resources refer to candidate resources in the resource cluster that are currently being used to process online business; idle resources can refer to candidate resources that are not currently being used to process online business, i.e., candidate resources that are currently in an idle state.
[0074] It should be noted that the mixed-deployment cluster identifier of an idle resource indicates the mixed-deployment cluster associated with that idle resource. The mixed-deployment cluster associated with the idle resource can call upon that idle resource to process offline services. Mixed-deployment clusters can include GPU mixed-deployment clusters, CPU mixed-deployment clusters, etc. The mixed-deployment cluster identifier can include at least one of characters, numbers, and text. For example, the mixed-deployment cluster identifier for a GPU mixed-deployment cluster can be "GPU tenant cluster (tenancy.x-k8s.io / tenant-GPU)", and the mixed-deployment cluster identifier for a CPU mixed-deployment cluster can be "CPU tenant cluster (tenancy.x-k8s.io / tenant-CPU)".
[0075] Different mixed-deployment clusters connect to different offline service platforms, and these platforms receive different types of offline services. For example, processing GPU offline services requires GPU, CPU, and memory resources; processing CPU offline services requires CPU and memory resources. Therefore, the resource types of idle resources associated with a GPU mixed-deployment cluster can include GPU, CPU, and memory types; the resource types of idle resources associated with a CPU mixed-deployment cluster can include CPU and memory types. Thus, the resource types of idle resources associated with different mixed-deployment clusters may be the same or different.
[0076] It should be noted that N is a positive integer. When N is greater than 1, it means that there are at least two idle resources in the resource cluster. At the same time, at least two of the N idle resources are associated with different mixed-distribution clusters, meaning that multiple idle resources in the resource cluster will be sent to multiple mixed-distribution clusters.
[0077] In this application, when a request for processing offline services is received, the resource allocation device can obtain the tag resource attributes and mixed-deployment cluster identifiers corresponding to the N idle resources in the resource cluster, or the resource allocation device can obtain the tag resource attributes and mixed-deployment cluster identifiers corresponding to the N idle resources in the resource cluster at time intervals, where the time interval can be a preset value; this is beneficial for subsequently calling idle resources to process offline services and improving the resource utilization rate in the resource cluster.
[0078] In one embodiment, the resource allocation device can obtain resource status information corresponding to each candidate resource in the resource cluster from each resource node device in the resource cluster. Based on the resource status information corresponding to each candidate resource, it determines N idle resources from the candidate resources, as well as the tag resource attributes and mixed-distribution cluster identifiers corresponding to the N idle resources. The resource status information can be used to indicate whether there are idle resources among the candidate resources.
[0079] S102. Based on the tag resource attributes and mixed deployment cluster identifiers corresponding to the N idle resources, generate the original resource attributes corresponding to the N idle resources.
[0080] It should be noted that the native resource attributes of each idle resource are adapted to the mixed deployment cluster associated with that idle resource. Here, adaptation means that the mixed deployment cluster can directly identify the native resource attributes. That is, in the process of calling idle resources, the mixed deployment cluster can determine the resource type of the corresponding idle resource based on the native resource attributes, and then call the corresponding idle resource to process offline business.
[0081] It should be noted that the native resource attributes of idle resources can also include the amount of idle resources, which indicates the number of processing units or the number of storage bytes of the idle resource. Specifically, when the native resource type label of the idle resource indicates that the resource type of the idle resource is GPU or CPU, the amount of idle resources indicates the number of processing units of the idle resource; when the native resource type label of the idle resource indicates that the resource type of the idle resource is memory, the amount of idle resources indicates the number of storage bytes of the idle resource.
[0082] It should be noted that the native resource type label can include at least one of characters, numbers, and text. For example, a native resource type label of "GPU" and an idle resource quantity of 8 indicates that there are idle resources of type GPU with 8 processing units in the resource cluster. A native resource type label of "CPU" and an idle resource quantity of 100 indicates that there are idle resources of type CPU with 100 processing units in the resource cluster. A native resource type label of "Memory" and an idle resource quantity of 300 indicates that there are idle resources of type memory with 300 gigabytes (Gi) in the resource cluster.
[0083] In this application, the mixed-deployment node devices in the mixed-deployment cluster are adapted to the native resource attributes of idle resources. That is, the mixed-deployment node devices can identify the native resource attributes of idle resources and can invoke idle resources to process offline services based on these native resource attributes. Therefore, the resource allocation device can generate native resource attributes corresponding to N idle resources based on the tag resource attributes corresponding to each of the N idle resources and the mixed-deployment cluster identifier. This allows the mixed-deployment cluster to directly invoke the corresponding idle resources based on the native resource attributes. In other words, the offline service platform connected to the mixed-deployment cluster can invoke the corresponding idle resources based on the native resource attributes without needing to adaptively adjust the configuration parameters of the offline service platform, thus improving the efficiency of resource invocation.
[0084] S103. Based on the mixed-deployment cluster identifiers corresponding to the N idle resources, send the original resource attributes of each idle resource to the corresponding mixed-deployment cluster.
[0085] In this application, the resource allocation device can determine the associated mixed-deployment cluster for each idle resource based on the mixed-deployment cluster identifier of each idle resource. The original resource attributes of each idle resource are sent to the corresponding mixed-deployment cluster, allowing the mixed-deployment cluster to directly identify the received original resource attributes. Each mixed-deployment cluster (i.e., the offline service platform corresponding to the mixed-deployment cluster) can independently invoke the corresponding idle resource to process offline services based on the received original resource attributes. The mixed-deployment clusters do not interfere with each other; that is, each mixed-deployment cluster can receive the original resource attributes of the idle resources it needs without being aware of the existence of other mixed-deployment clusters. This achieves cluster-level isolation of idle resources, improves resource utilization within the resource cluster, lowers the barrier to entry for using idle resources, and enhances their usability.
[0086] For example, a CPU-based mixed deployment cluster receives the native resource attributes of idle CPU resources and can use these attributes to process offline CPU tasks. Similarly, a GPU-based mixed deployment cluster receives the native resource attributes of idle GPU resources and can use these attributes to process offline GPU tasks, achieving cluster-level isolation for idle CPU and GPU resources. Here, idle CPU resources can refer to idle resources of type CPU used for offline tasks; and idle GPU resources can refer to idle resources of type GPU used for offline tasks.
[0087] In this application, a resource allocation device converts the tag resource attributes corresponding to N idle resources into native resource attributes adapted to the corresponding mixed-deployment clusters. The native resource attributes of the idle resources are then sent to the corresponding mixed-deployment clusters, meaning the mixed-deployment clusters can directly identify the native resource attributes of the received idle resources. Since the mixed-deployment clusters are registered with their respective connected offline service platforms, they are compatible with these platforms. This means the offline service platforms can directly identify the native resource attributes of the received idle resources, allowing them to directly call the corresponding idle resources to process offline services without needing to adapt configuration parameters. This reduces the complexity of idle resource invocation and improves idle resource invocation efficiency. In addition, among the N idle resources, at least two of them are associated with different mixed-deployment clusters. That is, the N idle resources are sent to multiple mixed-deployment clusters. Each mixed-deployment cluster (i.e., the offline service platform corresponding to the mixed-deployment cluster) can independently call the corresponding idle resources to process offline services based on the received native resource attributes. The mixed-deployment clusters do not interfere with each other. That is, each mixed-deployment cluster can receive the native resource attributes of the idle resources it needs without being aware of the existence of other mixed-deployment clusters. This achieves cluster-level isolation of idle resources and improves the utilization rate of resources in the resource cluster.
[0088] Further, please refer to Figure 3, which is a flowchart illustrating another resource allocation method provided in an embodiment of this application. As shown in Figure 3, this method can be executed by the resource allocation device in Figure 1. The method may include the following steps:
[0089] S201. Obtain the tag resource attributes and mixed cluster identifiers corresponding to the N idle resources in the resource cluster.
[0090] In one embodiment, the resource allocation device can receive change notification information sent by the mixed-distribution agent component corresponding to the resource cluster. This change notification message indicates a change in the value of the mixed-distribution resource information field in the reported information of the resource cluster. By receiving the change notification message from the mixed-distribution agent component, the device can promptly detect changes in the value of the mixed-distribution resource information field, thereby quickly responding to dynamic changes in idle resources within the resource cluster. Furthermore, the resource allocation device can send a request to the mixed-distribution agent component to retrieve reported information. Upon receiving the reported information returned by the mixed-distribution agent component in response to the request, the resource allocation device can parse the value of the mixed-distribution resource information field in the reported information to obtain the tag resource attributes and mixed-distribution cluster identifier corresponding to the N idle resources in the resource cluster. Without the need for frequent manual checks and updates of idle resources in the resource cluster, the resource allocation device can automatically receive change notification information and read and parse the reported information, which improves the management efficiency of idle resources.
[0091] It should be noted that the field value of the mixed resource information field in the reported information can indicate the mixed resource information, that is, the tag resource attribute and mixed cluster identifier of the idle resources in the resource cluster.
[0092] It should be noted that the reported information may also include interface version, resource object, callable information, total capacity information, etc. Specifically, the interface version in the reported information can indicate the interface version of the device sending the report; the resource object in the reported information reflects the type of resource object corresponding to the reported information. When the resource object type is Node, the reported information is a detailed description and status report of the device (such as a resource node device); when the resource object type is Pod, the reported information is a configuration or invocation command for the resource.
[0093] Among them, the callable information in the reported information is used to indicate the original resource type label and the amount of callable resources of the candidate resources in the resource cluster. The amount of callable resources can refer to the amount of unused resources. The total resource information in the reported information is used to indicate the original resource type label and the total amount of resources of the candidate resources in the resource cluster.
[0094] S202. Based on the tag resource attributes and mixed deployment cluster identifiers corresponding to the N idle resources, generate the native resource attributes corresponding to the N idle resources.
[0095] In one embodiment, the tag resource attribute of the i-th idle resource includes the mixed-distribution resource type tag of the i-th idle resource; i is a positive integer less than or equal to N. Therefore, the resource allocation device can obtain a tag mapping table configured for the mixed-distribution cluster associated with the i-th idle resource based on the mixed-distribution cluster identifier of the i-th idle resource. This tag mapping table can include at least one tag mapping combination, each including a native resource type tag and a mixed-distribution resource type tag. After obtaining the tag mapping table, the resource allocation device can query the tag mapping table for tag mapping combinations whose included mixed-distribution resource type tags are the same as those of the i-th idle resource. The resource allocation device can determine the native resource type tag included in the queried tag mapping combination as a native resource type tag that has a mapping relationship with the mixed-distribution resource type tag of the i-th idle resource, and use it as the native resource type tag of the i-th idle resource. The resource allocation device can generate the native resource attribute of the i-th idle resource based on the native resource type tag and the tag resource attribute of the i-th idle resource. The tag mapping table allows for quick retrieval of the corresponding native resource type tags, enabling the conversion of tag resource attributes and improving the flexibility and efficiency of resource management.
[0096] It should be noted that this label mapping table can include at least one label mapping combination, and each label mapping combination includes a native resource type label and a mixed-distribution resource type label. This label mapping table is pre-configured and used to map the mixed-distribution resource type labels of idle resources to native resource type labels. One mixed-distribution cluster can correspond to one label mapping table, which can be stored in the resource allocation device.
[0097] In one embodiment, the tag resource attribute of the i-th idle resource further includes the idle resource quantity corresponding to the i-th idle resource and the device identifier of the resource node device to which the i-th idle resource belongs, wherein the resource node device belongs to the resource cluster. Generating the native resource attribute of the i-th idle resource based on its native resource type tag and tag resource attribute includes: the resource allocation device can obtain the native resource attribute template of the mixed-deployment cluster associated with the i-th idle resource from the native resource attribute template set based on the mixed-deployment cluster identifier of the i-th idle resource. The native resource attribute template includes a call field identifier field. The resource allocation device can add the native resource type tag of the i-th idle resource as the field value of the call field to the native resource attribute template, thus clarifying the resource type of the idle resource and providing a basis for subsequent idle resource scheduling. The resource allocation device can add the idle resource quantity corresponding to the i-th idle resource to the template based on the position of the call field in the native resource attribute template, quantifying the available resource quantity of the idle resource, facilitating accurate idle resource allocation and scheduling by the resource allocation device. The resource allocation device can use the device identifier corresponding to the i-th idle resource as the field value of the identifier field and add it to the native resource attribute template to obtain the native resource attribute of the i-th idle resource. Through the native resource attribute template, the native resource attribute of idle resources can be generated through a simple replacement operation, improving the efficiency of native resource attribute generation.
[0098] S203. Based on the mixed-deployment cluster identifiers corresponding to the N idle resources, send the original resource attributes of each idle resource to the corresponding mixed-deployment cluster.
[0099] In one embodiment, the above-mentioned sending the native resource attributes of each idle resource to the corresponding mixed-distribution cluster based on the mixed-distribution cluster identifiers corresponding to the N idle resources includes: the resource allocation device can determine the resource reporting interface of the mixed-distribution cluster associated with the i-th idle resource based on the mixed-distribution cluster identifier of the i-th idle resource; i is a positive integer less than or equal to N. The resource allocation device can call the resource reporting interface to establish an information transmission connection with the mixed-distribution cluster associated with the i-th idle resource. Through this information transmission connection, the native resource attributes of the i-th idle resource are sent to the mixed-distribution cluster corresponding to the i-th idle resource. This enables the resource allocation device to send the native resource attributes of idle resources to the mixed-distribution cluster in a timely manner, allowing the mixed-distribution cluster to obtain the latest resource information in real time, thereby making more accurate resource allocation decisions.
[0100] It should be noted that the resource reporting interface can refer to a communication port or service interface provided by the mixed deployment cluster, which is used to receive resource information (such as the native resource attributes of idle resources) sent by external devices (such as resource allocation devices).
[0101] Please refer to Figure 4, which is a schematic diagram of a scenario for reporting idle resources provided in this application. As shown in Figure 4, the scenario for reporting idle resources includes a resource allocation device 30, a resource cluster 33, a mixed-distribution cluster 31, and a mixed-distribution cluster 32. Among them, the resource cluster 33 includes resource node devices 331, the mixed-distribution cluster 31 includes mixed-distribution node devices 311, and the mixed-distribution cluster 32 includes mixed-distribution node devices 321.
[0102] Specifically, resource allocation device 30 can obtain the reporting information 36 sent by resource cluster 11. The "interface version: v1" in the reporting information 36 can be represented as "apiVersion:v1", reflecting that the interface version of the sending device (i.e., resource node device 331) of the reporting information 36 is version v1. The "resource object: Node" in the reporting information 36 can be represented as "(kind:Node)", reflecting a detailed description and status report of the resource node device for which the reporting information 36 is sent.
[0103] As shown in Figure 4, the "GPU tenant cluster - offline GPU resource: 3" in reported information 36 can be represented as "tenancy.x-k8s.io / tenant-GPU-offline-GPU:3". This reflects the mixed-deployment cluster identifier and tag resource attribute of idle resource A4. "offline-GPU" in "tenancy.x-k8s.io / tenant-GPU-offline-GPU:3" is the mixed-deployment resource type tag for idle resource A4, indicating that the resource type of idle resource A4 is GPU. "3" in "tenancy.x-k8s.io / tenant-GPU-offline-GPU:3" represents the amount of idle resource A4, meaning idle resource A4 is a GPU resource with 3 processing units. "tenancy.x-k8s.io / tenant-GPU-offline-GPU:3" is the mixed-deployment cluster identifier for idle resource A4, reflecting the association between idle resource A4 and the GPU mixed-deployment cluster. The “GPU tenant cluster - offline CPU resource: 40” in reported information 36 can be represented as “tenancy.x-k8s.io / tenant-GPU-offline-CPU:40”, which reflects the mixed-deployment cluster identifier and tag resource attribute of idle resource A5. “offline-CPU” in “tenancy.x-k8s.io / tenant-GPU-offline-CPU:40” is the mixed-deployment resource type tag for idle resource A5, indicating that the resource type of idle resource A5 is CPU. “40” in “tenancy.x-k8s.io / tenant-GPU-offline-CPU:40” represents the amount of idle resource A5, meaning idle resource A5 has 40 CPU units. “tenancy.x-k8s.io / tenant-GPU-offline-CPU:40” is the mixed-deployment cluster identifier for idle resource A5, reflecting the association between idle resource A5 and the GPU mixed-deployment cluster.The “GPU tenant cluster - offline memory resource: 300Gi” in reported information 36 can be represented as “tenancy.x-k8s.io / tenant-GPU-offline-Memory:300Gi”, which reflects the mixed-deployment cluster identifier and tag resource attribute of idle resource A6. “offline-Memory” in “tenancy.x-k8s.io / tenant-GPU-offline-Memory:300Gi” is the mixed-deployment resource type tag of idle resource A6, indicating that the resource type of idle resource A6 is Memory. “300Gi” in “tenancy.x-k8s.io / tenant-GPU-offline-Memory:300Gi” represents the amount of idle resource A6, that is, idle resource A6 has 300 gigabytes of memory resources. In “tenancy.x-k8s.io / tenant-GPU-offline-300Gi”, “tenancy.x-k8s.io / tenant-GPU” is the mixed-deployment cluster identifier of idle resource A6, reflecting the association between idle resource A6 and GPU mixed-deployment cluster.
[0104] As shown in Figure 4, the "CPU tenant cluster - offline CPU resource: 30" in reported information 36 can be represented as "tenancy.x-k8s.io / tenant-CPU-offline-CPU:30". This reflects the mixed-deployment cluster identifier and tag resource attribute of idle resource A7. "offline-CPU" in "tenancy.x-k8s.io / tenant-CPU-offline-CPU:30" is the mixed-deployment resource type tag for idle resource A7, indicating that the resource type of idle resource A7 is CPU. "30" in "tenancy.x-k8s.io / tenant-CPU-offline-CPU:30" represents the amount of idle resource A7, meaning idle resource A7 has CPU resources of 30 processing units. "tenancy.x-k8s.io / tenant-CPU-offline-CPU:30" is the mixed-deployment cluster identifier for idle resource A7, reflecting the association between idle resource A7 and the CPU mixed-deployment cluster. The "CPU tenant cluster - offline memory resource: 200Gi" in reported information 36 can be represented as "tenancy.x-k8s.io / tenant-CPU-offline-Memory:200Gi". This reflects the mixed-deployment cluster identifier and resource attribute of idle resource A8. "offline-Memory" in "tenancy.x-k8s.io / tenant-CPU-offline-Memory:200Gi" is the mixed-deployment resource type tag for idle resource A8, indicating that the resource type of idle resource A8 is Memory. "200Gi" in "tenancy.x-k8s.io / tenant-CPU-offline-Memory:200Gi" represents the amount of idle resource A8, specifically 200 gigabytes of memory resource. In “tenancy.x-k8s.io / tenant-CPU-offline-300Gi”, “tenancy.x-k8s.io / tenant-CPU” is the mixed-deployment cluster identifier of idle resource A8, reflecting the association between idle resource A8 and CPU mixed-deployment cluster.
[0105] As shown in Figure 4, the "CPU resource: 90" in reported information 36 can be represented as "CPU: 90," reflecting the original resource type label and available resource quantity of candidate resource D1. "CPU" in "CPU: 90" is the original resource type label of candidate resource D1, indicating that the resource type of candidate resource D1 is CPU. "90" in "CPU: 90" represents the available resource quantity of candidate resource D1, meaning that candidate resource D1 has 90 unused CPU resources. Similarly, the "Memory resource: 500Gi" in reported information 36 can be represented as "Memory: 500Gi," reflecting the original resource type label and available resource quantity of candidate resource D2. "Memory" in "Memory: 500Gi" is the original resource type label of candidate resource D2, indicating that the resource type of candidate resource D2 is memory. In “Memory:500Gi”, “500Gi” represents the available resource quantity of candidate resource D2, meaning candidate resource D2 has 500 gigabytes of unused memory resources. In reported information 36, “GPU resource:8” can be represented as “GPU:8”, reflecting the native resource type label and available resource quantity of candidate resource D3. “GPU:8” represents the native resource type label of candidate resource D3, indicating that candidate resource D3 is a GPU type resource. “8” in “GPU:8” represents the available resource quantity of candidate resource D3, meaning candidate resource D3 has 8 unused GPU resources.
[0106] As shown in Figure 4, the "CPU resource: 100" in reported information 36 can be represented as "CPU: 100," reflecting the original resource type label and total resource quantity of candidate resource D1. "CPU" in "CPU: 100" is the original resource type label of candidate resource D1, indicating that the resource type of candidate resource D1 is CPU. "100" in "CPU: 100" represents the total resource quantity of candidate resource D1, meaning candidate resource D1 has a total of 100 processing units of CPU resources. Similarly, the "Memory resource: 512Gi" in reported information 36 can be represented as "Memory: 512Gi," reflecting the original resource type label and total resource quantity of candidate resource D2. "Memory" in "Memory: 512Gi" is the original resource type label of candidate resource D2, indicating that the resource type of candidate resource D2 is memory. "512Gi" in "Memory: 512Gi" represents the total resource quantity of candidate resource D2, meaning candidate resource D2 has a total of 512 gigabytes of memory resources. The "GPU resource:8" in reported information 36 can be represented as "GPU:8". It reflects the original resource type label and total resource quantity of candidate resource D3. "GPU" in "GPU:8" is the original resource type label of candidate resource D3, indicating that the resource type of candidate resource D3 is GPU. The "8" in "GPU:8" is the total resource quantity of candidate resource D3, that is, candidate resource D3 has a total of 8 processing units of GPU resources.
[0107] Furthermore, resource node devices in the resource cluster can send reporting information 36 to resource allocation device 30. Resource allocation device 30 can read the mixed-deployment cluster identifier and tag resource attribute corresponding to idle resources A4, A5, A6, A7, and A8 from the reporting information 36. Resource allocation device 30 can convert the tag resource attribute of idle resource A4 based on the mixed-deployment cluster identifier of idle resource A4 to obtain the original resource attribute of idle resource A4. By performing the above operations in sequence, the original resource attributes of idle resources A5, A6, A7, and A8 can be obtained. Resource allocation device 30 can aggregate the original resource attributes of idle resources belonging to the same mixed-deployment cluster into a synchronization message.
[0108] Specifically, if the mixed-deployment cluster identifier of mixed-deployment cluster 31 is a GPU tenant cluster, and the mixed-deployment cluster identifier of mixed-deployment cluster 32 is a CPU tenant cluster, then the resource allocation device 30 can aggregate the native resource attributes corresponding to idle resources A4, A5, and A6 respectively to obtain synchronization information 34; and send the synchronization information 34 to the mixed-deployment node device 311 in mixed-deployment cluster 31. The resource allocation device 30 can aggregate the native resource attributes corresponding to idle resources A7 and A8 respectively to obtain synchronization information 35; and send the synchronization information 35 to the mixed-deployment node device 321 in mixed-deployment cluster 32.
[0109] As shown in Figure 4, the "Interface Version: v1" in synchronization information 34 can be represented as "apiVersion:v1", reflecting that the interface version of the sending device (i.e., resource allocation device 30) of the synchronization information 34 is version v1. The "Resource Object: Node" in synchronization information 34 can be represented as "(kind:Node)", reflecting a detailed description and status report of the resource node device in the synchronization information 34. The "CPU Resource: 40" in synchronization information 34 can be represented as "CPU:40", reflecting the native resource type label and idle resource quantity of idle resource A4. "CPU" in "CPU:40" is the native resource type label of idle resource A4, reflecting that the resource type of idle resource A4 is CPU type. "40" in "CPU:40" represents the idle resource quantity of idle resource A4, meaning that idle resource A4 has CPU resources for 40 processing units. In synchronization information 34, "Memory Resource: 300Gi" can be represented as "Memory: 300Gi". This reflects the native resource type label and amount of idle resource A5. "Memory" in "Memory: 300Gi" is the native resource type label for idle resource A5, indicating that its resource type is memory. "300Gi" represents the amount of idle resource A5, meaning it contains 300 gigabytes of memory. Similarly, in synchronization information 34, "GPU Resource: 3" can be represented as "GPU: 3". This reflects the native resource type label and amount of idle resource A6. "GPU" in "GPU: 3" is the native resource type label for idle resource A6, indicating that its resource type is GPU. "3" represents the amount of idle resource A6, meaning it contains 8 GPU units.
[0110] As shown in Figure 4, the "Interface Version: v1" in synchronization information 35 can be represented as "apiVersion:v1", reflecting that the interface version of the sending device (i.e., resource allocation device 30) of the synchronization information 35 is version v1. The "Resource Object: Node" in synchronization information 35 can be represented as "(kind:Node)", reflecting a detailed description and status report of the resource node device in the synchronization information 35. The "CPU Resource: 30" in synchronization information 35 can be represented as "CPU:30", reflecting the native resource type label and idle resource quantity of idle resource A7. "CPU" in "CPU:30" is the native resource type label of idle resource A7, reflecting that the resource type of idle resource A7 is CPU type. "30" in "CPU:30" represents the idle resource quantity of idle resource A7, meaning that idle resource A7 has CPU resources for 30 processing units. The "Memory resource: 200Gi" in synchronization information 35 can be represented as "Memory: 200Gi". It reflects the original resource type label and amount of free resource A8. "Memory" in "Memory: 200Gi" is the original resource type label for free resource A8, indicating that the resource type of free resource A8 is memory. "200Gi" in "Memory: 200Gi" represents the amount of free resource A8, meaning that free resource A8 has 200 gigabytes of memory resources.
[0111] S204. Receive a request to invoke the j-th idle resource out of N idle resources.
[0112] In this application, after the resource allocation device sends the original resource attributes of each idle resource to the corresponding mixed deployment cluster, it can receive the call request sent by the mixed deployment cluster for the j-th idle resource among N idle resources.
[0113] It should be noted that the aforementioned call request includes the native resource attributes of the j-th idle resource, the call cluster identifier, and the service information of the offline service to be processed; the call cluster identifier is used to indicate the mixed-distribution cluster that sent the call request; j is a positive integer less than or equal to N. In addition, the call request also includes a call device identifier, which indicates the resource node device that provides the j-th idle resource.
[0114] S205. Based on the original resource attributes of the j-th idle resource, generate an offline instance that is compatible with the resource node device of the j-th idle resource.
[0115] In this application, the resource allocation device can obtain an offline instance template adapted to the resource node device of the j-th idle resource. The native resource type tag, resource usage, etc., from the native resource attributes of the j-th idle resource are added to the offline instance template to obtain an offline instance adapted to the resource node device of the j-th idle resource.
[0116] It should be noted that offline instance templates can be manually set in advance or can be the default template in the computer device.
[0117] In one embodiment, the native resource attributes of the j-th idle resource include a native resource type tag and a call resource quantity; step 205 includes: the resource allocation device can obtain an offline instance template adapted to the resource node device corresponding to the j-th idle resource; the offline instance template includes a mixed deployment business type field and the native resource type tag. The resource allocation device can determine the business type corresponding to the offline business to be processed based on the call cluster identifier in the call request. The business type can be GPU type, CPU type, etc. Further, the resource allocation device can determine the business type of the offline business as the field value of the mixed deployment business type field. The resource allocation device can parse the offline instance template to obtain the position of the native resource type tag in the offline instance template. The resource allocation device can add the call resource quantity to the position of the native resource type tag in the offline instance template, that is, use the call resource quantity as the tag value corresponding to the native resource type tag, indicating the call resource quantity of the idle resource corresponding to the native resource type tag. Therefore, the resource allocation device can obtain an offline instance adapted to the resource node device to which the j-th idle resource belongs. There is no need for complex analysis and configuration of calls to idle resources; instead, adapted offline instances can be generated through a simple offline instance template replacement operation.
[0118] It should be noted that the value of the "Mixed Deployment Service Type" field in the offline instance can indicate the service type of the offline service. Specifically, when the value of the "Mixed Deployment Service Type" field is "GPU", it indicates that the service type of the offline service is GPU; when the value of the "Mixed Deployment Service Type" field is "CPU", it indicates that the service type of the offline service is CPU.
[0119] It should be noted that offline instances can also include interface versions, resource objects, requirement information, and limitation information. Specifically, the interface version in an offline instance can indicate the interface version of the sending device; the resource objects in an offline instance reflect the type of resource objects corresponding to the offline instance. When the resource object type of an offline instance is Pod, the offline instance represents configuration or invocation instructions for that resource.
[0120] The demand information in offline instances can be used to indicate the native resource type label of idle resources and the minimum resource usage; the minimum resource usage refers to the minimum amount of resources required to ensure that offline services are processed normally. The limitation information in offline instances can be used to indicate the native resource type label of idle resources and the maximum resource usage; the maximum resource usage indicates the maximum amount of resources required to ensure that offline services are processed normally. The minimum and maximum resource usage can be determined based on the business information of the offline services. Setting the minimum resource usage can prevent over-allocation or under-allocation of resources, while setting the maximum resource usage can prevent offline services from consuming resources without restriction, thereby improving resource utilization efficiency.
[0121] In one embodiment, the resource allocation device can also obtain a label mapping table configured for the mixed-deployment cluster that sent the call request, based on the call cluster identifier. The resource allocation device can query the label mapping table for label mapping combinations where the included native resource type labels are identical to the native resource type labels in the offline instance. The resource allocation device can then replace the native resource type labels in the offline instance with the mixed-deployment resource type labels included in the queried label mapping combinations. This allows the resource cluster to directly utilize idle resources in the resource cluster to process offline services based on the mixed-deployment resource type labels and the amount of resources called in the offline instance, thereby improving the processing efficiency of offline services.
[0122] S206. Send the offline instance and service information corresponding to the j-th idle resource to the resource node device of the j-th idle resource.
[0123] In this application, the resource allocation device can determine and invoke the instance receiving interface of the resource node device providing the j-th idle resource based on the calling device identifier. Through this instance receiving interface, the obtained offline instance and the service information of the offline service to be processed are sent to the resource node device providing the j-th idle resource.
[0124] Please refer to Figure 5, which is a schematic diagram of a scenario for distributing offline services provided in this application. As shown in Figure 5, this scenario for distributing offline services includes a resource allocation device 50, a resource cluster 53, a mixed deployment cluster 51, a mixed deployment cluster 52, an offline service platform 54, and an offline service platform 55. Specifically, the resource cluster 53 includes resource node devices 531, the mixed deployment cluster 51 includes mixed deployment node devices 511, and the mixed deployment cluster 52 includes mixed deployment node devices 521. Mixed deployment node devices 511 can receive processing requests sent by the offline service platform 54, and mixed deployment node devices 521 can receive processing requests sent by the offline service platform 55.
[0125] Taking mixed-deployment cluster 51 as a GPU mixed-deployment cluster and mixed-deployment cluster 52 as a CPU mixed-deployment cluster as an example, specifically, the mixed-deployment node device 511 can receive the processing request 56 for offline service B3 sent by the offline service platform 54, as well as the service information of offline service B3. The "interface version: v1" in the processing request 56 can be represented as "apiVersion:v1", reflecting that the interface version of the receiving device (i.e., the mixed-deployment node device 511) is version v1. The "resource object: Pod" in the processing request 56 can be represented as "kind:Pod", reflecting that the processing request 56 is a configuration or invocation instruction for a resource. The service type of offline service B3 is GPU type.
[0126] The processing request 56 may include requirement information and constraint information. The requirement information may indicate the native resource type labels and minimum resource usage for the three resources used to process the offline service B3. The constraint information may indicate the native resource type labels and maximum resource usage for the three resources used to process the offline service B3. As shown in Figure 5, the minimum and maximum resource usage for the resources in processing request 56 are the same. This is because offline service B3 is a GPU offline service; GPU offline services require parallel processing. When processing offline service B3, sufficient resources need to be allocated at once to ensure the continuity and integrity of parallel processing of offline service B3; therefore, it is not necessary to independently set the minimum and maximum resource usage for each resource.
[0127] Therefore, the demand and constraint information in processing request 56 can indicate the native resource type labels and resource usage of the three resources used to process the offline service B3. As shown in Figure 5, "CPU resource: 10" in processing request 56 can be represented as "CPU: 10", reflecting the native resource type label and resource usage of resource C1. "CPU" in "CPU: 10" is the native resource type label of resource C1, indicating that the resource type of resource C1 is CPU. "10" in "CPU: 10" represents the resource usage of resource C1, meaning that 10 processing units of CPU resources are required to ensure that offline service B3 is processed normally. "Memory resource: 20Gi" in processing request 56 can be represented as "Memory: 20Gi", reflecting the native resource type label and resource usage of resource C2. "Memory" in "Memory: 20Gi" is the native resource type label of resource C2, indicating that the resource type of resource C2 is memory. In “Memory:20Gi”, “20Gi” represents the resource requirement for resource C2, meaning that 20 gigabytes of memory resources are needed to ensure that offline service B3 is processed normally. The “GPU resource:1” requirement in processing request 56 can be represented as “GPU:1”, reflecting the native resource type label and resource requirement of resource C3. “GPU:1” represents the native resource type label of resource C3, indicating that resource C3 is a GPU. The “1” in “GPU:1” represents the resource requirement for resource C3, meaning that one processing unit of GPU resources is needed to ensure that offline service B3 is processed normally.
[0128] Furthermore, the hybrid deployment node device 521 can receive a processing request 57 for offline service B4 sent by the offline service platform 55, as well as the service information of offline service B4. The "interface version: v1" in the processing request 57 can be represented as "apiVersion:v1", reflecting that the interface version (apiVersion) of the receiving device (i.e., the hybrid deployment node device 521) of the processing request 57 is version v1. The "resource object: Pod" in the processing request 57 can be represented as "kind:Pod", reflecting that the processing request 57 is a configuration or invocation instruction for a resource. The service type of offline service B4 is CPU type.
[0129] The business resource information for processing request 57 may include demand information and constraint information. As shown in Figure 5, the minimum and maximum resource usage amounts for processing request 57 are different. This is because the offline service is a CPU offline service, which requires serial processing. When processing offline service B4, the resource allocation can be dynamically adjusted according to the real-time resource requirements of the service to ensure the flexibility of serial processing of offline service B4. Therefore, the minimum and maximum resource usage amounts need to be set independently.
[0130] As shown in Figure 5, the "CPU resource: 20" in the request information of processing request 57 can be represented as "CPU: 20". This reflects the native resource type label and minimum resource requirement of resource C4. "CPU" in "CPU: 20" is the native resource type label of resource C4, indicating that resource C4's resource type is CPU. "20" in "CPU: 20" represents the minimum resource requirement for resource C4, meaning that at least 20 processing units of CPU resources are needed to ensure that offline service B4 is processed normally. Similarly, the "Memory resource: 50Gi" in the request information of processing request 57 can be represented as "Memory: 50Gi". This reflects the native resource type label and minimum resource requirement of resource C5. "Memory" in "Memory: 50Gi" is the native resource type label of resource C5, indicating that resource C5's resource type is memory. "50Gi" in "Memory: 50Gi" represents the minimum resource requirement for resource C5, meaning that at least 50 gigabytes of memory resources are needed to ensure that offline service B4 is processed normally.
[0131] As shown in Figure 5, the "CPU resource: 30" restriction information in processing request 57 can be represented as "CPU: 30," reflecting the native resource type label and maximum resource usage of resource A12. "CPU" in "CPU: 30" is the native resource type label of resource A12, indicating that resource A12's resource type is CPU. "30" in "CPU: 30" represents the maximum resource usage of resource A12, meaning that ensuring offline service B4 is processed normally requires a maximum of 30 processing units of CPU resources. Similarly, the "Memory resource: 60Gi" restriction information in processing request 57 can be represented as "Memory: 60Gi," reflecting the native resource type label and maximum resource usage of resource A13. "Memory" in "Memory: 60Gi" is the native resource type label of resource A13, indicating that resource A13's resource type is memory. In “Memory:60Gi”, “60Gi” represents the maximum amount of resources that resource A13 can access, meaning that a maximum of 60 gigabytes of memory resources are required to ensure that offline service B4 is processed normally.
[0132] Furthermore, taking the example of the mixed-deployment node device 511 determining, based on the processing request 56, that the resource node device 531 can provide three idle resources for processing the offline service B3, the mixed-deployment node device 511 can add a calling device identifier field to the processing request 56; and use the device identifier of the resource node device 531 as the field value of the calling device identifier field to obtain an updated processing request 56; based on the updated processing request 56 and the service information of the offline service B3, a first calling request is generated. The mixed-deployment node device 511 can send the first calling request to the resource allocation device 50. Then, after receiving the first calling request, the resource allocation device 50 can determine that the service type of the offline service B3 is GPU type based on the mixed-deployment cluster identifier of the mixed-deployment cluster 51. The resource allocation device 50 can add the interface version, resource object, requirement information, and restriction information from the updated processing request 56 in the first calling request, as well as the service type of the offline service B3, to the offline instance template to obtain the offline instance 58.
[0133] As shown in Figure 5, the explanations for "Interface Version: v1" and "Resource Object: Pod" in offline instance 58 can be found in the explanations for "Interface Version: v1" and "Resource Object: Pod" in processing request 56, and will not be repeated here. Similarly, the explanations for the requirement and restriction information in offline instance 58 can be found in the explanations for the requirement and restriction information in processing request 56, and will not be repeated here. Furthermore, "Mixed Deployment Service Type: GPU" in offline instance 58 can be represented as "mix-type: GPU," reflecting the service type of offline service B3. "GPU" in "mix-type: GPU" represents the service type of offline service B3, indicating that the service type of offline service B3 is GPU. Resource allocation device 50 can send the service information of offline instance 58 and offline service B3 to resource node device 531. Resource node device 531 can then use idle resources to process offline service B3 based on the service information of offline instance 58 and offline service B3.
[0134] Furthermore, taking the example of the mixed-deployment node device 521 determining, based on processing request 57, that resource node device 531 can provide two idle resources for processing offline service B4, the mixed-deployment node device 521 can add a calling device identifier field to processing request 56 and use the device identifier of resource node device 531 as the field value of this calling device identifier field. The mixed-deployment node device 521 can remove the minimum calling resource quantity in the demand information of processing request 57, that is, replace the minimum calling resource quantity in the demand information of processing request 57 with "0", to obtain an updated processing request 57. The mixed-deployment node device 521 can generate a second calling request based on the updated processing request 57 and the service information of offline service B4. The mixed-deployment node device 521 can send the second calling request to resource allocation device 50. Then, after receiving the second calling request, resource allocation device 50 can determine that the service type of offline service B4 is CPU type based on the mixed-deployment cluster identifier of mixed-deployment cluster 52. Resource allocation device 50 can add the interface version, resource object, requirement information and restriction information from the updated processing request 57 in the second call request, as well as the business type of offline business B4, to the offline instance template to obtain offline instance 59.
[0135] As shown in Figure 5, the explanations for "Interface Version: v1" and "Resource Object: Pod" in offline instance 59 can be found in the explanations for "Interface Version: v1" and "Resource Object: Pod" in processing request 57, and will not be repeated here. Similarly, the explanations for the restriction information in offline instance 59 can be found in the explanations for the restriction information in processing request 57, and will not be repeated here. Furthermore, "Mixed Deployment Service Type: GPU" in offline instance 59 can be represented as "mix-type: CPU," reflecting the service type of offline service B4. "CPU" in "mix-type: CPU" represents the service type of offline service B4, indicating that the service type of offline service B3 is GPU. The minimum call quantity in the demand information of offline instance 59 is "0," indicating that when processing offline service B4, fixed idle resources do not need to be reserved for offline service B4; idle resources can be dynamically scheduled to process offline service B4. Resource allocation device 50 can send the service information of offline instance 59 and offline service B4 to resource node device 531. Resource node device 531 can call idle resources to process offline service B4 based on offline instance 59 and the service information of offline service B4.
[0136] In this application, a resource allocation device converts the tag resource attributes corresponding to N idle resources into native resource attributes adapted to the corresponding mixed-deployment clusters. The native resource attributes of the idle resources are then sent to the corresponding mixed-deployment clusters, meaning the mixed-deployment clusters can directly identify the native resource attributes of the received idle resources. Since the mixed-deployment clusters are registered with their respective connected offline service platforms, they are compatible with these platforms. This means the offline service platforms can directly identify the native resource attributes of the received idle resources, allowing them to directly call the corresponding idle resources to process offline services without needing to adapt configuration parameters. This reduces the complexity of idle resource invocation and improves idle resource invocation efficiency. In addition, among the N idle resources, at least two of them are associated with different mixed-deployment clusters. That is, the N idle resources are sent to multiple mixed-deployment clusters. Each mixed-deployment cluster (i.e., the offline service platform corresponding to the mixed-deployment cluster) can independently call the corresponding idle resources to process offline services based on the received native resource attributes. The mixed-deployment clusters do not interfere with each other. That is, each mixed-deployment cluster can receive the native resource attributes of the idle resources it needs without being aware of the existence of other mixed-deployment clusters. This achieves cluster-level isolation of idle resources and improves the utilization rate of resources in the resource cluster.
[0137] Furthermore, when a mixed-deployment cluster sends a request to access idle resources to the resource allocation device, the resource allocation device can generate an offline instance based on the original resource attributes of the idle resource and the calling cluster identifier of the mixed-deployment cluster that sent the request. Accessing the idle resource through the offline instance, rather than through its original resource attributes, avoids offline and online services competing for resources within the resource cluster.
[0138] Further, please refer to Figure 6, which is a flowchart illustrating another resource allocation method provided in an embodiment of this application. As shown in Figure 6, this method can be executed by the resource cluster in Figure 1. The method may include the following steps:
[0139] S601. Obtain the tag resource attributes and mixed cluster identifiers corresponding to the N idle resources in the resource cluster.
[0140] It should be noted that the resource tag attribute of each idle resource indicates that the corresponding idle resource is used to process offline services, and each mixed deployment cluster identifier indicates the mixed deployment cluster associated with the corresponding idle resource. For explanations of idle resources, idle resource tag attributes, and mixed deployment cluster identifiers, please refer to the explanations of idle resources, idle resource tag attributes, and mixed deployment cluster identifiers above, which will not be repeated here.
[0141] It should be noted that when N is greater than 1, that is, the number of idle resources is at least two. Among the N idle resources, at least two of the idle resources are associated with different mixed-distribution clusters, that is, the N idle resources are sent to multiple mixed-distribution clusters.
[0142] In this application, a mixed deployment proxy component can be deployed in the resource cluster. Through the mixed deployment proxy component, the resource cluster can obtain the tag resource attributes and mixed deployment cluster identifiers corresponding to N idle resources in the resource cluster. By mining multiple idle resources in the resource cluster in parallel, the resource value and resource utilization of the resource cluster can be improved.
[0143] In one embodiment, step 601 includes: the resource cluster can obtain a reporting information template. The reporting information template includes a mixed-distribution resource information field. Using a mixed-distribution proxy component, the tag resource attributes corresponding to the N idle resources and the mixed-distribution cluster identifier are used as field values for the mixed-distribution resource information field and added to the reporting information template to obtain the reporting information. Simultaneously, the resource cluster can generate a change notification message indicating a change in the field value of the mixed-distribution resource information field in the reporting information, and send the change notification message to the resource allocation device.
[0144] In one embodiment, step 601 includes: the resource cluster can obtain the resource status information and resource type corresponding to each of the M candidate resources in the resource cluster. The resource cluster can store the resource types of the idle resources adapted to each mixed-distribution cluster. The resource cluster can obtain the resource type of the first candidate resource. When the resource type of the first candidate resource is the same as the resource type of the idle resource adapted to a certain mixed-distribution cluster, the first candidate resource is associated with that mixed-distribution cluster. Based on this, the resource cluster can identify the mixed-distribution clusters associated with each of the M candidate resources. Further, the resource cluster can determine N idle resources in an idle state from the M candidate resources based on the resource status information associated with each of the M candidate resources, and determine the tag resource attributes and mixed-distribution cluster identifiers corresponding to the N idle resources based on the resource status information, resource status information, and resource type associated with each of the M candidate resources. By fully exploring the idle resources in each candidate resource, the computing power potential of the resource cluster is fully released, and the resource utilization rate of the resource cluster is improved.
[0145] It should be noted that the resource status information of a candidate resource may include resource usage information, the device identifier of the resource node to which it belongs, etc. Resource usage information may include the allocated resource amount, the used resource amount, the total resource amount, etc. The resource node to which it belongs may refer to the resource node that provides the candidate resource, and this resource node belongs to the resource cluster.
[0146] It should be noted that allocated resources can refer to the amount of total resources allocated for processing online services, while used resources can refer to the amount of allocated resources that have been used. For example, if a resource cluster has 100 CPU units, and 60 of these 100 CPU units are allocated for processing online services, and 45 of these 60 allocated CPU units are in use, then the total CPU resources are 100 CPU units, the allocated CPU resources are 60 CPU units, and the used CPU resources are 45 CPU units.
[0147] It should be noted that associating candidate resources with a mixed deployment cluster means that idle resources among the candidate resources can be accessed by that mixed deployment cluster. For an explanation of candidate resources, please refer to the explanation above; it will not be repeated here.
[0148] In this context, a candidate resource can be associated with one or more mixed-deployment clusters. This means that different mixed-deployment clusters can be associated with candidate resources of the same resource type. For example, the resource types of idle resources adapted to a GPU mixed-deployment cluster can include GPU type, CPU type, and memory type. The resource types of idle resources adapted to a CPU mixed-deployment cluster include CPU type and memory type. When the resource type of a candidate resource is GPU, the candidate resource can be associated with a GPU mixed-deployment cluster; when the resource type of a candidate resource is CPU, the candidate resource can be associated with both a GPU mixed-deployment cluster and a CPU mixed-deployment cluster.
[0149] In one embodiment, determining N idle resources from the M candidate resources and determining the tag resource attributes and mixed-distribution cluster identifiers corresponding to the N idle resources based on the resource status information, resource type, and resource status information associated with the M candidate resources respectively includes: when the a-th candidate resource is associated with a first type of mixed-distribution cluster, obtaining the allocated resource quantity and total resource quantity of the a-th candidate resource from its resource status information; where a is a positive integer less than or equal to M; comparing the total resource quantity and the allocated resource quantity, and determining that a first idle resource exists among the a-th candidate resources when the total resource quantity is greater than the allocated resource quantity. The resource cluster can determine the tag resource attributes of the first idle resource based on the resource status information and resource type of the a-th candidate resource and the mixed-distribution cluster identifier of the first type of mixed-distribution cluster; and determine the mixed-distribution cluster identifier of the first idle resource based on the mixed-distribution cluster identifier of the first type of mixed-distribution cluster.
[0150] It should be noted that the first type of mixed-deployment cluster refers to a mixed-deployment cluster used to receive offline services that require parallel processing. These offline services can refer to GPU offline services. Therefore, the first type of mixed-deployment cluster can refer to a GPU mixed-deployment cluster, i.e., a mixed-deployment cluster used to receive GPU offline services. The first idle resource can refer to idle resources used for processing GPU offline services. The resource type of the first idle resource can include GPU type, CPU type, and memory type.
[0151] In one embodiment, determining the tag resource attribute of the first idle resource based on the resource status information and resource type of the a-th candidate resource, and the mixed-distribution cluster identifier of the first type of mixed-distribution cluster, includes: the resource cluster determining the original resource type tag of the a-th candidate resource based on its resource type; the resource cluster determining the renaming method corresponding to the first type of mixed-distribution cluster based on its mixed-distribution cluster identifier; converting the original resource type tag to a mixed-distribution resource type tag using the renaming method corresponding to the first type of mixed-distribution cluster; the resource cluster subtracting the allocated resource quantity from the total resource quantity to obtain the idle resource quantity of the first idle resource; and obtaining the device identifier of the resource node device to which the a-th candidate resource belongs from the resource status information, and determining the idle resource quantity, mixed-distribution resource type tag, and device identifier of the resource node device to which the a-th candidate resource belongs as the tag resource attribute of the first idle resource.
[0152] It should be noted that the resource type of a candidate resource can indicate its native resource type label. For example, if the resource type of a candidate resource is GPU, its native resource type label is GPU; if the resource type of a candidate resource is CPU, its native resource type label is CPU; and if the resource type of a candidate resource is memory, its native resource type label is memory.
[0153] It should be noted that the renaming method can include any of the following: 1. Tag mapping table; a tag mapping table can be used to convert native resource attributes into tag resource attributes with mapping relationships, and vice versa; the specific implementation process of the tag mapping table can be referred to the explanation above, and will not be repeated here; 2. Adding field operation; specifically, field operations can be performed on native resource attributes to obtain tag resource attributes, and field operations can be performed on tag resource attributes to obtain mixed native resource attributes; for example, if the native resource attribute is CPU:80, it indicates that there are 80 CPU type idle resources; adding a field operation to this native resource attribute, that is, adding "offline" at the beginning of CPU. By adding "ine-", you can obtain the tag resource attribute (i.e., offline-CPU: 80). Simultaneously, deleting the field "offline-" from this tag resource attribute yields the native resource attribute (i.e., CPU: 80). 3. Field movement operations: Specifically, you can move fields in the native resource attribute to obtain the tag resource attribute. You can also move fields in the tag resource attribute again to obtain the mixed native resource attribute. For example, if the native resource attribute is CPU: 80, it indicates that there are 80 CPU-type idle resources. Moving the "C" in "CPU" to the end yields the tag resource attribute (i.e., PUC: 80). Simultaneously, moving the "C" in "PUC" to the beginning yields the native resource attribute (i.e., CPU: 80).
[0154] In one embodiment, the a-th candidate resource can be associated with one or more mixed-distribution clusters. When the a-th candidate resource is also associated with a second type of mixed-distribution cluster, the resource cluster can obtain the used resource amount and total resource amount of the a-th candidate resource from the resource status information. The resource cluster can obtain the reserved amount ratio configured for the a-th candidate resource, multiply the total resource amount and the reserved amount ratio to obtain the reserved resource amount. The reserved resource amount is then added to the used resource amount to obtain the occupied resource amount of the a-th candidate resource. When the total resource amount is greater than the occupied resource amount, the resource cluster can determine that there is a second idle resource among the a-th candidate resources. The resource cluster can determine the tag resource attribute of the second idle resource based on the occupied resource amount, resource status information, and resource type of the a-th candidate resource, as well as the mixed-distribution cluster identifier of the second type of mixed-distribution cluster; and determine the mixed-distribution cluster identifier of the second idle resource based on the mixed-distribution cluster identifier of the second type of mixed-distribution cluster. The summation process includes addition, weighted summation, etc.
[0155] It should be noted that the second type of mixed-deployment cluster is a mixed-deployment cluster used to receive offline services that require serial processing. These offline services can refer to CPU offline services. Therefore, the second type of mixed-deployment cluster can refer to a CPU mixed-deployment cluster, i.e., a mixed-deployment cluster used to receive CPU offline services. The second type of idle resource can refer to idle resources used to process CPU offline services. The resource type of the second type of idle resource can include CPU type and memory type.
[0156] It should be noted that the reserved resource ratio can be manually set or set to a default value in the resource cluster. Reserved resources refer to the amount of resources reserved for online services out of the total resources, while occupied resources refer to the sum of used and reserved resources. For example, a resource cluster has 100 CPU units, of which 60 are allocated for online services, and 45 of these are in use. The reserved resource ratio for the CPU resources is 30%. In this case, the total CPU resources are 100 processing units, the allocated CPU resources are 60, the used CPU resources are 45, the reserved CPU resources are 30, and the occupied CPU resources are 75.
[0157] In one embodiment, determining the tag resource attribute of the second idle resource based on the occupied resource amount, resource status information, and resource type of the a-th candidate resource, and the mixed cluster identifier of the second type of mixed cluster, includes: the resource cluster determining the original resource type tag of the a-th candidate resource based on its resource type; the resource cluster determining the renaming method corresponding to the second type of mixed cluster based on its mixed cluster identifier; and converting the original resource type tag to a mixed resource type tag using the renaming method corresponding to the second type of mixed cluster; the resource cluster obtaining the device identifier and total resource amount of the resource node device to which the a-th candidate resource belongs from the resource status information; the resource cluster obtaining the idle resource amount of the second idle resource by subtracting the occupied resource amount from the total idle resource amount; and the resource cluster determining the idle resource amount of the second idle resource, the mixed resource type tag, and the device identifier of the resource node device to which the a-th candidate resource belongs as the tag resource attribute of the second idle resource.
[0158] S602. Send the tag resource attributes and mixed cluster identifier corresponding to the N idle resources to the resource allocation device.
[0159] In this application, the resource cluster can send the tag resource attributes and the mixed deployment cluster identifier corresponding to N idle resources to the resource allocation device through the mixed deployment agent component.
[0160] In one embodiment, after sending the tag resource attributes and mixed-deployment cluster identifier corresponding to each of the N idle resources to the resource allocation device, the resource cluster can receive the offline instance of the j-th idle resource among the N idle resources, as well as the service information of the offline service to be processed. The offline instance includes a mixed-deployment service type field; j is a positive integer less than or equal to N.
[0161] Because idle resources of the same resource type in the same resource node device may be sent to different mixed-distribution resource clusters, if multiple mixed-distribution resource clusters simultaneously call idle resources of the same resource type in the same resource node device based on their native resource attributes, it will cause multiple mixed-distribution resource clusters to compete for the idle resource, resulting in the inability to process offline services in multiple mixed-distribution clusters. For example, in Figure 1, idle resources A2 and A3 are both idle CPU resources in resource node device 111. Idle resource A2 is sent to mixed-distribution cluster 12, and idle resource A3 is sent to mixed-distribution cluster 13. If mixed-distribution cluster 12 calls idle resource A2 to process offline services based on its native resource attributes, and simultaneously, mixed-distribution cluster 13 calls idle resource A3 to process offline services based on its native resource attributes, this will cause mixed-distribution clusters 12 and 13 to compete for idle resources of the same resource type in resource node device 111, resulting in the inability to process offline services in mixed-distribution clusters 12 and 13.
[0162] Based on this, the resource cluster can identify the field values of the mixed-deployment service type field in the aforementioned offline instances to obtain the service type of the offline service to be processed. The resource cluster can obtain a priority mapping table, which includes at least two priority mapping combinations, each containing a service type and a service priority. The resource cluster can query the priority mapping table for priority mapping combinations whose included service types match the service type of the offline service to be processed. The resource cluster can then determine the service priority included in the queried priority mapping combinations as the service priority of the offline service to be processed. Based on the service priority of the offline service to be processed, the resource cluster can determine the processing strategy (e.g., processing network, processing order) for the offline service to be processed. Using the above processing strategy, based on the offline instance and the above service information, the j-th idle resource is invoked to process the offline service to be processed. When offline services in multiple mixed-deployment clusters all need to invoke idle resources of the same resource type, the resource cluster can determine the processing order of each offline service based on its respective service priority, ensuring that each offline service is processed sequentially according to the processing order. This avoids multiple mixed-deployment clusters competing for idle resources of the same resource type, thus improving the processing efficiency of offline services.
[0163] It should be noted that service priorities can include first priority, second priority, etc., with first priority being higher than second priority. Service priorities can be used to determine the processing strategy for offline services, which can include processing order, processing network, etc. The processing network can include high-speed network, low-speed network, etc.; high-speed network has a faster data processing speed than low-speed network.
[0164] Specifically, the higher the priority of an offline service, the earlier it is processed, and the faster the network data processing speed for that service; conversely, the lower the priority of an offline service, the later it is processed, and the slower the network data processing speed for that service.
[0165] For example, as shown in Figure 1, idle resources A2 and A3 in Figure 1 are both idle CPU resources in resource node device 111. Idle resource A2 is sent to the mixed deployment cluster 12, and idle resource A3 is sent to the mixed deployment cluster 13. When the mixed deployment cluster 12 needs to call idle resource A2 to process offline service B5, the resource cluster can receive the offline instance E1 for idle resource A2 sent by the resource allocation device. Simultaneously, when the mixed deployment cluster 13 needs to call idle resource A3 to process offline service B6, the resource cluster can receive the offline instance E2 for idle resource A3 sent by the resource allocation device. Taking the field value of the mixed deployment service type field in offline instance E1 as GPU and the field value of the mixed deployment service type field in offline instance E2 as CPU, the resource cluster can determine that the service type of offline service B5 is GPU type and the service type of offline service B6 is CPU type.
[0166] Furthermore, if the priority mapping table indicates that the service priority of GPU-type offline services is the first priority and that the service priority of CPU-type offline services is the second priority, the resource cluster can determine that the service priority of offline service B5 is the first priority and the service priority of offline service B6 is the second priority. That is, the processing order of offline service B5 is before the processing order of offline service B6. The processing network for offline service B5 can be a high-speed network, and the processing network for offline service B6 can be a low-speed network. The resource cluster can first use the high-speed network to call idle resource A2 to process offline service B5, and then, after offline service B5 is processed, use the low-speed network to call idle resource A3 to process offline service B6. In this way, mixed deployment clusters 12 and 13 will not preempt idle CPU resources in resource node device 111, and both offline services B5 and B6 can be processed normally, which helps improve the processing efficiency of offline services.
[0167] In one embodiment, the offline instance includes a mixed-resource type label. The resource cluster can determine the mixed-resource type label in the offline instance as the mixed-resource type label of the j-th idle resource. The resource cluster can obtain the label value corresponding to the mixed-resource type label in the offline instance and use this label value as the resource amount to be called for the j-th idle resource. Based on the mixed-resource type label and the resource amount to be called for the j-th idle resource, the resource cluster can call the j-th idle resource to process the offline business to be processed. The resource cluster can use the mixed-resource type label to call idle resources to process offline business, avoiding offline business from occupying online resources and thus affecting the normal processing of online business.
[0168] Please refer to Figure 7, which is a schematic diagram of a scenario for obtaining idle resources provided by this application. The mixed-deployment proxy component in Figure 7 can be the mixed-deployment proxy component deployed in the resource node device 331 in Figure 4. In other words, Figure 7 can be a schematic diagram of a scenario in which the resource node device 331 can obtain its own idle resources through the mixed-deployment proxy component.
[0169] Specifically, resource node device 331 can obtain candidate information 71. The "interface version: v1" in candidate information 71 can be represented as "apiVersion:v1", reflecting that the interface version of the device obtaining candidate information 71 (i.e., resource node device 331) is version v1. The "resource object: Node" in candidate information 71 can be represented as "kind:Node", reflecting that candidate information 71 is a detailed description and status report for this resource node device 331.
[0170] Specifically, the callable information in candidate information 71 indicates the original resource type label and the amount of callable resources corresponding to candidate resources D1, D2, and D3, respectively; the total information in candidate information 71 indicates the original resource type label and the total resource amount corresponding to candidate resources D1, D2, and D3, respectively. For explanations of the callable information and total capacity information in candidate information 71, please refer to the explanations of the callable information and total capacity information in reported information 36 in Figure 4; these will not be repeated here.
[0171] Furthermore, resource node device 331 can use the mixed deployment proxy component to determine the associated mixed deployment clusters for each of the candidate resources D1, D2, and D3 in the candidate information 71, based on their respective resource types. Resource node device 331 can also use the mixed deployment proxy component to determine the mixed deployment cluster identifiers and tag resource attributes corresponding to idle resources A4, A5, A6, A7, and A8, based on the associated mixed deployment clusters, resource status information, and resource types for each of the candidate resources D1, D2, and D3. Resource node device 331 can then aggregate the mixed deployment cluster identifiers and tag resource attributes corresponding to idle resources A4, A5, A6, A7, and A8 to obtain reporting information 72. Among them, reported information 72 may refer to reported information 36 in Figure 4. For an explanation of reported information 72, please refer to the explanation of reported information 36 in Figure 4. It will not be repeated here.
[0172] Specifically, resource node device 331 can use the mixed deployment proxy component to determine, based on the native resource type tag of candidate resource D1, that the resource type of candidate resource D1 is CPU, and that the mixed deployment cluster associated with candidate resource D1 includes GPU mixed deployment clusters and CPU mixed deployment clusters. Resource node device 331 can then determine, based on the resource status information and resource type of candidate resource D1, as well as the GPU and CPU mixed deployment clusters, that there are idle resources A5 and A7 within candidate resource D1, and determine the mixed deployment cluster identifier and tag resource attribute corresponding to idle resources A5 and A7, respectively. By sequentially performing the above operations, it can be determined that there are idle resources A6 and A8 in candidate resource D2, and determine the mixed deployment cluster identifier and tag resource attribute corresponding to idle resources A6 and A8, respectively; it can also be determined that there is idle resource A4 in candidate resource D3, and determine the mixed deployment cluster identifier and tag resource attribute of idle resource A4.
[0173] In this application, a resource allocation device converts the tag resource attributes corresponding to N idle resources into native resource attributes adapted to the corresponding mixed-deployment clusters. The native resource attributes of the idle resources are then sent to the corresponding mixed-deployment clusters, meaning the mixed-deployment clusters can directly identify the native resource attributes of the received idle resources. Since the mixed-deployment clusters are registered with their respective connected offline service platforms, they are compatible with these platforms. This means the offline service platforms can directly identify the native resource attributes of the received idle resources, allowing them to directly call the corresponding idle resources to process offline services without needing to adapt configuration parameters. This reduces the complexity of idle resource invocation and improves idle resource invocation efficiency. In addition, among the N idle resources, at least two of them are associated with different mixed-deployment clusters. That is, the N idle resources are sent to multiple mixed-deployment clusters. Each mixed-deployment cluster (i.e., the offline service platform corresponding to the mixed-deployment cluster) can independently call the corresponding idle resources to process offline services based on the received native resource attributes. The mixed-deployment clusters do not interfere with each other. That is, each mixed-deployment cluster can receive the native resource attributes of the idle resources it needs without being aware of the existence of other mixed-deployment clusters. This achieves cluster-level isolation of idle resources and improves the utilization rate of resources in the resource cluster.
[0174] Please refer to Figure 8, which is a schematic diagram of a resource allocation device provided in an embodiment of this application. As shown in Figure 8, the resource allocation device may include:
[0175] The first acquisition module 811 is used to acquire the tag resource attributes and mixed cluster identifiers corresponding to N idle resources in the resource cluster; each tag resource attribute marks the corresponding idle resource for processing offline services, and each mixed cluster identifier indicates the mixed cluster associated with the corresponding idle resource, where N is a positive integer;
[0176] The generation module 812 is used to generate the native resource attributes corresponding to the above N idle resources based on the mixed-deployment cluster identifier and tag resource attributes corresponding to the above N idle resources respectively; each native resource attribute is adapted to the mixed-deployment cluster associated with the corresponding idle resource;
[0177] The first sending module 813 is used to send the original resource attributes of each of the above N idle resources to the corresponding mixed cluster identifiers. The mixed cluster is used to call the corresponding idle resources to process offline services according to the received original resource attributes.
[0178] Optionally, the tag resource attribute of the i-th free resource includes the mixed resource type tag of the i-th free resource mentioned above; i is a positive integer less than or equal to N; the generation module 812 can also be used to perform the following operations:
[0179] Based on the mixed cluster identifier of the i-th idle resource, obtain the label mapping table configured for the mixed cluster associated with the i-th idle resource.
[0180] From the above tag mapping table, query the native resource type tag that has a mapping relationship with the mixed resource type tag of the i-th free resource, and use it as the native resource type tag of the i-th free resource.
[0181] Based on the original resource type tag and the tag resource attribute of the i-th idle resource, the original resource attribute of the i-th idle resource is generated.
[0182] Optionally, the tag resource attribute of the i-th idle resource may also include the amount of idle resource corresponding to the i-th idle resource, and the device identifier of the resource node device to which the i-th idle resource belongs, wherein the resource node device belongs to the resource cluster; the generation module 812 may also be used to perform the following operations:
[0183] Obtain the native resource attribute template of the mixed-distribution cluster associated with the i-th idle resource mentioned above; the native resource attribute template includes a call field and an identifier field;
[0184] Add the native resource type tag of the i-th idle resource to the native resource attribute template as the field value of the above-mentioned call field;
[0185] Based on the position of the above-mentioned call field in the above-mentioned native resource attribute template, add the amount of free resources corresponding to the i-th free resource to the above-mentioned native resource attribute template;
[0186] The device identifier corresponding to the i-th idle resource is used as the field value of the identifier field and added to the native resource attribute template to obtain the native resource attribute of the i-th idle resource.
[0187] Optionally, the first acquisition module 811 described above can also be used to perform the following operations:
[0188] Receive a change notification message sent by the mixed deployment agent component corresponding to the above resource cluster; the change notification message indicates that the field value of the mixed deployment resource information field in the reported information of the above resource cluster has changed;
[0189] Based on the aforementioned change notification message, the aforementioned reported information is read from the aforementioned mixed-deployment agent component;
[0190] Parse the field values of the mixed resource information field in the above reported information to obtain the tag resource attributes and mixed cluster identifiers corresponding to the N idle resources in the resource cluster.
[0191] Optionally, the first transmitting module 813 described above can also be used to perform the following operations:
[0192] Based on the mixed cluster identifier of the i-th idle resource, determine the resource reporting interface of the mixed cluster associated with the i-th idle resource; i is a positive integer less than or equal to N;
[0193] Call the resource reporting interface mentioned above to send the original resource attributes of the i-th idle resource to the mixed deployment cluster corresponding to the i-th idle resource.
[0194] Optionally, the first transmitting module 813 described above can also be used to perform the following operations:
[0195] Receive a call request for the j-th idle resource among the above N idle resources; the call request includes the original resource attributes of the j-th idle resource, the call cluster identifier, and the service information of the offline service to be processed; the call cluster identifier is used to indicate the mixed cluster that sent the call request; j is a positive integer less than or equal to N;
[0196] Based on the original resource attributes of the j-th idle resource and the cluster identifier, an offline instance adapted to the resource node device to which the j-th idle resource belongs is generated.
[0197] The offline instance corresponding to the j-th idle resource and the aforementioned service information are sent to the resource node device to which the j-th idle resource belongs. The resource node device to which the j-th idle resource belongs is used to call the j-th idle resource to process the offline service to be processed based on the offline instance and the aforementioned service information.
[0198] Optionally, the native resource attributes of the j-th idle resource mentioned above include a native resource type label and the amount of resource called; the first sending module 813 mentioned above can also be used to perform the following operations:
[0199] Obtain the offline instance template adapted to the resource node device corresponding to the j-th idle resource mentioned above; the offline instance template includes the mixed deployment business type field and the original resource type tag mentioned above;
[0200] Based on the aforementioned cluster identifier, determine the business type corresponding to the aforementioned offline business to be processed, and use the aforementioned business type as the field value of the aforementioned mixed-distribution business type field.
[0201] Based on the position of the aforementioned native resource type tag in the aforementioned offline instance template, the aforementioned resource call amount is added to the aforementioned offline instance template to obtain an offline instance adapted to the resource node device to which the aforementioned j-th idle resource belongs.
[0202] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0203] In this application, a resource allocation device converts the tag resource attributes corresponding to N idle resources into native resource attributes adapted to the corresponding mixed-deployment clusters. The native resource attributes of the idle resources are then sent to the corresponding mixed-deployment clusters, meaning the mixed-deployment clusters can directly identify the native resource attributes of the received idle resources. Since the mixed-deployment clusters are registered with their respective connected offline service platforms, they are compatible with these platforms. This means the offline service platforms can directly identify the native resource attributes of the received idle resources, allowing them to directly call the corresponding idle resources to process offline services without needing to adapt configuration parameters. This reduces the complexity of idle resource invocation and improves idle resource invocation efficiency. In addition, among the N idle resources, at least two of them are associated with different mixed-deployment clusters. That is, the N idle resources are sent to multiple mixed-deployment clusters. Each mixed-deployment cluster (i.e., the offline service platform corresponding to the mixed-deployment cluster) can independently call the corresponding idle resources to process offline services based on the received native resource attributes. The mixed-deployment clusters do not interfere with each other. That is, each mixed-deployment cluster can receive the native resource attributes of the idle resources it needs without being aware of the existence of other mixed-deployment clusters. This achieves cluster-level isolation of idle resources and improves the utilization rate of resources in the resource cluster.
[0204] Please refer to Figure 9, which is a schematic diagram of another resource allocation device provided in an embodiment of this application. As shown in Figure 9, the resource allocation device may include:
[0205] The second acquisition module 911 is used to acquire the tag resource attributes and mixed cluster identifiers corresponding to N idle resources in the resource cluster; each tag resource attribute marks the corresponding idle resource for processing offline services, and each mixed cluster identifier indicates the mixed cluster associated with the corresponding idle resource, where N is a positive integer;
[0206] The second sending module 912 is used to send the tag resource attributes and mixed-deployment cluster identifiers corresponding to the above N idle resources to the resource allocation device; the resource allocation device is used to send the native resource attributes of each idle resource to the corresponding mixed-deployment cluster according to the mixed-deployment cluster identifiers corresponding to the above N idle resources; each native resource attribute is generated by the resource allocation device according to the mixed-deployment cluster identifier and tag resource attributes of the corresponding idle resource; the mixed-deployment cluster is used to call the corresponding idle resource to process offline services according to the received native resource attributes.
[0207] Optionally, the second acquisition module 911 described above can also be used to perform the following operations:
[0208] Obtain the resource status information and resource type of each of the M candidate resources in the resource cluster;
[0209] Based on the resource types corresponding to the above M candidate resources, determine the mixed-deployment clusters associated with the above M candidate resources;
[0210] Based on the mixed-deployment clusters, resource status information, and resource types associated with the above M candidate resources, N idle resources are determined from the above M candidate resources, along with the tag resource attributes and mixed-deployment cluster identifiers corresponding to the above N idle resources.
[0211] Optionally, the second acquisition module 911 described above can also be used to perform the following operations:
[0212] When the a-th candidate resource is associated with the first type of mixed cluster, the allocated resource amount and total resource amount of the a-th candidate resource are obtained from the resource status information of the a-th candidate resource; the first type of mixed cluster is a mixed cluster used to receive offline services that need to be processed in parallel; a is a positive integer less than or equal to M.
[0213] When the total amount of resources mentioned above is greater than the amount of resources already allocated, it is determined that there is a first idle resource among the a-th candidate resources;
[0214] Based on the resource status information and resource type of the above-mentioned candidate resource a, and the mixed cluster identifier of the above-mentioned first type of mixed cluster, the tag resource attribute of the above-mentioned first idle resource is determined.
[0215] The mixed cluster identifier of the first type of mixed cluster is used to determine the mixed cluster identifier of the first idle resource.
[0216] Optionally, the second acquisition module 911 described above can also be used to perform the following operations:
[0217] Based on the resource type of the above-mentioned candidate resource a and the mixed cluster identifier of the above-mentioned first type of mixed cluster, a mixed resource type label for the above-mentioned first idle resource is generated.
[0218] The difference between the allocated resources and the total resources is calculated to obtain the available resources of the first available resource.
[0219] From the above resource status information, obtain the device identifier of the resource node device to which the a-th candidate resource belongs;
[0220] The idle resource quantity and mixed resource type label of the first idle resource, as well as the device identifier of the resource node device to which the a-th candidate resource belongs, are determined as the tag resource attributes of the first idle resource.
[0221] Optionally, the resource status information of the a-th candidate resource may also include the amount of resources used by the a-th candidate resource; the second acquisition module 911 may also be used to perform the following operations:
[0222] When the aforementioned candidate resource a is also associated with the second type of mixed cluster, the occupied resource amount of the aforementioned candidate resource a is determined based on the aforementioned total resource amount and the aforementioned used resource amount; the aforementioned second type of mixed cluster is a mixed cluster used to receive offline services that require serial processing.
[0223] When the total amount of resources mentioned above is greater than the amount of resources already occupied, it is determined that there is a second idle resource among the a-th candidate resources mentioned above.
[0224] Based on the occupied resource quantity, resource status information and resource type of the above-mentioned candidate resource a, and the mixed cluster identifier of the above-mentioned second type of mixed cluster, the tag resource attribute of the above-mentioned second idle resource is determined.
[0225] The mixed cluster identifier of the second type of mixed cluster is used to determine the mixed cluster identifier of the second idle resource.
[0226] Optionally, the second acquisition module 911 described above can also be used to perform the following operations:
[0227] Obtain the reservation ratio allocated to the a-th candidate resource mentioned above;
[0228] The ratio of the total resource quantity to the reserved quantity is multiplied to obtain the reserved resource quantity.
[0229] The used resources and the reserved resources are summed to obtain the occupied resources of the a-th candidate resource.
[0230] Optionally, the second acquisition module 911 described above can also be used to perform the following operations:
[0231] Based on the resource type of the above-mentioned candidate resource a and the mixed cluster identifier of the above-mentioned second type of mixed cluster, a mixed resource type label for the above-mentioned second idle resource is generated.
[0232] From the above resource status information, obtain the device identifier of the resource node device to which the a-th candidate resource belongs, and the total resource quantity of the a-th candidate resource;
[0233] The difference between the total resource amount and the occupied resource amount is calculated to obtain the free resource amount of the second free resource.
[0234] The idle resource quantity and mixed resource type label of the aforementioned second idle resource, as well as the device identifier of the resource node device to which the aforementioned a-th candidate resource belongs, are determined as the tag resource attributes of the aforementioned second idle resource.
[0235] Optionally, the second transmitting module 912 described above can also be used to perform the following operations:
[0236] Obtain the reporting information template; the above reporting information template includes the mixed-department resource information field;
[0237] Using the mixed deployment proxy component, the tag resource attributes and mixed deployment cluster identifier corresponding to the above N idle resources are used as the field values of the above mixed deployment resource information field and added to the above reporting information template to obtain the reporting information.
[0238] Generate a change notification message indicating that the field value of the mixed resource information field in the above-reported information has changed;
[0239] The aforementioned change notification message is sent to the resource allocation device; the resource allocation device is also used to parse the field value of the mixed deployment resource information field in the aforementioned reported information to obtain the tag resource attributes and mixed deployment cluster identifiers corresponding to the aforementioned N idle resources respectively; the aforementioned reported information is read by the resource allocation device from the aforementioned mixed deployment agent component after receiving the aforementioned change notification message.
[0240] Optionally, the second acquisition module 911 described above can also be used to perform the following operations:
[0241] Receive the offline instance for the j-th idle resource among the above N idle resources, and the service information of the offline service to be processed; the offline instance includes a mixed service type field; j is a positive integer less than or equal to N;
[0242] Based on the field value of the mixed-service type field in the above offline instance, determine the service priority of the above offline services to be processed;
[0243] Based on the service priority of the offline services to be processed, determine the processing network for the offline services to be processed.
[0244] Using the aforementioned processing network, based on the aforementioned offline instance and the aforementioned business information, the aforementioned j-th idle resource is invoked to process the aforementioned offline business to be processed.
[0245] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0246] In this application, a resource allocation device converts the tag resource attributes corresponding to N idle resources into native resource attributes adapted to the corresponding mixed-deployment clusters. The native resource attributes of the idle resources are then sent to the corresponding mixed-deployment clusters, meaning the mixed-deployment clusters can directly identify the native resource attributes of the received idle resources. Since the mixed-deployment clusters are registered with their respective connected offline service platforms, they are compatible with these platforms. This means the offline service platforms can directly identify the native resource attributes of the received idle resources, allowing them to directly call the corresponding idle resources to process offline services without needing to adapt configuration parameters. This reduces the complexity of idle resource invocation and improves idle resource invocation efficiency. In addition, among the N idle resources, at least two of them are associated with different mixed-deployment clusters. That is, the N idle resources are sent to multiple mixed-deployment clusters. Each mixed-deployment cluster (i.e., the offline service platform corresponding to the mixed-deployment cluster) can independently call the corresponding idle resources to process offline services based on the received native resource attributes. The mixed-deployment clusters do not interfere with each other. That is, each mixed-deployment cluster can receive the native resource attributes of the idle resources it needs without being aware of the existence of other mixed-deployment clusters. This achieves cluster-level isolation of idle resources and improves the utilization rate of resources in the resource cluster.
[0247] Please refer to Figure 10, which is a schematic diagram of the structure of a computer device provided in an embodiment of this application. As shown in Figure 10, the computer device 1000 may refer to a resource allocation device, including: a processor 1001, a network interface 1004, and a memory 1005. Furthermore, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. In some embodiments, the user interface 1003 may include a display screen and a keyboard. Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage device. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. As shown in Figure 10, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a computer program.
[0248] In the computer device 1000 shown in Figure 10, the network interface 1004 provides network communication functions; the user interface 1003 is mainly used to provide an input interface; and the processor 1001 can be used to call computer programs stored in memory 1005 to execute:
[0249] Obtain the tag resource attributes and mixed deployment cluster identifiers corresponding to N idle resources in the resource cluster; each tag resource attribute marks the corresponding idle resource for processing offline services, and each mixed deployment cluster identifier indicates the mixed deployment cluster associated with the corresponding idle resource, where N is a positive integer;
[0250] Based on the mixed-deployment cluster identifier and tag resource attribute corresponding to the above N idle resources, the native resource attributes corresponding to the above N idle resources are generated; each native resource attribute is adapted to the mixed-deployment cluster associated with the corresponding idle resource;
[0251] Based on the mixed-deployment cluster identifiers corresponding to the aforementioned N idle resources, the native resource attributes of each idle resource are sent to the corresponding mixed-deployment cluster; the aforementioned mixed-deployment cluster is used to call the corresponding idle resource to process offline services based on the received native resource attributes.
[0252] In this application, a resource allocation device converts the tag resource attributes corresponding to N idle resources into native resource attributes adapted to the corresponding mixed-deployment clusters. The native resource attributes of the idle resources are then sent to the corresponding mixed-deployment clusters, meaning the mixed-deployment clusters can directly identify the native resource attributes of the received idle resources. Since the mixed-deployment clusters are registered with their respective connected offline service platforms, they are compatible with these platforms. This means the offline service platforms can directly identify the native resource attributes of the received idle resources, allowing them to directly call the corresponding idle resources to process offline services without needing to adapt configuration parameters. This reduces the complexity of idle resource invocation and improves idle resource invocation efficiency. In addition, among the N idle resources, at least two of them are associated with different mixed-deployment clusters. That is, the N idle resources are sent to multiple mixed-deployment clusters. Each mixed-deployment cluster (i.e., the offline service platform corresponding to the mixed-deployment cluster) can independently call the corresponding idle resources to process offline services based on the received native resource attributes. The mixed-deployment clusters do not interfere with each other. That is, each mixed-deployment cluster can receive the native resource attributes of the idle resources it needs without being aware of the existence of other mixed-deployment clusters. This achieves cluster-level isolation of idle resources and improves the utilization rate of resources in the resource cluster.
[0253] Furthermore, it should be noted that this application also provides a computer-readable storage medium storing a computer program executed by the aforementioned data processing apparatus. This computer program includes program instructions, which, when executed by the processor, enable the execution of the data processing method described in the corresponding embodiments above. Therefore, further details will not be repeated here. Additionally, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this application, please refer to the description of the method embodiments of this application.
[0254] As an example, the above program instructions can be deployed and executed on a computer device, or deployed and executed on at least two computer devices in one location, or executed on at least two computer devices distributed in at least two locations and interconnected by a communication network. At least two computer devices distributed in at least two locations and interconnected by a communication network can form a blockchain network.
[0255] The aforementioned computer-readable storage medium can be a data processing apparatus provided in any of the foregoing embodiments or a central storage unit of the aforementioned computer device, such as a hard disk or central storage of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium may include both the central storage unit and external storage devices of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0256] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish content in different media, rather than to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.
[0257] In practice, the collection and processing of data in this application should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the data subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the data subject.
[0258] This application also provides a computer program product, including a computer program. When executed by a processor, the computer program implements the data processing method and decoding method described in the preceding embodiments, and therefore will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the embodiments of the computer program product involved in this application, please refer to the description of the method embodiments of this application.
[0259] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0260] The methods and related apparatus provided in this application are described with reference to the method flowcharts and / or structural diagrams provided in this application. Each block of the method flowcharts and / or structural diagrams, as well as combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions are provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable network-connected device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable network-connected device, create means for implementing the functions specified in one or more blocks of the flowcharts and / or one or more blocks of the structural diagrams. These computer program instructions may also be stored in a computer-readable storage medium capable of directing a computer or other programmable network-connected device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more blocks of the flowcharts and / or one or more blocks of the structural diagrams. These computer program instructions may also be loaded onto a computer or other programmable network-connected device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable device, provide steps for implementing the functions specified in one or more flowcharts and / or one or more structural diagrams in blocks.
[0261] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
A resource allocation method characterized by comprising: The method is performed by a resource allocation device, and the method includes: Retrieve the tag resource attributes and mixed deployment cluster identifiers corresponding to N idle resources in the resource cluster; each tag resource attribute marks the corresponding idle resource as being used to process offline services, and each mixed deployment cluster identifier indicates the mixed deployment cluster associated with the corresponding idle resource; N is a positive integer; Based on the mixed-deployment cluster identifier and tag resource attribute corresponding to the N idle resources, the native resource attributes corresponding to the N idle resources are generated respectively; each native resource attribute is adapted to the mixed-deployment cluster associated with the corresponding idle resource; Based on the mixed-deployment cluster identifiers corresponding to the N idle resources, the native resource attributes of each idle resource are sent to the corresponding mixed-deployment cluster; the mixed-deployment cluster is used to call the corresponding idle resource to process offline services based on the received native resource attributes. The method of claim 1, wherein The tag resource attribute of the i-th idle resource includes the mixed resource type tag of the i-th idle resource; i is a positive integer less than or equal to N; The step of generating native resource attributes corresponding to the N idle resources based on the mixed-distribution cluster identifier and tag resource attributes corresponding to the N idle resources includes: Based on the mixed cluster identifier of the i-th idle resource, obtain the label mapping table configured for the mixed cluster associated with the i-th idle resource; From the tag mapping table, query the native resource type tag that has a mapping relationship with the mixed resource type tag of the i-th idle resource, and use it as the native resource type tag of the i-th idle resource; The native resource attributes of the i-th idle resource are generated based on the native resource type tag and the tag resource attribute of the i-th idle resource. The method according to claim 2, characterized in that The tag resource attribute of the i-th idle resource also includes the amount of idle resource corresponding to the i-th idle resource, and the device identifier of the resource node device to which the i-th idle resource belongs, wherein the resource node device belongs to the resource cluster; The step of generating the native resource attributes of the i-th idle resource based on its native resource type tag and tag resource attributes includes: Obtain the native resource attribute template of the mixed-distribution cluster associated with the i-th idle resource; the native resource attribute template includes a call field and an identifier field; The native resource type tag of the i-th idle resource is used as the field value of the call field and added to the native resource attribute template; Based on the position of the called field in the native resource attribute template, the amount of free resources corresponding to the i-th free resource is added to the native resource attribute template; The device identifier corresponding to the i-th idle resource is used as the field value of the identifier field and added to the native resource attribute template to obtain the native resource attribute of the i-th idle resource. The method of claim 1, wherein The acquisition of the tag resource attributes and mixed-distribution cluster identifiers corresponding to the N idle resources in the resource cluster includes: Receive a change notification message sent by the mixed deployment agent component corresponding to the resource cluster; the change notification message indicates that the field value of the mixed deployment resource information field in the reported information of the resource cluster has changed; Based on the change notification message, the reported information is read from the mixed-department agent component; The field values of the mixed resource information field in the reported information are parsed to obtain the tag resource attributes and mixed cluster identifiers corresponding to the N idle resources in the resource cluster. The method of claim 1, wherein The step of sending the original resource attributes of each idle resource to the corresponding mixed-distribution cluster based on the mixed-distribution cluster identifier corresponding to each of the N idle resources includes: Based on the mixed cluster identifier of the i-th idle resource, determine the resource reporting interface of the mixed cluster associated with the i-th idle resource; i is a positive integer less than or equal to N; The resource reporting interface is invoked to send the native resource attributes of the i-th idle resource to the mixed-deployment cluster corresponding to the i-th idle resource. The method according to any one of claims 1 to 5, characterized in that The method further includes: Receive a call request for the j-th idle resource among the N idle resources; the call request includes the native resource attributes of the j-th idle resource, the call cluster identifier, and the service information of the offline service to be processed; the call cluster identifier is used to indicate the mixed cluster that sent the call request; j is a positive integer less than or equal to N; Based on the native resource attributes of the j-th idle resource and the call cluster identifier, generate an offline instance adapted to the resource node device to which the j-th idle resource belongs; The offline instance corresponding to the j-th idle resource and the service information are sent to the resource node device to which the j-th idle resource belongs. The resource node device to which the j-th idle resource belongs is used to call the j-th idle resource to process the offline service to be processed according to the offline instance and the service information. The method according to claim 6, characterized in that The native resource attributes of the j-th idle resource include the native resource type tag and the amount of resources called; The step of generating an offline instance adapted to the resource node device to which the j-th idle resource belongs, based on the original resource attributes of the j-th idle resource and the calling cluster identifier, includes: Obtain an offline instance template adapted to the resource node device corresponding to the j-th idle resource; the offline instance template includes a mixed-deployment service type field and the native resource type tag; Based on the cluster identifier, determine the service type corresponding to the offline service to be processed, and use the service type as the field value of the mixed service type field; According to the position of the native resource type tag in the offline instance template, the amount of resources to be called is added to the offline instance template to obtain an offline instance that is adapted to the resource node device to which the j-th idle resource belongs. The method according to any one of claims 1 to 7, characterized in that When N is greater than 1, at least two of the N idle resources are associated with different mixed clusters. A resource allocation method characterized by comprising: The method is executed by resource node devices in the resource cluster, and the method includes: Get the tag resource attributes and mixed deployment cluster identifiers corresponding to N idle resources in the resource cluster; each tag resource attribute marks the corresponding idle resource for processing offline services, and each mixed deployment cluster identifier indicates the mixed deployment cluster associated with the corresponding idle resource, where N is a positive integer; The tag resource attributes and mixed-deployment cluster identifiers corresponding to the N idle resources are sent to the resource allocation device. The resource allocation device is used to send the native resource attributes of each idle resource to the corresponding mixed-deployment cluster based on the mixed-deployment cluster identifiers corresponding to the N idle resources. Each native resource attribute is generated by the resource allocation device based on the mixed-deployment cluster identifier and tag resource attributes of the corresponding idle resource. The mixed-deployment cluster is used to call the corresponding idle resource to process offline services based on the received native resource attributes. The method of claim 9, wherein The acquisition of the tag resource attributes and mixed-distribution cluster identifiers corresponding to the N idle resources in the resource cluster includes: Obtain the resource status information and resource type of each of the M candidate resources in the resource cluster; Based on the resource types corresponding to the M candidate resources, determine the mixed-distribution clusters associated with the M candidate resources respectively; Based on the mixed-deployment clusters, resource status information, and resource types associated with the M candidate resources, N idle resources are determined from the M candidate resources, along with the tag resource attributes and mixed-deployment cluster identifiers corresponding to the N idle resources. The method of claim 10, wherein The step of determining N idle resources from the M candidate resources based on the associated mixed-deployment clusters, resource status information, and resource types of the M candidate resources, and the corresponding tag resource attributes and mixed-deployment cluster identifiers of the N idle resources, includes: When the a-th candidate resource is associated with the first type of mixed cluster, the allocated resource amount and total resource amount of the a-th candidate resource are obtained from the resource status information of the a-th candidate resource; the first type of mixed cluster is a mixed cluster used to receive offline services that need to be processed in parallel; a is a positive integer less than or equal to M; When the total amount of resources is greater than the amount of allocated resources, it is determined that there is a first idle resource among the a-th candidate resources; Based on the resource status information and resource type of the a-th candidate resource, and the mixed cluster identifier of the first type of mixed cluster, the tag resource attribute of the first idle resource is determined. The mixed cluster identifier of the first type of mixed cluster is used to determine the mixed cluster identifier of the first idle resource. The method of claim 11, wherein The step of determining the tag resource attribute of the first idle resource based on the resource status information and resource type of the a-th candidate resource, and the mixed cluster identifier of the first type of mixed cluster, includes: Based on the resource type of the a-th candidate resource and the mixed cluster identifier of the first type of mixed cluster, a mixed resource type label for the first idle resource is generated. The difference between the allocated resource amount and the total resource amount is calculated to obtain the idle resource amount of the first idle resource; From the resource status information, obtain the device identifier of the resource node device to which the a-th candidate resource belongs; The idle resource quantity and mixed resource type label of the first idle resource, as well as the device identifier of the resource node device to which the a-th candidate resource belongs, are determined as the tag resource attributes of the first idle resource. The method of claim 11, wherein The resource status information of the a-th candidate resource also includes the amount of resources used by the a-th candidate resource; the method further includes: When the a-th candidate resource is also associated with the second type of mixed cluster, the occupied resource amount of the a-th candidate resource is determined according to the total resource amount and the used resource amount; the second type of mixed cluster is a mixed cluster used to receive offline services that need to be processed serially. When the total amount of resources is greater than the amount of resources already occupied, it is determined that there is a second idle resource among the a-th candidate resources; Based on the occupied resource amount, resource status information and resource type of the a-th candidate resource, and the mixed cluster identifier of the second type of mixed cluster, the tag resource attribute of the second idle resource is determined. The mixed cluster identifier of the second type of mixed cluster is used to determine the mixed cluster identifier of the second idle resource. The method of claim 13, wherein The step of determining the occupied resource amount of the a-th candidate resource based on the total resource amount and the used resource amount includes: Obtain the reservation ratio allocated to the a-th candidate resource; The ratio of the total resource quantity to the reserved quantity is multiplied to obtain the reserved resource quantity; The used resources and the reserved resources are summed to obtain the occupied resources of the a-th candidate resource. The method of claim 13, wherein The step of determining the tag resource attribute of the second idle resource based on the occupied resource amount, resource status information, and resource type of the a-th candidate resource, and the mixed cluster identifier of the second type of mixed cluster, includes: Based on the resource type of the a-th candidate resource and the mixed cluster identifier of the second type of mixed cluster, a mixed resource type label for the second idle resource is generated. From the resource status information, obtain the device identifier of the resource node device to which the a-th candidate resource belongs, and the total resource quantity of the a-th candidate resource; The difference between the total resource amount and the occupied resource amount is calculated to obtain the free resource amount of the second free resource. The idle resource quantity and mixed resource type label of the second idle resource, as well as the device identifier of the resource node device to which the a-th candidate resource belongs, are determined as the tag resource attributes of the second idle resource. The method according to any one of claims 9-15, characterized in that The step of sending the tag resource attributes and mixed-distribution cluster identifiers corresponding to the N idle resources to the resource allocation device includes: Obtain the reporting information template; the reporting information template includes a mixed-resource information field; Using the mixed deployment proxy component, the tag resource attributes and mixed deployment cluster identifier corresponding to the N idle resources are used as field values of the mixed deployment resource information field and added to the reporting information template to obtain the reporting information; Generate a change notification message indicating that the field value of the mixed resource information field in the reported information has changed; The change notification message is sent to the resource allocation device; the resource allocation device is also used to parse the field value of the mixed deployment resource information field in the reported information to obtain the tag resource attribute and mixed deployment cluster identifier corresponding to the N idle resources respectively; the reported information is read by the resource allocation device from the mixed deployment agent component after receiving the change notification message. The method according to any one of claims 9-16, characterized in that The method further includes: Receive an offline instance for the j-th idle resource among the N idle resources, and service information for the offline service to be processed; the offline instance includes a mixed service type field; j is a positive integer less than or equal to N; The service priority of the offline service to be processed is determined based on the field value of the mixed service type field in the offline instance. The processing network for the offline services to be processed is determined based on their service priorities. Using the processing network, based on the offline instance and the service information, the j-th idle resource is invoked to process the offline service to be processed. A resource allocation apparatus characterized by comprising: The resource allocation device is deployed in the resource allocation equipment and includes: The first acquisition module is used to acquire the tag resource attributes and mixed cluster identifiers corresponding to N idle resources in the resource cluster. Each tag resource attribute marks the corresponding idle resource for processing offline services, and each mixed cluster identifier indicates the mixed cluster associated with the corresponding idle resource. N is a positive integer. The generation module is used to generate native resource attributes corresponding to the N idle resources based on the mixed-deployment cluster identifier and tag resource attributes corresponding to the N idle resources respectively; each native resource attribute is adapted to the mixed-deployment cluster associated with the corresponding idle resource; The first sending module is used to send the original resource attributes of each idle resource to the corresponding mixed-deployment cluster according to the mixed-deployment cluster identifier corresponding to each of the N idle resources; the mixed-deployment cluster is used to call the corresponding idle resource to process offline services according to the received original resource attributes. A resource allocation apparatus characterized by comprising: The resource allocation device is deployed in the resource node devices of the resource cluster, including: The second acquisition module is used to acquire the tag resource attributes and mixed cluster identifiers corresponding to N idle resources in the resource cluster. Each tag resource attribute marks the corresponding idle resource for processing offline services, and each mixed cluster identifier indicates the mixed cluster associated with the corresponding idle resource. N is a positive integer. The second sending module is used to send the tag resource attributes and mixed-deployment cluster identifiers corresponding to the N idle resources to the resource allocation device; the resource allocation device is used to send the native resource attributes of each idle resource to the corresponding mixed-deployment cluster according to the mixed-deployment cluster identifiers corresponding to the N idle resources; each native resource attribute is generated by the resource allocation device according to the mixed-deployment cluster identifier and tag resource attributes of the corresponding idle resource; the mixed-deployment cluster is used to call the corresponding idle resource to process offline services according to the received native resource attributes. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 17. A computer storage medium, characterized by The computer storage medium stores a computer program, and the computer program is executed by a processor to perform the method in any one of claims 1 to 17.