Resource allocation method and device for edge computing task and edge computing device

CN122593986APending Publication Date: 2026-08-18GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610600094.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-30
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0004]然而,DVFS技术主要在操作系统内部执行,这导致基于DVFS技术,使用电力MEC设备基于大模型进行边缘计算时,未能在计算任务延迟与节能之间达到均衡

Benefits of technology

[0037]The aforementioned resource allocation method, apparatus, and edge computing device for edge computing tasks are described above. The method, applied to an edge computing device, involves dividing a large model executing the edge computing task into a multi-layered structure; obtaining the frequency adjustment set of the edge computing device; constructing a hierarchical inference time model based on the multi-layered structure and frequency adjustment set of the large model; constructing an inference energy consumption model of the large model based on the multi-layered structure, resource information of the edge computing device, and frequency adjustment set; and solving the hierarchical inference time model and inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy. In this embodiment, the hierarchical inference time model and inference energy consumption model are constructed based on the multi-layered structure of the large model. The target allocation strategy obtained after solving the hierarchical inference time model and inference energy consumption model is the frequency allocated to each layer of the large model. This allows for the allocation of corresponding frequency resources according to the computational needs of each layer, thereby achieving a balance between latency protection and energy saving in edge computing tasks, and thus making the resource allocation method for edge computing tasks more practical.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122593986A_ABST
    Figure CN122593986A_ABST
Patent Text Reader

Abstract

The application relates to a resource allocation method and device for an edge computing task and an edge computing device. The method is applied to the edge computing device and comprises the following steps: dividing a large model for executing an edge computing task into a multi-layer structure; acquiring a frequency adjustment set of the edge computing device; constructing a layered inference time model according to the multi-layer structure of the large model and the frequency adjustment set; constructing an inference energy consumption model of the large model according to the multi-layer structure of the large model, resource information of the edge computing device and the frequency adjustment set; and solving the layered inference time and the inference energy consumption model according to the frequency adjustment set to determine a target allocation strategy. The resource allocation method for the edge computing task provided by the application can achieve a balance between delay guarantee and energy saving of the edge computing task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of edge computing technology, and in particular to a resource allocation method, apparatus and edge computing device for edge computing tasks. Background Technology

[0002] Power intelligent applications such as distribution automation, advanced power metering, and drone power inspection urgently require low-latency, high-performance edge computing within the power 5G private network. However, due to the lightweight nature and resource constraints of multi-access edge computing (MEC) devices, the energy consumption of power MEC devices greatly limits their computing performance.

[0003] In traditional technologies, Dynamic Voltage and Frequency Scaling (DVFS) is typically used to dynamically adjust the voltage and clock frequency of power MEC equipment to reduce energy consumption.

[0004] However, DVFS technology primarily runs within the operating system, which means that when using power MEC devices based on DVFS technology for edge computing based on large models, a balance between computing task latency and energy saving cannot be achieved. Summary of the Invention

[0005] Therefore, it is necessary to provide a resource allocation method, apparatus, and edge computing device for edge computing tasks that can achieve a balance between latency protection and energy saving in edge computing tasks, in order to address the above-mentioned technical problems.

[0006] In a first aspect, this application provides a resource allocation method for edge computing tasks, applied to an edge computing device, the method comprising:

[0007] The large model performing edge computing tasks is divided into a multi-layer structure; and the frequency adjustment set of edge computing devices is obtained.

[0008] Based on the multi-layered structure and frequency adjustment set of the large model, a hierarchical inference time model is constructed.

[0009] Based on the multi-layered structure of the large model, the resource information of edge computing devices, and the frequency adjustment set, an inference energy consumption model for the large model is constructed.

[0010] Based on the frequency adjustment set, the hierarchical inference time model and inference energy consumption model are solved to determine the target allocation strategy.

[0011] In one embodiment, a hierarchical inference time model is constructed based on the multi-layered structure and frequency adjustment set of the large model, including:

[0012] Determine the runtime of each layer in the large model for performing edge computing tasks at each frequency in the frequency adjustment set;

[0013] Based on the runtime and frequency adjustment sets corresponding to the multi-layer structure, a hierarchical inference time model is constructed.

[0014] In one embodiment, a hierarchical inference time model is constructed based on the runtime and frequency adjustment sets corresponding to the multi-layer structure, including:

[0015] Based on the least squares method, the runtime and frequency adjustment sets corresponding to the multi-layer structure are fitted to determine the parameters of the fitting curve.

[0016] A hierarchical inference time model is constructed based on the parameters of the fitted curve and the frequency adjustment set.

[0017] In one embodiment, based on the multi-layered structure of the large model, the resource information of the edge computing devices, and the frequency adjustment set, an inference energy consumption model for the large model is constructed, including:

[0018] Based on resource information and frequency adjustment sets, construct an energy consumption model for each layer of the large model to perform edge computing tasks;

[0019] Based on the energy consumption model corresponding to the multi-layer structure, an inference energy consumption model is constructed.

[0020] In one embodiment, the hierarchical inference time model and inference energy consumption model are solved based on the frequency adjustment set to determine the target allocation strategy, including:

[0021] Based on the frequency adjustment set and the hierarchical inference time model, a segmented inference time model is constructed. The segmented inference time model is used to characterize the relationship between the sum of the segmented inference time and the frequency adjustment time and each frequency in the frequency adjustment set.

[0022] Based on the frequency adjustment set, the segmented inference time model and inference energy consumption model are solved to determine the target allocation strategy; the target allocation strategy includes the large model segmentation strategy and the frequency allocation strategy.

[0023] In one embodiment, based on the frequency adjustment set, the segmented inference time model and the inference energy consumption model are solved to determine the target allocation strategy, including:

[0024] Using a greedy algorithm, the segmented inference time model and inference energy consumption model are solved based on the frequency adjustment set to determine the target allocation strategy.

[0025] In one embodiment, a greedy algorithm is used to solve the segmented inference time model and the inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy, including:

[0026] The first layer in the multi-layer structure of the large model is taken as the first segment, and the first segment is taken as the current segment. The initial frequency is selected from the frequency adjustment set.

[0027] The initial inference result is determined based on the initial frequency and the segmented inference time model; the initial inference result includes the initial inference time.

[0028] If the initial inference time meets the preset conditions, the remaining layers in the multi-layer structure are segmented to obtain the initial allocation strategy; the initial allocation strategy includes the initial segmentation strategy and the initial frequency allocation strategy.

[0029] The initial allocation strategy is optimized based on the inference energy consumption model and frequency adjustment set to obtain the target allocation strategy.

[0030] Secondly, one embodiment of this application provides a resource allocation apparatus for edge computing tasks, applied to an edge computing device, the apparatus comprising:

[0031] The acquisition module is used to divide the large model performing edge computing tasks into a multi-layer structure; and to acquire the frequency adjustment set of edge computing devices.

[0032] The building module is used to construct a hierarchical inference time model based on the multi-layer structure and frequency adjustment set of the large model; and to construct an inference energy consumption model of the large model based on the resource information and frequency adjustment set of the edge computing device.

[0033] The determination module is used to solve the hierarchical inference time model and inference energy consumption model based on the multi-layer structure and frequency adjustment set of the large model, and to determine the target allocation strategy.

[0034] Thirdly, one embodiment of this application provides an edge computing device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method provided in the first aspect above.

[0035] Fourthly, one embodiment of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in the first aspect above.

[0036] Fifthly, one embodiment of this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method provided in the first aspect.

[0037] The aforementioned resource allocation method, apparatus, and edge computing device for edge computing tasks are described above. The method, applied to an edge computing device, involves dividing a large model executing the edge computing task into a multi-layered structure; obtaining the frequency adjustment set of the edge computing device; constructing a hierarchical inference time model based on the multi-layered structure and frequency adjustment set of the large model; constructing an inference energy consumption model of the large model based on the multi-layered structure, resource information of the edge computing device, and frequency adjustment set; and solving the hierarchical inference time model and inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy. In this embodiment, the hierarchical inference time model and inference energy consumption model are constructed based on the multi-layered structure of the large model. The target allocation strategy obtained after solving the hierarchical inference time model and inference energy consumption model is the frequency allocated to each layer of the large model. This allows for the allocation of corresponding frequency resources according to the computational needs of each layer, thereby achieving a balance between latency protection and energy saving in edge computing tasks, and thus making the resource allocation method for edge computing tasks more practical. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 This is an application environment diagram of a resource allocation method for edge computing tasks in one embodiment;

[0040] Figure 2 This is a flowchart illustrating the steps of a resource allocation method for edge computing tasks in one embodiment.

[0041] Figure 3 This is a flowchart illustrating the steps of a resource allocation method for edge computing tasks in another embodiment;

[0042] Figure 4 This is a flowchart illustrating the steps of a resource allocation method for edge computing tasks in another embodiment;

[0043] Figure 5 This is a flowchart illustrating the steps of a resource allocation method for edge computing tasks in another embodiment;

[0044] Figure 6 This is a flowchart illustrating the steps of a resource allocation method for edge computing tasks in another embodiment;

[0045] Figure 7This is a flowchart illustrating the steps of a resource allocation method for edge computing tasks in another embodiment;

[0046] Figure 8 This is a flowchart illustrating the steps of a resource allocation method for edge computing tasks in another embodiment;

[0047] Figure 9 This is a schematic diagram of the resource allocation device for an edge computing task in one embodiment. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0049] It should be noted that the terms "comprising" and "having" as used in this application, and any variations thereof, are intended to cover non-exclusive inclusion.

[0050] First, before introducing the technical solutions of the embodiments disclosed in this application, the background technology or technological evolution on which the embodiments of this application are based will be introduced. In the field of power technology, power intelligent applications such as distribution automation, advanced power metering, and UAV power inspection urgently need to perform low-latency, high-performance edge computing within the power 5G private network. However, due to the lightweight and resource-constrained nature of multi-access edge computing (MEC) devices, the energy consumption of power MEC devices greatly limits their computing performance. Currently, commercial computers can reduce energy consumption by dynamically adjusting the voltage and clock frequency of the processor during computing using Dynamic Voltage and Frequency Scaling (DVFS) technology, which can be applied to power smart grids. However, DVFS technology mainly executes within the operating system, while power smart grid applications mainly run at the application layer. The underlying DVFS cannot accurately perceive the characteristics of power services. Therefore, current DVFS mainly adjusts the frequency dynamically according to the processor load, and often keeps the frequency unchanged during the execution of a task. When power MEC devices perform edge computing tasks based on large models, the large model is composed of multiple layers such as input layers, output layers, multiple convolutional layers, hidden layers, and fully connected layers. Different layers have different superparameters and different computational requirements. Using the same processor frequency throughout the entire large model inference process can easily lead to layers with low computational requirements wasting energy due to excessive frequency resource allocation, while layers with high computational requirements cannot meet low-latency computing needs due to insufficient frequency resource allocation. This results in a failure to achieve a balance between computational latency and energy saving. To address this, this application provides a resource allocation method for edge computing tasks.

[0051] The resource allocation method for edge computing tasks provided in this application embodiment is applied to an edge computing device, which is an industrial-grade embedded computing device, and its internal structure is as follows: Figure 1The computer device, as shown, includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a resource allocation method for edge computing tasks. The display unit can be used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0052] Those skilled in the art will understand that Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0053] The technical solution of this application and how the technical solution of this application solves the technical problem are described in detail below with specific embodiments.

[0054] In one embodiment, such as Figure 2 As shown, a resource allocation method for edge computing tasks is provided, with an example of its application to an edge computing device. In this embodiment, the method includes the following steps:

[0055] Step 200: Divide the large model that performs edge computing tasks into a multi-layer structure; and obtain the frequency adjustment set of the edge computing devices.

[0056] When edge computing devices perform edge computing tasks, they use large models for computation. Before executing an edge computing task, the device divides the large model into multiple layers. , where K is a natural number and K > 1, representing the number of multi-layer structures after partitioning. When the edge computing task executes the edge computing task (batch dataset), the data flow direction is successively .

[0057] In an optional embodiment, the edge computing device usually partitions the large model by splitting the large model network structure horizontally at the maximum granularity to obtain a multi-layer structure. Usually, the network structure of the large model includes an input layer, a hidden layer, a fully connected layer, an output layer, etc. The edge computing device can directly partition the large model according to the layer structure of the large model, and the multi-layer structure after partitioning is the input layer structure, the hidden layer structure, the fully connected layer structure, and the output layer structure.

[0058] The frequency adjustment set of the edge computing task refers to the set composed of the frequencies of the hardware processing modules in the edge computing device. It can be understood that the hardware processing modules in the edge computing device include a central processing unit (CPU), a graphics processing unit (GPU), and memory. The frequency adjustment set refers to the set composed of the frequency set of the CPU, the frequency set of the GPU, and the frequency set of the memory. Specifically, the frequency adjustment set is to perform a triple combination of the frequency set of the CPU, the frequency set of the GPU, and the frequency set of the memory to form a triple set <frequency set of the CPU, frequency set of the GPU, frequency set of the memory>.

[0059] For the frequency set of the CPU, assume that the adjustable range of the CPU frequency is , and the frequencies within this range are divided into N c parts, then the frequency set of the CPU is . Among them, , , and it satisfies . For the frequency set of the GPU, assume that the adjustable range of the GPU frequency is , and the frequencies within this range are N g parts, then the frequency set of the GPU is , where , , and it satisfies . For the frequency set of the memory, assume that the adjustable range of the memory frequency is , and the frequencies within this range are N m parts, and the frequency set of the memory is , where , , and it satisfies . The frequency adjustment set can be expressed as:

[0060]

[0061] The frequency adjustment set of the edge computing device can be pre-stored in the edge computing device and can be directly retrieved when needed.

[0062] Step 210: Based on the multi-layered structure and frequency adjustment set of the large model, construct a hierarchical inference time model.

[0063] Edge computing devices, based on the multi-layered structure of the partitioned large model and the frequency adjustment set, can construct a hierarchical inference time model. This hierarchical inference time model characterizes the correspondence between the runtime of each layer in the large model executing its corresponding edge computing task and the frequencies in the frequency adjustment set. The hierarchical inference time model can be expressed as: , This represents the runtime of the k-th layer structure when performing the corresponding edge computing task at each frequency in the frequency adjustment set.

[0064] Step 220: Based on the multi-layer structure of the large model, the resource information of the edge computing devices, and the frequency adjustment set, construct the inference energy consumption model of the large model.

[0065] Resource information for edge computing devices refers to the resource information of the hardware processing devices within these devices, including the computing power resources (GPU, CPU, and memory) that can be utilized by edge computing tasks, as well as the operating status and parameter information of storage resources. This resource information can be obtained in real-time through monitoring devices installed within the edge computing device.

[0066] After acquiring resource information, the edge computing device constructs an energy consumption model for the large model based on this information, the multi-layered structure of the large model, and the frequency adjustment set. The energy consumption model characterizes the energy consumed by each layer of the large model when executing its corresponding edge computing task at each frequency in the frequency adjustment set. The inference energy consumption model of the large model can be expressed as: ,in, This represents the energy consumed by the k-th layer structure in the large model when performing the corresponding edge computing tasks at each frequency in the frequency adjustment set.

[0067] Step 230: Solve the hierarchical inference time model and inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy.

[0068] After obtaining the hierarchical inference time and inference energy models of the construction layer, the edge computing device iterates through each frequency in the frequency adjustment set and solves the hierarchical inference time model and inference energy consumption model to obtain the frequencies required for each layer of the large model under preset conditions, i.e., the target allocation strategy. The preset conditions refer to the inference time output by the inference time model being less than a preset time threshold, and the energy consumption output by the inference energy consumption model being less than a preset energy consumption threshold. This embodiment does not limit the specific method used to solve the hierarchical inference time model and inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy, as long as the function can be achieved.

[0069] The resource allocation method for edge computing tasks provided in this application is applied to edge computing tasks. This method divides a large model executing the edge computing task into a multi-layered structure; obtains the frequency adjustment set of the edge computing devices; constructs a hierarchical inference time model based on the multi-layered structure and frequency adjustment set of the large model; constructs an inference energy consumption model of the large model based on the multi-layered structure, resource information of the edge computing devices, and the frequency adjustment set; and solves the hierarchical inference time model and inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy. In this embodiment, the hierarchical inference time model and inference energy consumption model are constructed based on the multi-layered structure of the large model. The target allocation strategy obtained after solving the hierarchical inference time model and inference energy consumption model is the frequency allocated to each layer of the large model. This allows for the allocation of corresponding frequency resources according to the computing needs of each layer, thereby achieving a balance between latency protection and energy saving in edge computing tasks, and thus making the resource allocation method for edge computing tasks more practical.

[0070] In addition, the resource allocation method for edge computing tasks provided in this application can be directly and quickly deployed in existing edge computing devices, avoiding major adjustments to the DVFS technology in the operating system kernel of the edge computing device, thus making the resource allocation method for edge computing tasks more practical.

[0071] In one embodiment, such as Figure 3 As shown, this involves an implementation of a hierarchical inference time model based on the multi-layered structure and frequency adjustment set of a large model. The steps of this implementation include:

[0072] Step 300: Determine the running time of each layer in the large model for performing edge computing tasks at each frequency in the frequency adjustment set.

[0073] For each layer structure of the large model, the edge computing device determines the running time required to execute the edge computing task at each frequency in the frequency adjustment set according to this layer structure. It can be understood that edge computing task samples are obtained to determine the sizes of different batches of datasets in the edge computing tasks processed by each layer structure of the large model. The edge computing device runs the large model based on each frequency in the frequency adjustment set to construct the running time of each layer structure at different batch sizes and frequencies.

[0074] In an optional embodiment, the running time corresponding to each layer structure and the frequency adjustment set can form a dataset: {batch size, <CPU frequency set, GPU frequency set, memory frequency set>}, }. Where represents the running time of each layer structure of the large model under this batch size and frequency triple.

[0075] Step 310: Construct a hierarchical inference time model according to the running time corresponding to the multi-layer structure and the frequency adjustment set.

[0076] After obtaining the running time corresponding to the multi-layer structure of the large model, the edge computing device constructs a hierarchical inference time model according to this running time model and the frequency adjustment set.

[0077] In this embodiment, the running time corresponding to each layer structure in the large model when executing the edge computing task at each frequency in the frequency adjustment set is determined; according to the running time model corresponding to the multi-layer structure and the frequency adjustment set, a hierarchical inference time model is constructed. In this way, the method of first determining the running time corresponding to the multi-layer structure and then constructing the hierarchical inference time model is easy to implement and can improve the practicability of the resource allocation method for edge computing tasks.

[0078] In one embodiment, as Figure 4 shown, it involves an implementation manner of constructing a hierarchical inference time model according to the running time model corresponding to the multi-layer structure and the frequency adjustment set. The steps of this implementation manner include:

[0079] Step 400: Based on the least squares method, fit the running time corresponding to the multi-layer structure and the frequency adjustment set to determine the fitting curve parameters.

[0080] The fitting curve parameters are fixed parameters in the hierarchical inference time model. After the edge computing task obtains the running time corresponding to each layer structure, the least squares method (nonlinear least squares method) is used to fit the running time corresponding to the multi-layer structure and the frequencies in the frequency adjustment set to determine the fitting curve parameters.

[0081] In an optional embodiment, the edge computing device uses the non - linear least - squares method to fit the running time and frequency adjustment set corresponding to the multi - layer structure, and a data set can be formed: {batch size, <CPU frequency set, GPU frequency set, memory frequency set>}, and we can obtain . Among them, represents the computational amount of the k - th layer structure. When k = 1, the computational amount of this layer structure is represented by the batch size. When k = 2, 3, …, K, it is represented by the feature map size of this hierarchical structure, are the parameters of the fitting curve.

[0082] Step 410: Construct a hierarchical inference time model according to the fitting curve parameters and the frequency adjustment set.

[0083] After obtaining the fitting curve parameters, the edge computing device constructs a hierarchical inference time model according to the fitting curve parameters and the frequency adjustment set, that is, the model composed of the set of inference time models for each layer is represented as a hierarchical inference time model.

[0084] In this embodiment, based on the least - squares method, the running time and frequency adjustment set corresponding to the multi - layer structure are fitted to determine the fitting curve parameters; according to the fitting curve parameters and the frequency adjustment set, a hierarchical inference time model is constructed. The method of determining the fitting curve parameters is fast and easy to implement, so as to improve the efficiency of constructing the hierarchical inference time model and make the resource allocation method for edge computing tasks more practical.

[0085] In an embodiment, as Figure 5 shown, it involves an implementation method of constructing an inference energy consumption model for a large model according to the multi - layer structure of the large model, the resource information of the edge computing device, and the frequency adjustment set. The steps of this implementation method include:

[0086] Step 500: Construct an energy consumption model for each layer structure in the large model to execute edge computing tasks according to the resource information and the frequency adjustment set.

[0087] For each layer structure in the large model, the edge computing device constructs a model corresponding to the energy consumed by this layer structure to execute the corresponding edge computing task according to the resource information and the frequency adjustment set, so as to obtain the energy consumption models corresponding to the multi - layer structure.

[0088] In an optional embodiment, the energy consumption model corresponding to the k - th layer structure in the large model can be expressed as: , where represents the energy consumption factor, respectively represent the energy consumption systems of the CPU, GPU, and memory.

[0089] Step 510: Construct an inference energy consumption model based on the energy consumption model corresponding to the multi-layer structure.

[0090] After obtaining the energy consumption model corresponding to each layer of the structure, the edge computing device constructs an inference energy consumption model based on the energy consumption models corresponding to multiple layers. In essence, the edge computing device sums the energy consumption models corresponding to each layer to obtain the inference energy consumption model.

[0091] In this embodiment, an energy consumption model for each layer of the large model to perform edge computing tasks is constructed based on resource information and frequency adjustment set; an inference energy consumption model is constructed based on the energy consumption model corresponding to the multi-layer structure. This method of constructing the inference energy consumption model is quick and easy to implement, which can improve the efficiency of constructing the inference energy consumption model, thereby improving the practicality of the resource allocation method for edge computing tasks.

[0092] In one embodiment, such as Figure 6 As shown, this involves solving a hierarchical inference time model and an inference energy consumption model based on a frequency adjustment set to determine a target allocation strategy. The steps of this implementation include:

[0093] Step 600: Based on the frequency adjustment set and the hierarchical inference time model, construct the segmented inference time model; the segmented inference time model is used to characterize the relationship between the sum of the segmented inference time and the frequency adjustment time and each frequency in the frequency adjustment set.

[0094] In a large model with multiple layers, there may be adjacent layers with the same final assigned frequency. These adjacent layers with the same frequency can be grouped into the same segment. During edge computing tasks performed by adjacent layers with different frequencies, frequency adjustment consumes time. Based on this, the edge computing device constructs a segmented inference time model according to the frequency adjustment set and the layered inference time. The segmented inference time model includes the segmented inference time model itself, as well as the time consumed for frequency adjustment in that segment. Each segment includes at least one layer, and in the case of multiple layers in each segment, these multiple layers are adjacent and have the same assigned frequency.

[0095] In an optional embodiment, the piecewise time inference model can be represented as: ,in, Indicates the frequency allocation strategy. For natural numbers, This indicates the frequency allocation strategy. The number of segments in the large model. Indicating frequency allocation strategy The reasoning time for the next s-th segment This indicates the frequency adjustment time, i.e., the clock frequency adjustment delay.

[0096] Step 610: Solve the segmented inference time model and inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy; the target allocation strategy includes the large model segmentation strategy and the frequency allocation strategy.

[0097] After obtaining the segmented inference time model, the edge computing device solves the segmented inference time model and inference energy consumption model based on the frequency adjustment set to determine the optimal segmentation strategy for the large model and the corresponding frequency allocation strategy for each segment, i.e., the target allocation strategy. This embodiment does not limit the specific method used to solve the segmented inference time model and inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy, as long as the function can be achieved.

[0098] In this embodiment, a segmented inference time model is constructed based on the frequency adjustment set and the hierarchical inference time model. The segmented inference time model and the inference energy consumption model are then solved using the frequency adjustment set to determine the target allocation strategy. This approach divides multi-layered structures with similar allocation strategies in a large model into the same segment, and by considering the frequency adjustment time to obtain the corresponding segmented inference time model, it improves the accuracy of the determined target allocation strategy and increases the efficiency of executing edge computing tasks according to the target allocation strategy. This makes the resource allocation method for edge computing tasks more practical and reliable.

[0099] In one embodiment, an implementation involves solving a segmented inference time model and an inference energy consumption model based on a frequency adjustment set to determine a target allocation strategy. This step includes:

[0100] Using a greedy algorithm, the segmented inference time model and inference energy consumption model are solved based on the frequency adjustment set to determine the target allocation strategy.

[0101] The core of a greedy algorithm is to select only the current local optimum at each step, without backtracking or considering the future, hoping to achieve the global optimum. In other words, it makes the best choice at each step. Edge computing devices can use greedy algorithms to solve segmented inference time and inference energy consumption models based on frequency adjustment sets to obtain the optimal target allocation strategy.

[0102] In one embodiment, such as Figure 7 As shown, this involves an implementation method that uses a greedy algorithm to solve the segmented inference time model and inference energy consumption model based on the frequency adjustment set, and determines the target allocation strategy. The steps of this implementation method include:

[0103] Step 700: Take the first layer of the multi-layer structure of the large model as the first segment, take the first segment as the current segment, and select the initial frequency from the frequency adjustment set.

[0104] Edge computing devices can first mark the large model segment sequence as empty, meaning that the multi-layered structure of the large model has not yet been segmented, allowing... Assuming s represents the current segment, s=1, the first layer of the multi-layered structure of the large model is placed in, and labeled as... The edge computing device selects a frequency from the frequency adjustment set as its initial frequency. This selection can be random or based on the frequency distribution order within the set. Essentially, the initial frequency is a frequency triplet. , This includes the CPU frequency, GPU frequency, and memory frequency.

[0105] Step 710: Determine the initial inference result based on the initial frequency and the segmented inference time model; the initial inference result includes the initial inference time.

[0106] The initial inference result includes the initial inference time and initial energy consumption. After obtaining the current segment and its corresponding initial frequency, the edge computing device substitutes the initial frequency into the segmented inference time model to obtain the initial inference time.

[0107] Step 720: If the initial inference time meets the preset conditions, the remaining layers in the multi-layer structure are segmented to obtain the initial allocation strategy; the initial allocation strategy includes the initial segmentation strategy and the initial frequency allocation strategy.

[0108] The initial inference time is pre-set to be less than or equal to an inference time threshold. The inference time threshold can be expressed as: .in, This is the maximum inference time that a large model can tolerate. This represents the number of layers in the s-th segment. After obtaining the initial inference time, the edge computing device determines whether the initial inference time meets preset conditions, i.e., it determines the initial inference time. Is it less than or equal to the inference time threshold, i.e. If the initial inference time meets the preset conditions, the remaining layers in the multi-layer structure are segmented to obtain the initial allocation strategy. If the edge computing device determines that the initial inference time does not meet the preset conditions, the initial frequency can be reselected.

[0109] In an optional embodiment, the specific implementation of segmenting the remaining layers in the multi-layer structure to obtain the initial allocation strategy includes:

[0110] Select the layer structure adjacent to the layer structure in the current segment from the remaining layer structure (select the second layer structure in the multi-layer structure) and put it into the current segment to form a new current segment. Return to execute steps 700-710 until all the layer structures in the remaining layer structure have been traversed, and the segmentation of the layer structure is completed. The initial allocation strategy is obtained, which can obtain the segment sequence corresponding to the large model and the frequency of each segment structure allocation of the large model.

[0111] The current segment is the first segment and includes the first layer structure of the large model. The second layer structure of the large model is selected and placed into the current segment to form a temporary segment. , Input the initial frequency into the segmented inference time model to obtain the initial inference time corresponding to the temporary segment. If the initial inference time meets the preset conditions, the temporary segment is used as the new current segment and the above steps are repeated. If the initial inference time does not meet the preset conditions, the temporary segment is used as a new segment (the second segment), and the execution steps 700-710 are returned.

[0112] Specifically: for k=2 to K, execute

[0113] Combine the current segment with the k-th layer structure to form a temporary segment. ; Calculate temporary segments based on initial frequencies Initial inference time ;judge Is it true? If true, then place the k-th layer structure into the current segment, and let... If the initial frequency remains unchanged, then the k-th layer structure is treated as a new segment, i.e., s = s + 1, the new segment. Select a new initial frequency from the frequency adjustment set, such that the first... The initial inference time of the segments satisfies ;

[0114] End for

[0115] The segments obtained based on the above description and their corresponding initial frequencies are then placed into the large model segment sequence, i.e. The initial allocation strategy can be expressed as .

[0116] Step 730: Optimize the initial allocation strategy based on the inference energy consumption model and frequency adjustment set to obtain the target allocation strategy.

[0117] After obtaining the initial allocation strategy, the edge computing device can determine the energy consumption of each segment of the large model based on the initial allocation strategy and the inference energy consumption model.

[0118] In one optional embodiment, the initial frequency can be substituted into the inference energy consumption model to obtain the initial energy consumption while determining the initial inference time, and finally the energy consumption corresponding to each segment structure can be determined according to the initial segmentation strategy in the initial allocation strategy; alternatively, after obtaining the initial allocation strategy, the energy consumption corresponding to each segment structure can be calculated directly according to the initial segmentation strategy and the initial frequency allocation strategy in the initial allocation strategy, as well as the inference energy consumption model.

[0119] After determining the energy consumption of each segment of the large model, the edge computing device selects the segment with the highest energy consumption and determines whether to choose an intermediate frequency from the frequency adjustment set to reduce the energy consumption of that segment. And it meets the delay requirement, that is .in, This indicates the energy consumption corresponding to the intermediate frequency. This indicates the energy consumption corresponding to the initial allocation strategy. This represents the inference time corresponding to the intermediate frequency. If satisfied, the frequency in the initial frequency allocation strategy corresponding to that segment is replaced with the intermediate frequency; the frequencies in the adjacent segments of the segment with the highest energy consumption are replaced with the intermediate frequency to determine whether they satisfy both energy consumption reduction and delay requirements; if satisfied, the segment structure can be merged with the segment structure with the highest energy consumption, and the frequency of the merged segment structure is the intermediate frequency; if not satisfied, the initial frequency allocation strategy corresponding to the adjacent segments is maintained. The above process is repeated M-1 times, where M is a natural number, and satisfies... ,in, This indicates the number of elements in the frequency adjustment set. In other words, for i=1 to M, up to the steps described above, End for.

[0120] In this embodiment, any layer of the multi-layered structure of the large model is first taken as the current segment, and an initial frequency is selected from the frequency adjustment set. Based on the initial frequency and the segmented inference time model, an initial inference result is determined, including the initial inference time. If the initial inference time meets preset conditions, the remaining layers in the multi-layered structure are segmented to obtain an initial allocation strategy. The initial allocation strategy is then optimized based on the inference energy consumption model and the frequency adjustment set to obtain a target allocation strategy. This approach first determines the optimal initial allocation strategy in terms of latency guarantee for edge computing tasks, and then optimizes the initial allocation strategy in terms of energy consumption, resulting in a target allocation strategy that achieves a balance between latency guarantee and energy saving for edge computing tasks. This makes the resource allocation method for edge computing tasks more practical and reliable. Furthermore, the greedy algorithm used in this embodiment has low complexity and can run quickly on resource-constrained edge computing devices, further enhancing the practicality of the resource allocation method for edge computing tasks.

[0121] Please see Figure 8One embodiment of this application provides a resource allocation method for edge computing tasks, the method comprising the following steps:

[0122] Step 800: Divide the large model that performs edge computing tasks into a multi-layer structure and obtain the frequency adjustment set of the edge computing devices;

[0123] Step 810: Determine the running time of each layer in the large model for performing edge computing tasks at each frequency in the frequency adjustment set;

[0124] Step 820: Based on the nonlinear least squares method, fit the running time and frequency adjustment set corresponding to the multi-layer structure to determine the parameters of the fitting curve;

[0125] Step 830: Construct a hierarchical inference time model based on the fitting curve parameters and frequency adjustment set.

[0126] Step 840: Based on the resource information and frequency adjustment set of the edge computing devices, construct an energy consumption model for each layer of the large model to perform edge computing tasks;

[0127] Step 850: Construct an inference energy consumption model based on the energy consumption model corresponding to the multi-layer structure;

[0128] Step 860: Based on the frequency adjustment set and the hierarchical inference time model, construct the segmented inference time model; the segmented inference time model is used to characterize the relationship between the sum of the segmented inference time and the frequency adjustment time and each frequency in the frequency adjustment set.

[0129] Step 870: Using a greedy algorithm, solve the segmented inference time model and inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy. The target allocation strategy includes the target segmentation strategy and the target frequency allocation strategy.

[0130] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0131] Based on the same inventive concept, this application also provides a resource allocation device for edge computing tasks to implement the resource allocation method for edge computing tasks described above. The solution provided by this device is similar to the implementation described in the above method. Therefore, the specific limitations in one or more resource allocation device embodiments for edge computing tasks provided below can be found in the limitations of the resource allocation method for edge computing tasks described above, and will not be repeated here.

[0132] In one embodiment, such as Figure 9 As shown, a resource allocation device 10 for edge computing tasks is provided, comprising: an acquisition module 11, a construction module 12, and a determination module 13, wherein:

[0133] Module 11 is used to divide the large model performing edge computing tasks into a multi-layer structure and to obtain the frequency adjustment set of the edge computing device;

[0134] Module 12 is used to construct a hierarchical inference time model based on the multi-layer structure and frequency adjustment set of the large model; and to construct an inference energy consumption model of the large model based on the resource information and frequency adjustment set of the edge computing device.

[0135] Module 13 is used to solve the hierarchical inference time model and inference energy consumption model based on the multi-layer structure and frequency adjustment set of the large model, and to determine the target allocation strategy.

[0136] In one embodiment, the construction module 12 includes a first construction unit. The first construction unit is used to determine the runtime of each layer in the large model for performing edge computing tasks at each frequency in the frequency adjustment set; and to construct a hierarchical inference time model based on the runtime of the multi-layer structure and the frequency adjustment set.

[0137] In one embodiment, the first building unit is specifically used to fit the runtime and frequency adjustment set corresponding to the multi-layer structure based on the least squares method to determine the fitting curve parameters; and to construct a hierarchical inference time model based on the fitting curve parameters and the frequency adjustment set.

[0138] In one embodiment, the construction module 12 further includes a second construction unit. The second construction unit is used to construct an energy consumption model for each layer of the large model to perform edge computing tasks based on resource information and frequency adjustment sets; and to construct an inference energy consumption model based on the energy consumption models corresponding to the multi-layer structure.

[0139] In one embodiment, the determining module 13 includes a third building unit and a determining unit. The third building unit is used to construct a segmented inference time model based on the frequency adjustment set and the hierarchical inference time model; the segmented inference time model is used to characterize the relationship between the sum of the segmented inference time and the frequency adjustment time and each frequency in the frequency adjustment set; the determining unit is used to solve the segmented inference time model and the inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy; the target allocation strategy includes a large model segmentation strategy and a frequency allocation strategy.

[0140] In one embodiment, the determining unit is specifically used to solve the segmented inference time model and the inference energy consumption model based on the frequency adjustment set using a greedy algorithm to determine the target allocation strategy.

[0141] In one embodiment, the determining unit is further configured to take the first layer in the multi-layer structure of the large model as the first segment, take the first segment as the current segment, select an initial frequency from the frequency adjustment set; determine the initial inference result based on the initial frequency and the segmented inference time model; the initial inference result includes the initial inference time; if the initial inference time meets the preset conditions, segment the remaining layers in the multi-layer structure to obtain an initial allocation strategy; the initial allocation strategy includes an initial segmentation strategy and an initial frequency allocation strategy; optimize the initial allocation strategy based on the inference energy consumption model and the frequency adjustment set to obtain the target allocation strategy.

[0142] Each module in the resource allocation device for the aforementioned edge computing tasks can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0143] In one embodiment, an edge computing device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0144] The large model performing edge computing tasks is divided into a multi-layer structure; and the frequency adjustment set of edge computing devices is obtained.

[0145] Based on the multi-layered structure and frequency adjustment set of the large model, a hierarchical inference time model is constructed.

[0146] Based on the multi-layered structure of the large model, the resource information of edge computing devices, and the frequency adjustment set, an inference energy consumption model for the large model is constructed.

[0147] Based on the frequency adjustment set, the hierarchical inference time model and inference energy consumption model are solved to determine the target allocation strategy.

[0148] In one embodiment, when the processor executes the computer program, it also performs the following steps: determining the runtime of each layer in the large model for performing edge computing tasks at each frequency in the frequency adjustment set; and constructing a hierarchical inference time model based on the runtime of the multi-layer structure and the frequency adjustment set.

[0149] In one embodiment, when the processor executes the computer program, it also performs the following steps: fitting the runtime and frequency adjustment set corresponding to the multi-layer structure based on the least squares method to determine the fitting curve parameters; and constructing a hierarchical inference time model based on the fitting curve parameters and the frequency adjustment set.

[0150] In one embodiment, when the processor executes the computer program, it also performs the following steps: constructing an energy consumption model for each layer of the large model to perform edge computing tasks based on resource information and frequency adjustment sets; and constructing an inference energy consumption model based on the energy consumption models corresponding to the multi-layer structure.

[0151] In one embodiment, when the processor executes the computer program, it further performs the following steps: constructing a segmented inference time model based on the frequency adjustment set and the hierarchical inference time model; the segmented inference time model is used to characterize the relationship between the sum of the segmented inference time and the frequency adjustment time and each frequency in the frequency adjustment set; solving the segmented inference time model and the inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy; the target allocation strategy includes a large model segmentation strategy and a frequency allocation strategy.

[0152] In one embodiment, when the processor executes the computer program, it also performs the following steps: using a greedy algorithm, based on the frequency adjustment set, to solve the segmented inference time model and the inference energy consumption model, and determine the target allocation strategy.

[0153] In one embodiment, when the processor executes the computer program, it further performs the following steps: taking the first layer in the multi-layer structure of the large model as the first segment, taking the first segment as the current segment, and selecting an initial frequency from the frequency adjustment set; determining an initial inference result based on the initial frequency and the segmented inference time model; the initial inference result includes the initial inference time; if the initial inference time meets a preset condition, segmenting the remaining layers in the multi-layer structure to obtain an initial allocation strategy; the initial allocation strategy includes an initial segmentation strategy and an initial frequency allocation strategy; and optimizing the initial allocation strategy based on the inference energy consumption model and the frequency adjustment set to obtain a target allocation strategy.

[0154] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0155] The large model performing edge computing tasks is divided into a multi-layer structure; and the frequency adjustment set of edge computing devices is obtained.

[0156] Based on the multi-layered structure and frequency adjustment set of the large model, a hierarchical inference time model is constructed.

[0157] Based on the multi-layered structure of the large model, the resource information of edge computing devices, and the frequency adjustment set, an inference energy consumption model for the large model is constructed.

[0158] Based on the frequency adjustment set, the hierarchical inference time model and inference energy consumption model are solved to determine the target allocation strategy.

[0159] In one embodiment, when the computer program is executed by the processor, it also performs the following steps: determining the runtime of each layer in the large model for performing edge computing tasks at each frequency in the frequency adjustment set; and constructing a hierarchical inference time model based on the runtime of the multi-layer structure and the frequency adjustment set.

[0160] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: fitting the runtime and frequency adjustment set corresponding to the multi-layer structure based on the least squares method to determine the fitting curve parameters; and constructing a hierarchical inference time model based on the fitting curve parameters and the frequency adjustment set.

[0161] In one embodiment, when the computer program is executed by the processor, it also performs the following steps: constructing an energy consumption model for each layer of the large model to perform edge computing tasks based on resource information and frequency adjustment sets; and constructing an inference energy consumption model based on the energy consumption models corresponding to the multi-layer structure.

[0162] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: constructing a segmented inference time model based on the frequency adjustment set and the hierarchical inference time model; the segmented inference time model is used to characterize the relationship between the sum of the segmented inference time and the frequency adjustment time and each frequency in the frequency adjustment set; solving the segmented inference time model and the inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy; the target allocation strategy includes a large model segmentation strategy and a frequency allocation strategy.

[0163] In one embodiment, when the computer program is executed by the processor, it also performs the following steps: using a greedy algorithm, based on the frequency adjustment set, to solve the segmented inference time model and the inference energy consumption model, and determine the target allocation strategy.

[0164] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: taking the first layer in the multi-layer structure of the large model as the first segment, taking the first segment as the current segment, and selecting an initial frequency from the frequency adjustment set; determining an initial inference result based on the initial frequency and the segmented inference time model; the initial inference result includes the initial inference time; if the initial inference time meets a preset condition, segmenting the remaining layers in the multi-layer structure to obtain an initial allocation strategy; the initial allocation strategy includes an initial segmentation strategy and an initial frequency allocation strategy; optimizing the initial allocation strategy based on the inference energy consumption model and the frequency adjustment set to obtain a target allocation strategy.

[0165] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0166] The large model performing edge computing tasks is divided into a multi-layer structure; and the frequency adjustment set of edge computing devices is obtained.

[0167] Based on the multi-layered structure and frequency adjustment set of the large model, a hierarchical inference time model is constructed.

[0168] Based on the multi-layered structure of the large model, the resource information of edge computing devices, and the frequency adjustment set, an inference energy consumption model for the large model is constructed.

[0169] Based on the frequency adjustment set, the hierarchical inference time model and inference energy consumption model are solved to determine the target allocation strategy.

[0170] In one embodiment, when the computer program is executed by the processor, it also performs the following steps: determining the runtime of each layer in the large model for performing edge computing tasks at each frequency in the frequency adjustment set; and constructing a hierarchical inference time model based on the runtime of the multi-layer structure and the frequency adjustment set.

[0171] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: fitting the runtime and frequency adjustment set corresponding to the multi-layer structure based on the least squares method to determine the fitting curve parameters; and constructing a hierarchical inference time model based on the fitting curve parameters and the frequency adjustment set.

[0172] In one embodiment, when the computer program is executed by the processor, it also performs the following steps: constructing an energy consumption model for each layer of the large model to perform edge computing tasks based on resource information and frequency adjustment sets; and constructing an inference energy consumption model based on the energy consumption models corresponding to the multi-layer structure.

[0173] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: constructing a segmented inference time model based on the frequency adjustment set and the hierarchical inference time model; the segmented inference time model is used to characterize the relationship between the sum of the segmented inference time and the frequency adjustment time and each frequency in the frequency adjustment set; solving the segmented inference time model and the inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy; the target allocation strategy includes a large model segmentation strategy and a frequency allocation strategy.

[0174] In one embodiment, when the computer program is executed by the processor, it also performs the following steps: using a greedy algorithm, based on the frequency adjustment set, to solve the segmented inference time model and the inference energy consumption model, and determine the target allocation strategy.

[0175] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: taking the first layer in the multi-layer structure of the large model as the first segment, taking the first segment as the current segment, and selecting an initial frequency from the frequency adjustment set; determining an initial inference result based on the initial frequency and the segmented inference time model; the initial inference result includes the initial inference time; if the initial inference time meets a preset condition, segmenting the remaining layers in the multi-layer structure to obtain an initial allocation strategy; the initial allocation strategy includes an initial segmentation strategy and an initial frequency allocation strategy; optimizing the initial allocation strategy based on the inference energy consumption model and the frequency adjustment set to obtain a target allocation strategy.

[0176] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0177] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0178] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A resource allocation method for edge computing tasks, characterized in that, Applied to edge computing devices, the method includes: The large model executing the edge computing task is divided into a multi-layer structure; and the frequency adjustment set of the edge computing device is obtained. Based on the multi-layered structure of the large model and the frequency adjustment set, a hierarchical inference time model is constructed. Based on the multi-layer structure of the large model, the resource information of the edge computing device, and the frequency adjustment set, the inference energy consumption model of the large model is constructed. Based on the frequency adjustment set, the hierarchical inference time model and the inference energy consumption model are solved to determine the target allocation strategy.

2. The method according to claim 1, characterized in that, The construction of a hierarchical inference time model based on the multi-layered structure of the large model and the frequency adjustment set includes: Determine the running time of each layer in the large model for executing the edge computing task at each frequency in the frequency adjustment set; The hierarchical inference time model is constructed based on the runtime corresponding to the multi-layer structure and the frequency adjustment set.

3. The method according to claim 2, characterized in that, The step of constructing the hierarchical inference time model based on the runtime corresponding to the multi-layer structure and the frequency adjustment set includes: Based on the least squares method, the running time corresponding to the multi-layer structure and the frequency adjustment set are fitted to determine the parameters of the fitting curve. The hierarchical inference time model is constructed based on the fitted curve parameters and the frequency adjustment set.

4. The method according to claim 1, characterized in that, The step of constructing the inference energy consumption model of the large model based on the multi-layer structure of the large model, the resource information of the edge computing device, and the frequency adjustment set includes: Based on the resource information and the frequency adjustment set, construct an energy consumption model for each layer of the large model to perform the edge computing task; Based on the energy consumption model corresponding to the multi-layer structure, the inference energy consumption model is constructed.

5. The method according to claim 1, characterized in that, The step of solving the hierarchical inference time model and the inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy includes: Based on the frequency adjustment set and the hierarchical inference time model, a segmented inference time model is constructed; the segmented inference time model is used to characterize the relationship between the sum of the segmented inference time and the frequency adjustment time and each frequency in the frequency adjustment set; Based on the frequency adjustment set, the segmented inference time model and the inference energy consumption model are solved to determine the target allocation strategy; the target allocation strategy includes a large model segmentation strategy and a frequency allocation strategy.

6. The method according to claim 5, characterized in that, The step of solving the segmented inference time model and the inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy includes: Using a greedy algorithm, the segmented inference time model and the inference energy consumption model are solved based on the frequency adjustment set to determine the target allocation strategy.

7. The method according to claim 6, characterized in that, The step of using a greedy algorithm to solve the segmented inference time model and the inference energy consumption model based on the frequency adjustment set to determine the target allocation strategy includes: The first layer in the multi-layer structure of the large model is taken as the first segment, and the first segment is taken as the current segment. An initial frequency is selected from the frequency adjustment set. Based on the initial frequency and the segmented inference time model, an initial inference result is determined; the initial inference result includes the initial inference time. If the initial inference time meets the preset conditions, the remaining layers in the multi-layer structure are segmented to obtain an initial allocation strategy; the initial allocation strategy includes an initial segmentation strategy and an initial frequency allocation strategy. The initial allocation strategy is optimized based on the inference energy consumption model and the frequency adjustment set to obtain the target allocation strategy.

8. A resource allocation device for edge computing tasks, characterized in that, Applied to edge computing devices, the device includes: The acquisition module is used to divide the large model performing the edge computing task into a multi-layer structure; and to acquire the frequency adjustment set of the edge computing device; The construction module is used to construct a hierarchical inference time model based on the multi-layer structure of the large model and the frequency adjustment set; and to construct an inference energy consumption model of the large model based on the resource information of the edge computing device and the frequency adjustment set. The determination module is used to solve the hierarchical inference time model and the inference energy consumption model based on the multi-layer structure of the large model and the frequency adjustment set, and to determine the target allocation strategy.

9. An edge computing device, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, 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 to 7.