Dynamic resource allocation method and allocation device for edge nodes
By dynamically adjusting the computing resource allocation of edge nodes and reasonably allocating resources according to the process's resource usage priority, the problems of low resource utilization and low computing efficiency in the existing technology are solved, and more efficient resource utilization and computing performance are achieved.
Patent Information
- Application Number
- CN202110578182.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-26
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-05-26
AI Technical Summary
In the prior art, the allocation of computing resources of edge nodes adopts a fixed amount allocation method, resulting in low resource utilization and low computing efficiency, and it is impossible to effectively respond to real-time changes in resource requirements of different types of processes.
By receiving the registration information of the target process, determining the resource usage priority based on the registration information, and dynamically adjusting resource allocation according to the resource usage and priority of the edge nodes, dividing different resource groups to reasonably allocate computing resources.
The dynamic and reasonable allocation of edge node computing resources is realized, computing efficiency and resource utilization are improved, and resource requirements for key services are guaranteed.
Smart Images

Figure CN113268346B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of distributed computing technology, and in particular to a dynamic resource allocation method and allocation device for edge nodes. Background Art
[0002] Edge computing is a distributed computing architecture that moves the computing of applications, data and services from cloud center nodes to edge nodes closer to users for processing. The core concept of edge computing is decentralization and local computing, which is generally suitable for scenarios with high requirements for real-time performance and data security. Since the computing resources and computing power of edge nodes are limited, if there is no resource restriction, when multiple processes are initiated at the same time, there will be insufficient resources or computing power, resulting in the impact of key services or even process crashes. At present, the existing technology adopts a fixed amount allocation method for edge nodes, that is, different computing resources are allocated to different types of processes. However, in the actual operation process, the resources occupied by different types of processes also change in real time. This fixed allocation method is likely to cause insufficient computing resources for one type of process while more computing resources are idle for another type of process, resulting in low computing efficiency and insufficient resource utilization of edge nodes. Summary of the invention
[0003] The purpose of the present invention is to provide a technical solution that can dynamically and reasonably allocate computing resources of edge nodes to solve the above-mentioned problems existing in the prior art.
[0004] To achieve the above object, the present invention provides a method for dynamic resource allocation of edge nodes, comprising the following steps:
[0005] Receiving registration information of a target process that needs to be run on the edge node, the registration information being used to characterize resource attributes of the target process;
[0006] Determining the resource usage priority of the target process according to the registration information;
[0007] Dynamically allocate resources to the target process according to the resource usage of the edge node and the resource usage priority.
[0008] According to the dynamic resource allocation method for edge nodes provided by the present invention, the step of determining the resource usage priority of the target process according to the registration information includes:
[0009] Dividing the target process into a corresponding target resource group based on the registration information;
[0010] The resource usage priority of the target process is determined according to the resource usage priority of the target resource group.
[0011] According to the dynamic resource allocation method provided by the present invention, the registration information includes top-level attributes, time-sensitive attributes, data loss-sensitive attributes and other attributes, and the step of dividing the target process into corresponding target resource groups based on the registration information includes:
[0012] Classify the target process with the registration information as the top-level attribute into the first priority resource group;
[0013] Classify the target process whose registration information is a time-sensitive attribute into the second priority resource group;
[0014] Classify the target process whose registration information is a data loss sensitive attribute into a third priority resource group;
[0015] The target process whose registration information is other attributes is classified into the fourth priority resource group.
[0016] According to the dynamic resource allocation method provided by the present invention, the step of dynamically allocating resources to the target process according to the resource usage of the edge node and the resource usage priority includes:
[0017] Acquire the actually required resources of the target resource group running in the edge node, and calculate the difference between the actually required resources and the preset usage upper limit of the target resource group;
[0018] The resource allocation of the target resource group is dynamically adjusted according to the difference and the resource usage priority.
[0019] According to the dynamic resource allocation method provided by the present invention, the step of dynamically adjusting the resource allocation of the target resource group according to the difference and the resource usage priority includes:
[0020] When the difference is greater than zero, obtaining resource usage of other resource groups with a higher priority than the target resource group; if the other resource groups contain idle resources, allocating the idle resources in the other resource groups to the target resource group;
[0021] When the difference is less than zero, obtain the resource usage of other resource groups with lower priority than the target resource group; if the actual required resources of the other resource groups are greater than the preset usage upper limit of the other resource groups, allocate the idle resources of the target resource group to the other resource groups.
[0022] According to the dynamic resource allocation method provided by the present invention, the step of dynamically adjusting the resource allocation of the target resource group according to the difference and the resource usage priority further includes:
[0023] In the case where the difference is greater than zero, if a plurality of other resource groups with higher priorities than the target resource group contain idle resources, the idle resources of the other resource groups with the highest priority are allocated to the target resource group;
[0024] When the difference is less than zero, if the actual required resources of multiple other resource groups with lower priorities than the target resource group are greater than the preset usage upper limit of the other resource groups, the idle resources of the target resource group are allocated to the other resource groups with the highest priority.
[0025] According to the dynamic resource allocation method provided by the present invention, the preset usage upper limit is calculated by the following steps:
[0026] The preset usage upper limit of the first priority resource group is the total amount of resources of the edge node;
[0027] Respectively obtain the occupancy ratios of resource groups of other priorities except the first priority resource group;
[0028] The remaining resources after deducting the actually required resources of the first priority resource group from the total resources are calculated, and the remaining resources are multiplied by the occupancy ratio to obtain the corresponding preset usage upper limits of other priority resource groups.
[0029] To achieve the above object, the present invention further provides a dynamic resource allocation device for an edge node, comprising:
[0030] A registration module, adapted to receive registration information of a target process to be run on the edge node, wherein the registration information is used to characterize resource attributes of the target process;
[0031] A priority determination module, adapted to determine the resource usage priority of the target process according to the registration information;
[0032] The dynamic allocation module is adapted to dynamically allocate resources to the target process according to the resource usage of the edge node and the resource usage priority.
[0033] To achieve the above objectives, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0034] To achieve the above object, the present invention also provides a computer-readable storage medium on which a computer program is stored, and the computer program implements the steps of the above method when executed by a processor.
[0035] The method and device for allocating resources of the main station of the edge node provided by the present invention have the following beneficial effects compared with the prior art:
[0036] (1) The present invention obtains registration information based on the inherent resource attributes of the process to be run in the edge node, and divides the process into corresponding resource groups based on the registration information. As a prerequisite, the present application sets different resource usage priorities and resource usage upper limits for different resource groups in advance. Dividing resource groups by registration information can more accurately estimate the resource usage of different processes, which is conducive to more reasonable division of resource groups.
[0037] (2) The present invention can determine which resource groups currently have idle resources and which resource groups are short of resources by monitoring the actual required resources of the resource groups and calculating the difference between the actual required resources and the upper limit of resource usage, and then dynamically adjust the resource allocation between resource groups according to the priority. In this way, idle resources can be allocated to the resource groups with insufficient resources, thereby realizing the dynamic allocation of computing resources in the edge nodes and improving the computing efficiency of the edge nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a flow chart of Embodiment 1 of the method for dynamic resource allocation of edge nodes of the present invention;
[0039] Figure 2 This is a schematic diagram of dividing resource groups according to registration information in Embodiment 1 of the present invention;
[0040] Figure 3 A schematic diagram of the total number of computing resources of a certain edge node in Embodiment 1 of the present invention;
[0041] Figure 4 A schematic diagram of resource usage upper limits corresponding to different resource groups according to the first embodiment of the present invention;
[0042] Figure 5 A resource allocation flow chart when a target resource group is in a resource-deficient state according to an embodiment of the present invention;
[0043] Figure 6 A resource allocation flow chart when a target resource group is in a resource surplus state according to an embodiment of the present invention;
[0044] Figure 7 A schematic diagram of dynamic resource allocation according to the first embodiment of the present invention;
[0045] Figure 8 A schematic diagram of a program module of a first embodiment of a dynamic resource allocation device for edge nodes of the present invention;
[0046] Fig. 9 This is a schematic diagram of the hardware structure of Embodiment 1 of the dynamic resource allocation device for edge nodes of the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0048] Embodiment 1
[0049] This embodiment proposes a dynamic resource allocation method for edge nodes. The execution subject of the method may include any physical computing device with data storage and data processing capabilities, such as a desktop computer, a server, a server cluster, etc., and may also include a logical unit in a physical computing device. Figure 1 FIG. 1 is a schematic flow chart of a method for dynamic resource allocation of edge nodes according to Embodiment 1 of the present invention. Figure 1 As shown, the dynamic resource allocation method includes the following steps:
[0050] S100: Receive registration information of a target process that needs to be run on the edge node, where the registration information is used to characterize resource attributes of the target process.
[0051] It can be understood that different processes correspond to different applications or services, and the applications or services have corresponding resource attribute information based on different businesses. For example, for applications or services with high requirements for instant feedback, the resource attributes of the corresponding processes may be time-sensitive attributes; for applications or services with high requirements for data integrity, the resource attributes of the corresponding processes may be data loss-sensitive attributes; for applications or services with high importance levels that need to be executed first, the resource attributes of the corresponding processes may be TOP (top-level) attributes; for applications that cannot obtain registration information, the corresponding processes may be considered to have other attributes. In short, before any target process in this embodiment runs, the inherent resource attributes corresponding to the process will be sent as registration information, so that this embodiment can obtain the usage tendency of different processes for computing resources.
[0052] S200: Determine the resource usage priority of the target process according to the registration information.
[0053] The resource usage priority determines which processes can give priority to the use of CPU resources, memory resources or hard disk resources in the edge node, and which processes need to wait for higher priority processes to release the occupied edge node resources before they can continue to use them. In this step, the resource usage priority corresponding to each target process can be determined based on the registration information of the target process. For example, for the resource attribute in the registration information that is the TOP attribute, the resource usage priority of the target process can be determined to be the first priority, that is, all resources in the edge node are given priority to the target process; for the resource attribute in the registration information that is the time-sensitive attribute, the resource usage priority of the target process can be determined to be the second priority, that is, all resources in the edge node are the remaining resources after the first priority process, and are given priority to the target process; for the resource attribute in the registration information that is the data loss sensitive attribute, the resource usage priority of the target process can be determined to be the third priority, that is, all resources in the edge node are the remaining resources after the first priority process and the second priority process, and are given priority to the target process; and so on.
[0054] S300: Dynamically allocating resources to the target process according to the resource usage of the edge node and the resource usage priority.
[0055] In this embodiment, the resource usage of the edge node may include which resources are in an idle state and which resources are in a busy state. On this basis, it is determined which processes can use the idle resources in the edge node, and which processes need to wait for the currently running process to release resources before using the corresponding resources in the edge node. For example, for edge node resources in an idle state, priority is given to the process with the highest resource usage priority for operation; for edge node resources in a busy state, the processes to be used can be sorted according to their priorities, and then the released edge node resources are allocated to the process with the highest priority in sequence.
[0056] Through the above steps, this embodiment can effectively guarantee the resource usage requirements of key businesses, and at the same time can dynamically adjust the resource occupancy of each service group according to the actual resource usage of the system, thereby greatly improving the system resource utilization.
[0057] It is understandable that the number of processes running in the edge node is very large. If resources are allocated on a per-process basis, it will consume a lot of computer computing power and be inefficient. To this end, in step S200 of this embodiment, the target processes can be grouped according to different registration information, and then the resource usage priority of the processes included in the group can be determined according to the resource usage priority of each group. Specifically, S200 includes the following steps:
[0058] S210: Divide the target process into corresponding target resource groups based on the registration information; wherein different resource groups are pre-configured with different resource usage priorities and different resource usage upper limits.
[0059] This embodiment pre-sets the mapping relationship between registration information and resource groups, so the resource group corresponding to the target process can be determined based on the registration information of the target process. The resource group refers to multiple processes with the same tendency to use resources, such as the same data loss sensitive attribute or the same time sensitive attribute. This embodiment divides the process into resource groups and allocates computing resources of edge nodes based on resource groups, so that the allocation scheme can be more centralized and effective, avoiding the situation where resources are allocated by process and causing management confusion.
[0060] Figure 2 FIG. 1 shows a schematic diagram of dividing resource groups according to registration information in the first embodiment of the present invention. Figure 2 As shown, the resource group corresponding to the process with registration information TOP (top attribute) is L0, and the upper limit of resource usage is unlimited, that is, all computing resources of the edge node can be used; the resource group corresponding to the process with registration information Time sensitive (time sensitive attribute) is L1, and the upper limit of resource usage is 50% after excluding the resources used by L0; the resource group corresponding to the process with registration information No data loss (data loss sensitive attribute) is L2, and the upper limit of resource usage is 30% after excluding the resources used by L0; the resource group corresponding to the process with registration information Others (other attributes) is L3, and the upper limit of resource usage is 20% after excluding the resources used by L0. Further, different resource usage priorities can be set for different resource groups, and the resource usage of which resource group is preferentially satisfied during dynamic resource allocation is determined according to the priority. For example, in this embodiment, resource group L0 has the first priority, that is, the highest priority, resource group L1 has the second priority, resource group L2 has the third priority, and resource group L3 has the fourth priority.
[0061] S220: Determine the resource usage priority of the target process according to the resource usage priority of the target resource group.
[0062] In this step, the resource usage priority of the target process is consistent with the resource usage priority of the corresponding target resource group. Figure 2 For example, if the target process is divided into resource group L0, the corresponding resource usage priority is the first priority; if the target process is divided into resource group L1, the corresponding resource usage priority is the second priority; if the target process is divided into resource group L2, the corresponding resource usage priority is the third priority; if the target process is divided into resource group L3, the corresponding resource usage priority is the fourth priority; and so on.
[0063] It can be understood that each edge node has a specific total number of computing resources, including the number of CPU cores, memory capacity, hard disk capacity, etc. These total number of computing resources are usually pre-stored. Figure 3 FIG. 1 is a schematic diagram of the total number of computing resources of a certain edge node in this embodiment. Figure 3 It can be seen that the computing resource types of the edge node include CPU, memory and hard disk. The number of CPU cores is 16, the memory capacity is 16G, and the hard disk capacity is 200G.
[0064] Combination Figure 2 and Figure 3 , based on the total number of computing resources of the edge node, the resource usage upper limit of resource group L1, resource group L2 and resource group L3 can be calculated by monitoring the actual required resources of resource group L0. Taking memory as an example, assuming that the actual required resources of resource group L0 are 6G, then the resource usage upper limit of resource group L1 is (16-6)×50%=5G, the resource usage upper limit of resource group L2 is (16-6)×30%=3G, and the resource usage upper limit of resource group L3 is (16-6)×20%=2G. Figure 4 shown.
[0065] As described above, in step S300 of this embodiment, the step of dynamically allocating resources to the target process according to the resource usage of the edge node and the resource usage priority may include:
[0066] S310: Obtain the actually required resources for the target resource group to run in the edge node, and calculate the difference between the actually required resources and the corresponding resource usage upper limit.
[0067] The actual required resources of the target resource group can be obtained through any existing resource occupancy viewing command, for example, the current memory usage of the target resource group can be obtained through the Linux free command, and the current CPU usage of the target resource group can be obtained through the Linux top command. By calculating the difference between the actual required resources of the target resource group and the corresponding resource usage upper limit, it can be determined whether the current target resource group is in a state of insufficient resources or in a state of excess resources. Taking memory as an example, assuming that the resource usage upper limit of the target resource group is 5G, when the actual required resources are 3G, the difference between the actual required resources and the resource usage upper limit is 3-5=-2<0, indicating that the target resource group is currently in a state of excess resources; and when the actual required resources are 6G, the difference between the actual required resources and the resource usage upper limit is 6-5=1>0, indicating that the target resource group is currently in a state of insufficient resources. By calculating the difference between the actual required resources and the resource usage upper limit, this embodiment can further perform dynamic resource allocation according to the different states of the target resource group, thereby achieving the purpose of resource balancing.
[0068] S320: Dynamically adjust resource allocation of the target resource group according to the difference and the resource usage priority.
[0069] The principle of dynamic resource allocation in this step is that when the target resource group is in a state of insufficient resources, the idle resources are obtained from other resource groups with higher priority and in a state of excess resources; when the target resource group is in a state of resource process, the idle resources of the target resource group are allocated to other resource groups with lower priority and in a state of insufficient resources. Based on this, this step will describe the process of dynamic resource allocation from two aspects.
[0070] Figure 5 FIG. 4 shows a resource allocation flow chart when the target resource group is in a resource-deficient state. Figure 5 As shown, step S320 includes:
[0071] S321: When the difference is greater than zero, obtain resource usage of other resource groups different from the target resource group.
[0072] The difference value greater than zero indicates that the actual required resources of the target resource group exceed the preset resource usage upper limit. For the resources exceeding the upper limit, the idle resources of other resource groups can be used under appropriate conditions. Therefore, this step obtains the resource usage of other resource groups different from the target resource group in order to determine whether other resource groups contain idle resources.
[0073] S322: If the other resource groups contain idle resources, allocate the idle resources to the target resource group. Considering the situation that multiple other resource groups contain idle resources, this embodiment further determines which resource group's idle resources are allocated according to the priority. Specifically, the idle resources of the other resource group with the highest priority are allocated to the target resource group.
[0074] For example, if the target resource group is L2, the resource groups containing idle resources include resource group L1 and resource group L3. Since the priority of L1 is higher than that of L3, the idle resources of L1 are preferentially allocated to L2. If the idle resources of L1 still cannot meet the needs of L2, the idle resources of L3 are further allocated to L2.
[0075] Figure 6 FIG. 2 shows a resource allocation flow chart when the target resource group is in a state of excess resources. Figure 6 As shown, step S400 also includes:
[0076] S323: When the difference is less than zero, obtain resource usage of other resource groups whose priorities are lower than the target resource group.
[0077] The difference value less than zero indicates that the actual required resources of the target resource group are less than the predetermined resource usage upper limit, that is, there are idle resources, which can be allocated to other resource groups in a resource-deficient state under appropriate conditions. Therefore, this step obtains the resource usage of other resource groups different from the target resource group in order to determine whether there are other resource groups that need idle resources.
[0078] S324: If the other resource groups also need idle resources, allocate the idle resources of the target resource group to the other resource groups. Considering the situation that multiple other resource groups need additional resources, this embodiment preferentially allocates the idle resources of the target resource group to other resource groups with the highest priority.
[0079] For example, if the target resource group is L2, other resource groups that need idle resources include resource group L1 and resource group L3. Since the priority of L1 is higher than that of L3, the idle resources of L2 are preferentially allocated to L1. If there are still idle resources in L2 after being allocated to L1, the idle resources of L2 are further allocated to L3.
[0080] Figure 7 FIG. 1 is a schematic diagram of dynamic resource allocation in Embodiment 1 of the present invention. Figure 7It can be seen that resource group L1' has the first priority, resource group L2' has the second priority, and resource group L3' has the third priority. It is stipulated that the resource usage upper limit of resource group L1' is unlimited, and the resource usage upper limits of resource group L2' and resource group L3' each account for 50% of the remaining resources. Among them, the actual required resources (taking memory as an example) of resource group L1', resource group L2' and resource group L3' in time period T1 are 3G, 3G and 3G respectively, the actual required resources in time period T2 are 3G, 3G and 4G respectively, and the actual required resources in time period T1 are 2G, 3G and 6G respectively. Assuming that the total memory resources of the current edge node are 10G, then the resource usage upper limits allocated by the edge node to resource group L1', resource group L2' and resource group L3' in time period T1 are 3G, 3G and 3G respectively, the resource usage upper limits allocated in time period T2 are 3G, 3G and 4G respectively, and the resource usage upper limits allocated in time period T3 are 2G, 3G and 5G respectively. It can be seen that in time period T1, resources are allocated completely according to the actual needs of each resource group, and the sum of the resource usage limits allocated to resource group L1', resource group L2' and resource group L3' is no more than the total resource 10G. In time period T2, resources are still allocated according to the actual needs of each resource group, and the sum of the resource usage limits allocated to resource group L1', resource group L2' and resource group L3' is equal to the total resource 10G. In time period T3, the actual resource needs of resource group L1' are first met, and the resource usage limit of 2G is allocated to resource group L1'; secondly, the actual resource needs of resource group L2' are met, and the resource usage limit of 3G is allocated to resource group L2'; at this time, the remaining resources of the edge node are 10-2-3=5G, although the actual resource needs of resource group L3' are 6G, based on its lowest priority, the resource usage limit allocated is 5G.
[0081] The dynamic resource allocation method for edge nodes provided in this embodiment can effectively guarantee the resource usage requirements of key businesses, and can dynamically adjust the resource occupancy of each service group according to the actual resource usage of the system, thereby greatly improving system resource utilization.
[0082] Please continue reading Figure 8 , shows a dynamic resource allocation device for edge nodes. In this embodiment, the dynamic resource allocation device 80 may include or be divided into one or more program modules, one or more program modules are stored in a storage medium, and are executed by one or more processors to complete the present invention and implement the above-mentioned dynamic resource allocation method for edge nodes. The program module referred to in the present invention refers to a series of computer program instruction segments that can complete specific functions, which is more suitable for describing the execution process of the dynamic resource allocation device 80 in the storage medium than the program itself. The following description will specifically introduce the functions of each program module in this embodiment:
[0083] A registration module 81, adapted to receive registration information of a target process that needs to be run on the edge node, wherein the registration information is used to characterize resource attributes of the target process;
[0084] A priority determination module 82, adapted to determine the resource usage priority of the target process according to the registration information;
[0085] The dynamic allocation module 83 is adapted to dynamically allocate resources to the target process according to the resource usage of the edge node and the resource usage priority.
[0086] Through the above-mentioned dynamic resource allocation device of the edge node, the resource usage requirements of key businesses can be effectively guaranteed, and at the same time, the resource occupancy of each service group can be dynamically adjusted according to the actual resource usage of the system, which greatly improves the system resource utilization.
[0087] The present embodiment also provides a computer device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that can execute programs. The computer device 90 of the present embodiment includes at least but is not limited to: a memory 91 and a processor 92 that can communicate with each other via a system bus, such as Fig. 9 It should be pointed out that Fig. 9 Only computer device 90 is shown having components 91 - 92 , but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.
[0088] In this embodiment, the memory 91 (i.e., a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 91 may be an internal storage unit of the computer device 90, such as a hard disk or a memory of the computer device 90. In other embodiments, the memory 91 may also be an external storage device of the computer device 90, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 90. Of course, the memory 91 may also include both an internal storage unit of the computer device 90 and an external storage device thereof. In this embodiment, the memory 91 is generally used to store an operating system and various application software installed on the computer device 90, such as the program code of the dynamic resource allocation device 80 of the edge node of the first embodiment. In addition, the memory 91 can also be used to temporarily store various types of data that have been output or are to be output.
[0089] In some embodiments, the processor 92 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 92 is generally used to control the overall operation of the computer device 90. In this embodiment, the processor 92 is used to run the program code stored in the memory 91 or process data, such as running the dynamic resource allocation device 80 of the edge node to implement the dynamic resource allocation method of the edge node of the first embodiment.
[0090] This embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, and the program implements the corresponding function when executed by the processor. The computer-readable storage medium of this embodiment is used to store the dynamic resource allocation device 80 of the edge node, and when executed by the processor, the dynamic resource allocation method of the edge node of the first embodiment is implemented.
[0091] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0092] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0093] A person of ordinary skill in the art can understand that all or part of the steps carried out in the above-mentioned embodiment method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable medium. When the program is executed, it includes one of the steps of the method embodiment or a combination thereof.
[0094] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0095] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.
[0096] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A dynamic resource allocation method for edge nodes, characterized in that: The following steps are involved: Receiving registration information of a target process that needs to be run on the edge node, the registration information being used to characterize resource attributes of the target process; Determining the resource usage priority of the target process according to the registration information includes: dividing the target process into a corresponding target resource group based on the registration information; determining the resource usage priority of the target process according to the resource usage priority of the target resource group; Dynamically allocating resources for the target process according to the resource usage of the edge node and the resource usage priority, including: obtaining the actual required resources of the target resource group running in the edge node, and calculating the difference between the actually required resources and the preset usage upper limit of the target resource group; dynamically adjusting the resource allocation of the target resource group according to the difference and the resource usage priority; when the difference is greater than zero, obtaining the resource usage of other resource groups with a higher priority than the target resource group; if the other resource groups contain idle resources, allocating the idle resources in the other resource groups to the target resource group; when the difference is less than zero, obtaining the resource usage of other resource groups with a lower priority than the target resource group; if the actual required resources of the other resource groups are greater than the preset usage upper limit of the other resource groups, allocating the idle resources of the target resource group to the other resource groups; The preset usage limit is calculated by the following steps: The preset usage upper limit of the first priority resource group is the total amount of resources of the edge node; Obtaining the occupancy ratios of resource groups of other priorities except the first priority resource group respectively; The remaining resources after deducting the actually required resources of the first priority resource group from the total resources are calculated, and the remaining resources are multiplied by the occupancy ratio to obtain the corresponding preset usage upper limits of other priority resource groups.
2. The dynamic resource allocation method according to claim 1, characterized in that: The registration information includes top-level attributes, time-sensitive attributes, data loss-sensitive attributes, and other attributes. The step of dividing the target process into corresponding target resource groups based on the registration information includes: Classify the target process with the registration information as the top-level attribute into the first priority resource group; Classify the target process whose registration information is a time-sensitive attribute into the second priority resource group; Classify the target process whose registration information is a data loss sensitive attribute into a third priority resource group; The target process whose registration information is other attributes is classified into a fourth priority resource group, wherein the other attributes are resource attributes of the process corresponding to the application or service that cannot obtain the registration information.
3. The dynamic resource allocation method according to claim 1, characterized in that: The step of dynamically adjusting resource allocation of the target resource group according to the difference and the resource usage priority also includes: In the case where the difference is greater than zero, if a plurality of other resource groups with higher priorities than the target resource group contain idle resources, the idle resources of the other resource groups with the highest priority are allocated to the target resource group; When the difference is less than zero, if the actual required resources of multiple other resource groups with lower priorities than the target resource group are greater than the preset usage upper limit of the other resource groups, the idle resources of the target resource group are allocated to the other resource groups with the highest priority.
4. A dynamic resource allocation device for an edge node, characterized in that: include: A registration module, adapted to receive registration information of a target process to be run on the edge node, wherein the registration information is used to characterize resource attributes of the target process; A priority determination module, adapted to determine the resource usage priority of the target process according to the registration information, comprising: dividing the target process into a corresponding target resource group based on the registration information; determining the resource usage priority of the target process according to the resource usage priority of the target resource group; A dynamic allocation module is adapted to dynamically allocate resources to the target process according to the resource usage of the edge node and the resource usage priority, including: obtaining the actual required resources of the target resource group running in the edge node, and calculating the difference between the actual required resources and the preset usage upper limit of the target resource group; dynamically adjusting the resource allocation of the target resource group according to the difference and the resource usage priority; when the difference is greater than zero, obtaining the resource usage of other resource groups with a higher priority than the target resource group; if the other resource groups contain idle resources, allocating the idle resources in the other resource groups to the target resource group; when the difference is less than zero, obtaining the resource usage of other resource groups with a lower priority than the target resource group; if the actual required resources of the other resource groups are greater than the preset usage upper limit of the other resource groups, allocating the idle resources of the target resource group to the other resource groups; The preset usage limit is calculated by the following steps: The preset usage upper limit of the first priority resource group is the total amount of resources of the edge node; Obtaining the occupancy ratios of resource groups of other priorities except the first priority resource group respectively; The remaining resources after deducting the actually required resources of the first priority resource group from the total resources are calculated, and the remaining resources are multiplied by the occupancy ratio to obtain the corresponding preset usage upper limits of other priority resource groups.
5. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Process management method and device, computing equipment and storage medium
CN111352710A
Multi-copy-based task scheduling method and system for edge computing environment
CN111381950A