Resource allocation method, device, medium, equipment and product based on edge computing
By selecting target nodes for resource allocation based on a preset strategy in edge computing, the problem of uneven resource utilization is solved, and more efficient resource utilization and energy consumption management are achieved.
Patent Information
- Application Number
- CN202510887741.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-06-27
AI Technical Summary
The randomness of resource allocation in existing edge computing leads to uneven resource utilization and low utilization rates.
By determining resource requirements and obtaining node resource information, target nodes are selected from candidate nodes based on a preset node selection strategy for resource allocation, prioritizing maximizing physical resource consumption, minimizing node fragmentation rate, and minimizing energy consumption.
It has improved resource utilization, reduced resource waste and energy consumption, and ensured the stability and efficiency of resource allocation.
Smart Images

Figure CN120378384B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of edge computing technology, and more specifically, to a resource allocation method, apparatus, medium, device, and product based on edge computing. Background Technology
[0002] Edge computing architectures typically consist of a central cluster and edge clusters. When resources are requested from the central cluster, resources are usually selected and allocated from the edge clusters first to reduce data transmission latency and improve response speed.
[0003] However, in related technologies, resources are usually selected randomly in the edge cluster, which has certain limitations. Summary of the Invention
[0004] This content section is provided to briefly introduce the concepts, which will be described in detail in the subsequent detailed description section. This content section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] In a first aspect, this disclosure provides a resource allocation method based on edge computing, the resource allocation method based on edge computing comprising:
[0006] In response to a resource request, resource requirement information for the resource request is determined. The resource requirement information is used to indicate the required target edge cluster and the required target resources. The target resources include the target resource specifications and the target specification quantity.
[0007] Obtain node resource information for the target edge cluster, and determine multiple candidate nodes in the target edge cluster for allocating the target resources based on the node resource information and the target resources, wherein the node resource information is used at least to indicate the resource allocation information of each node in the target edge cluster;
[0008] Based on a preset node selection strategy, a target node for allocating the target resource is determined from the plurality of candidate nodes, and the target resource is obtained from the target node for resource allocation. The node selection strategy aims to maximize the preset physical resource consumption of the node, minimize the node fragmentation rate, and minimize the node energy consumption.
[0009] Secondly, this disclosure provides a resource allocation device based on edge computing, the resource allocation device based on edge computing comprising:
[0010] The first determining module is used to determine resource requirement information for the resource request in response to the resource request. The resource requirement information is used to indicate the required target edge cluster and the required target resources. The target resources include the target resource specifications and the target specification quantity.
[0011] The second determining module is used to acquire node resource information for the target edge cluster, and determine multiple candidate nodes in the target edge cluster for allocating the target resources based on the node resource information and the target resources, wherein the node resource information is used at least to indicate the resource allocation information of each node in the target edge cluster;
[0012] The first processing module is used to determine a target node for allocating the target resource from the plurality of candidate nodes based on a preset node selection strategy, and to obtain the target resource from the target node for resource allocation. The node selection strategy aims to maximize the preset physical resource consumption of the node, minimize the node fragmentation rate, and minimize the node energy consumption.
[0013] Thirdly, this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect.
[0014] Fourthly, this disclosure provides an electronic device, comprising:
[0015] A storage device on which computer programs are stored;
[0016] A processing device for executing the computer program in the storage device to implement the steps of the method in the first aspect.
[0017] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0018] The above technical solution allows for the selection of a target node for allocating resources after identifying multiple candidate nodes based on resource request needs, using a preset node selection strategy. Since the node selection strategy can aim to maximize the preset physical resource consumption of nodes, it prioritizes nodes with fewer remaining resources, thus reducing resource waste. Furthermore, the strategy can also aim to minimize node fragmentation, prioritizing nodes with more concentrated resource allocation to reduce fragmentation and improve resource utilization. Finally, the strategy can also aim to minimize node energy consumption, prioritizing nodes with lower energy consumption to reduce overall system energy consumption.
[0019] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0020] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:
[0021] Figure 1 The diagram shown is a schematic of a Kubernetes cluster in related technologies;
[0022] Figure 2 This is a flowchart illustrating a resource allocation method based on edge computing according to an exemplary embodiment of the present disclosure;
[0023] Figure 3 This is a schematic block diagram illustrating a resource request process based on edge computing according to an exemplary embodiment of the present disclosure;
[0024] Figure 4 This is a schematic block diagram illustrating a resource release process based on edge computing according to an exemplary embodiment of the present disclosure;
[0025] Figure 5 This is a schematic diagram illustrating the conversion between different resource information in resource allocation information according to an exemplary embodiment of this disclosure;
[0026] Figure 6 This is a structural block diagram of a resource allocation device based on edge computing, according to an exemplary embodiment of the present disclosure.
[0027] Figure 7This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0028] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0029] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0030] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0031] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0032] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0033] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0034] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0035] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0036] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0037] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0038] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0039] It should be understood that Kubernetes (Container Orchestration System) is an industrial-grade container orchestration and scheduling platform used to manage various underlying containers. A complete Kubernetes cluster contains at least one master node and multiple node nodes (worker nodes), such as... Figure 1 As shown.
[0040] However, with the rapid increase in the number of internet-connected smart terminal devices and the arrival of the 5G and IoT era, the traditional centralized storage and computing model of cloud computing centers has gradually become unable to meet the timeliness, capacity, and computing power requirements of terminal devices. To address this challenge, edge computing architecture has emerged, which involves pushing cloud computing capabilities down to the user's edge and device side, forming multiple edge clusters, and using a central cluster to uniformly deliver, operate, and manage these multiple edge clusters.
[0041] However, currently, when allocating resources to multiple edge clusters, a random allocation method is usually adopted, which has problems such as uneven resource utilization and low resource utilization rate.
[0042] For example, if an edge computing architecture includes a central cluster and 10 edge clusters, and each edge cluster consists of multiple nodes, then when the central cluster receives a resource request, it can first determine the target edge cluster from the multiple edge clusters, and then select candidate nodes from the multiple nodes of the target edge cluster that can meet the resource request requirements. If there are multiple candidate nodes, one or more candidate nodes can be arbitrarily selected to deploy the task.
[0043] This resource allocation method results in some nodes being overloaded with tasks while others remain relatively idle, leading to uneven resource utilization and low resource efficiency.
[0044] In view of this, the present disclosure provides a resource allocation method, apparatus, medium, device and product based on edge computing to solve the above-mentioned technical problems.
[0045] The embodiments of this disclosure will be further explained below with reference to the accompanying drawings.
[0046] Figure 2 This is a flowchart illustrating a resource allocation method based on edge computing according to an exemplary embodiment of this disclosure, with reference to... Figure 2 The resource allocation method based on edge computing may include the following steps:
[0047] S201: In response to a resource request, determine the resource requirement information for the resource request. The resource requirement information is used to indicate the target edge cluster and the target resources required. The target resources include the target resource specifications and the target specification quantity.
[0048] It should be understood that resource specifications refer to a standardized set of hardware resource configurations defined in a computing environment to meet the needs of different applications and services. These typically include physical resources such as CPU (Central Processing Unit), memory, network bandwidth, hard disk, and network interface card (NIC). Different resource specifications can generally be set according to the application's performance requirements, user needs, and the overall system architecture. For example, resource specifications could be: 4-core CPU, 8GB memory, 50GB storage; or 8-core CPU, 16GB memory, 100GB storage; and of course, various other combinations are also possible, which are not limited in this disclosure.
[0049] S202: Obtain node resource information for the target edge cluster, and determine multiple candidate nodes in the target edge cluster for allocating target resources based on the node resource information and target resources, wherein the node resource information is used to indicate the resource allocation information of each node in the target edge cluster.
[0050] For example, resource allocation information may include unallocated resource specification information for each node, where the resource specification information includes the specification type and quantity of the resource specification. Therefore, after obtaining the node resource information of the target edge cluster, it can be first determined whether the number of unallocated specifications for the target resource specification in the target edge cluster is greater than the target specification quantity. If the number of unallocated specifications is less than the target specification quantity, the resource request is not placed in the waiting queue, but a failure result is immediately returned to inform the resource requester that their resource needs cannot be met. If the number of unallocated specifications is greater than or equal to the target specification quantity, then for each node, it can be determined whether the number of unallocated specifications for the target resource specification of that node is greater than the target specification quantity. If the number of unallocated specifications for the target resource specification of that node is greater than or equal to the target specification quantity, then that node can be selected as a candidate node. If the number of unallocated specifications for the target resource specification of each node in the target edge cluster is less than the target specification quantity, then multiple nodes can be arbitrarily selected from the target edge cluster such that the sum of the number of unallocated specifications for the target resource specification of these nodes is greater than or equal to the target specification quantity, and these nodes can be selected as candidate nodes.
[0051] S103: Based on a preset node selection strategy, determine the target node for allocating target resources from multiple candidate nodes, and obtain the target resources from the target node for resource allocation. The node selection strategy aims to maximize the preset physical resource consumption of the node, minimize the node fragmentation rate, and minimize the node energy consumption.
[0052] It should be understood that the preset node selection strategy can be any selection strategy that can satisfy the above objectives, and can be determined according to the actual situation. This disclosure does not impose any restrictions on this. In possible ways, the preset node selection strategy may include at least one of a first node selection strategy, a second node selection strategy, a third node selection strategy, and a fourth node selection strategy; wherein, the first node selection strategy is used to select candidate nodes with a resource load ratio reaching a preset resource load ratio from multiple candidate nodes when the target resource specifications meet the preset resource specifications; the second node selection strategy is used to select candidate nodes from multiple candidate nodes whose preset physical resources can satisfy the target resources; the third node selection strategy is used to select candidate nodes from multiple candidate nodes that have not been allocated resources to the target user, where the target user is the user who initiated the resource request; and the fourth node selection strategy is used to select candidate nodes from multiple candidate nodes that have created the fewest virtual machines.
[0053] The resource load ratio is an indicator used to measure the resource utilization of a node, calculated by the ratio of the node's currently allocated resources to its total resources. In this embodiment, by selecting a candidate node with a resource load ratio that meets the preset resource specifications from multiple candidate nodes as the target node, the possibility of resource fragmentation can be reduced, and resource utilization can be improved. For example, the preset resource specifications can be those requiring fewer resources, such as 2 CPU cores, 4GB of memory, and 20GB of storage. This allows tasks requiring fewer resources to be scheduled to nodes with higher resource loads, while tasks requiring more resources can be scheduled to nodes with lower resource loads, thereby improving the stability of task processing.
[0054] It should be understood that physical resources in a node generally refer to CPU (Central Processing Unit), memory, network bandwidth, hard disk, and network interface card (NIC). Therefore, the preset physical resource can be any of these, and this embodiment does not impose any limitations on this. Given that resources such as memory, network bandwidth, hard disk, and NIC can be manipulated through resource over-allocation, while CPU, due to its deterministic and irreplaceable nature, typically does not support over-allocation, the preset physical resource in this embodiment can refer to the CPU. By selecting a candidate node from multiple candidate nodes whose CPU can meet the required CPU load as the target node, the task can have sufficiently powerful computing capabilities to execute, improving task execution performance.
[0055] Furthermore, by selecting the target node from multiple candidate nodes that have not allocated resources to the target user, the resources required by the target user can be distributed more evenly. This reduces the risk of the target user being unable to access the required resources due to a single node failure, thus ensuring service continuity and stability. In addition, by selecting the candidate node with the fewest virtual machines created from multiple candidate nodes as the target node, resource contention within the node can be reduced, improving the performance and stability of individual virtual machines. Furthermore, resource waste can be reduced, increasing overall resource utilization.
[0056] The above technical solution allows for the selection of a target node for allocating resources after identifying multiple candidate nodes based on resource request needs, using a preset node selection strategy. Since the node selection strategy can aim to maximize the preset physical resource consumption of nodes, it prioritizes nodes with fewer remaining resources, thus reducing resource waste. Furthermore, the strategy can also aim to minimize node fragmentation, prioritizing nodes with more concentrated resource allocation to reduce fragmentation and improve resource utilization. Finally, the strategy can also aim to minimize node energy consumption, prioritizing nodes with lower energy consumption to reduce overall system energy consumption.
[0057] To facilitate understanding of the edge computing-based resource allocation method provided in this disclosure, the following describes the possible implementation methods in this disclosure.
[0058] In possible approaches, determining the target node for allocating the target resource from multiple candidate nodes based on a preset node selection strategy may include:
[0059] Based on the preset node selection strategy, determine the selection weight of each candidate node; based on the selection weight of each candidate node, determine the target node for allocating the target resources.
[0060] It should be understood that there can be one or more preset node selection strategies. When there is only one preset node selection strategy, selection can be made from multiple candidate nodes based on that strategy, and any one of the selected candidate nodes can be selected as the target node. When there are multiple preset node selection strategies, selection can be made from multiple candidate nodes for each strategy, assigning a first weight value to the selected candidate nodes and a second weight value to the unselected candidate nodes. Finally, the sum of the weight values of each node is calculated, and the node with the largest sum of weight values can be selected as the target node.
[0061] In other words, among the possible approaches, there can be multiple preset node selection strategies. Correspondingly, determining the selection weight of each candidate node based on these preset strategies can include:
[0062] Each node is selected from multiple candidate nodes according to a preset node selection strategy. The selected candidate nodes are assigned a first weight value, and the unselected candidate nodes are assigned a second weight value. The first weight value is greater than the second weight value. For each candidate node, the sum of the weight values of the candidate node under all node selection strategies is used as the selection weight of the candidate node.
[0063] In this embodiment, the first weight value and the second weight value can be determined according to the actual situation, and this disclosure does not impose any restrictions on them. For example, the first weight value can be 10, and the second weight value can be 0. Thus, when selecting nodes for each preset node selection strategy, a weight of 10 can be assigned to the selected candidate node, and a weight of 0 can be assigned to the unselected candidate node. Finally, the selection weight of the candidate node is obtained by summing the weights of each candidate node.
[0064] For example, continuing with the previous example, the preset node selection strategy can include a first node selection strategy, a second node selection strategy, a third node selection strategy, and a fourth node selection strategy. Candidate nodes can include candidate node a, candidate node b, and candidate node c.
[0065] If candidate node a and candidate node c are selected based on the first node selection strategy, then candidate node a and candidate node c can be assigned a weight value of 10, and candidate node b can be assigned a weight value of 0.
[0066] If candidate node a is selected based on the second node selection strategy, then candidate node a can be assigned a weight value of 10, and candidate nodes b and c can be assigned a weight value of 0.
[0067] If candidate nodes a and b are selected based on the third node selection strategy, then candidate nodes a and b can be assigned a weight value of 10, and candidate node c can be assigned a weight value of 0.
[0068] If candidate node c is selected based on the fourth node selection strategy, then candidate node c can be assigned a weight value of 10, and candidate nodes a and b can be assigned a weight value of 0.
[0069] Finally, by summing the weights of each candidate node, the selection weight of each candidate node is obtained: the selection weight of candidate node a is 30, the selection weight of candidate node b is 10, and the selection weight of candidate node c is 20.
[0070] In possible approaches, resource allocation information may include unallocated resource specification information, pre-allocated resource specification information, and allocated resource specification information. The resource specification information may include the specification type and quantity of the resource specifications. Accordingly, the resource allocation method based on edge computing may also include:
[0071] After determining the target node, based on the target resources, reduce the number of specifications of the corresponding specification type in the unallocated resource specification information and increase the number of specifications of the corresponding specification type in the pre-allocated resource specification information; according to the increased number of specifications and the corresponding specification type in the pre-allocated resource specification information, create resource placeholders of the corresponding number and type in the target node.
[0072] Accordingly, obtaining target resources from the target node for resource allocation may include:
[0073] Allocate resources corresponding to the resource placeholders in the target node;
[0074] Accordingly, resource allocation methods based on edge computing may also include:
[0075] Based on the resource placeholders created in the target node, reduce the number of specifications of the target resource specification type in the pre-allocated resource specification information and increase the number of specifications of the target resource specification type in the allocated resource specification information.
[0076] For example, the resource allocation information of the target node can be shown in Table 1:
[0077] Table 1 Resource allocation information for the target node
[0078]
[0079] Specification type a consists of a 4-core CPU, 8GB of RAM, and 50GB of storage; specification type b consists of an 8-core CPU, 16GB of RAM, and 100GB of storage. "available" indicates the number of unallocated specifications, "reserved" indicates the number of pre-allocated specifications, "allocated" indicates the number of allocated specifications, and "total" indicates the total number of specifications.
[0080] If the target resource specifications are: 4-core CPU, 8GB RAM, 50GB storage, and the target quantity is 2, it indicates that the user needs 2 resources of specification type 'a'. Therefore, to ensure the requested resources are successfully allocated to the user, 2 resources of specification type 'a' can be transferred from the available list to the reserved list to pre-allocate them. That is, the available list for specification type 'a' can be changed to 13, and the reserved list can be changed to 2. Next, a resource placeholder request can be sent to the target node to create placeholders for 2 resources of specification type 'a' on the target node. Finally, to ensure the resource allocation information on the target node accurately reflects its resource allocation status, 2 resources of specification type 'a' can be transferred from the reserved list to the allocated list. That is, the reserved list for specification type 'a' can be changed to 0, and the allocated list can be changed to 7.
[0081] It should be understood that in related technologies, after resources are allocated to the edge cluster, the edge cluster typically reports resource information, and then the central cluster updates the central inventory resources based on the reported resource information. However, due to the delay in inventory updates, and in high-frequency resource request scenarios, multiple requests may simultaneously operate based on outdated inventory information, leading to resource overselling. In this embodiment, the required resources can be converted into reserved resources first, then allocated to the target node, and finally converted into allocated resources. This achieves phased and refined control of resource allocation, ensuring real-time synchronization and accurate updates of the central and edge inventory status during resource allocation, thereby improving the strong consistency between central and edge inventory resources and reducing the probability of resource overselling. Furthermore, since resource allocation information represents information related to resource specifications, modifications to resource allocation information can be made simply by adding or subtracting from the existing records. Compared to recording the allocation of each physical resource in the resource allocation information, this reduces the amount of data modification and computation, and also improves the efficiency of modifying resource allocation information. Especially in high-concurrency scenarios, this can improve the overall throughput and response speed of the system.
[0082] In some possible ways, node resource information can be stored in an inventory module of the central cluster. Accordingly, the resource allocation method based on edge computing can also include:
[0083] The first resource information of the target node is determined by the target node and sent to the inventory module. The first resource information is used to indicate the number of first resource placeholders of the corresponding specification type of the target resource specification in the target node. The inventory module is used to determine the first reconciliation result based on the first resource allocation information and the first resource information of the target node. If the number of first resource placeholders indicated by the first reconciliation result is inconsistent with the number of allocated specifications of the corresponding specification type of the target resource specification in the resource allocation information, the first alarm information is output. The first alarm information can be used to indicate that the resource inventory information in the target node is inconsistent with the resource inventory of the target node in the inventory module.
[0084] For example, continuing with the previous example, after creating two resource placeholders of specification type 'a' in the target node, the target node can count the number of resource placeholders corresponding to specification type 'a', i.e., 7 resource placeholders of specification type 'a', and can proactively report these 7 resource placeholders of specification type 'a' to the inventory module. After receiving the information reported by the target node, the inventory module can verify it based on the reported information and the stored resource allocation information for the target node. If the allocated value for specification type 'a' in the target node's resource allocation information is 7, then the resource inventory in the target node is considered consistent with the resource inventory for the target node in the inventory module; if the allocated value for specification type 'a' in the target node's resource allocation information is not 7, then the resource inventory in the target node is considered inconsistent with the resource inventory for the target node in the inventory module, and an alarm message can be generated to notify the administrator that the resource inventory information in the target node is inconsistent with the resource inventory for the target node in the inventory module, thus enabling the administrator to handle the situation promptly.
[0085] By employing the above method, when a new resource placeholder is added to the target node, a proactive reporting operation can be initiated to the inventory module. This allows the inventory module to perform timely resource inventory verification, further improving the strong consistency between central and edge inventory resources and reducing the probability of resource overselling. Furthermore, since only the number of resource placeholders corresponding to the newly added specification type is reported during proactive reporting, both the amount of data transmitted and the amount of data verification required by the inventory module are reduced, thus improving verification efficiency.
[0086] In possible approaches, resource allocation information may include unallocated resource specification information, pre-allocated resource specification information, and allocated resource specification information. The resource specification information may include the specification type and quantity of the resource specifications. Accordingly, the resource allocation method based on edge computing may also include:
[0087] In response to a resource release request, resource release information is determined for the resource release request. The resource release information is used to indicate the node to be released, the specification type to be released, and the quantity of specifications to be released. Based on the specification type to be released and the quantity of specifications to be released, the corresponding number and corresponding specification type of resource placeholders are removed from the node to be released, and the quantity of specifications of the corresponding specification type in the allocated resource specification information is reduced and the quantity of specifications of the corresponding specification type in the unallocated resource specification information is increased.
[0088] For example, the resource allocation information of the node to be released can be shown in Table 2:
[0089] Table 2 Resource allocation information for nodes to be released
[0090]
[0091] Specification type a consists of a 4-core CPU, 8GB of RAM, and 50GB of storage; specification type b consists of an 8-core CPU, 16GB of RAM, and 100GB of storage. "available" indicates the number of unallocated specifications, "reserved" indicates the number of pre-allocated specifications, "allocated" indicates the number of allocated specifications, and "total" indicates the total number of specifications.
[0092] If the specification type to be released is specification type b, and the number of specifications to be released is 1, then we can first remove one resource placeholder corresponding to specification type b from the nodes to be released. After the resource placeholder is successfully removed, one resource of specification type b can be transferred from allocated to available. That is to say, the allocated of specification type b can be changed to 3, and the available of specification type b can be changed to 7.
[0093] By employing the above methods, allocated resources can be promptly converted to unallocated resources after the resources of the target node are released. This ensures real-time synchronization and accurate updating of the central and edge inventory states, improving the strong consistency between central and edge inventory resources and reducing the probability of resource overselling. Furthermore, since resource allocation information represents information related to resource specifications, modifications can be made simply by adding or subtracting from existing records. Compared to recording the allocation of each physical resource in the resource allocation information, this reduces the amount of data modification and computation, and improves the efficiency of modifying resource allocation information. Especially in high-concurrency scenarios, this can enhance the overall system throughput and response speed.
[0094] In some possible ways, node resource information can be stored in an inventory module of the central cluster. Accordingly, the resource allocation method based on edge computing can also include:
[0095] The second resource information of the node to be released is determined by the node to be released, and the second resource information is sent to the inventory module. The second resource information is used to indicate the number of second resource placeholders corresponding to the specification type to be released in the node to be released. The inventory module is used to determine the second reconciliation result based on the second resource allocation information and the second resource information of the node to be released. If the second reconciliation result indicates that the number of second resource placeholders is inconsistent with the number of allocated specifications for the specification type to be released in the second resource allocation information, the second alarm information is output. The second alarm information can be used to indicate that the resource inventory information in the target node is inconsistent with the resource inventory in the inventory module for the target node.
[0096] For example, continuing with the previous example, after removing one resource placeholder corresponding to specification type b from the node to be released, the target node can count the number of resource placeholders corresponding to specification type b, i.e., 3 resource placeholders of specification type b, and can actively report the 3 resource placeholders of specification type b to the inventory module. After receiving the information reported by the node to be released, the inventory module can check the reported information and the stored resource allocation information for the node to be released. If the allocated value for specification type b in the resource allocation information of the node to be released is 3, it is considered that the resource inventory in the node to be released is consistent with the resource inventory in the inventory module for the node to be released; if the allocated value for specification type a in the resource allocation information of the node to be released is not 3, it is considered that the resource inventory in the node to be released is inconsistent with the resource inventory in the inventory module for the node to be released, and an alarm message can be generated to prompt the administrator that the resource inventory information in the target node is inconsistent with the resource inventory in the inventory module for the target node, so that the administrator can handle it in a timely manner.
[0097] By employing the above method, a proactive reporting operation can be initiated to the inventory module when resource placeholders are removed at the target node. This allows the inventory module to perform timely resource inventory verification, further improving the strong consistency between central and edge inventory resources and reducing the probability of resource overselling. Furthermore, since only the number of resource placeholders corresponding to the removed specification type is reported during proactive reporting, both the amount of data transmitted and the amount of data verification required by the inventory module are reduced, thus improving verification efficiency.
[0098] In order to further improve the strong consistency between central and edge inventory resources and reduce the probability of resource overselling, the inventory module can also periodically poll the number of resource placeholders on each node and verify them with the stored resource allocation information. If there is a discrepancy, an alarm message will be generated to trigger an alarm.
[0099] It should be understood that in edge computing scenarios, the volume of resource requests is enormous, and multiple requests may simultaneously require the resources of the same node. Using traditional methods, such as locking each node, would lead to inefficient resource request processing, intense lock contention, and consequently, impacted overall performance. Therefore, to achieve efficient and accurate resource allocation in high-concurrency scenarios, avoid resource allocation conflicts caused by multiple simultaneous requests, and improve request processing efficiency, a possible approach is to introduce a version number into the resource allocation information of each node. This version number is then added after each update of the resource allocation information, thereby increasing the independence and order of each operation.
[0100] For example, if multiple requests simultaneously request resource allocation for node A, when one request reads the resource allocation information for node A and obtains a version number of 1, resource allocation calculations and other operations can be performed based on this version number. After the operation is complete, when preparing to update the resource allocation information, it is possible to first check whether the version number of the current resource allocation information is still 1. If the version number has not changed, it means that no other requests have updated the resource allocation information for node A after reading it, and the updated information and version number 2 can be written. Conversely, if the version number has changed, it means that other requests have updated the resource allocation information for node A after reading it, and the latest resource allocation information and corresponding version number for node A can be read again, and the operation can be performed again. This achieves efficient and accurate resource allocation in high-concurrency scenarios, avoiding resource allocation conflicts caused by multiple requests operating simultaneously.
[0101] To facilitate a further understanding of the edge computing-based resource allocation method provided in the embodiments of this disclosure, the following is in conjunction with the appendix. Figure 3 Appendix Figure 4 and appendix Figure 5 Further explanation of this plan:
[0102] First, the edge computing architecture in the embodiments of this disclosure will be described. The edge computing architecture in the embodiments of this disclosure can be as follows: Figure 3 or Figure 4 As shown, it includes a central cluster and multiple edge clusters. The central cluster may include:
[0103] A cloud platform is a unified interactive platform and interface for users, through which users can apply for and release resources.
[0104] The scheduling engine is used to schedule resource request and resource release tasks. When a scheduled task is a resource request task, it can initiate a resource request operation to the inventory module; when a scheduled task is a resource release task, it can initiate a resource release operation to the inventory module.
[0105] The inventory module is a key-value inventory model based on Nodes, where the KEY is a unique identifier for each Node. The Value of a Node can define three types of inventory resource information and the total resource (total). These three resource information types can be unallocated resources, reserved resources, and allocated resources, and the conversion between these three types of resource information can be done as follows: Figure 5 As shown.
[0106] In this embodiment, each edge cluster can be composed of multiple nodes, and the edge cluster can also be a KV storage model, where the KEY is the unique identifier of the edge cluster.
[0107] Next, the resource allocation process disclosed herein will be explained, such as... Figure 3 As shown, the following steps may be included:
[0108] Step 1: After a user initiates a resource request through the cloud platform, the cloud platform can forward the resource request to the scheduling engine;
[0109] Step 2: After receiving a resource request, the scheduling engine first parses the request to obtain the required target edge cluster and the required first resource; then it obtains the node resource information for the target edge cluster from the inventory module; then, based on the first resource, the node resource information, and the preset node selection strategy, it determines the target node; finally, it can send a resource request to the inventory module for the target node.
[0110] Step 3: After receiving a resource request for the target node, the inventory module transfers the corresponding quantity and type of resources from the unallocated resources of the target node to the reserved resources of the target node. If the transfer fails, it will retry. If the transfer is successful, it will send a message to the scheduling engine to indicate that the transfer was successful.
[0111] Step 4: After receiving the message that the transfer was successful, the scheduling engine can immediately send a resource reservation request to the edge cluster;
[0112] Step 5: After receiving a resource placeholder request, the edge cluster can create the corresponding number and type of resource placeholders on the target node. Upon successful creation, it can send a message to the scheduling engine indicating successful creation, prompting the scheduling engine to request resource allocation from the inventory module. This allows the inventory module to transfer the corresponding number and type of resources from the target node's reserved resources to the allocated resources. Simultaneously, it can count the number of resource placeholders of the corresponding type and proactively report this information to the inventory module for inventory verification.
[0113] Finally, the resource release process disclosed herein will be explained, such as... Figure 4 As shown, the following steps may be included:
[0114] Step 1: When a user initiates a resource release request through the cloud platform, the cloud platform can forward the resource release request to the scheduling engine;
[0115] Step 2: After receiving the resource release request, the scheduling engine first parses the resource release request to obtain the node to be released and the second resource to be released. Then, based on the node to be released and the second resource to be released, it sends a request to the edge cluster to remove the resource placeholder.
[0116] Step 3: After receiving the request to remove resource placeholders, the edge cluster removes the corresponding number and type of resource placeholders from the nodes to be released. After successful removal, it sends a message to the scheduling engine to indicate that the resource placeholder removal was successful. This prompts the scheduling engine to send a request to the inventory module to release the allocated resources. As a result, the inventory module can transfer the corresponding number and type of resources from the allocated resources of the nodes to be released to the unallocated resources. On the other hand, it can count the number of resource placeholders of the corresponding type and actively report this information to the inventory module so that the inventory module can perform inventory verification.
[0117] Based on the same concept, embodiments of this disclosure also provide a resource allocation device based on edge computing, such as... Figure 6 As shown, the edge computing-based resource allocation device 600 may include:
[0118] The first determining module 601 is used to determine the resource requirement information for the resource request in response to the resource request request. The resource requirement information is used to indicate the required target edge cluster and the required target resources. The target resources include the target resource specifications and the target specification quantity.
[0119] The second determining module 602 is used to obtain node resource information for the target edge cluster, and determine multiple candidate nodes in the target edge cluster for allocating target resources based on the node resource information and target resources, wherein the node resource information is used to indicate the resource allocation information of each node in the target edge cluster at least.
[0120] The first processing module 603 is used to determine the target node for allocating target resources from multiple candidate nodes based on a preset node selection strategy, and to obtain the target resources from the target node for resource allocation. The node selection strategy aims to maximize the preset physical resource consumption of the node, minimize the node fragmentation rate, and minimize the node energy consumption.
[0121] The edge computing-based resource allocation device 600 described above can determine the target node for allocating the target resources from among multiple candidate nodes after identifying multiple candidate nodes based on resource request requests, based on a preset node selection strategy. Since the node selection strategy can aim to maximize the preset physical resource consumption of nodes, nodes with fewer remaining resources can be prioritized during the selection process, thereby reducing resource waste. Furthermore, the node selection strategy can also aim to minimize node fragmentation, thus prioritizing nodes with more concentrated resource allocation to reduce resource fragmentation and improve resource utilization. Additionally, since the node selection strategy can also aim to minimize node energy consumption, nodes with lower energy consumption can be prioritized, thereby reducing the overall energy consumption of the system.
[0122] In one possible manner, the first processing module 603 may include:
[0123] The first determination submodule is used to determine the selection weight of each candidate node according to the preset node selection strategy;
[0124] The second determination submodule is used to determine the target node for allocating target resources based on the selection weight of each candidate node.
[0125] In possible approaches, the preset node selection strategy may include at least one of a first node selection strategy, a second node selection strategy, a third node selection strategy, and a fourth node selection strategy; the first node selection strategy is used to select candidate nodes from multiple candidate nodes whose resource load ratio reaches a preset resource load ratio, provided that the target resource specifications meet the preset resource specifications; the second node selection strategy is used to select candidate nodes from multiple candidate nodes whose preset physical resources can meet the target resource requirements; the third node selection strategy is used to select candidate nodes from multiple candidate nodes whose resources have not been allocated to the target user, where the target user is the user who initiated the resource request; and the fourth node selection strategy is used to select candidate nodes from multiple candidate nodes whose number of virtual machines created is the fewest.
[0126] In possible approaches, there are multiple preset node selection strategies, and correspondingly, the first determining submodule may include:
[0127] The processing unit is used to select nodes from multiple candidate nodes according to each preset node selection strategy, and assign a first weight value to the selected candidate nodes and a second weight value to the unselected candidate nodes, wherein the first weight value is greater than the second weight value.
[0128] The determining unit is used to sum the weight values of each candidate node under all node selection strategies, and use this sum as the selection weight of the candidate node.
[0129] In possible embodiments, the resource allocation information includes unallocated resource specification information, pre-allocated resource specification information, and allocated resource specification information. The resource specification information includes the specification type and quantity of the resource specifications. Accordingly, the edge computing-based resource allocation device 600 may further include:
[0130] The second processing module is used to, after determining the target node, reduce the number of specifications of the corresponding specification type of the target resource specification in the unallocated resource specification information and increase the number of specifications of the corresponding specification type of the target resource specification in the pre-allocated resource specification information, based on the target resource.
[0131] The third processing module is used to create resource placeholders with corresponding quantity and type in the target node based on the number of added specifications and the corresponding specification type in the pre-allocated resource specification information.
[0132] Accordingly, the first processing module 603 can be used to allocate resources corresponding to resource placeholders in the target node;
[0133] Accordingly, the edge computing-based resource allocation device 600 may further include:
[0134] The fourth processing module is used to reduce the number of specifications of the target resource specification type in the pre-allocated resource specification information and increase the number of specifications of the target resource specification type in the allocated resource specification information, based on the resource placeholders created in the target node.
[0135] In one possible manner, node resource information is stored in an inventory module of the central cluster, and correspondingly, the edge computing-based resource allocation device 600 may further include:
[0136] The fifth processing module is used to determine the first resource information of the target node through the target node and send the first resource information to the inventory module. The first resource information is used to indicate the number of first resource placeholders of the corresponding specification type of the target resource specification in the target node. The inventory module is used to determine the first reconciliation result based on the first resource allocation information and the first resource information of the target node. If the number of first resource placeholders indicated by the first reconciliation result is inconsistent with the number of allocated specifications of the corresponding specification type of the target resource specification in the resource allocation information, the first alarm information is output.
[0137] In possible embodiments, the resource allocation information includes unallocated resource specification information, pre-allocated resource specification information, and allocated resource specification information. The resource specification information includes the specification type and quantity of the resource specifications. Accordingly, the edge computing-based resource allocation device 600 may further include:
[0138] The third determination module is used to respond to a resource release request and determine the resource release information for the resource release request. The resource release information is used to indicate the node to be released, the specification type to be released, and the quantity of specifications to be released.
[0139] Based on the specification type and quantity of the specifications to be released, remove the corresponding number and type of resource placeholders from the nodes to be released, and reduce the quantity of the corresponding specification type in the allocated resource specification information and increase the quantity of the corresponding specification type in the unallocated resource specification information.
[0140] In one possible manner, node resource information is stored in an inventory module of the central cluster, and correspondingly, the edge computing-based resource allocation device 600 may further include:
[0141] The sixth processing module is used to determine the second resource information of the node to be released through the node to be released, and send the second resource information to the inventory module. The second resource information is used to indicate the number of second resource placeholders corresponding to the specification type to be released in the node to be released. The inventory module is used to determine the second reconciliation result based on the second resource allocation information and the second resource information of the node to be released, and output the second alarm information if the number of second resource placeholders indicated by the second reconciliation result is inconsistent with the number of allocated specifications for the specification type to be released in the second resource allocation information.
[0142] Based on the same concept, embodiments of this disclosure also provide a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of any of the above-described edge computing-based resource allocation methods.
[0143] Based on the same concept, this disclosure also provides an electronic device that may include:
[0144] A storage device on which computer programs are stored;
[0145] A processing device for executing a computer program stored in a storage device to implement the steps of any of the above-described edge computing-based resource allocation methods.
[0146] Based on the same concept, embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described edge computing-based resource allocation methods.
[0147] The following is for reference. Figure 7 The diagram illustrates a structural schematic of an electronic device 700 suitable for implementing embodiments of the present disclosure. Terminal devices in embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0148] like Figure 7 As shown, the electronic device 700 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the electronic device 700. The processing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0149] Typically, the following devices can be connected to I / O interface 705: input devices 706 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 707 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 708 including, for example, magnetic tapes, hard disks, etc.; and communication devices 709. Communication device 709 allows electronic device 700 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 7 An electronic device 700 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0150] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 709, or installed from storage device 708, or installed from ROM 702. When the computer program is executed by processing device 701, it performs the functions defined in the methods of embodiments of this disclosure.
[0151] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0152] In some implementations, communication can be conducted using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol), and can be interconnected with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0153] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0154] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: respond to a resource request request, determine resource requirement information for the resource request request, the resource requirement information indicating the required target edge cluster and the required target resources, the target resources including target resource specifications and target specification quantities; acquire node resource information for the target edge cluster, and, based on the node resource information and the target resources, determine multiple candidate nodes in the target edge cluster for allocating the target resources, wherein the node resource information at least indicates resource allocation information for each node in the target edge cluster; and, based on a preset node selection strategy, determine a target node for allocating the target resources from the multiple candidate nodes, and acquire the target resources from the target node for resource allocation, wherein the node selection strategy aims to maximize the preset physical resource consumption of the node, minimize the node fragmentation rate, and minimize the node energy consumption when selecting nodes.
[0155] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0156] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0157] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules are not, in some cases, intended to limit the functionality of the module itself.
[0158] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0159] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0160] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0161] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0162] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.
Claims
1. A resource allocation method based on edge computing, characterized in that, The resource allocation method based on edge computing includes: In response to a resource request, resource requirement information for the resource request is determined. The resource requirement information is used to indicate the required target edge cluster and the required target resources. The target resources include the target resource specifications and the target specification quantity. Obtain node resource information for the target edge cluster, and determine multiple candidate nodes in the target edge cluster for allocating the target resources based on the node resource information and the target resources. The node resource information includes resource allocation information for each node in the target edge cluster, and the resource allocation information includes unallocated resource specification information, pre-allocated resource specification information, and allocated resource specification information. The resource specification information includes the specification type and quantity of the resource specification. Based on a preset node selection strategy, a target node for allocating the target resource is determined from the plurality of candidate nodes. The node selection strategy aims to maximize the preset physical resource consumption of the node, minimize the node fragmentation rate, and minimize the node energy consumption. After determining the target node, based on the target resource, reduce the number of specifications of the target resource specification type in the unallocated resource specification information and increase the number of specifications of the target resource specification type in the pre-allocated resource specification information. Based on the number of specifications added in the pre-allocated resource specification information and the specification type corresponding to the number of added specifications, create resource placeholders with the corresponding number and specification type in the target node. Allocate resources corresponding to the resource placeholders in the target node; Based on the resource placeholders created in the target node, reduce the number of specifications of the target resource specification type in the pre-allocated resource specification information and increase the number of specifications of the target resource specification type in the allocated resource specification information.
2. The resource allocation method based on edge computing according to claim 1, characterized in that, The method of determining the target node for allocating the target resource from the plurality of candidate nodes based on a preset node selection strategy includes: The selection weight of each candidate node is determined according to the preset node selection strategy; Based on the selection weight of each candidate node, a target node for allocating the target resource is determined.
3. The resource allocation method based on edge computing according to claim 2, characterized in that, The preset node selection strategy includes at least one of the first node selection strategy, the second node selection strategy, the third node selection strategy, and the fourth node selection strategy. The first node selection strategy is used to select candidate nodes whose resource load ratio reaches the preset resource load ratio from the plurality of candidate nodes when the target resource specification meets the preset resource specification. The second node selection strategy is used to select candidate nodes from the plurality of candidate nodes whose preset physical resources can satisfy the target resources; The third node selection strategy is used to select candidate nodes that have not been allocated resources to the target user from among the multiple candidate nodes, where the target user is the user who initiated the resource request. The fourth node selection strategy is used to select the candidate node with the fewest virtual machines among the multiple candidate nodes.
4. The resource allocation method based on edge computing according to claim 2, characterized in that, The preset node selection strategy is multiple, and the step of determining the selection weight of each candidate node according to the preset node selection strategy includes: Each node is selected from the plurality of candidate nodes according to a preset node selection strategy. A first weight value is assigned to the selected candidate node, and a second weight value is assigned to the unselected candidate node. The first weight value is greater than the second weight value. For each candidate node, the sum of the weights of the candidate node under all node selection strategies is used as the selection weight of the candidate node.
5. The resource allocation method based on edge computing according to any one of claims 1-4, characterized in that, The node resource information is stored in the inventory module of the central cluster, and the resource allocation method based on edge computing further includes: The first resource information of the target node is determined by the target node and sent to the inventory module. The first resource information is used to indicate the number of first resource placeholders of the specification type corresponding to the target resource specification in the target node. The inventory module is used to determine a first reconciliation result based on the first resource allocation information of the target node and the first resource information. If the first reconciliation result indicates that the number of first resource placeholders is inconsistent with the number of allocated specifications for the specification type corresponding to the target resource specification in the first resource allocation information, a first alarm message is output.
6. The resource allocation method based on edge computing according to any one of claims 1-4, characterized in that, The edge computing-based resource allocation method also includes: In response to a resource release request, resource release information is determined for the resource release request, wherein the resource release information is used to indicate the node to be released, the specification type to be released, and the quantity of specifications to be released; Based on the specification type and the quantity of specifications to be released, remove the corresponding number and type of resource placeholders from the node to be released, and reduce the quantity of the corresponding specification type in the allocated resource specification information and increase the quantity of the corresponding specification type in the unallocated resource specification information.
7. The resource allocation method based on edge computing according to claim 6, characterized in that, The node resource information is stored in the inventory module of the central cluster, and the resource allocation method based on edge computing further includes: The second resource information of the node to be released is determined by the node to be released, and the second resource information is sent to the inventory module. The second resource information is used to indicate the number of second resource placeholders corresponding to the specification type to be released in the node to be released. The inventory module is used to determine a second reconciliation result based on the second resource allocation information of the node to be released and the second resource information. If the second reconciliation result indicates that the number of second resource placeholders is inconsistent with the number of allocated specifications for the specification type to be released in the second resource allocation information, a second alarm message is output.
8. A resource allocation device based on edge computing, characterized in that, Edge computing-based resource allocation devices include: The first determining module is used to determine resource requirement information for the resource request in response to the resource request. The resource requirement information is used to indicate the required target edge cluster and the required target resources. The target resources include the target resource specifications and the target specification quantity. The second determining module is used to acquire node resource information for the target edge cluster, and determine multiple candidate nodes in the target edge cluster for allocating the target resources based on the node resource information and the target resources. The node resource information includes resource allocation information for each node in the target edge cluster, and the resource allocation information includes unallocated resource specification information, pre-allocated resource specification information, and allocated resource specification information. The resource specification information includes the specification type and quantity of the resource specification. The first processing module is used to determine the target node for allocating the target resource from the plurality of candidate nodes based on a preset node selection strategy, wherein the node selection strategy aims to maximize the preset physical resource consumption of the node, minimize the node fragmentation rate, and minimize the node energy consumption. The second processing module is used to, after determining the target node, reduce the number of specifications of the target resource specification type in the unallocated resource specification information and increase the number of specifications of the target resource specification type in the pre-allocated resource specification information based on the target resource. The third processing module is used to create resource placeholders with corresponding quantity and corresponding specification type in the target node according to the number of specifications added in the pre-allocated resource specification information and the specification type corresponding to the number of added specifications. The first processing module is further configured to allocate resources corresponding to the resource placeholders in the target node; The fourth processing module is used to reduce the number of specifications of the target resource specification type in the pre-allocated resource specification information and increase the number of specifications of the target resource specification type in the allocated resource specification information, based on the resource placeholders created in the target node.
9. A computer-readable medium having a computer program stored thereon, characterized in that, When executed by a processing device, the computer program performs the steps of the method according to any one of claims 1-7.
10. An electronic device, characterized in that, include: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1-7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-7.
Citation Information
Patent Citations
Task scheduling method and system
CN116302448A