A method for deploying a fog computing application based on a hierarchical decision mechanism

CN123011257APending Publication Date: 2026-10-30DALIAN MARITIME UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

[0005]本发明提供一种基于层次化决策机制的雾计算应用部署方法,以克服现有技术难以动态调整优先级,难以满足部署过程对实时性和适应性的要求,难以在复杂部署场景中实现精准决策,缺乏有效的协调机制问题

Benefits of technology

[0045]有益效果:本发明通过构建策略选择网络、任务选择网络和设备选择网络三层协同的层次化决策架构,将复杂的雾计算应用部署问题逐层解耦,有效解决了传统方法中因全部决策变量耦合而导致的“维数灾难”问题;具体地,策略选择网络负责从宏观层面确定当前部署阶段的整体策略倾向,任务选择网络依据策略指导从多个相互依赖的服务任务中精准选定待部署任务,设备选择网络则在策略和任务的双重约束下确定最优部署设备;三层网络各自聚焦于不同层级的决策子问题,避免了单一网络承担全部决策压力所导致的策略模糊和决策冲突,从而在任务规模庞大、候选设备众多的实际雾计算场景中,仍能实现高精度的部署决策;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123011257A_ABST
    Figure CN123011257A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on hierarchical decision mechanism's fog computing application deployment method, comprising: initialization fog computing environment, and according to the directed acyclic graph of application to be deployed is constructed, and extraction current deployment state is represented;Based on current deployment state, determine deployment strategy and type by strategy selection network;Utilize priority mechanism to determine the comprehensive priority of candidate task and equipment selection guide parameter, determine the task to be deployed and its deployment equipment by task selection network and equipment selection network respectively;After completing deployment, according to response time and deployment cost, obtain hierarchical reward by using improved Chebyshev multi-objective reward function, and the joint optimization training of each decision network is carried out by PPO algorithm;After training is completed, the target application is input into the trained network, and the final deployment result is output.The application can realize the collaborative optimization of task and equipment, improve the efficiency of fog computing application deployment and resource utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer networks and distributed computing, and in particular to a method for deploying fog computing applications based on a hierarchical decision-making mechanism. Background Technology

[0002] In fog computing environments, complex applications often consist of multiple interconnected services. The deployment of each service can be viewed as an independent task, and these tasks have topological dependencies, modeled as a directed acyclic graph (DAG) structure. When scheduling tasks under this structure, it is necessary to rationally select the task execution order and complete resource allocation while satisfying service dependencies. Although the task size is fixed, the complex dependencies between tasks and the dynamic changes in the state of environmental resources make the task deployment process face greater uncertainty. Therefore, how to coordinate the conflict between response time and deployment cost while satisfying service dependencies and environmental constraints has become a key challenge for application deployment in the current fog computing environment.

[0003] Currently, mainstream fog computing application deployment methods mainly include static rule-based methods, heuristic optimization algorithm-based methods, and deep reinforcement learning-based methods. Static rule-based methods typically rely on manually set scheduling order or priority rules, making static decisions based on a single feature of the task. Heuristic optimization algorithm-based methods usually model the application deployment problem as a combinatorial optimization problem, that is, finding a deployment scheme that can simultaneously optimize response time and deployment cost while satisfying task dependencies and resource constraints. Deep reinforcement learning-based methods continuously train the agent through interaction with the environment, enabling it to dynamically adjust the deployment strategy according to the environmental state. Therefore, this method has good state awareness and self-adjustment capabilities, and is more adaptable to changing deployment environments.

[0004] However, existing methods still have the following problems: Existing methods typically use static rules or single indicators to set priorities, lacking comprehensive consideration of topology priority, urgency priority, and resource prediction priority, and are difficult to dynamically adjust priorities, resulting in a lack of flexibility and accuracy in the deployment process; existing methods generally struggle to perceive dynamic changes in environmental states such as device status and network status in real time, and static rules cannot adjust deployment strategies according to real-time environmental changes, failing to meet the real-time and adaptability requirements of the deployment process; existing methods mostly employ single-layer decision-making mechanisms, lacking hierarchical strategies, making it difficult to achieve accurate decisions in complex deployment scenarios; when collaboratively optimizing response time and deployment costs, existing methods mostly use weighted sum methods, lacking effective coordination mechanisms, leading to a certain degree of imbalance in target optimization and unstable deployment results. Summary of the Invention

[0005] This invention provides a fog computing application deployment method based on a hierarchical decision-making mechanism to overcome the problems of existing technologies, such as difficulty in dynamically adjusting priorities, difficulty in meeting the real-time and adaptability requirements of the deployment process, difficulty in achieving accurate decision-making in complex deployment scenarios, and lack of effective coordination mechanisms.

[0006] To achieve the above objectives, the technical solution of the present invention is as follows: A method for deploying fog computing applications based on a hierarchical decision-making mechanism, characterized by comprising: S1. Initialize the fog computing environment and construct a directed acyclic graph containing task dependencies based on the application to be deployed; S2. Obtain the current deployment state based on the directed acyclic graph containing task dependencies; S3. Based on the current deployment status, select the network through the policy to obtain the current deployment policy and the current deployment policy type; S4. Based on the current deployment strategy and the current deployment strategy type, obtain the comprehensive priority score of each candidate task and the device selection strategy guidance parameters through the priority mechanism; S5. Based on the comprehensive priority score of each candidate task, obtain the service tasks to be deployed through the task selection network; S6. Based on the current deployment status, the service tasks to be deployed, and the device selection strategy guidance parameters, obtain the deployment device corresponding to the service tasks to be deployed by selecting the network. S7. Deploy the service task to be deployed to the deployment device corresponding to the service task to be deployed, and obtain the deployment result; update the current deployment status through the deployment result, obtain the updated deployment status, and feed back the updated deployment status to S3; S8. Based on the deployment results, obtain the response time and deployment cost before and after deployment; based on the response time and deployment cost before and after deployment, obtain the multi-objective reward value through the improved Chebyshev multi-objective reward function, and then obtain the hierarchical reward of task deployment; save the hierarchical reward of task deployment to memory, and delete the current task from the candidate tasks. S9. Repeat steps S3 to S8 until all tasks are deployed; obtain the final bonus reward based on the hierarchical rewards of all task deployments in memory; based on the final bonus reward, perform joint optimization training on the policy selection network, task selection network, and device selection network using the PPO algorithm to obtain optimized parameters; retain the optimized parameters and use them for the next round of training. S10. After reaching the preset number of training iterations, the trained policy selection network, task selection network, and device selection network are obtained based on the optimization parameters. A directed acyclic graph is obtained based on the actual fog computing environment and the actual application to be deployed. The final deployment result is then output through the trained policy selection network, task selection network, and device selection network.

[0007] Furthermore, the specific execution steps of the priority mechanism are as follows: S41. Obtain the task feature matrix in the current deployment state; S42. Based on the task feature matrix, obtain the topology priority feature through the topology encoder, and obtain the enhanced topology priority feature through the multi-head attention mechanism; based on the task feature matrix, obtain the urgency priority feature through the urgency encoder; based on the task feature matrix, obtain the resource prediction priority feature through the resource prediction encoder. S43. Based on the topology priority features, urgency priority features, and resource prediction priority features, the dynamic weight vector is obtained by sequentially passing it through a dynamic weight learner and a multilayer perceptron; based on the dynamic weight vector, the adjusted dynamic weight is obtained through a policy adjustment factor. S44. Obtain the initial comprehensive priority score based on the enhanced topology priority features, urgency priority features, resource prediction priority features, current deployment strategy, and adjusted dynamic weights; S45. Based on the initial overall priority score and the type of the current deployment strategy, the overall priority score and device selection strategy guidance parameters for each candidate task are obtained through the strategy guidance adjustment rules.

[0008] Furthermore, the expression for the topology priority feature is:

[0009] In the formula, This is a topology priority feature; This is the second-layer linear mapping matrix of the topology priority encoder; It is the ReLU activation function; For layer normalization function; This is the first-level linear mapping matrix of the topology priority encoder; This is the task feature matrix; This is the first-layer linear mapping bias vector of the topology priority encoder; This is the bias vector of the second-layer linear mapping of the topology priority encoder; The expression for the enhanced topology priority feature is:

[0010] In the formula, To enhance topology priority features; This is a multi-head attention mechanism; The expression for the urgency priority feature is:

[0011] In the formula, Urgency priority feature; This is the second-level linear mapping matrix of the urgency priority encoder; This is the first-level linear mapping matrix of the urgency priority encoder; This is the first-layer linear mapping bias vector of the urgency priority encoder; This is the second-layer linear mapping bias vector of the urgency priority encoder; The expression for the resource prediction priority feature is:

[0012] In the formula, For resource prediction priority characteristics; This is the second-level linear mapping matrix of the resource prediction priority encoder; The first-level linear mapping matrix of the resource prediction priority encoder; The first-layer linear mapping bias vector of the resource prediction priority encoder; This is the bias vector for the second-layer linear mapping of the resource prediction priority encoder.

[0013] Furthermore, the specific steps to obtain the adjusted dynamic weights are as follows: S431. Based on the topology priority features, the global topology priority features are obtained through a dynamic weight learner, and the expression is:

[0014] In the formula, This is a global feature of topology priority; For the set of candidate tasks; Index for candidate tasks; For the first Topological priority features of each candidate task; S432. Based on the urgency priority features, the global urgency priority features are obtained through a dynamic weight learner, and the expression is:

[0015] In the formula, Urgency priority is a global feature; For the first The urgency and priority characteristics of each candidate task; S433. Based on the resource prediction priority features, the global features of resource prediction priority are obtained through a dynamic weight learner, and the expression is:

[0016] In the formula, Global features for resource prediction priority; For the first Resource prediction priority characteristics of each candidate task; S434. Based on the global features of topology priority, urgency priority, and resource prediction priority, a global priority feature is obtained through concatenation, expressed as:

[0017] In the formula, It is a global priority feature; S435. Based on the global priority features, a dynamic weight vector is obtained through a multilayer perceptron, expressed as:

[0018] In the formula, It is a dynamic weight vector; These are the weights of the first layer of the multilayer perceptron; These are the weights of the second layer of the multilayer perceptron; The weights are for the third layer of the multilayer perceptron. This refers to the first-layer bias term of the multilayer perceptron. This refers to the bias term of the second layer of the multilayer perceptron. This refers to the bias term of the third layer of a multilayer perceptron. S436. Based on the dynamic weight vector, the adjusted dynamic weights are obtained through the strategy adjustment factor, expressed as:

[0019] In the formula, The adjusted dynamic weights; This is the normalization function; This is element-wise multiplication; This is a strategy adjustment factor.

[0020] Furthermore, the expression for the initial comprehensive priority score is:

[0021] In the formula, This is the initial overall priority score; Priority head network weights; Prioritize integration; For the adjusted Chebyshev context vector; For priority header network bias; The expression for fusion priority is:

[0022] In the formula, For the first Adjusted dynamic weights for each priority dimension; Indexes for priority dimensions; For the first Features with priority dimensions, when hour, To enhance topology priority features ,when hour, Urgency priority feature ,when hour, Prioritization features for resource prediction ; The expression for the adjusted Chebyshev context vector is:

[0023] In the formula, For the adjusted Chebyshev context vector; This is the Chebyshev context vector; This is the current deployment strategy; This is a policy-dependent Chebyshev context adjustment function.

[0024] Furthermore, the expression for the policy-guided adjustment rule is as follows: :

[0025]

[0026] :

[0027]

[0028] :

[0029]

[0030]

[0031] :

[0032]

[0033]

[0034] In the formula, , , and The current deployment strategy type, where, A time-first strategy, As a cost-first strategy, For equilibrium strategy, An adaptive strategy; For strategy ID; Adjustment amount for candidate task scores; To provide comprehensive guidance; Selecting guiding parameters for devices under a time-priority strategy; This refers to the time priority preference parameter; Guided parameters for selecting equipment under a cost-first strategy; This is a cost preference parameter; This refers to the adjustment amount for equipment scores under the equilibrium strategy. This is the ratio of the current response time to the reference response time. This represents the ratio of the current deployment cost to the reference deployment cost. Selecting guiding parameters for devices under the balancing strategy; To balance preference parameters; This refers to the adjustment amount for device ratings under the adaptive strategy. Selecting guidance parameters for devices under adaptive strategies; For adaptive preference parameters; The expression for the comprehensive guidance intensity is as follows:

[0035] In the formula, Basic strength; The score represents the degree of matching between the strategy and the problem characteristics; As an emergency regulatory factor; Adjust the coefficients during the training phase; The expression for the matching score between the strategy and the problem features is:

[0036] In the formula, Due to time pressure, and ; Due to cost pressures, and ; For the degree of imbalance, and ; For task complexity, and ,in, That is, the initial comprehensive priority score.

[0037] Furthermore, the expression for the improved Chebyshev multi-objective reward function is as follows:

[0038] In the formula, For multi-objective reward values; This is the normalized target vector of the previous state; The normalized target vector for the current state; To smooth out Chebyshev distance values; The expression for the smoothed Chebyshev distance value is:

[0039] In the formula, The target vector value; Let Chebyshev be the weight vector; For the ideal point; For smoothing parameters; For the target index.

[0040] Furthermore, the expression for the hierarchical reward of the task deployment is:

[0041] In the formula, Hierarchical rewards for task deployment; Basic rewards; To balance the constraints of rewards; For extreme constraints and punishments; To balance and improve incentive items; The expression for the basic reward is:

[0042] In the formula, To provide a scaling factor for rewards.

[0043] Furthermore, the expression for the final bonus reward is:

[0044] In the formula, This is the final bonus reward; Total number of task deployments; Deploy indexes for tasks; This is the initial total time; This represents the initial total cost; This is the final total time; This represents the final total cost.

[0045] Beneficial Effects: This invention constructs a hierarchical decision-making architecture with three layers of collaboration: a strategy selection network, a task selection network, and a device selection network. This decouples the complex fog computing application deployment problem layer by layer, effectively solving the "curse of dimensionality" problem caused by the coupling of all decision variables in traditional methods. Specifically, the strategy selection network is responsible for determining the overall strategy tendency of the current deployment stage from a macro perspective. The task selection network accurately selects the task to be deployed from multiple interdependent service tasks based on the strategy guidance. The device selection network determines the optimal deployment device under the dual constraints of strategy and task. Each of the three networks focuses on a different level of decision sub-problems, avoiding the strategy ambiguity and decision conflicts caused by a single network bearing all the decision pressure. Thus, high-precision deployment decisions can still be achieved in actual fog computing scenarios with large task scales and numerous candidate devices. By employing an improved Chebyshev multi-objective reward function, the conflicting optimization objectives of deployment response time and deployment cost are transformed into hierarchical single-objective reward values. Compared to the traditional linear weighted summation method, the Chebyshev method does not require pre-setting weight coefficients, effectively avoiding bias caused by improper weight selection, and achieving a more uniform search on the Pareto front. By hierarchically feeding back the multi-objective reward values ​​to each decision network, the policy selection, task selection, and device selection networks can take into account the differentiated needs of latency-sensitive and cost-sensitive applications during joint training, effectively controlling resource leasing and energy consumption while reducing service response time, demonstrating excellent multi-objective trade-off capabilities. By accurately modeling the dependencies between application service tasks using directed acyclic graphs (DAGs), and integrating task dependencies, candidate device states, and current deployment progress into a unified deployment state representation through a state feature extraction module, this mechanism enables the decision network to globally perceive the data dependencies of undeployed tasks on deployed tasks. Consequently, during task selection and device allocation, it prioritizes deploying tasks with close dependencies to nearby devices, reducing cross-device data transmission hops. Compared to traditional methods based on independent task assumptions or simple priority ranking, this significantly reduces network communication latency caused by data transfer between tasks, making it particularly suitable for computationally intensive IoT and edge intelligence application scenarios with frequent data interactions. By updating the current deployment status based on the deployment results after each service task is completed during the deployment process, and feeding the updated deployment status back to the next round of decision-making in real time, a closed-loop "perception-decision-deployment-update" iterative mechanism is formed. This design enables the invention to dynamically respond to real-time changes in device resources in the fog computing environment. For example, when the computing load of a device suddenly increases or the network connection status changes, the status feature extraction module can promptly capture the change and influence the deployment decisions of subsequent tasks, thereby effectively avoiding deployment scheme failures caused by environmental dynamism. Compared with static planning or offline optimization methods, the invention has stronger environmental adaptability and online scheduling capabilities. Attached Figure Description

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

[0047] Figure 1 This is a flowchart illustrating the application deployment method of the present invention. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0049] This embodiment provides a method for deploying fog computing applications based on a hierarchical decision-making mechanism, such as... Figure 1 As shown, it includes: S1. Initialize the fog computing environment and construct a directed acyclic graph containing task dependencies based on the application to be deployed; In this embodiment, the infrastructure in the fog computing environment consists of N heterogeneous devices and one cloud entity C; the device feature vector of the infrastructure can be represented as... ,in, Let k be the feature vector of the k-th device. Let k be the processing speed of the kth device. For the communication delay of the k-th device, The cost of using the k-th device. Let be the load of the k-th device.

[0050] Specifically, the directed acyclic graph representation of application service tasks is as follows: ,in, Let E be the set of task nodes and E be the set of dependency edges. It is an adjacency matrix.

[0051] S2. Obtain the current deployment state based on the directed acyclic graph containing task dependencies; Specifically, the current deployment state includes a directed acyclic graph adjacency matrix, a task feature matrix, a device feature matrix, a candidate task set, and an executable mask; Specifically, the adjacency matrix of the directed acyclic graph (DAG) is directly extracted from the topology of the DAG; the task feature matrix takes the adjacency matrix as input, aggregates the original features (computational complexity, data volume, deadline, etc.) of each task node through a graph convolutional neural network, and then projects them through a multilayer perceptron; the candidate task set is obtained through topological analysis, that is, all tasks whose predecessor tasks have been deployed are added to the candidate list; the executable mask is a binary vector corresponding to the candidate task set, with 1 set for tasks whose dependencies are fully satisfied, and 0 set otherwise; the device feature matrix is ​​independent of the DAG and is composed of device hardware features and the current task allocation state. The expression for the task feature matrix is ​​as follows:

[0052] In the formula, This is the task feature matrix; The weight matrix is ​​a learnable matrix; This is the projection bias vector; The original task features are obtained by processing the adjacency matrix of the directed acyclic graph through multilayer perceptron, normalization, activation function, attention enhancement and pooling. The expression for the device feature matrix is:

[0053] In the formula, For the device feature matrix; The hardware characteristics of the device include its processing power, storage capacity, computing power, etc. The current task allocation status indicates the tasks already allocated to the device and the remaining available resources.

[0054] In this embodiment, before obtaining the current deployment state, the task dependency complexity of the directed acyclic graph containing task dependencies is dynamically adjusted. The adjustment formula is as follows:

[0055] In the formula, This is the task-dependent complexity parameter used during the training of the episode; This is the current training round; It is a basic dependency factor.

[0056] S3. Based on the current deployment status, select the network through the policy to obtain the current deployment policy and the current deployment policy type; In this embodiment, the strategy selection network is a one-layer Actor-Critic network, defining four complementary decision strategies, each corresponding to a different optimization objective; the decision strategies are respectively The TIME_PRIORITY strategy indicates that the optimization objective is to minimize the response time. The COST_PRIORITY strategy indicates that the optimization objective is to minimize deployment costs. The BALANCED strategy indicates that the optimization goal is to collaboratively improve response time and deployment cost. The ADAPTIVE strategy refers to dynamically adjusting targets based on historical performance to adapt to the actual needs of the current task.

[0057] Specifically, the steps to obtain the current deployment strategy are as follows: S31. Based on the current deployment status, obtain the graph feature matrix through a graph convolutional neural network; based on the graph feature matrix and the adjacency matrix of the directed acyclic graph, obtain the pooling features and node features through a graph convolutional layer, expressed as:

[0058] In the formula, This is a pooling feature; For node features; The feature matrix of the graph; The adjacency matrix of a directed acyclic graph; For graph convolutional layers; S32. Based on the pooling features, the scores for each policy are obtained through the multilayer perceptron in the Actor network, expressed as: (The expression is incomplete in the original text.)

[0059] In the formula, Scoring of each strategy; For Actor network multilayer perceptron; In this embodiment, the scores of each strategy are adjusted by using frequency: When a certain strategy is overused, that is If the strategy score is negative, then a penalty will be applied: ,in, For the first The penalty value of each strategy, For the first The frequency of use of each strategy; When a certain strategy is underutilized, i.e. A reward will be given for the score of the strategy: ,in, For the first The reward value of each strategy; The first The expression for the frequency of use of each strategy is:

[0060] In the formula, For the first The number of times each strategy is selected; The total number of times all strategies were selected; S33. Based on the scores of each strategy, the probability distribution of strategy selection is obtained through the Softmax function, expressed as follows:

[0061] In the formula, The probability distribution for strategy selection; For the Softmax function; For temperature parameters, in the early stages of training, The settings are relatively high to encourage strategy exploration; as training progresses, Gradually reduce the probability, so that the model tends to choose strategies with higher probabilities, achieving a smooth transition from exploration to exploitation; S34. Based on the probability distribution of strategy selection, the final selected strategy, i.e., the current deployment strategy, is obtained through a classification distribution sampling mechanism, and its expression is:

[0062] In the formula, The final strategy chosen; For classification and distribution sampling mechanism; Simultaneously, the log probability of the final chosen strategy is calculated, expressed as:

[0063] In the formula, The score corresponding to the final selected strategy; For the first The score for each strategy; To perform an exponential summation of the scores for all candidate strategies.

[0064] In this embodiment, based on the pooling characteristics, the policy value is obtained through the multilayer perceptron in the Critic network, and the expression is:

[0065] In the formula, For strategic value; Based on the strategy value and combined with the preset baseline value of the strategy, the final strategy value is obtained, expressed as:

[0066] In the formula, For the ultimate strategic value; This is the baseline value for the preset strategy.

[0067] S4. Based on the current deployment strategy and the current deployment strategy type, obtain the comprehensive priority score of each candidate task and the device selection strategy guidance parameters through the priority mechanism; Preferably, the specific execution steps of the priority mechanism are as follows: S41. Obtain the task feature matrix in the current deployment state; S42. Based on the task feature matrix, obtain the topology priority feature through the topology encoder, and obtain the enhanced topology priority feature through the multi-head attention mechanism; based on the task feature matrix, obtain the urgency priority feature through the urgency encoder; based on the task feature matrix, obtain the resource prediction priority feature through the resource prediction encoder. The topology encoder, urgency encoder, and resource prediction encoder described herein are all dedicated feature extraction modules designed in this embodiment. They are constructed using standard deep learning components such as two-layer linear mapping, layer normalization, and ReLU activation. However, their input feature selection, encoding targets, and combination methods are specifically designed for the priority evaluation scenario of fog computing tasks, rather than directly applying existing encoder structures. Preferably, the expression for the topology priority feature is:

[0068] In the formula, This is a topology priority feature; This is the second-layer linear mapping matrix of the topology priority encoder; It is the ReLU activation function; For layer normalization function; This is the first-level linear mapping matrix of the topology priority encoder; This is the task feature matrix; This is the first-layer linear mapping bias vector of the topology priority encoder; This is the bias vector of the second-layer linear mapping of the topology priority encoder; The expression for the enhanced topology priority feature is:

[0069] In the formula, To enhance topology priority features; This is a multi-head attention mechanism; The expression for the urgency priority feature is:

[0070] In the formula, Urgency priority feature; This is the second-level linear mapping matrix of the urgency priority encoder; This is the first-level linear mapping matrix of the urgency priority encoder; This is the first-layer linear mapping bias vector of the urgency priority encoder; This is the second-layer linear mapping bias vector of the urgency priority encoder; The expression for the resource prediction priority feature is:

[0071] In the formula, For resource prediction priority characteristics; This is the second-level linear mapping matrix of the resource prediction priority encoder; The first-level linear mapping matrix of the resource prediction priority encoder; The first-layer linear mapping bias vector of the resource prediction priority encoder; This is the bias vector for the second-layer linear mapping of the resource prediction priority encoder.

[0072] S43. Based on the topology priority features, urgency priority features, and resource prediction priority features, the dynamic weight vector is obtained by sequentially passing it through a dynamic weight learner and a multilayer perceptron; based on the dynamic weight vector, the adjusted dynamic weight is obtained through a policy adjustment factor. Preferably, the specific steps to obtain the adjusted dynamic weights are as follows: S431. Based on the topology priority features, the global topology priority features are obtained through a dynamic weight learner, and the expression is:

[0073] In the formula, This is a global feature of topology priority; For the set of candidate tasks; Index for candidate tasks; For the first Topological priority features of each candidate task; S432. Based on the urgency priority features, the global urgency priority features are obtained through a dynamic weight learner, and the expression is:

[0074] In the formula, Urgency priority is a global feature; For the first The urgency and priority characteristics of each candidate task; S433. Based on the resource prediction priority features, the global features of resource prediction priority are obtained through a dynamic weight learner, and the expression is:

[0075] In the formula, Global features for resource prediction priority; For the first Resource prediction priority characteristics of each candidate task; S434. Based on the global features of topology priority, urgency priority, and resource prediction priority, a global priority feature is obtained through concatenation, expressed as:

[0076] In the formula, It is a global priority feature; S435. Based on the global priority features, a dynamic weight vector is obtained through a multilayer perceptron, expressed as:

[0077] In the formula, It is a dynamic weight vector; These are the weights of the first layer of the multilayer perceptron; These are the weights of the second layer of the multilayer perceptron; The weights are for the third layer of the multilayer perceptron. This refers to the first-layer bias term of the multilayer perceptron. This refers to the bias term of the second layer of the multilayer perceptron. This refers to the bias term of the third layer of a multilayer perceptron. S436. Based on the dynamic weight vector, the adjusted dynamic weights are obtained through the strategy adjustment factor, expressed as:

[0078] In the formula, The adjusted dynamic weights; This is the normalization function; This is element-wise multiplication; This is a strategy adjustment factor.

[0079] S44. Obtain the initial comprehensive priority score based on the enhanced topology priority features, urgency priority features, resource prediction priority features, current deployment strategy, and adjusted dynamic weights; Preferably, the expression for the initial comprehensive priority score is:

[0080] In the formula, This is the initial overall priority score; Priority head network weights; Prioritize integration; For the adjusted Chebyshev context vector; For priority header network bias; The expression for fusion priority is:

[0081] In the formula, For the first Adjusted dynamic weights for each priority dimension; Indexes for priority dimensions; For the first Features with priority dimensions, when hour, To enhance topology priority features ,when hour, Urgency priority feature ,when hour, Prioritization features for resource prediction ; The expression for the adjusted Chebyshev context vector is:

[0082] In the formula, For the adjusted Chebyshev context vector; This is the Chebyshev context vector; This is the current deployment strategy; For policy-dependent Chebyshev context adjustment functions; The expression for the Chebyshev context vector is as follows:

[0083] In the formula, These are the second layer weights of the context encoder; These are the first layer weights of the context encoder; and For bias terms; Contextual feature representation; The expression representing the context feature is:

[0084] In the formula, This is the normalized response time; This refers to the normalized deployment cost; The weights corresponding to the response time objective in Chebyshev; The weights corresponding to the deployment cost targets in Chebyshev.

[0085] S45. Based on the initial overall priority score and the type of the current deployment strategy, the overall priority score and device selection strategy guidance parameters for each candidate task are obtained through the strategy guidance adjustment rules.

[0086] Preferably, the expression for the strategy-guided adjustment rule is as follows: :

[0087]

[0088] :

[0089]

[0090] :

[0091]

[0092]

[0093] :

[0094]

[0095]

[0096] In the formula, , , and The current deployment strategy type, where, A time-first strategy, As a cost-first strategy, For equilibrium strategy, An adaptive strategy; For strategy ID; Adjustment amount for candidate task scores; To provide comprehensive guidance; Selecting guiding parameters for devices under a time-priority strategy; This refers to the time priority preference parameter; Guided parameters for selecting equipment under a cost-first strategy; This is a cost preference parameter; This refers to the adjustment amount for equipment scores under the equilibrium strategy. This is the ratio of the current response time to the reference response time. This represents the ratio of the current deployment cost to the reference deployment cost. Selecting guiding parameters for devices under the balancing strategy; To balance preference parameters; This refers to the adjustment amount for device ratings under the adaptive strategy. Selecting guidance parameters for devices under adaptive strategies; For adaptive preference parameters; The expression for the comprehensive guidance intensity is as follows:

[0097] In the formula, Basic strength; The score represents the degree of matching between the strategy and the problem characteristics; As an emergency regulatory factor; Adjust the coefficients during the training phase; The expression for the matching score between the strategy and the problem features is:

[0098] In the formula, Due to time pressure, and ; Due to cost pressures, and ; For the degree of imbalance, and ; For task complexity, and ,in, That is, the initial overall priority score; The expression for the emergency adjustment factor is: ; The expression for the adjustment coefficient during the training phase is: .

[0099] Specifically, the expressions for the comprehensive priority score of each candidate task and the device selection strategy guidance parameters are as follows:

[0100]

[0101] In the formula, The overall priority score for each candidate task; Select strategy guidance parameters for the device; Select policy guidance parameters for the device corresponding to the current policy type.

[0102] S5. Based on the comprehensive priority score of each candidate task, obtain the service tasks to be deployed through the task selection network; Specifically, the task selection network is a single-layer Actor-Critic network. Guided by high-level strategies, the task selection network can more rationally determine the tasks to be deployed and optimize task deployment efficiency. The specific execution steps of the task selection network are as follows: S51. Based on the comprehensive priority scores of each candidate task, generate the task selection probability distribution, expressed as:

[0103] In the formula, Choose a probability distribution for the task; For masking functions; S52. Based on the task selection probability distribution, the service tasks to be deployed are obtained through a classification distribution sampling mechanism, expressed as:

[0104]

[0105]

[0106] In the formula, The tasks are categorized and distributed accordingly; For task indexing; Service tasks awaiting deployment.

[0107] In this embodiment, the value estimate of task selection is calculated using the multilayer perceptron in the Critic network and a preset baseline value for the task. The expression is as follows:

[0108] In the formula, Value estimation for task selection; The baseline value for the preset task.

[0109] S6. Based on the current deployment status, the service tasks to be deployed, and the device selection strategy guidance parameters, obtain the deployment device corresponding to the service tasks to be deployed by selecting the network. Specifically, the device selection network is a layer Actor-Critic network. Taking into account device performance, task requirements, environmental load status, and device selection guidance parameters corresponding to the current strategy type, the most suitable device is selected as the deployment node to ensure that the task is effectively executed on the appropriate device. The specific steps for the device to select a network are as follows: S61. Obtain the device feature matrix of the current deployment status; S62. Based on the device feature matrix of the current deployment status, the initial score of the device is obtained through a multilayer perceptron, expressed as:

[0110] In the formula, An initial rating for the equipment; S63. Adjust the initial score of the equipment using the equipment selection strategy guidance parameters to obtain the adjusted equipment score, expressed as:

[0111] In the formula, The equipment score was adjusted. The device score adjustment amount is determined by the current deployment strategy, and This refers to the device selection policy guidance parameter, used to guide and correct the initial device score output by the device selection network. For example, when the TIME_PRIORITY policy is selected... The calculation logic for other strategies is consistent with this; S64. Based on the adjusted equipment rating, generate the probability distribution of equipment selection, expressed as:

[0112] In the formula, The probability distribution for device selection; S65. Based on the probability distribution of device selection, the deployment devices corresponding to the service tasks to be deployed are obtained through a classification distribution sampling mechanism, expressed as:

[0113]

[0114] In the formula, Index for deploying devices; The deployment device corresponding to the service task to be deployed.

[0115] In this embodiment, the value estimate of device selection is calculated using the multilayer perceptron in the Critic network and preset device benchmark values, expressed as:

[0116] In the formula, Value estimation for equipment selection; This is the preset baseline value for the device.

[0117] S7. Deploy the service task to be deployed to the deployment device corresponding to the service task to be deployed, and obtain the deployment result; update the current deployment status through the deployment result, obtain the updated deployment status, and feed back the updated deployment status to S3; S8. Based on the deployment results, obtain the response time and deployment cost before and after deployment; based on the response time and deployment cost before and after deployment, obtain the multi-objective reward value through the improved Chebyshev multi-objective reward function, and then obtain the hierarchical reward of task deployment; save the hierarchical reward of task deployment to memory, and delete the current task from the candidate tasks. Specifically, the deployment response time is obtained by summing three parts: the computation time of the task on the deployment device (task computation amount divided by device processing speed), the communication time of data transmission from the device where the predecessor task is located to the current deployment device (data amount divided by link bandwidth, and considering communication latency), and the queuing waiting time introduced by the current load of the device; the maximum completion time of all predecessor dependency paths is taken as the earliest start time of the current task, and the computation time is added to obtain the response time of the current task. Deployment costs consist of two parts: equipment usage costs and communication costs generated by data transmission. It can be expressed as the unit cost of the equipment multiplied by the task computation time, plus the amount of cross-device data transmission multiplied by the unit transmission cost.

[0118] In this embodiment, a smoothed Chebyshev function is proposed based on the traditional Chebyshev reward function. By enhancing the penalty mechanism for performance degradation and improving the adaptive balancing ability among multiple objectives, the optimization of time and cost can be flexibly balanced, thereby improving the multi-objective trade-off effect. Preferably, the expression for the improved Chebyshev multi-objective reward function is:

[0119] In the formula, For multi-objective reward values; This is the normalized target vector of the previous state; The normalized target vector for the current state; To smooth out Chebyshev distance values; The expression for the normalized target vector of the previous state is:

[0120] In the formula, The response time before the current task deployment action is executed; The deployment cost prior to executing the current task deployment action; The expression for the normalized target vector of the current state is:

[0121] In the formula, The response time after the current task deployment action is executed; The deployment cost after executing the current task deployment action; The expression for the smoothed Chebyshev distance value is:

[0122] In the formula, The target vector value; Let Chebyshev be the weight vector; For the ideal point; For smoothing parameters; For the target index.

[0123] Preferably, the expression for the hierarchical reward of the task deployment is:

[0124] In the formula, Hierarchical rewards for task deployment; Basic rewards; To balance the constraints of rewards; For extreme constraints and punishments; To balance and improve incentive items; The expression for the basic reward is:

[0125] In the formula, To provide a scaling factor for rewards.

[0126] Specifically, the calculation of the balance constraint reward takes into account the symmetry of time and cost objectives, that is, whether it is the time change rate or the cost change rate, as long as the threshold is exceeded, the balance constraint reward is used; in extreme cases, a constraint penalty term is introduced. The expression for the balance constraint reward is:

[0127] In the formula, The response time penalty factor; 2.0 is the deployment cost penalty factor; 2.0 is an additional multiplier for cost penalties. This is a ReLU function that only penalizes the portion exceeding the threshold; The threshold is dynamically adjusted for the current training epoch, expressed as: ; The expression for the extreme constraint penalty is: ; When both the time and cost change ratios are negative and large, it indicates that the multi-objective optimization is achieving good results. To further promote the optimization process, if the improvement difference between time and cost is small (i.e., when both are optimized simultaneously), a positive reward is given to encourage balanced optimization. If there is an unbalanced improvement (i.e., one objective is optimized while the other deteriorates), a unified penalty is imposed to avoid inconsistency in the optimization process. Therefore, a balanced improvement reward is introduced. The expression for the balance improvement reward item is: .

[0128] In this embodiment, after the reward calculation is completed, the relevant interaction information is stored in memory for subsequent policy network updates. The memory is based on a memory-based experience storage mechanism, maintaining an independent memory instance for each parallel environment to ensure that experience data from different environments do not interfere with each other. After each task deployment step, the agent's complete interaction data is recorded, including current deployment status information, decision behavior information, reward feedback information, termination flag information, and multi-objective optimization information. The current deployment status information records the core status information during task deployment, including the DAG adjacency matrix, task feature matrix, device feature matrix, candidate task set, and executable mask to construct a complete status representation. The decision behavior information records complete behavioral information of hierarchical decision-making, including: the selected strategy type and its log probability, task selection action, device selection action, strategy value function, task value function and device value function; The reward feedback information records the hierarchical rewards for task deployment, which are used to balance the two optimization objectives of response time and deployment cost. The termination identifier information marks the current state as a termination state after all tasks have been deployed, so as to determine whether the training round has ended during the strategy update phase. The multi-objective optimization information records relevant information supporting multi-objective optimization, including priority weight information: the task priority weight allocation of the current step, which is used to guide the priority mechanism for task selection; Chebyshev calculation information: the normalized objective value used for multi-objective optimization, which supports the time and cost balance optimization calculation; and current global environment state information: an environment state object including the current number of training iterations, number of steps, environment identifier, and other contextual information. All the above experience information will be stored in memory to provide data support for subsequent optimization of the strategy network parameters using the PPO algorithm, thereby achieving a coordinated balance between continuous strategy optimization and response time and deployment cost; after completing the PPO strategy update, all memory instances will be cleared to prepare for the next round of training.

[0129] S9. Repeat steps S3 to S8 until all tasks are deployed; obtain the final bonus reward based on the hierarchical rewards of all task deployments in memory; based on the final bonus reward, perform joint optimization training on the policy selection network, task selection network, and device selection network using the PPO algorithm to obtain optimized parameters; retain the optimized parameters and use them for the next round of training. Preferably, the expression for the final bonus reward is:

[0130] In the formula, This is the final bonus reward; Total number of task deployments; Deploy indexes for tasks; This is the initial total time; This represents the initial total cost; This is the final total time; This represents the final total cost.

[0131] Specifically, in the policy optimization stage, the Hierarchical Proximal Policy Optimization (PPO) algorithm is introduced. The PPO combines generalized advantage estimation (GAE), mild normalization policy, priority regularization loss function, pruning objective function and adaptive gradient pruning to optimize the policy network parameters, ensure the effectiveness of Chebyshev reward signal in multi-objective optimization, thereby guiding policy update and further improving training stability and convergence efficiency. Each of the three Actor networks employs an independent optimization strategy to ensure efficient policy updates. To improve training stability, PPO pruning is used to limit the policy update magnitude, ensuring effective gradient propagation in the Actor networks. Furthermore, temperature parameters are adjusted differentially: the policy selection network uses a fixed high temperature to encourage exploration of diversity, while the task and device selection network uses an adaptive temperature parameter that gradually decays, initially encouraging exploration and later ensuring stable convergence, thereby optimizing the parameters of the three-layer Actor network. The PPO network uses a hierarchical generalized advantage estimation technique; in this embodiment, it maintains three independent value functions: the policy value function... Task value function and equipment value function Three value functions are used for hierarchical GAE calculation to ensure the accuracy of decision evaluation at each level; the policy selection network uses... For GAE computation, the task and device selection network uses a combined value function. Perform joint GAE calculations; In the optimization process of the PPO network, to further control the gradient explosion problem and avoid excessive bias towards a single objective during optimization, a priority regularization loss function is introduced, with the expression:

[0132] In the formula, This is the priority regularization loss function; For the collected priority weight set; The weight vector of the first One component; is the variance of the weight vector; 0.1 and 0.05 are regularization coefficients; It is the numerical stability coefficient; Finally, the parameters of all networks are updated using the total loss function; the expression for the total loss function is:

[0133] In the formula, This is the total loss function; Choose network loss for the task; Select network loss for the device; Choose network loss for the strategy; The expressions for the task selection network loss, device selection network loss, and policy selection network loss are as follows:

[0134]

[0135]

[0136] In the formula, Select the network and device for the task, and choose the value loss factor in the network. Select the PPO pruning strategy loss coefficient in the network and device selection for the task; Select the network and device for the task, and choose the entropy loss coefficient in the network. Select priority regularization loss coefficients in the network for the task; Choose the value loss coefficient in the network for the strategy; Select the PPO pruning strategy loss coefficient in the network for the strategy selection; Choose the entropy loss coefficient in the network for the strategy; The value function loss of the task selection network is used to measure the error between the value estimate of the task selection Critic output and the target reward. The PPO pruning policy loss for the task selection network is used to limit the policy update range of the task selection actor. The entropy loss of the task selection network is used to maintain the exploratory nature of the task selection strategy and avoid premature convergence. This is the priority regularization loss, used to constrain the distribution of task priority weights and avoid excessive bias of priority weights towards a single dimension. The value function loss of the device selection network is used to measure the error between the value estimate of the device selection Critic output and the target return. The PPO pruning policy loss for network selection by the device is used to limit the policy update range for the device's selection of the Actor; The entropy loss for selecting networks for devices is used to maintain the exploratory nature of the device selection strategy; The value function loss of the policy selection network is used to measure the error between the value estimate of the policy selection Critic output and the target reward. The policy loss of the policy selection network is used to prune the policy selection actor and limit the policy update range of the policy selection actor. The entropy loss of the policy selection network is used to maintain the diversity and exploratory nature of policy selection; To further improve training stability, the most recent 10 gradient norm values ​​were recorded, and the results were analyzed based on the gradient L2 norm. Calculate the mean and standard deviation, where, For the loss function with respect to the parameters gradient, Let be the gradient of the loss function with respect to the p-th parameter; Based on this information, the gradient clipping threshold is adjusted adaptively. This achieves stable gradient updates, further improving the convergence speed and stability of training; the expression for the adaptive adjustment of the gradient clipping threshold is:

[0137] In the formula, Standard deviation; The mean; Let be the gradient clipping threshold for the u-th update; The hierarchical PPO algorithm optimizes the policy network parameters, ensuring the stability and convergence of the training process. The hierarchical decision architecture enables the high-level policy selection network to guide the decision-making of the task and device selection networks, achieving multi-level collaborative optimization from policy to deployment.

[0138] S10. After reaching the preset number of training iterations, the trained policy selection network, task selection network, and device selection network are obtained based on the optimization parameters. A directed acyclic graph is obtained based on the actual fog computing environment and the actual application to be deployed. The final deployment result is then output through the trained policy selection network, task selection network, and device selection network.

[0139] In this embodiment, the effectiveness of the fog computing application deployment method is verified from two aspects. Firstly, the fog computing application deployment method of this embodiment is compared with application deployment methods employing single-layer decision-making mechanisms, weighted sum reward methods, and static priority methods that only consider task dependencies, verifying the advantages of the hierarchical decision-making mechanism, priority mechanism, and multi-objective balancing mechanism of the fog computing application deployment method of this embodiment in task deployment. Secondly, it is compared with the classic multi-objective genetic algorithm NSGA-II, representing the current mainstream deployment strategy, and two greedy algorithms (the delay-first strategy Greedy-Lat and the cost-first strategy Greedy-Cost), verifying the advantages of the fog computing application deployment method of this embodiment in response time and deployment cost optimization. Both methods demonstrate experimental results through four evaluation metrics. The verification experiments were conducted on a server with an NVIDIA 8GB GPU, running on an Ubuntu 24.04.2 LTS (GNU / Linux 6.6.87.2-microsoft-standard-WSL2 x86_64) operating system, using Python 3.10, PyTorch version 1.13.0+cu117, and CUDA version 11.7. The specific experimental steps are as follows: First, a multi-objective application deployment simulation dataset for fog computing scenarios was constructed to verify the priority mechanism and smooth Chebyshev reward function strategy of the fog computing application deployment method in this embodiment. This dataset is based on the job-shop scheduling model and comprehensively reflects the heterogeneity of equipment, the dependencies between tasks, and the trade-off between time and cost objectives. The dataset is generated using a parameterized method, and the scheduling scenario is generated by reasonably controlling the three variables of the number of tasks, the number of equipment, and the degree of dependency. Second, it employs 36 tasks with dependencies, using a 6×6 Job-Shop model; it utilizes 18 heterogeneous devices, including 17 fog devices and 1 cloud server; the task processing time is within the range [8,9], reflecting the compactness of task execution time; the task dependency structure is a 36×36 directed acyclic graph (DAG), with a basic dependency degree set to 0.2, meaning each task has a 20% probability of depending on other tasks, forming a not very dense topology; the device feature matrix has dimensions [18,4]. Each device has four attributes: processing speed, resource cost, communication latency, and current load. The cost of the fog device is selected from the set [1, 10, 20, 30, 40], and the communication latency ranges from [1, 10, 20, 30, 40, 50]. For performance comparison, all tasks are initially deployed on a cloud server as the benchmark for performance evaluation. The cloud server in this experiment is configured as [4, 20, 50, 0], reflecting its low cost and high latency. Data is generated using a fixed random seed to ensure the reproducibility of the experiment. A two-stage weighting strategy is adopted: the initial reward calculation uses a weight of [1.0, 0.5] to reflect the relative importance of response time in the fog computing environment and to provide the algorithm with a learning signal that meets the actual business needs; the Chebyshev reward function time and cost in the training and optimization stage are both weighted at 0.5, which aims to evaluate the performance of each algorithm in the balanced optimization scenario, avoid target bias in the training process, and provide a benchmark reference for adjusting the weights according to specific needs in practical applications. Third, the evaluation metrics used in the comparative experiments were the Average Time Improvement Rate (ATR). Average Cost Improvement Rate (ADR) Balance Score (BS) and Overall Performance Index (OPI); Fourth, the fog computing application deployment method of this embodiment is compared with the application deployment methods that adopt a single-layer decision-making mechanism, a weighted and reward method, and a static priority method that only considers task dependencies, to verify the advantages of the hierarchical decision-making mechanism, priority mechanism, and multi-objective balancing mechanism proposed in this invention in the task deployment process; the experimental results are shown in Table 1. Table 1. Experimental comparison between the fog computing application deployment method and the static priority deployment method in this embodiment.

[0140] As can be seen from the experimental results in Table 1, the fog computing application deployment method of this embodiment has significant advantages in multi-objective optimization. In terms of average time optimization rate, the fog computing application deployment method of this embodiment is significantly better than the static priority deployment method, indicating that the hierarchical decision-making mechanism can more effectively reduce task response time. Although there is a certain gap in average cost optimization rate, in terms of multi-objective balance, the balance score of the fog computing application deployment method of this embodiment is much higher than that of the static priority deployment method, indicating that the static priority deployment method has a single-objective bias and fails to effectively consider deployment time and deployment cost. The overall performance score further shows that the method of this invention is more effective in balancing processing time and cost. Fifth, the fog computing application deployment method of this embodiment is compared with the classic multi-objective genetic algorithm (NSGA-II) and two greedy algorithms (delay-first strategy Greedy-Lat and cost-first strategy Greedy-Cost) to verify the advantages of the method of this invention in terms of response time and deployment cost optimization. NSGA-II: Achieves multi-objective search optimization by using non-dominated sorting and crowding comparison, suitable for complex optimization tasks, and capable of handling the balance between multiple objectives; Greedy-Lat: Prioritizes the device with the lowest latency, and when latency is the same, selects the device with the lowest cost, emphasizing real-time performance; Greedy-Cost: Prioritizes the lowest-cost equipment, and when costs are the same, selects the equipment with the lowest latency to effectively control deployment costs; The experimental results are shown in Table 2; Table 2. Experimental comparison of the fog computing application deployment method in this embodiment with the other three methods.

[0141] As shown in Table 2, the fog computing application deployment method in this embodiment performs excellently in all evaluation metrics. Compared with NSGA-II, although it can theoretically provide diverse solution sets and has better convergence ability, it performs poorly in this experiment, especially with a low time optimization rate and a negative cost optimization rate, indicating that it is not effective in complex fog computing environments with task dependence, device performance differences, and multi-objective optimization. The comparison results with the two greedy algorithms show that although Greedy-Lat and Greedy-Cost perform well in their respective single objectives, they tend to optimize in a single objective and lack multi-objective balance. In contrast, the method of this invention achieves better comprehensive performance in terms of average time optimization rate, average cost optimization rate, and balance score, proving its advantages in multi-objective optimization. Ultimately, experimental results show that the fog computing application deployment method in this embodiment, through a three-layer progressive hierarchical decision-making mechanism that comprehensively considers topology, urgency, and resource prediction priorities, and adopts a dynamic deployment strategy, maintains good single-objective optimization capabilities while successfully achieving synergistic optimization of response time and deployment cost. The advantages of this fog computing application deployment method are: the hierarchical progressive architecture of the hierarchical decision-making mechanism improves deployment efficiency; dynamic priority weight adjustment adapts to different application scenarios; the smooth Chebyshev reward function effectively coordinates multi-objective optimization; and the PPO algorithm ensures stable optimization of the policy network. This method realizes the transformation from static rules to dynamic learning, enabling real-time adjustment of deployment strategies based on environmental conditions. Compared with traditional static priority deployment methods and other multi-objective optimization methods, the fog computing application deployment method in this embodiment performs excellently in terms of multi-objective balance, especially in complex fog computing environments, where it can efficiently handle the trade-off between time and cost, demonstrating significant performance advantages.

[0142] The present invention has the following beneficial effects: This invention constructs a hierarchical decision-making architecture with three layers of collaboration: a strategy selection network, a task selection network, and a device selection network. This decouples the complex fog computing application deployment problem layer by layer, effectively solving the "curse of dimensionality" problem caused by the coupling of all decision variables in traditional methods. Specifically, the strategy selection network is responsible for determining the overall strategy tendency of the current deployment stage from a macro perspective. The task selection network accurately selects the task to be deployed from multiple interdependent service tasks based on the strategy guidance. The device selection network determines the optimal deployment device under the dual constraints of strategy and task. Each of the three networks focuses on a different level of decision sub-problems, avoiding the strategy ambiguity and decision conflicts caused by a single network bearing all the decision-making pressure. Thus, high-precision deployment decisions can still be achieved in real fog computing scenarios with large task scales and numerous candidate devices. By employing an improved Chebyshev multi-objective reward function, the conflicting optimization objectives of deployment response time and deployment cost are transformed into hierarchical single-objective reward values. Compared to the traditional linear weighted summation method, the Chebyshev method does not require pre-setting weight coefficients, effectively avoiding bias caused by improper weight selection, and achieving a more uniform search on the Pareto front. By hierarchically feeding back the multi-objective reward values ​​to each decision network, the policy selection, task selection, and device selection networks can take into account the differentiated needs of latency-sensitive and cost-sensitive applications during joint training, effectively controlling resource leasing and energy consumption while reducing service response time, demonstrating excellent multi-objective trade-off capabilities. By accurately modeling the dependencies between application service tasks using directed acyclic graphs (DAGs), and integrating task dependencies, candidate device states, and current deployment progress into a unified deployment state representation through a state feature extraction module, this mechanism enables the decision network to globally perceive the data dependencies of undeployed tasks on deployed tasks. Consequently, during task selection and device allocation, it prioritizes deploying tasks with close dependencies to nearby devices, reducing cross-device data transmission hops. Compared to traditional methods based on independent task assumptions or simple priority ranking, this significantly reduces network communication latency caused by data transfer between tasks, making it particularly suitable for computationally intensive IoT and edge intelligence application scenarios with frequent data interactions. By updating the current deployment status based on the deployment results after each service task is completed during the deployment process, and feeding the updated deployment status back to the next round of decision-making in real time, a closed-loop "perception-decision-deployment-update" iterative mechanism is formed. This design enables the invention to dynamically respond to real-time changes in device resources in the fog computing environment. For example, when the computing load of a device suddenly increases or the network connection status changes, the status feature extraction module can promptly capture the change and influence the deployment decisions of subsequent tasks, thereby effectively avoiding deployment scheme failures caused by environmental dynamism. Compared with static planning or offline optimization methods, the invention has stronger environmental adaptability and online scheduling capabilities.

[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for deploying fog computing applications based on a hierarchical decision-making mechanism, characterized in that, include: S1. Initialize the fog computing environment and construct a directed acyclic graph containing task dependencies based on the application to be deployed; S2. Obtain the current deployment state based on the directed acyclic graph containing task dependencies; S3. Based on the current deployment status, select the network through the policy to obtain the current deployment policy and the current deployment policy type; S4. Based on the current deployment strategy and the current deployment strategy type, obtain the comprehensive priority score of each candidate task and the device selection strategy guidance parameters through the priority mechanism; S5. Based on the comprehensive priority score of each candidate task, obtain the service tasks to be deployed through the task selection network; S6. Based on the current deployment status, the service tasks to be deployed, and the device selection strategy guidance parameters, obtain the deployment device corresponding to the service tasks to be deployed by selecting the network. S7. Deploy the service task to be deployed to the deployment device corresponding to the service task to be deployed, and obtain the deployment result; The current deployment status is updated based on the deployment results to obtain the updated deployment status, and the updated deployment status is fed back to S3. S8. Based on the deployment results, obtain the response time and deployment cost before and after deployment; based on the response time and deployment cost before and after deployment, obtain the multi-objective reward value through the improved Chebyshev multi-objective reward function, and then obtain the hierarchical reward of task deployment; save the hierarchical reward of task deployment to memory, and delete the current task from the candidate tasks. S9. Repeat steps S3 to S8 until all tasks are deployed. The final bonus reward is obtained based on the hierarchical rewards of all task deployments in memory; based on the final bonus reward, the policy selection network, task selection network, and device selection network are jointly optimized and trained using the PPO algorithm to obtain optimized parameters; The optimized parameters are retained and used in the next round of training; S10. After reaching the preset number of training iterations, the trained policy selection network, task selection network, and device selection network are obtained based on the optimization parameters. Based on the actual fog computing environment and the actual application to be deployed, a directed acyclic graph is obtained, and the final deployment result is output through the trained policy selection network, task selection network and device selection network.

2. The fog computing application deployment method based on a hierarchical decision-making mechanism according to claim 1, characterized in that, The specific execution steps of the priority mechanism are as follows: S41. Obtain the task feature matrix in the current deployment state; S42. Based on the task feature matrix, obtain the topology priority feature through the topology encoder, and obtain the enhanced topology priority feature through the multi-head attention mechanism; based on the task feature matrix, obtain the urgency priority feature through the urgency encoder; based on the task feature matrix, obtain the resource prediction priority feature through the resource prediction encoder. S43. Based on the topology priority features, urgency priority features, and resource prediction priority features, the dynamic weight vector is obtained by sequentially passing it through a dynamic weight learner and a multilayer perceptron; based on the dynamic weight vector, the adjusted dynamic weight is obtained through a policy adjustment factor. S44. Obtain the initial comprehensive priority score based on the enhanced topology priority features, urgency priority features, resource prediction priority features, current deployment strategy, and adjusted dynamic weights; S45. Based on the initial overall priority score and the type of the current deployment strategy, the overall priority score and device selection strategy guidance parameters for each candidate task are obtained through the strategy guidance adjustment rules.

3. The fog computing application deployment method based on a hierarchical decision-making mechanism according to claim 2, characterized in that, The expression for the topology priority feature is: In the formula, This is a topology priority feature; This is the second-layer linear mapping matrix of the topology priority encoder; It is the ReLU activation function; For layer normalization function; This is the first-level linear mapping matrix of the topology priority encoder; The task feature matrix; This is the first-layer linear mapping bias vector of the topology priority encoder; This is the bias vector of the second-layer linear mapping of the topology priority encoder; The expression for the enhanced topology priority feature is: In the formula, To enhance topology priority features; This is a multi-head attention mechanism; The expression for the urgency priority feature is: In the formula, Urgency priority feature; This is the second-level linear mapping matrix of the urgency priority encoder; This is the first-level linear mapping matrix of the urgency priority encoder; This is the first-layer linear mapping bias vector of the urgency priority encoder; This is the second-layer linear mapping bias vector of the urgency priority encoder; The expression for the resource prediction priority feature is: In the formula, For resource prediction priority characteristics; This is the second-level linear mapping matrix of the resource prediction priority encoder; The first-level linear mapping matrix of the resource prediction priority encoder; The first-layer linear mapping bias vector of the resource prediction priority encoder; This is the bias vector for the second-layer linear mapping of the resource prediction priority encoder.

4. The fog computing application deployment method based on a hierarchical decision-making mechanism according to claim 3, characterized in that, The specific steps to obtain the adjusted dynamic weights are as follows: S431. Based on the topology priority features, the global topology priority features are obtained through a dynamic weight learner, and the expression is: In the formula, This is a global feature of topology priority; For the set of candidate tasks; Index for candidate tasks; For the first Topological priority features of each candidate task; S432. Based on the urgency priority features, the global urgency priority features are obtained through a dynamic weight learner, and the expression is: In the formula, Urgency priority is a global feature; For the first The urgency and priority characteristics of each candidate task; S433. Based on the resource prediction priority features, the global features of resource prediction priority are obtained through a dynamic weight learner, and the expression is: In the formula, Global features for resource prediction priority; For the first Resource prediction priority characteristics of each candidate task; S434. Based on the global features of topology priority, urgency priority, and resource prediction priority, a global priority feature is obtained through concatenation, expressed as: In the formula, It is a global priority feature; S435. Based on the global priority features, a dynamic weight vector is obtained through a multilayer perceptron, expressed as: In the formula, It is a dynamic weight vector; These are the weights of the first layer of the multilayer perceptron; These are the weights of the second layer of the multilayer perceptron; The weights are for the third layer of the multilayer perceptron. This refers to the first-layer bias term of the multilayer perceptron. This refers to the bias term of the second layer of the multilayer perceptron. This refers to the bias term of the third layer of a multilayer perceptron. S436. Based on the dynamic weight vector, the adjusted dynamic weights are obtained through the strategy adjustment factor, expressed as: In the formula, The adjusted dynamic weights; This is the normalization function; This is element-wise multiplication; This is a strategy adjustment factor.

5. A fog computing application deployment method based on a hierarchical decision-making mechanism according to claim 4, characterized in that, The expression for the initial comprehensive priority score is: In the formula, This is the initial overall priority score; Priority head network weights; Prioritize integration; For the adjusted Chebyshev context vector; For priority header network bias; The expression for fusion priority is: In the formula, For the first Adjusted dynamic weights for each priority dimension; Indexes for priority dimensions; For the first Features with priority dimensions, when hour, To enhance topology priority features ,when hour, Urgency priority feature ,when hour, Prioritization features for resource prediction ; The expression for the adjusted Chebyshev context vector is: In the formula, For the adjusted Chebyshev context vector; This is the Chebyshev context vector; This is the current deployment strategy; This is a policy-dependent Chebyshev context adjustment function.

6. The fog computing application deployment method based on a hierarchical decision-making mechanism according to claim 5, characterized in that, The expression for the strategy-guided adjustment rule is as follows: : : : : In the formula, , , and The current deployment strategy type, where, A time-first strategy, As a cost-first strategy, For equilibrium strategy, An adaptive strategy; For strategy ID; Adjustment amount for candidate task scores; To provide comprehensive guidance; Selecting guiding parameters for devices under a time-priority strategy; This refers to the time priority preference parameter; Guided parameters for selecting equipment under a cost-first strategy; This is a cost preference parameter; This refers to the adjustment amount for equipment scores under the equilibrium strategy. This is the ratio of the current response time to the reference response time. This is the ratio of the current deployment cost to the reference deployment cost. Selecting guiding parameters for devices under the balancing strategy; To balance preference parameters; This refers to the adjustment amount for device ratings under the adaptive strategy. Selecting guidance parameters for devices under adaptive strategies; For adaptive preference parameters; The expression for the comprehensive guidance intensity is as follows: In the formula, Basic strength; The score represents the degree of matching between the strategy and the problem characteristics; As an emergency regulatory factor; Adjust the coefficients during the training phase; The expression for the matching score between the strategy and the problem features is: In the formula, Due to time pressure, and ; Due to cost pressures, and ; For the degree of imbalance, and ; For task complexity, and ,in, That is, the initial comprehensive priority score.

7. The fog computing application deployment method based on a hierarchical decision-making mechanism according to claim 1, characterized in that, The expression for the improved Chebyshev multi-objective reward function is as follows: In the formula, For multi-objective reward values; This is the normalized target vector of the previous state; The normalized target vector for the current state; To smooth out Chebyshev distance values; The expression for the smoothed Chebyshev distance value is: In the formula, The target vector value; Let Chebyshev be the weight vector; For the ideal point; For smoothing parameters; For the target index.

8. A fog computing application deployment method based on a hierarchical decision-making mechanism according to claim 7, characterized in that, The expression for the hierarchical reward of the task deployment is: In the formula, Hierarchical rewards for task deployment; Basic rewards; To balance the constraints of rewards; For extreme constraints and punishments; To balance and improve incentive items; The expression for the basic reward is: In the formula, To provide a scaling factor for rewards.

9. A fog computing application deployment method based on a hierarchical decision-making mechanism according to claim 8, characterized in that, The expression for the final bonus reward is: In the formula, This is the final bonus reward; Total number of task deployments; Deploy indexes for tasks; This is the initial total time; This represents the initial total cost; This is the final total time; This represents the final total cost.