Resource allocation method and device for edge computing environment, equipment and medium
By establishing a dynamic heterogeneous graph in the edge computing environment and using agent networks and multilayer perceptrons to predict resource allocation strategies, the uncertainty of resource requirements and high-dimensional adaptation problems of machine learning tasks are solved, achieving efficient and flexible resource allocation, which is suitable for complex task scheduling in low-latency scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN UNIV
- Filing Date
- 2026-02-14
- Publication Date
- 2026-07-07
AI Technical Summary
Existing technologies struggle to accurately estimate the resilience and uncertain resource requirements of machine learning tasks, and cannot adapt to high-dimensional problem inputs and complex decision variables. This results in unreasonable resource allocation in edge computing environments, failing to meet the requirements for low latency and privacy protection.
By establishing a dynamic heterogeneous graph and extracting the dependencies between nodes, the agent's Actor network and multilayer perceptron network are used to predict resource allocation strategies. Combined with Bayesian conflict resolution strategies and invalid action masking mechanisms, flexible resource allocation is achieved.
It enables efficient scheduling of complex machine learning tasks in edge computing environments, reduces task completion time, improves resource utilization, and provides flexibility and accuracy for low-latency scenarios.
Smart Images

Figure CN122348931A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of edge computing and artificial intelligence technology, and in particular to a resource allocation method, apparatus, device and medium for edge computing environments. Background Technology
[0002] With the rapid development of the Internet of Things (IoT), artificial intelligence, and 5G technologies, billions of smart devices, such as smartphones, wearables, autonomous vehicles, and industrial sensors, are connected to the internet via 5G networks and are beginning to handle computationally intensive and data-intensive applications, such as facial recognition, virtual reality (VR), and smart navigation. However, IoT devices have limited resources (computing, storage, etc.) and battery capacity, making them unsuitable for supporting machine learning tasks that require significant computing power and low response times to provide a high-quality experience to end users. While cloud computing is considered a reliable computing and storage solution, the long propagation latency between terminal devices and the remote cloud makes it difficult to meet the requirements for low latency and privacy protection.
[0003] To address these challenges, edge computing moves computing power and storage resources to the network edge, bringing data processing closer to the data source, significantly reducing propagation latency, improving service quality, and protecting data privacy. As a primary workload in edge computing environments, machine learning (ML) applications need to process online data streams generated at the edge, such as in scenarios like traffic prediction and smart factory process monitoring.
[0004] Currently, there are two main solutions in the relevant technologies: (1) Edge cloud schedulers such as Kubernetes (a container orchestration and cluster management platform, K8s) and KubeEdge (a Kubernetes-based edge computing platform) use preset rules to allocate resources; (2) Cloud edge scheduling schemes based on deep learning.
[0005] However, since solution (1) in the relevant technologies relies on fixed logic to perform resource allocation, it is difficult to accurately estimate the elasticity and uncertain resource requirements of machine learning tasks; solution (2) lacks the ability to adapt to high-dimensional problem inputs and complex decision variables in model design, and cannot support the problem of accurate scheduling in complex scenarios, which urgently needs to be solved. Summary of the Invention
[0006] This application provides a resource allocation method, apparatus, device, and medium for edge computing environments to address the problems in related technologies, such as the difficulty in accurately estimating the elastic and uncertain resource requirements of machine learning tasks and the inability to adapt to high-dimensional problem inputs and complex decision variables. It flexibly adapts to low-latency scenarios and provides a general solution for the efficient scheduling of complex machine learning tasks in edge computing.
[0007] To achieve the above objectives, the first aspect of this application proposes a resource allocation method for edge computing environments, comprising the following steps: Obtain current edge computing environment information, establish a dynamic heterogeneous graph based on the current edge computing environment information, extract the dependencies between nodes from the dynamic heterogeneous graph through the heterogeneous graph Transformer, and obtain a structured environment embedding representation based on the dependencies between nodes; Based on the structured environment embedding representation, the most suitable target task for the current cluster is determined through the enhanced cross-attention module of the Actor network of the agent; Based on the mapping relationship between the target task and the current cluster, the multilayer perceptron network of the Actor network predicts the reward values corresponding to different resource allocation strategies, and the resource allocation strategy with the highest reward value is taken as the final resource allocation strategy, so as to perform resource allocation according to the final resource allocation strategy. According to an embodiment of this application, after performing resource allocation according to the final resource allocation strategy, the method further includes: Get the current resource allocation progress; If the current resource allocation progress is complete, then update the current edge computing environment information.
[0008] According to one embodiment of this application, determining the most suitable target task for the current cluster based on the structured environment embedding representation through the enhanced cross-attention module of the Actor network of the agent includes: Based on the structured environment embedding representation, an initial mapping table is generated through the Actor network of the agent; Identify whether the number of tasks corresponding to the current cluster in the initial mapping table is multiple; If the number is multiple, then based on the preset Bayesian conflict resolution strategy, the task most suitable for the current cluster state is determined from the multiple tasks in the initial mapping table as the target task; otherwise, the unique task corresponding to the current cluster in the initial mapping table is taken as the target task.
[0009] According to one embodiment of this application, the preset Bayesian conflict resolution strategy is as follows: ; in, For clusters m The posterior probability, For clusters m Select task n The conditional probability, To select a cluster m The prior probability, This is the normalization factor for the total probability.
[0010] According to one embodiment of this application, when predicting the reward values corresponding to different resource allocation strategies through the multilayer perceptron network of the Actor network, the method further includes: Based on a preset invalid action masking mechanism, allocation strategies that do not meet preset constraints are deleted from the different resource allocation strategies.
[0011] According to one embodiment of this application, the preset invalid action masking mechanism is as follows: ; in, The score for the resource allocation decision after masking is given. For cluster m resources k Available capacity For the task n Resources k The minimum requirement, For resource allocation decisions The original score.
[0012] The resource allocation method for edge computing environments proposed in this application establishes a dynamic heterogeneous graph based on current edge computing environment information and extracts dependencies between nodes to obtain a structured environment embedding representation. It then determines the target task of the current cluster through an Actor network of intelligent agents, predicts the reward value corresponding to the resource allocation strategy through a multilayer perceptron network of the Actor network, and allocates resources according to the strategy with the highest reward value. This solves the problems in related technologies of accurately estimating the elastic and uncertain resource requirements of machine learning tasks and the inability to adapt to high-dimensional problem inputs and complex decision variables. It flexibly adapts to low-latency scenarios and provides a general solution for the efficient scheduling of complex machine learning tasks in edge computing.
[0013] To achieve the above objectives, a second aspect of this application provides a resource allocation device for edge computing environments, comprising: The acquisition module acquires the current edge computing environment information, establishes a dynamic heterogeneous graph based on the current edge computing environment information, extracts the dependencies between nodes from the dynamic heterogeneous graph through the heterogeneous graph Transformer, and obtains a structured environment embedding representation based on the dependencies between nodes. The determination module, based on the structured environment embedding representation, determines the most suitable target task for the current cluster through the enhanced cross-attention module of the Actor network of the agent; The allocation module, based on the mapping relationship between the target task and the current cluster, predicts the reward value corresponding to different resource allocation strategies through the multilayer perceptron network of the Actor network, and takes the resource allocation strategy with the highest reward value as the final resource allocation strategy, so as to allocate resources according to the final resource allocation strategy.
[0014] According to one embodiment of this application, after resource allocation is performed according to the final resource allocation strategy, the allocation module is further configured to: Get the current resource allocation progress; If the current resource allocation progress is complete, then update the current edge computing environment information.
[0015] According to one embodiment of this application, the determining module is specifically used for: Based on the structured environment embedding representation, an initial mapping table is generated through the Actor network of the agent; Identify whether the number of tasks corresponding to the current cluster in the initial mapping table is multiple; If the number is multiple, then based on the preset Bayesian conflict resolution strategy, the task most suitable for the current cluster state is determined from the multiple tasks in the initial mapping table as the target task; otherwise, the unique task corresponding to the current cluster in the initial mapping table is taken as the target task.
[0016] According to one embodiment of this application, the preset Bayesian conflict resolution strategy is as follows: ; in, For cluster m The posterior probability, For cluster m Select task n The conditional probability, To select a cluster m The prior probability, This is the normalization factor for the total probability.
[0017] According to one embodiment of this application, when predicting the reward values corresponding to different resource allocation strategies through the multilayer perceptron network of the Actor network, the allocation module is further configured to: Based on a preset invalid action masking mechanism, allocation strategies that do not meet preset constraints are deleted from the different resource allocation strategies.
[0018] According to one embodiment of this application, the preset invalid action masking mechanism is as follows: ; in, The score for the resource allocation decision after masking is given. For cluster m resources k Available capacity For the task n Resources k The minimum requirement, For resource allocation decisions The original score.
[0019] The resource allocation device for edge computing environments proposed in this application establishes a dynamic heterogeneous graph based on current edge computing environment information and extracts dependencies between nodes to obtain a structured environment embedding representation. It then determines the target task of the current cluster through an Actor network of intelligent agents, predicts the reward value corresponding to the resource allocation strategy through a multilayer perceptron network of the Actor network, and allocates resources according to the resource allocation strategy with the highest reward value. This solves the problems in related technologies of accurately estimating the elastic and uncertain resource requirements of machine learning tasks and the inability to adapt to high-dimensional problem inputs and complex decision variables. It flexibly adapts to low-latency scenarios and provides a general solution for the efficient scheduling of complex machine learning tasks in edge computing.
[0020] To achieve the above objectives, a third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the resource allocation method for edge computing environments as described in the above embodiments.
[0021] To achieve the above objectives, a fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the resource allocation method for edge computing environments as described in the above embodiments.
[0022] To achieve the above objectives, a fifth aspect of this application provides a computer program product, which, when executed by a processor, implements the resource allocation method for edge computing environments as described in the above embodiments.
[0023] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0024] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart illustrating a resource allocation method for an edge computing environment according to an embodiment of this application; Figure 2 This is a schematic diagram of a heterogeneous graph representation and HGT-based feature extraction process according to an embodiment of this application; Figure 3 This is a schematic diagram of a feature extraction module based on heterogeneous graph Transformer according to an embodiment of this application; Figure 4 This is a schematic diagram of an enhanced cross-attention mechanism model provided according to an embodiment of this application; Figure 5 This is a flowchart of a task unloading and resource allocation method for HGT-MARL provided according to an embodiment of this application; Figure 6 This is a schematic diagram comparing single-task scheduling and multi-task scheduling according to an embodiment of this application; Figure 7 This is a schematic diagram of a multi-task scheduling algorithm provided according to an embodiment of this application; Figure 8 This is a schematic diagram of an HGT-MARL model architecture provided according to an embodiment of this application; Figure 9 This is a block diagram of a resource allocation device for an edge computing environment according to an embodiment of this application; Figure 10 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. Detailed Implementation
[0025] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0026] The following describes, with reference to the accompanying drawings, a resource allocation method, apparatus, device, and medium for edge computing environments proposed according to embodiments of this application. First, the resource allocation method for edge computing environments proposed according to embodiments of this application will be described with reference to the accompanying drawings.
[0027] Figure 1 This is a flowchart of a resource allocation method for an edge computing environment according to an embodiment of this application.
[0028] like Figure 1 As shown, this resource allocation method for edge computing environments includes the following steps: In step S101, the current edge computing environment information is obtained, and a dynamic heterogeneous graph is established based on the current edge computing environment information. The dependencies between nodes are extracted from the dynamic heterogeneous graph through the heterogeneous graph Transformer, and a structured environment embedding representation is obtained based on the dependencies between nodes.
[0029] In this context, "current edge computing environment information" refers to the collection of real-time status data and heterogeneous attribute information related to "computing, network, storage, and tasks" in the edge computing system at a specific point in time. "Dynamic heterogeneous graph" refers to a graph structure data model constructed based on the current edge computing environment information in an edge computing scenario, possessing both heterogeneity and dynamism. "Heterogeneous Graph Transformer (HGT)" refers to a variant Transformer model optimized for the structural characteristics and data distribution of heterogeneous graphs. "Dependencies between nodes" refers to the mutual constraints, support, or influences formed between different types of nodes based on multi-dimensional information such as resource status, task requirements, and network connectivity in the edge computing environment.
[0030] Specifically, such as Figure 2 As shown, Figure 2 This is a schematic diagram of a heterogeneous graph representation and HGT-based feature extraction process according to an embodiment of this application. In HGT-MARL (Heterogeneous Graph Transformer-enhanced Multi-Agent Reinforcement Learning), the edge computing environment is modeled as a dynamic heterogeneous graph structure: ; in, t The time step reflects the dynamic characteristics of the graph structure as it changes over time. Let be the set of nodes at time step t. Includes four types of elements: server nodes s (Agent), Candidate Tasks (Pending task) Task in execution (Runningtask) and central connection node b (Central) is used to accelerate the dissemination of information; This represents the corresponding edge set.
[0031] Furthermore, to simplify the decision space of the agent, embodiments of this application maintain a fixed-size set of candidate tasks for each agent, and at the beginning of each time step, the earliest arriving task is selected from its queue to fill the gap. This hierarchical design structures the decision space, separating the candidate task set and the execution task set, significantly reducing the search complexity of task selection. (Edge set) It encodes the interaction relationships between different types of nodes, such as the executability relationship between the edge cluster and the candidate task, and the resource supply relationship between the edge cluster and the task in execution.
[0032] To accurately describe the attribute characteristics of different types of nodes, HGT-MARL designed specific feature vectors for each type of node. These feature vectors together constitute the original state characteristics of agent m: ; in, Let be the original state feature vector of agent m at time t. The feature vector of the edge server node is defined as follows: ; in, It includes information on the availability of various resources and the length of the running task queue. m For the index of edge clusters, For cluster m, the first k Resource availability K The total number of resource types, For cluster m Queuing task queue The length.
[0033] Furthermore, The feature vector of the candidate task node is defined as follows: ; in, The minimum requirements for various resources and the task types are encoded. n For task indexing, For the task n For the k The minimum requirement for this type of resource. For the task n Type identifier.
[0034] Furthermore, The feature vector of the task node in execution is defined as follows: ; in, It records the allocated resource amount, task type, and execution time. The amount of resource of type k allocated to task n. Let be the length of time task n has been executed. These feature vectors together constitute the agent's original state representation, serving as input to the HGT-based feature extraction module.
[0035] Specifically, HGT networks process heterogeneous graph structures through type-aware graph convolution operations, designing dedicated parameter matrices for different types of nodes and edges to achieve targeted feature extraction. In this embodiment, through multi-layer HGT network processing, the model can capture multi-hop dependencies between nodes and extract deep-level structural features. For example, such as... Figure 3 As shown, Figure 3 This is a schematic diagram of a feature extraction module based on heterogeneous graph Transformer (HGT) according to an embodiment of this application. As shown in the diagram, the HGT network in this embodiment adopts a 7-layer architecture, with 4 attention heads per layer and a hidden layer dimension of 256. Compared to traditional homogeneous graph neural networks, HGT can preserve rich semantic information in heterogeneous graphs, avoiding the problem of information dilution. This characteristic makes HGT particularly suitable for handling complex heterogeneous system relationships in edge computing environments, providing a comprehensive and accurate environmental representation for subsequent task offloading and resource allocation decisions.
[0036] Therefore, the HGT-MARL model first models the edge computing environment as a dynamic heterogeneous graph, and then uses a heterogeneous graph Transformer to process this heterogeneous graph and extract the dependencies between nodes, providing rich structured state representations for the Actor network and Critic network of each agent. The environment modeling method based on heterogeneous graph Transformer in this application differs from traditional vector concatenation or homogeneous graph representation methods. HGT designs dedicated parameter matrices for different types of nodes (such as edge servers, candidate tasks, and tasks in execution) and edges (such as server-processing-task, task-request-server), accurately capturing the complex heterogeneous relationships in the edge environment. This representation method can distinguish the interaction patterns between different types of entities, providing comprehensive and accurate environmental information for subsequent decision-making.
[0037] In step S102, based on the structured environment embedding representation, the target task most suitable for the current cluster is determined by the enhanced cross-attention module of the Actor network of the agent.
[0038] Optionally, in some embodiments, based on the structured environment embedding representation, the target task most suitable for the current cluster is determined by the enhanced cross-attention module of the agent's Actor network, including: generating an initial mapping table based on the structured environment embedding representation; identifying whether there are multiple tasks corresponding to the current cluster in the initial mapping table; if there are multiple tasks, then determining the task most suitable for the current cluster state from the multiple tasks in the initial mapping table as the target task based on a preset Bayesian conflict resolution strategy; otherwise, taking the unique task corresponding to the current cluster in the initial mapping table as the target task.
[0039] Optionally, in some embodiments, the preset Bayesian conflict resolution strategy is: ; in, For cluster m The posterior probability, For cluster m Select task n The conditional probability, To select a cluster m The prior probability, This is the normalization factor for the total probability.
[0040] The initial mapping table refers to the initial association table automatically generated by the Actor network of the intelligent agent based on the global environmental semantic information of the structured environment embedding representation, which is used to associate edge clusters with tasks to be processed.
[0041] Specifically, this application embodiment designs a task offloading strategy based on an enhanced cross-attention mechanism, which can adaptively perceive the degree of matching between task characteristics and system state, and consider the mutual influence between tasks, thereby achieving intelligent task offloading.
[0042] Furthermore, the enhanced cross-attention mechanism is a core component of the HGT-MARL task offloading strategy, consisting of three main modules: a multi-head cross-attention layer, a feature enhancement and interaction fusion layer, and a task matching evaluation layer. This mechanism first receives the task embedding representation output from the HGT feature extraction network, then processes these features through a series of network layers, ultimately generating a probability distribution for task selection.
[0043] The multi-head cross-attention layer is a fundamental component of the enhanced cross-attention mechanism. It allows interaction between task features, enabling each task to focus on the characteristics of other tasks and thus perceive resource competition between them. In this layer, the task embedding serves simultaneously as both a query vector and a key-value pair vector, and information exchange between tasks is achieved by calculating attention weights. For each attention head... hThe calculation process is as follows: ; ; ; in, h Let X be the attention head index, and X be the input task embedding matrix. For the first h The query vector matrix of attention heads, For the first h The key vector matrix of each attention head. For the first h The value vector matrix of each attention head, , and For a learnable parameter matrix, Here is the attention weight matrix. Scaling factor For the first h The output matrix of each attention head.
[0044] Furthermore, the output of multi-head attention is obtained through a concatenation operation, calculated using the following formula: ; in, Z The output matrix of multi-head attention. This is for outputting the projection matrix.
[0045] Through this multi-head design, the system can simultaneously focus on multiple feature dimensions from different angles, thereby improving its expressive power.
[0046] To further enhance feature representation capabilities, the feature enhancement and interaction fusion layer employs a structure combining a feedforward neural network (FFN) with residual connections. The FFN enhances feature representation capabilities through nonlinear transformations as follows: ; in, , , , These are learnable parameters.
[0047] Furthermore, to avoid the loss of original information during feature transformation, a residual connection mechanism is introduced here, combined with layer normalization operations, to form the following feature enhancement module: ; in, LayerNorm This is a layer normalization operation used to stabilize the training process and accelerate convergence.
[0048] Specifically, unlike the standard Transformer, the embodiments of this application employ a wider intermediate layer in the FFN design, expanding it to four times the input dimension instead of the standard two times, in order to enhance the model's ability to express different resource configuration combinations. This design enables the embodiments of this application to more accurately capture the sensitivity differences of machine learning tasks to different resource combinations.
[0049] Furthermore, the task matching evaluation layer, the final layer of the enhanced cross-attention mechanism, is responsible for generating the probability distribution of task selection. This layer first averages the processed features along the task dimension to obtain a global context representation, which serves as the query vector to evaluate the degree of matching between each task and the current system state. The specific calculation is as follows: ; ; ; in, Represented as a global context; N The total number of tasks to be evaluated; This is the task feature vector of the i-th task after processing by the preceding module; energy The matching energy value between each task and the current system state; logits is the original score vector for task selection; , and The learnable parameter matrix; It provides nonlinear transformation capabilities, enhancing the complexity of feature interactions.
[0050] Finally, the embodiments of this application are adopted. softmax The function (Softmax Function, normalized exponential function) will logits Convert it into a probability distribution to serve as the basis for task selection: ; in, For the first n One task; For the first n The probability that a task is assigned to the current cluster is the task selection probability output by the enhanced cross-attention mechanism. For the first n The original score for each task.
[0051] In summary, this matching-based selection method enables the system to choose the task most suitable for the current environmental state, rather than simply following predefined priority rules. For example, such as Figure 4 As shown, Figure 4This is a schematic diagram of an enhanced cross-attention mechanism model provided according to an embodiment of this application.
[0052] Furthermore, in a distributed environment, multiple edge cluster agents may simultaneously select the same task, leading to resource allocation conflicts. To address this issue, embodiments of this application design a conflict resolution mechanism based on Bayesian theory. This mechanism interprets the task offloading probability as a conditional probability and, combined with the resource status of the edge cluster, applies Bayesian inference to calculate the optimal allocation strategy. For each task... n The system calculates and offloads it to the cluster. m The posterior probability. Calculated based on resource matching degree. :
[0053] in, For edge clusters m Chinese resource types k Available quantity, For the task n For resource types k The required quantity. This application's embodiments allocate tasks to the cluster with the highest posterior probability, achieving efficient conflict coordination. This Bayesian-based conflict resolution method has two key advantages: firstly, it considers task selection probability and resource matching degree, ensuring that tasks are allocated to the most suitable cluster; secondly, it maintains the flexibility of probabilistic decision-making, avoiding deadlock problems that may be caused by deterministic strategies, while retaining a certain probability of allocating tasks to another cluster, maintaining the system's exploratory capability.
[0054] Therefore, during the task unloading phase, the enhanced cross-attention module of the Actor network first receives the environment embedding representation from the HGT, and then selects the task most suitable for the current cluster state for unloading. If task competition occurs between clusters, a Bayesian-based conflict resolution module coordinates to ensure that each task is ultimately unloaded to only one cluster. Addressing the challenges of task dynamism, this application proposes a task unloading strategy based on an enhanced cross-attention mechanism. This mechanism extracts task features hierarchically through multi-head attention and feature interaction, allowing each task to focus on the characteristics of other tasks, thereby perceiving the competitive relationship between tasks. When a new task arrives or the system state changes, the enhanced cross-attention can dynamically adjust the attention given to different tasks, achieving intelligent task unloading and priority ranking, effectively responding to continuous environmental changes.
[0055] In step S103, based on the mapping relationship between the target task and the current cluster, the multilayer perceptron network of the Actor network predicts the reward value corresponding to different resource allocation strategies, and the resource allocation strategy with the highest reward value is taken as the final resource allocation strategy, so as to allocate resources according to the final resource allocation strategy.
[0056] In this context, the return value refers to the core evaluation metric used in reinforcement learning to quantify the overall benefit generated by a specific strategy when executed in the current environment.
[0057] Specifically, in edge computing environments, resource allocation strategies have a decisive impact on system performance. Different types of machine learning tasks have varying resource requirements and sensitivities; simply increasing the amount of a particular type of resource while ignoring the synergistic effects between resources may lead to suboptimal system performance. The Multilayer Perceptron (MLP) is the core component of the HGT-MARL resource allocation strategy, responsible for mapping task features and system states to scores for different resource configurations. This network consists of three layers: two hidden layers and one output layer. The first hidden layer maps the input features to a high-dimensional space, introducing non-linearity using the ReLU (Rectified Linear Unit) activation function; the second hidden layer further extracts the complex relationships between features, also using ReLU activation; the output layer generates a score for each configuration in the discrete resource space, with the dimensionality consistent with the size of the resource configuration space. Based on these scores, the model can generate personalized resource allocation schemes for different types of tasks. Compared with traditional rule-based or heuristic methods, MLP-based resource allocation strategies have two significant advantages: First, they can automatically discover complex resource sensitivity patterns by learning the nonlinear mapping relationship between task characteristics and optimal resource allocation; second, they can adapt to different task types and system states, generating customized resource allocation schemes for each task, thereby improving resource utilization efficiency.
[0058] Therefore, by using a dynamic heterogeneous graph Transformer, the complex dependencies between edge servers, tasks, and resources are accurately captured, supporting differentiated feature extraction for multiple types of nodes (CPU (Central Processing Unit) / GPU (Graphics Processing Unit) / tasks), thus solving the problem of insufficient modeling capabilities for heterogeneous resources in traditional methods. An enhanced cross-attention mechanism, combining multi-head attention and residual networks, enables task decisions to perceive global resource competition and adaptively adjust priorities. Compared to static rules or single LSTM (Long Short-Term Memory) models, the response speed for dynamic tasks is significantly improved. In synthetic and real-world load tests, the average task completion time is reduced by 9.8%-63.8% compared to the baseline algorithm, and resource utilization is improved by more than 40%, especially in high-concurrency, short-cycle machine learning task scenarios. It can be flexibly adapted to low-latency scenarios such as real-time inference for autonomous driving and data analysis for industrial IoT, providing a general solution for efficient scheduling of complex machine learning tasks in edge computing.
[0059] Furthermore, to avoid resource conflicts or invalid scheduling, this application embodiment also sets up an invalid action masking mechanism.
[0060] Optionally, in some embodiments, when predicting the reward value corresponding to different resource allocation strategies through the multilayer perceptron network of the Actor network, the method further includes: deleting allocation strategies that do not meet preset constraints based on a preset invalid action masking mechanism.
[0061] Optionally, in some embodiments, the preset invalid action masking mechanism is as follows: ; in, The score for the resource allocation decision after masking is given. For cluster m resources k Available capacity For the task n Resources k The minimum requirement, For resource allocation decisions The original score.
[0062] Among them, the preset constraints can be user-defined constraints, constraints obtained through a finite number of experiments, or constraints obtained through a finite number of computer simulations.
[0063] Specifically, to achieve fine-grained resource optimization, embodiments of this application design a resource allocation strategy and an invalid action masking mechanism based on a multilayer perceptron. This strategy can predict the optimal resource allocation based on task characteristics and system state, while ensuring that all allocation decisions satisfy system constraints. For example... Figure 5 As shown, Figure 5 This is a flowchart of a task unloading and resource allocation method for HGT-MARL provided according to an embodiment of this application.
[0064] Furthermore, in the actual allocation process, this embodiment of the application needs to ensure that all resource allocation decisions meet two basic constraints: first, the resources allocated to the task cannot be lower than its minimum requirement; and second, they cannot exceed the available resource capacity of the system. Traditional reinforcement learning methods typically prevent agents from performing invalid actions by adding a penalty term to the reward function, but this approach often leads to unstable training and difficulty in convergence. To solve this problem, this embodiment of the application sets up an invalid action masking mechanism, which identifies and masks resource configurations that do not meet the constraints, ensuring that the system only considers legitimate allocation decisions. The core idea of the invalid action masking mechanism is to set the score of resource configurations that do not meet the constraints to negative infinity, so that they are allocated with zero probability in subsequent softmax operations.
[0065] By employing a pre-defined invalid action masking mechanism, this embodiment of the application can ensure that all resource allocation decisions meet pre-defined constraints while maintaining training stability. In a multi-agent environment, to further improve training efficiency, this embodiment of the application uses a special masking strategy when handling resource allocation after conflict resolution. For agents that fail to obtain a task in conflict resolution, this embodiment of the application masks their resource allocation decisions, obtaining gradient updates only from the task selection part, without assuming gradient responsibility for the resource allocation decisions. This design is achieved by adjusting the chain rule of conditional probabilities: ; in, For the first m Each intelligent agent observes information Based on this, take action The probability of; For the first m The policy network of an agent includes parameters such as weights and biases. For the first m An agent selects a task. n The predicted probability; For the task n Assigned to cluster m The probability of resource allocation decisions; i As an indicator, used for predicting the final resource allocation of conflicting agents in masked scheduling task failures. At the same time, the task selection prediction probability in the loss function is retained. When intelligent agents m In the mission n The value is 1 if the conflict is resolved successfully, and 0 otherwise.
[0066] Therefore, this design allows agents that fail to acquire tasks to still learn from their task selection experience, while avoiding ineffective resource allocation gradients, significantly improving training efficiency and stability. HGT-MARL's fine-grained resource allocation and constraint handling strategy learns the complex relationship between task characteristics and optimal resource allocation through a multilayer perceptron network, and ensures that all allocation decisions satisfy system constraints through an invalid action masking mechanism. This design can generate personalized resource allocation schemes for different types of machine learning tasks, improving resource utilization while reducing task completion time, thereby achieving efficient resource utilization in edge computing environments.
[0067] Furthermore, in order to avoid resource conflicts or waste caused by lagging environmental information, the embodiments of this application dynamically update the edge computing environment information according to the resource allocation progress.
[0068] Optionally, in some embodiments, after allocating resources according to the final resource allocation strategy, the method further includes: obtaining the current resource allocation progress; if the current resource allocation progress is complete, then updating the current edge computing environment information.
[0069] Specifically, this application embodiment obtains the execution progress of the current resource allocation in real time, and triggers the synchronous update of edge computing environment information only when the current resource allocation progress is not completed, so as to ensure that the environment data is consistent with the actual state of resource allocation, and provide accurate and real-time input support for the next round of task selection and resource allocation decisions.
[0070] This effectively ensures the accuracy of subsequent task selection and resource allocation decisions.
[0071] Furthermore, the embodiments of this application also include a multi-agent reinforcement learning framework and a single-task and multi-task scheduling mechanism.
[0072] On the one hand, in edge computing environments, multiple edge clusters need to work collaboratively to optimize overall system performance while maintaining the flexibility and robustness of distributed decision-making. To achieve this goal, embodiments of this application design a multi-agent reinforcement learning framework based on the Actor-Critic architecture and the PPO (Proximal Policy Optimization) algorithm. Through a strategy combining parameter sharing and distributed decision-making, efficient collaborative optimization is achieved.
[0073] The HGT-MARL multi-agent reinforcement learning framework is based on an Actor-Critic architecture, where each edge cluster agent contains an Actor network and a Critic network. The Actor network is responsible for generating action policies for task offloading and resource allocation, while the Critic network evaluates the value of the environment state, providing quantitative guidance for policy optimization. In terms of network design, the Actor network consists of three parts: HGT feature extraction, enhanced cross-attention, and a resource allocation MLP (Multi-Layer Perceptron), while the Critic network shares the HGT feature extraction part and evaluates the value of the system state through the multi-layer perceptron.
[0074] The Critic network, acting as a value assessment component, works in conjunction with the Actor network to form a complete Actor-Critic architecture. The core function of the Critic network is to evaluate the value of environmental states, providing quantitative guidance for policy optimization. This network effectively reduces the variance of policy gradient estimation and significantly improves training stability by accurately estimating the state value function V(s) or the state-action value function Q(s, a). In the complex environment of edge computing task scheduling, accurate value assessment is crucial for agents to make optimal resource allocation decisions.
[0075] The Critic network in HGT-MARL leverages the advantages of heterogeneous graph representations in its structural design, transforming the complex states of edge computing environments into feature representations rich in semantic information. This network first shares the heterogeneous graph Transformer preprocessing module from the Actor network, extracting structured features of server nodes, task nodes, and resource relationships through type-aware graph convolution operations. This feature extraction method effectively captures the complex interactions between different entities in the edge environment, providing comprehensive environmental information for value estimation. After feature extraction, the Critic evaluation module of each agent receives the corresponding node embedding representation and maps the high-dimensional features to a scalar value estimate using a multilayer perceptron. This multilayer perceptron typically contains two fully connected layers: the first layer maintains the same dimension as the input and uses the ReLU activation function to enhance non-linear expressiveness; the second layer compresses the features into a single scalar output, representing the estimated value of the current state.
[0076] To improve training efficiency and model generalization ability, HGT-MARL employs a parameter-sharing mechanism in its Critic network design. Although each edge cluster agent has its own Critic evaluation instance, they share the exact same network parameters. This design significantly reduces the total number of model parameters, enabling the system to utilize limited training samples more effectively and accelerating the convergence process. Simultaneously, despite parameter sharing, the value estimates generated by each agent are still personalized evaluations for their specific states because each agent receives different observation inputs.
[0077] In multi-agent environments, HGT-MARL employs a combination of decentralized evaluation and centralized training. Each agent independently generates value estimates based on its own observations, but they collaboratively optimize by sharing a global reward signal. This design preserves the flexibility and robustness of decentralized decision-making while ensuring that all agents optimize towards a common goal. In its implementation, the Critic network processes batches of observation data during forward propagation, generating corresponding value estimates for each agent, and then merging these estimates into a single vector as the final output. This batch processing approach significantly improves computational efficiency, especially in large-scale multi-agent environments.
[0078] In the PPO algorithm-driven training process, the Critic network plays an irreplaceable role. It first calculates the generalized advantage function A(s, a) by estimating the state value, which measures the advantage of a particular action relative to average performance. This advantage estimate is then used to guide the policy update of the Actor network, forming the PPO truncation objective function by multiplying it by the rate of policy improvement. Simultaneously, the Critic network itself continuously optimizes its value estimation ability by minimizing the mean squared error loss function, which calculates the difference between the estimated value and the discounted cumulative reward. In the HGT-MARL system, to ensure training stability, the Critic update employs a value function pruning technique, limiting the magnitude of value changes in each update. In this way, the Critic network continuously improves its accuracy in evaluating the environment state, providing more reliable decision guidance for the Actor network. The PPO algorithm balances sample efficiency and training stability by limiting the policy update magnitude, making it particularly suitable for handling complex decision-making problems in edge computing environments. During training, the system employs a parameter-sharing strategy, where all agents share the same network parameters but make independent decisions based on their own observations. This design significantly reduces the number of model parameters and improves sample utilization efficiency and training stability. Simultaneously, the system designs a dedicated reward function, transforming the goal of minimizing the global task completion time into minimizing the number of active tasks within the system at each time step. The reward function is: ; in, Let be the number of active tasks in the system at time t.
[0079] Furthermore, this reward design provides agents with clear optimization directions, prompting them to work together to reduce task backlog in the system.
[0080] Thus, the HGT-MARL multi-agent reinforcement learning framework achieves efficient collaboration among agents in an edge cluster through an Actor-Critic architecture, the PPO algorithm, and a parameter sharing mechanism. This design maintains the flexibility and robustness of distributed decision-making while promoting collaborative optimization among agents by sharing reward signals and network parameters, providing powerful learning capabilities and adaptability for task scheduling in edge computing environments.
[0081] Therefore, this application employs a multi-agent reinforcement learning framework, modeling each edge cluster as an agent and designing a conflict resolution mechanism based on Bayesian theory. The MARL framework allows each agent to make independent decisions based on local observations, maintaining the autonomy and flexibility of the distributed system. Simultaneously, it promotes global cooperation by sharing reward signals, avoiding local optima. When multiple agents compete for the same task, the Bayesian conflict resolution mechanism can calculate the execution probability of each agent based on resource status and task characteristics, ensuring that the task is assigned to the agent with the highest resource matching degree, effectively solving the decision conflict problem in a distributed environment.
[0082] On the other hand, to improve resource utilization and system throughput in edge computing environments, this application's embodiments design an extension mechanism from single-task scheduling to multi-task scheduling. Single-task scheduling means that at most one task can be scheduled per physical time point, while multi-task scheduling allows multiple tasks to be scheduled continuously within a single physical time point. In single-task scheduling mode, at most one task can be scheduled per physical time point, and the short intervals between time steps can overlap with scheduling overhead. Each cluster schedules at most one task at the beginning of each physical time interval. The advantage of this mode is its simplicity of implementation, clear scheduling logic, and suitability for light-load and resource-constrained scenarios. However, single-task scheduling has significant limitations: when multiple clusters conflict in selecting the same task at a certain time step, only one cluster can successfully schedule the task, while other clusters need to wait for the next physical time point to attempt new scheduling, potentially leading to idle resources and reduced overall system efficiency.
[0083] like Figure 6 As shown, Figure 6 This is a schematic diagram comparing single-task scheduling and multi-task scheduling according to an embodiment of this application, wherein... Figure 6 (a) is a schematic diagram of single-task scheduling provided in an embodiment of this application. Figure 6(b) is a schematic diagram of single-task scheduling provided in an embodiment of this application. Figure 6 As can be seen, the dashed line represents the physical time interval boundary, and the red dots represent agents that failed in the competition. In the single-task scheduling mode, when a competition conflict occurs, the failed agent needs to wait for the next physical time point before it can be rescheduled, resulting in resources being idle during this period. In contrast, the multi-task scheduling mode allows the failed agent to immediately switch to the next candidate task without waiting for the next physical time point, significantly improving resource utilization efficiency and task throughput.
[0084] like Figure 7 As shown, Figure 7 This is a schematic diagram of a multi-task scheduling algorithm provided according to an embodiment of this application. The core algorithm flow of multi-task scheduling includes: First, initializing the system state and setting the continue (system running state flag variable) flag to true (the standard value of Boolean logic); then, repeatedly executing the following steps until continue is false (the standard value of Boolean logic): (1) all agents make decisions based on the current state; (2) resolving decision conflicts and applying actions; (3) updating the system state; (4) checking whether all agents are unable to make effective decisions, and if so, setting continue to false; finally, starting to execute the scheduled tasks. Through this cyclic mechanism, the embodiment of this application can continuously schedule multiple non-conflicting tasks within a single physical time interval until all agents are unable or do not need further scheduling.
[0085] Multi-task scheduling offers two significant advantages over single-task scheduling: First, it provides more opportunities to resolve conflicts. In single-task scheduling, once a conflict occurs, the agent must wait until the next physical time point to attempt a new scheduling; however, in multi-task scheduling, the agent can immediately attempt the next candidate task without waiting for physical time to advance. This greatly reduces resource idle time caused by conflicts and improves system responsiveness. Second, multi-task scheduling achieves better resource allocation through task packaging. Even in the absence of conflicts, multi-task scheduling allows the agent to allocate multiple tasks within a single physical time interval, making full use of available resources. This task packaging capability enables the system to process multiple small tasks at the same time point, or simultaneously schedule a combination of resource-sensitive and non-sensitive tasks, achieving a better resource utilization strategy. In terms of reward design, multi-task scheduling employs a different strategy than single-task scheduling. In single-task scheduling, a reward is generated at each time step, while in multi-task scheduling, system performance is evaluated and rewards are generated only at physical time progression points; rewards for intermediate logical time steps are zero. This design allows the system to focus on actual performance in the physical world, rather than the intermediate states of logical time steps.
[0086] Therefore, HGT-MARL's single-task and multi-task scheduling mechanisms provide flexible scheduling options for edge computing environments, enabling the selection of the most suitable scheduling mode based on different workload characteristics and resource conditions. In particular, the multi-task scheduling mechanism, by allowing multiple scheduling decisions to be made consecutively within a single physical point in time, effectively resolves task conflict issues, improves resource utilization and system throughput, and provides strong support for efficient task scheduling in edge computing environments.
[0087] To facilitate a better understanding of the resource allocation method for edge computing environments proposed in the embodiments of this application by those skilled in the art, the following is a detailed explanation. Figure 8 Further explanation is needed.
[0088] like Figure 8 As shown, Figure 8 This is a schematic diagram of the HGT-MARL model architecture provided according to an embodiment of this application. As shown in the diagram, in terms of system architecture, the HGT-MARL model follows a cyclical operation mode of environment awareness, task offloading, resource allocation, and environment update, and achieves efficient task scheduling through multiple collaborative modules. This application proposes a distributed scheduling algorithm, HGT-MARL, combining heterogeneous graph Transformer and multi-agent reinforcement learning. Specifically, it designs a heterogeneous graph Transformer state representation method, defining dedicated parameter matrices for different types of nodes and edges. Node features are extracted through type-aware graph convolution operations, achieving efficient representation of heterogeneous resource environments. Furthermore, this application proposes a task offloading strategy based on an enhanced cross-attention mechanism. By enhancing feature representation through cross-attention and a feedforward neural network with residual connections, each task can focus on the features of other tasks and perceive resource competition relationships, addressing the challenge of dynamic task changes in edge environments. The Bayesian conflict resolution mechanism designed in this application intelligently allocates tasks based on resource status and task characteristics, ensuring that the agent with the highest resource matching degree obtains the task execution right. In addition, this application uses a multilayer perceptron combined with an invalid action mask to directly learn the optimal resource combination from training, while dynamically blocking illegal actions, avoiding the training instability caused by traditional penalty methods. HGT-MARL constructs a complete closed loop from environment awareness to task offloading and resource allocation, which maintains the decision-making autonomy of each edge cluster and achieves collaborative optimization oriented towards global optimum, providing a systematic solution for machine learning task scheduling in edge computing environments.
[0089] The resource allocation method for edge computing environments proposed in this application establishes a dynamic heterogeneous graph based on current edge computing environment information and extracts dependencies between nodes to obtain a structured environment embedding representation. It then determines the target task of the current cluster through an Actor network of intelligent agents, predicts the reward value corresponding to the resource allocation strategy through a multilayer perceptron network of the Actor network, and allocates resources according to the strategy with the highest reward value. This solves the problems in related technologies of accurately estimating the elastic and uncertain resource requirements of machine learning tasks and the inability to adapt to high-dimensional problem inputs and complex decision variables. It flexibly adapts to low-latency scenarios and provides a general solution for the efficient scheduling of complex machine learning tasks in edge computing.
[0090] Next, with reference to the accompanying drawings, a resource allocation device for edge computing environments proposed according to embodiments of this application is described.
[0091] Figure 9 This is a block diagram of a resource allocation device for an edge computing environment according to an embodiment of this application.
[0092] like Figure 9 As shown, the resource allocation device 10 for edge computing environments includes: an acquisition module 100, a determination module 200, and an allocation module 300.
[0093] The acquisition module 100 acquires the current edge computing environment information, establishes a dynamic heterogeneous graph based on the current edge computing environment information, extracts the dependencies between nodes from the dynamic heterogeneous graph through the heterogeneous graph Transformer, and obtains a structured environment embedding representation based on the dependencies between nodes. The determination module 200, based on the structured environment embedding representation, determines the most suitable target task for the current cluster through the enhanced cross-attention module of the Actor network of the agent; The allocation module 300, based on the mapping relationship between the target task and the current cluster, predicts the reward value corresponding to different resource allocation strategies through the multilayer perceptron network of the Actor network, and takes the resource allocation strategy with the highest reward value as the final resource allocation strategy, so as to allocate resources according to the final resource allocation strategy.
[0094] According to one embodiment of this application, after resource allocation is performed according to the final resource allocation strategy, the allocation module 300 is further configured to: Get the current resource allocation progress; If the current resource allocation progress is complete, then update the current edge computing environment information.
[0095] According to one embodiment of this application, the determining module 200 is specifically used for: Based on the embedded representation of the structured environment, an initial mapping table is generated through the Actor network of the agent; Identify whether there are multiple tasks corresponding to the current cluster in the initial mapping table; If there are multiple tasks, the task most suitable for the current cluster state is determined from the multiple tasks in the initial mapping table based on the preset Bayesian conflict resolution strategy. Otherwise, the unique task corresponding to the current cluster in the initial mapping table is taken as the target task.
[0096] According to one embodiment of this application, the preset Bayesian conflict resolution strategy is as follows: ; in, For cluster m The posterior probability, For cluster m Select task n The conditional probability, To select a cluster m The prior probability, This is the normalization factor for the total probability.
[0097] According to one embodiment of this application, when predicting the reward values corresponding to different resource allocation strategies through a multilayer perceptron network of an Actor network, the allocation module 200 is further configured to: Based on a preset invalid action masking mechanism, allocation strategies that do not meet preset constraints are deleted from different resource allocation strategies.
[0098] According to one embodiment of this application, the preset invalid action masking mechanism is as follows: ; in, The score for the resource allocation decision after masking is given. For cluster m resources k Available capacity For the task n Resources k The minimum requirement, For resource allocation decisions The original score.
[0099] It should be noted that the foregoing explanation of the resource allocation method embodiment for edge computing environments also applies to the resource allocation device for edge computing environments in this embodiment, and will not be repeated here.
[0100] The resource allocation device for edge computing environments proposed in this application establishes a dynamic heterogeneous graph based on current edge computing environment information and extracts dependencies between nodes to obtain a structured environment embedding representation. It then determines the target task of the current cluster through an Actor network of intelligent agents, predicts the reward value corresponding to the resource allocation strategy through a multilayer perceptron network of the Actor network, and allocates resources according to the resource allocation strategy with the highest reward value. This solves the problems in related technologies of accurately estimating the elastic and uncertain resource requirements of machine learning tasks and the inability to adapt to high-dimensional problem inputs and complex decision variables. It flexibly adapts to low-latency scenarios and provides a general solution for the efficient scheduling of complex machine learning tasks in edge computing.
[0101] Figure 10 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. The electronic device may include: The memory 1001, the processor 1002, and the computer program stored on the memory 1001 and capable of running on the processor 1002.
[0102] When the processor 1002 executes the program, it implements the resource allocation method for edge computing environments provided in the above embodiments.
[0103] Furthermore, electronic devices also include: Communication interface 1003 is used for communication between memory 1001 and processor 1002.
[0104] The memory 1001 is used to store computer programs that can run on the processor 1002.
[0105] The memory 1001 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.
[0106] If the memory 1001, processor 1002, and communication interface 1003 are implemented independently, then the communication interface 1003, memory 1001, and processor 1002 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 10The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0107] Optionally, in a specific implementation, if the memory 1001, processor 1002, and communication interface 1003 are integrated on a single chip, then the memory 1001, processor 1002, and communication interface 1003 can communicate with each other through an internal interface.
[0108] The processor 1002 may be a CPU, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present invention.
[0109] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the resource allocation method for edge computing environments as described above.
[0110] This application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described resource allocation method embodiments for edge computing environments.
[0111] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0112] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0113] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A resource allocation method for edge computing environments, characterized in that, include: Obtain current edge computing environment information, establish a dynamic heterogeneous graph based on the current edge computing environment information, extract the dependencies between nodes from the dynamic heterogeneous graph through the heterogeneous graph Transformer, and obtain a structured environment embedding representation based on the dependencies between nodes; Based on the structured environment embedding representation, the most suitable target task for the current cluster is determined through the enhanced cross-attention module of the Actor network of the agent; Based on the mapping relationship between the target task and the current cluster, the multilayer perceptron network of the Actor network predicts the reward value corresponding to different resource allocation strategies, and the resource allocation strategy with the highest reward value is taken as the final resource allocation strategy, so as to allocate resources according to the final resource allocation strategy.
2. The method according to claim 1, characterized in that, After allocating resources according to the final resource allocation strategy, the process also includes: Get the current resource allocation progress; If the current resource allocation progress is complete, then update the current edge computing environment information.
3. The method according to claim 1, characterized in that, The process of determining the most suitable target task for the current cluster based on the structured environment embedding representation, through the enhanced cross-attention module of the Actor network of the agent, includes: Based on the structured environment embedding representation, an initial mapping table is generated through the Actor network of the agent; Identify whether the number of tasks corresponding to the current cluster in the initial mapping table is multiple; If the number is multiple, then based on the preset Bayesian conflict resolution strategy, the task most suitable for the current cluster state is determined from the multiple tasks in the initial mapping table as the target task; otherwise, the unique task corresponding to the current cluster in the initial mapping table is taken as the target task.
4. The method according to claim 3, characterized in that, The preset Bayesian conflict resolution strategy is as follows: ; in, For cluster m The posterior probability, For cluster m Select task n The conditional probability, To select a cluster m The prior probability, This is the normalization factor for the total probability.
5. The method according to claim 1, characterized in that, When predicting the reward values corresponding to different resource allocation strategies using the multilayer perceptron network of the Actor network, the method further includes: Based on a preset invalid action masking mechanism, allocation strategies that do not meet preset constraints are deleted from the different resource allocation strategies.
6. The method according to claim 5, characterized in that, The preset invalid action masking mechanism is as follows: ; in, The score for the resource allocation decision after masking is given. For cluster m resources k Available capacity For the task n Resources k The minimum requirement, For resource allocation decisions The original score.
7. A resource allocation device for edge computing environments, characterized in that, include: The acquisition module acquires the current edge computing environment information, establishes a dynamic heterogeneous graph based on the current edge computing environment information, extracts the dependencies between nodes from the dynamic heterogeneous graph through the heterogeneous graph Transformer, and obtains a structured environment embedding representation based on the dependencies between nodes. The determination module, based on the structured environment embedding representation, determines the most suitable target task for the current cluster through the enhanced cross-attention module of the Actor network of the agent; The allocation module, based on the mapping relationship between the target task and the current cluster, predicts the reward value corresponding to different resource allocation strategies through the multilayer perceptron network of the Actor network, and takes the resource allocation strategy with the highest reward value as the final resource allocation strategy, so as to allocate resources according to the final resource allocation strategy.
8. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the resource allocation method for an edge computing environment as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the resource allocation method for edge computing environments as described in any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the resource allocation method for edge computing environments as described in any one of claims 1-6.