Power Internet of Things Offloading Strategy and Resource Allocation Optimization Method for Cloud-Edge Collaborative Sensing
By adopting cloud-edge collaborative perception strategies and deep learning models in power IoT systems, the challenges of power IoT systems in data processing and resource management are solved, and more efficient data processing and more reliable resource allocation are achieved.
Patent Information
- Application Number
- CN202510210220.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2045-02-25
AI Technical Summary
Power IoT systems face data transmission bandwidth and delay issues, data privacy and security issues, and task scheduling difficulties caused by resource constraints and heterogeneity of edge devices.
The power IoT offload strategy and resource configuration optimization method with cloud-edge collaborative perception are adopted. By building a deep learning model based on BiGRU and an adaptive federated learning strategy, the tasks are intelligently allocated and executed between the power IoT end and the edge computing device end, and the decision on task offloading and migration strategies is made using discrete DDPG-based algorithms.
Improves the data processing capability of the Internet of Things in the power industry, reduces energy consumption, and enhances the real-time and security of the system, thereby providing more efficient and reliable solutions for smart grids and energy management.
Smart Images

Figure CN119729630B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of the power Internet of things, and particularly relates to a power Internet of things offloading strategy and resource allocation optimization method for cloud-edge collaborative perception. Background Technique
[0002] With the rapid development of information technology, the Power Internet of Things (PIoT) combines sensors, intelligent devices, communication technologies with cloud computing, realizing comprehensive perception, intelligent processing and optimal decision-making of the power system, and has played an increasingly important role in fields such as smart grids, energy management and remote monitoring. However, with the continuous expansion of the scale of the power Internet of things, the challenges of data processing and resource management it faces are becoming increasingly prominent.
[0003] In the traditional power Internet of things architecture, data usually needs to be transmitted to the central data center for processing and analysis. Although this method can centrally process a large amount of data, there are some obvious limitations. First, the bandwidth requirements and latency problems in the data transmission process become the bottleneck of system performance. Especially in large-scale distributed power systems, the real-time transmission and processing requirements of data pose extremely high demands on network bandwidth. Second, the issues of data privacy and security cannot be ignored. In the centralized processing mode, a large amount of sensitive data needs to be transmitted in the network, which increases the risk of data leakage and being attacked. In addition, the construction and maintenance costs of the centralized data center are high, and it is difficult to adapt to rapidly changing business requirements and environmental conditions.
[0004] To solve the above problems, Mobile Edge Computing (MEC) technology has emerged as the times require. Mobile edge computing transfers data processing and analysis tasks from the cloud to the network edge, that is, close to the data source, thereby reducing the latency and bandwidth requirements of data transmission and improving the real-time performance and efficiency of data processing. At the same time, edge computing can also process sensitive data locally, reducing the risk of data leakage and enhancing the security of the system.
[0005] However, the application of edge computing in the power Internet of Things also faces some challenges. First of all, edge devices are usually resource-constrained, including computing power, storage space, and energy supply. This limits their ability to process complex tasks and perform large-scale data analysis; secondly, different edge devices are controlled by different vendors, which involves edge cooperation limitations; moreover, there are a wide variety of devices and diverse data sources in the power Internet of Things, resulting in data heterogeneity and uneven distribution, and the update of its own model is restricted due to privacy. This brings difficulties to the resource allocation and task scheduling of edge computing. In addition, due to the dynamics and uncertainties of the power system, how to effectively predict and schedule tasks to adapt to system changes is an important issue that edge computing needs to solve.
[0006] To overcome these challenges, the present invention proposes a method and system for minimizing the task processing cost of a cloud-edge collaborative perception power Internet of Things. The system realizes the intelligent allocation and execution of tasks between the power Internet of Things side and the edge computing device side by constructing a cloud-edge collaborative task offloading model. The system uses a deep learning model based on a bidirectional gated recurrent unit (BiGRU) to predict the task feature relationships of the power Internet of Things nodes covered by the edge server, such as historical request task information and context information, so as to discover the implicit relationships between devices and tasks and provide decision-making support for task offloading. At the same time, the system uses federated learning technology to update the BiGRU model parameters, enabling the model to adapt to the heterogeneity and dynamics in the power Internet of Things and solving the problem of difficult model update due to privacy. In addition, the system uses an algorithm based on discrete deep deterministic policy gradient (DDPG) to make decisions on task offloading and migration strategies to minimize the latency and energy consumption of task processing. Summary of the Invention
[0007] In view of this, the present invention aims to provide an offloading strategy and resource configuration optimization method for a cloud-edge collaborative perception power Internet of Things to solve the contradiction between the completion requirements of specific tasks of power Internet of Things nodes and the unbalanced allocation of computing resources of mobile edge computing devices. The present invention can improve the data processing ability of the power Internet of Things, reduce energy consumption, enhance the real-time performance and security of the system, and thus provide a more efficient and reliable solution for fields such as smart grids and energy management.
[0008] To achieve the above object, the technical solution of the present invention is realized as follows:
[0009] An offloading strategy and resource configuration optimization method for a cloud-edge collaborative perception power Internet of Things specifically includes the following steps:
[0010] S1: Build a cache global prediction model based on BiGRU, set the model parameters of the cache global prediction model and the device parameters of the cloud-edge collaborative task offloading model. The cloud-edge collaborative task offloading model includes the power Internet of Things, the cloud server, and the MEC server;
[0011] S2: Use the task characteristics of the power Internet of Things to train the cache global prediction model, and use the trained cache global prediction model to predict the task cache category of the power Internet of Things;
[0012] Calculate the latency and power consumption of the computing tasks of the power Internet of Things when they are executed on the local MEC server, migrated to the adjacent MEC server, and migrated to the cloud server respectively;
[0013] S3: Build an adaptive federated learning strategy, deploy the trained cache global prediction model on the MEC server, and use the adaptive federated learning strategy to adaptively allocate weights to the MEC server and update the cache global prediction model;
[0014] S4: Build a task offloading and migration model based on discrete DDPG, use the processing results of the adaptive federated learning strategy to train the task offloading and migration model, and use the trained task offloading and migration model to determine the task offloading and migration strategy.
[0015] Further, before step S1, build a cloud-edge collaborative task offloading model. The execution methods of the computing tasks of the power Internet of Things include being executed on the local MEC server, migrating from the local MEC server to the adjacent MEC server, and migrating from the local MEC server to the cloud server. The execution priorities of the computing tasks of the power Internet of Things from high to low are the local MEC server, the adjacent MEC server, and the cloud server.
[0016] Further, in step S1, the power Internet of Things includes N nodes, the number of cloud servers is one, and the number of MEC servers is E. Each MEC server covers power Internet of Things nodes, .
[0017] Further, in step S2, the cache global prediction model based on BiGRU includes an input layer, a BiGRU network, a first fully connected layer, and a second fully connected layer connected in sequence.
[0018] Further, in step S2, the steps of calculating the latency and power consumption of the computing tasks of each power Internet of Things when they are executed on the local MEC server, migrated to the adjacent MEC server, and migrated to the cloud server respectively include:
[0019] Divide the continuous time period T into time slots, and set each time slot as t, The tasks generated by each power Internet of Things node n at time slot t are as follows:
[0020] ;
[0021] Among them, is the size of the generated task , is the number of CPU clock cycles required to process the task , is the deadline for completing the task , is the cache capacity required to process the task ;
[0022] Calculate the latency and power consumption when the task is offloaded to the local MEC server for execution:
[0023] ;
[0024] ;
[0025] Among them, is the latency for the task to be offloaded to the local MEC server, is the energy consumption for the task to be offloaded to the local MEC server, is the transmission time for the task to be offloaded from the power Internet of Things node n to the local MEC server e, is the task processing time of the local MEC server e after the task is offloaded from the power Internet of Things node n to the local MEC server e, is the task transmission energy consumption for the task to be offloaded to the local MEC server, is the task processing energy consumption for the task to be offloaded to the local MEC server;
[0026] Calculate the latency and power consumption when the task is migrated to the adjacent MEC server for execution:
[0027] ;
[0028] ;
[0029] Among them, is the latency for the task to be offloaded to the local MEC server and then migrated to the adjacent MEC server, is the task Power consumption for migration to an adjacent MEC server after offloading to the local MEC server For the task Migration time for migrating from the local MEC server to an adjacent MEC server for execution Is the latency required for the adjacent MEC server to process the task For the task Migration energy consumption for migrating from the local MEC server to an adjacent MEC server for execution Is the energy consumption required for processing the task at the adjacent MEC server;
[0030] Calculate the latency and power consumption for the task to be migrated to the cloud server for execution:
[0031] ;
[0032] ;
[0033] Among them, For the task Latency for offloading to the cloud server after offloading to the local MEC server For the task Power consumption for offloading to the cloud server after offloading to the local MEC server Is the transmission time for the task to be offloaded from the power IoT node n to the local MEC server e and then to the cloud server Is the task processing delay for the task to be offloaded from the power IoT node n to the local MEC server e and then to the cloud server Is the transmission power consumption for the task to be offloaded from the power IoT node n to the local MEC server e and then to the cloud server Is the task processing energy consumption for the task to be offloaded from the power IoT node n to the local MEC server e and then to the cloud server
[0034] Furthermore, step S3 specifically includes the following steps:
[0035] S31: Based on the relationship between the task characteristics learned during the process of training the cache global prediction model at the power IoT side and the task offloading decision, determine the weight allocation strategy at the power IoT side:
[0036] ;
[0037] Among them, Is the weight of the power IoT Is the weight obtained from the previous round of training of the power IoT Is the update scale parameter;
[0038] S32: Deploy the trained cache global prediction model on each MEC server, upload the model parameters and weights of the trained cache global prediction model to each MEC server, and each MEC server updates its deployed cache global prediction model using the adaptive weighted average method and distributes the updated cache global prediction model to the power IoT side; the power IoT side performs network training and task feature recognition on the updated cache global prediction model, and further adjusts the weight distribution and update frequency of each MEC server according to the results of network training and task feature recognition until the cache global prediction models deployed on each MEC server meet user requirements:
[0039] The formula adopted by the adaptive weighted average method is:
[0040] ;
[0041] Among them, is the number of power IoT nodes connected to the local MEC server e, is the information entropy of the task features generated by the nodes of the current power IoT and the task features generated by other power IoT, and L is the number of layers of the cache global prediction model.
[0042] Furthermore, step S4 specifically includes the following steps:
[0043] S41: Based on the task offloading and migration model of discrete DDPG, deploy a DDPG neural network model on each MEC server side, and define the state action and reward function ;
[0044] S42: Initialize the network parameters of the prediction network, the network parameters of the target network, and the capacity of the experience replay pool included in the DDPG neural network model;
[0045] S43: Reset the training environment of each MEC server to the z-th training environment, set the state of each MEC server to , and the initial reward is is 0;
[0046] S44: Select T time slots, and at the t-th time slot, execute step S45;
[0047] S45: In the i-th MEC server, according to the initial state , initialize the Gaussian noise vector , and process each MEC server using the adaptive federated learning strategy to obtain the processing result;
[0048] S46: Make all MEC servers execute the action , obtain the rewards corresponding to each MEC server ;
[0049] S47: Store the sample < , , , > into the experience replay buffer pool, and select the mini-batch training samples in the experience replay buffer pool as the training samples for the prediction network of the (i + 1)-th MEC server, which is the state for the next time slot;
[0050] S48: Replace the i-th MEC server with the (i + 1)-th MEC server, repeat steps S45 - S47, obtain the rewards of all MEC servers, and calculate the average reward of all MEC servers;
[0051] S49: Calculate the gradients of the discriminator of the prediction network, and use the Adam optimizer to update the network parameters of the prediction network backward ; Calculate the gradients of the generator of the prediction network, and use the Adam optimizer to update the network parameters of the prediction network backward ;
[0052] S410: Soft-update the network parameters of the target network using the network parameters of the prediction network;
[0053] S411: Replace the t-th time slot with the (t + 1)-th time slot, repeat steps S44 - S410 until the calculations for T time slots are completed;
[0054] S412: Calculate the average reward of all time slots, and guide the adaptive federated learning strategy according to the average reward of all time slots to adaptively allocate weights for each MEC server and update the cached global prediction model;
[0055] S413: Replace the z-th training environment with the (z + 1)-th training environment, repeat steps S43 - S412 until the calculations for all training environments are completed.
[0056] Compared with the prior art, the present invention can achieve the following beneficial effects:
[0057] The power Internet of Things offloading strategy and resource allocation optimization method with cloud-edge collaborative perception of the present invention realizes the intelligent allocation and execution of tasks between the power Internet of Things side and the MEC server side by constructing a cloud-edge collaborative task offloading model. The present invention uses a deep learning model based on bidirectional gated recurrent unit (BiGRU) to predict the task feature relationships of the power Internet of Things nodes covered by the MEC server, such as historical request task information and context information, so as to discover the implicit relationships between devices and tasks, provide decision support for task offloading, improve the cache configuration efficiency of the MEC server side, as well as the task offloading and migration efficiency. At the same time, the present invention adopts an adaptive federated learning strategy to update the parameters of the cache global prediction model based on BiGRU, enabling the cache global prediction model to adapt to the heterogeneity and dynamics in the power Internet of Things, solving the problem of difficult update of the cache global prediction model due to privacy. The present invention adaptively updates the local model parameters according to the task characteristics at the power Internet of Things side, improving the learning efficiency. In addition, the present invention adopts an algorithm based on discrete deep deterministic policy gradient (DDPG) to make decisions on task offloading and migration strategies, minimizing the latency and energy consumption of task processing and improving the convergence speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention. In the drawings:
[0059] Figure 1 is a schematic flow chart of the power Internet of Things offloading strategy and resource allocation optimization method with cloud-edge collaborative perception according to the embodiment of the present invention;
[0060] Figure 2 is a schematic structural diagram of the cloud-edge collaborative task offloading model according to the embodiment of the present invention;
[0061] Figure 3 is a schematic structural diagram of the adaptive federated learning strategy according to the embodiment of the present invention;
[0062] Figure 4 is a schematic structural diagram of the task offloading and migration model based on discrete DDPG according to the embodiment of the present invention;
[0063] Figure 5 is a performance effect diagram of the method for minimizing the task processing cost of the power Internet of Things with cloud-edge collaborative perception according to the embodiment of the present invention;
[0064] Figure 6 is a performance comparison diagram between the method for minimizing the task processing cost of the power Internet of Things with cloud-edge collaborative perception according to the embodiment of the present invention and other baseline methods. Detailed implementation manners
[0065] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not constitute a limitation to the present invention.
[0066] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments may be combined with each other.
[0067] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "center", "longitudinal", "transverse", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation to the present invention. In addition, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first", "second", etc. may explicitly or implicitly include one or more of such features. In the description of the present invention, unless otherwise specified, the meaning of "a plurality" is two or more.
[0068] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "mounted", "connected" and "coupled" should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection or an integral connection; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood through specific situations.
[0069] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments.
[0070] As Figure 1As shown in the figure, the present invention proposes an offloading strategy and resource allocation optimization method for the power Internet of Things with cloud-edge collaborative perception, which specifically includes the following steps: S1: Construct a cache global prediction model based on BiGRU, and set the model parameters of the cache global prediction model and the device parameters of the cloud-edge collaborative task offloading model. The cloud-edge collaborative task offloading model includes the power Internet of Things, a cloud server, and an MEC server; S2: Train the cache global prediction model using the task characteristics of the power Internet of Things, and use the trained cache global prediction model to predict the task cache categories of the power Internet of Things; Calculate the latency and power consumption of the computing tasks of the power Internet of Things when they are offloaded to the local MEC server for execution, migrated to an adjacent MEC server for execution, and migrated to the cloud server for execution; S3: Construct an adaptive federated learning strategy, deploy the trained cache global prediction model on the MEC server, and use the adaptive federated learning strategy to adaptively allocate weights to the MEC server and update the cache global prediction model; S4: Construct a task offloading and migration model based on discrete DDPG, train the task offloading and migration model using the processing results of the adaptive federated learning strategy, and use the trained task offloading and migration model to determine the task offloading and migration strategy.
[0071] The present invention constructs a cloud-edge collaborative task offloading model, enabling the heterogeneous tasks with specific caches generated by the power Internet of Things nodes to be executed on the cloud server side or offloaded to the MEC server side, calculating the processing latency and energy consumption of the computing tasks, and analyzing the optimization objectives of task offloading and migration; Construct a cache global prediction model based on BiGRU on the power Internet of Things side and the MEC server side to predict the task feature relationship of the power Internet of Things nodes covered by the MEC server; The power Internet of Things nodes and the MEC server interact, and the parameters of the cache global prediction model are interactively updated by proposing an adaptive federated learning strategy; Construct a task offloading and migration model based on discrete DDPG on the MEC server side to minimize the weighted latency and energy consumption cost.
[0072] In some embodiments, as Figure 2 shown, before step S1, construct a cloud-edge collaborative task offloading model. The execution methods of the computing tasks of the power Internet of Things include offloading to the local MEC server for execution, migrating from the local MEC server to an adjacent MEC server for execution, and migrating from the local MEC server to the cloud server for execution. The execution priorities of the computing tasks of the power Internet of Things are, from high to low, the local MEC server, the adjacent MEC server, and the cloud server.
[0073] In some embodiments, the power Internet of Things includes N nodes, the number of cloud servers is one, and the number of MEC servers is E. Each MEC server covers power Internet of Things nodes, .
[0074] It should be noted that due to the limited processing capacity of the power Internet of Things itself, some tasks need to be offloaded to the MEC server for processing. All the caches required for the tasks are placed on the cloud server. Because of resource constraints, the MEC server will regularly store the caches required for a small number of tasks. Further, the tasks of the power Internet of Things can be executed on the local MEC server, adjacent MEC servers or the cloud server.
[0075] 1) Local MEC server: If at time slot t, the cache required for the task requested by the power Internet of Things node n has been placed in the local MEC server e (the recently connected MEC server), then the power Internet of Things can directly offload the task to the current MEC server for execution and then return the result.
[0076] 2) Adjacent edge server: If at time slot t, the cache required for the task requested by the power Internet of Things node n has not been placed in the local MEC server e, but the adjacent MEC server has the cache required for the task, then the task is migrated from the local MEC server to the adjacent MEC server for execution and then the result is returned to the power Internet of Things node n. If multiple adjacent MEC servers have all placed the cache required for the task, the local MEC server randomly selects one of the adjacent MEC servers to migrate and execute the task.
[0077] 3) Cloud server: If neither the local MEC server nor the adjacent MEC servers have placed the cache required for processing the task, the local MEC server offloads the task to the cloud server for processing and then returns its processing result to the power Internet of Things node n.
[0078] In some embodiments, the cache global prediction model based on BiGRU includes an input layer, a BiGRU network, a first fully connected layer, and a second fully connected layer connected in sequence.
[0079] It should be noted that different MEC servers are controlled by different suppliers, which involves edge cooperation restrictions. The current device knows information such as the computing and communication resources of the MEC server it is connected to, but does not know the global information of adjacent MEC servers. Since each MEC server has a limited cache capacity, it is crucial for MEC servers to cooperate when predicting the cache required for tasks to reduce the cost of task processing. Therefore, the present invention proposes a cache global prediction model based on BiGRU to predict the task feature relationships of the power Internet of Things nodes covered by the MEC server and determine the appropriate predicted request content to be cached by the MEC server. The present invention uses a deep learning model based on bidirectional gated recurrent unit (BiGRU) to predict the task feature relationships of the power Internet of Things nodes covered by the MEC server, such as historical request task information and context information, so as to discover the implicit relationship between devices and tasks and provide decision support for the cache placement strategy of the MEC server and further task offloading.
[0080] Furthermore, the training process of the cache global prediction model based on BiGRU is as follows:
[0081] Task feature collection: Collect historical task data from the power Internet of Things device side, including task categories (such as: data collection, status monitoring, anomaly detection, etc.), task data size (in bytes), the number of CPU clock cycles required for the task, the task completion deadline, the size of the cache capacity required for the task, and other features.
[0082] Data preprocessing: Clean and normalize the collected historical task data to meet the input requirements of the cache global prediction model (for the sake of simplicity of expression, the cache global prediction model will be abbreviated as the model in the explanation of the training process).
[0083] Input the preprocessed data into the model for model training. According to the initialized number of training iterations, determine whether the training is completed. If the iteration number is reached, deploy the trained model to the edge computing server and end the training; otherwise, execute the next step.
[0084] Among them, the input layer receives the preprocessed task feature data (the preprocessed data), the BiGRU network is used to capture the time series dependence relationship of the task feature data, the BiGRU layer processes the input data from two directions (forward and backward) to more comprehensively understand the data pattern, and two fully connected layers (FC1 and FC2) are used to further extract features and perform non-linear transformations. Each fully connected layer contains no more than 200 neurons.
[0085] Input task features into the model, including the task data generated by the current power Internet of Things device side and the collected historical task data.
[0086] Define the loss function as the mean squared error (MSE) to evaluate the difference between the predicted values and the actual values of the model. Select the Adam optimization algorithm for optimizing the model parameters. Use the historical task data to train the model and update the model weights through the backpropagation algorithm to minimize the loss function.
[0087] Predict the cache categories required for future tasks. Input the new task feature data into the current model for inference calculation, and convert the output of the fully connected layer into the predicted cache categories required for future tasks.
[0088] Update and iterate the model. By comparing the cache categories predicted by the model with the actual categories, reduce the value of the model loss function. According to the evaluation results, adjust and optimize the model structure or parameters to improve the prediction performance.
[0089] Deploy the trained model to the edge computing server for real-time prediction of the cache categories required for tasks at the power IoT device side.
[0090] In some embodiments, in step S2, the steps of calculating the latency and power consumption when the computing tasks of each power IoT are executed by being offloaded to the local MEC server, migrated to the adjacent MEC server, and migrated to the cloud server respectively include:
[0091] Divide the continuous time period T into time slots, and set each time slot as t. , the task generated by each power IoT node n in time slot t :
[0092] ;
[0093] Among them, is the size of generating task , is the number of CPU clock cycles required to process task , is the deadline for completing task , is the cache capacity required to process task ;
[0094] Calculate the latency and power consumption when the task is offloaded to the local MEC server for execution:
[0095] ;
[0096] ;
[0097] Among them, is the latency of task offloaded to the local MEC server, is the task Energy consumption for offloading to the local MEC server For task Transmission time for offloading from the power Internet of Things node n to the local MEC server e For task After offloading from the power Internet of Things node n to the local MEC server e, the task processing time of the local MEC server e For task Task transmission energy consumption for offloading to the local MEC server For task Task processing energy consumption for offloading to the local MEC server;
[0098] Calculate the delay and power consumption for the task to be migrated to the adjacent MEC server for execution:
[0099] ;
[0100] ;
[0101] Among them, For task Delay for offloading to the local MEC server and then migrating to the adjacent MEC server For task Power consumption for offloading to the local MEC server and then migrating to the adjacent MEC server For task Migration time for migrating from the local MEC server to the adjacent MEC server for execution Is the delay required for the adjacent MEC server to process the task, For task Migration energy consumption for migrating from the local MEC server to the adjacent MEC server for execution Is the energy consumption required for processing the task on the adjacent MEC server;
[0102] Calculate the delay and power consumption for the task to be migrated to the cloud server for execution:
[0103] ;
[0104] ;
[0105] Among them, For task Delay for offloading to the local MEC server and then offloading to the cloud server For task Power consumption for offloading to the local MEC server and then offloading to the cloud server is the transmission time of the task from the power IoT node n to the local MEC server e and then to the cloud server. is the task processing delay after the task is offloaded from the power IoT node n to the local MEC server e and then to the cloud server. is the transmission power consumption of the task after it is offloaded from the power IoT node n to the local MEC server e and then to the cloud server. It is the task processing energy consumption after offloading the task from the power IoT node n to the local MEC server e and then to the cloud server.
[0106] It should be noted that in the constructed cloud-edge collaborative task offloading model, when each power IoT communicates with the local MEC server or the adjacent MEC server through a wireless link, according to the Shannon theorem, the time slot can be obtained t The task uplink transmission rate between the power IoT node n and the local MEC server e .
[0107] ;
[0108] in, is the bandwidth size, is the transmission power, is the channel gain, is the standard deviation of additive Gaussian white noise with mean 0.
[0109] Similarly, the task downlink transmission rate between the local MEC server e and the cloud server in time slot t can be obtained: :
[0110] ;
[0111] After the task processing is completed, the result needs to be returned to the power Internet of Things, but the result is much smaller than the task size, that is, it can be ignored. Therefore, the present invention does not consider the downlink return processing of the task.
[0112] Furthermore, the specific steps of calculating the latency and power consumption of each power IoT computing task offloaded to a local MEC server for execution, migrated to an adjacent MEC server for execution, and migrated to a cloud server for execution include:
[0113] 1. Offload to the local MEC server
[0114] According to the transmission rate ,Task Transmission time from power IoT node n to local MEC server e It can be calculated as:
[0115] ;
[0116] Then the task transmission energy consumption is:
[0117] ;
[0118] wherein, is the offloading power for the computing task to be offloaded from the current power Internet of Things node to the local MEC server.
[0119] After the task is offloaded to the local MEC server e, the local MEC server needs to process the task, then the task processing time can be calculated as:
[0120] ;
[0121] wherein, is the number of CPU clock cycles required for the local MEC server to process the task after the task is offloaded to the local MEC server e and is the number of CPU clock cycles allocated by the MEC server for task execution.
[0122] The task processing energy consumption is
[0123] ;
[0124] wherein, is the power of the local MEC server to process the task .
[0125] Then the total delay for the task offloaded to the local MEC server is:
[0126] ;
[0127] The task offloaded to the local MEC server has a total energy consumption of:
[0128] .
[0129] 2. Migration to an adjacent MEC server:
[0130] The task execution requested by the power Internet of Things node n requires cache that is not placed in the local MEC server e, but the adjacent MEC server stores the required cache for the task, then the task is migrated from the local MEC server to the adjacent MEC server for execution, and the migration time can be calculated as:
[0131]
[0132] Among them, is the migration cost constant, and its value is a constant.
[0133] Then the migration energy consumption can be calculated as:
[0134] ;
[0135] Among them, is the migration power for the computing task to migrate from the local MEC server to other MEC servers (with the required cache for the task).
[0136] Similarly, the latency and energy consumption required for the adjacent MEC server to process the task are respectively:
[0137] ;
[0138] ;
[0139] Among them, the physical meaning of is the execution power of the migrated computing task at the adjacent MEC server side, is the number of CPU clock cycles allocated by the adjacent MEC server for task execution.
[0140] Then for the task after being offloaded to the local MEC server and then migrated to other MEC servers, the total latency is:
[0141] ;
[0142] For the task after being offloaded to the local MEC server and then migrated to other MEC servers, the total energy consumption is:
[0143] .
[0144] 3. Migration to the cloud server:
[0145] The transmission time for the task to be offloaded from the power Internet of Things node n to the local MEC server e and then migrated to the cloud server can be calculated as:
[0146] ;
[0147] Then the transmission energy consumption is:
[0148] ;
[0149] Similarly, the task processing delay is
[0150] ;
[0151] wherein, is the number of CPU clock cycles allocated by the cloud server for task execution.
[0152] The task processing energy consumption is
[0153] ;
[0154] wherein, is the execution power of the migrated computing task on the cloud server;
[0155] Then the total delay of task unloaded to the local MEC server and then to the cloud server is:
[0156] ;
[0157] The task unloaded to the local MEC server and then to the cloud server has a total energy consumption of:
[0158] .
[0159] 4. Optimization Objectives of Task Offloading and Migration
[0160] The optimization objective of the present invention is to minimize the weighted cost of delay and energy consumption of tasks generated by all power IoT nodes. Then, for the tasks n generated by the power IoT node in time slot t the cost can be expressed as:
[0161] ;
[0162] wherein, is the task decision variable, and its value range is . When it means: the task is processed on the local MEC server; when it means: the task is migrated to the adjacent MEC server for processing; when it means: the task is offloaded to the cloud server for processing. is the weight variable used to balance the delay cost and the energy consumption cost, satisfying .
[0163] Then, the optimization problem of minimizing the cost can be described as the long-term weighted average cost of tasks of all power IoT nodes:
[0164] ;
[0165] s.t. 、 、 、 、 ;
[0166] wherein represents minimizing the weighted average cost of latency and energy consumption for all tasks. represents whether to cache the corresponding service on the MEC server to execute the task. represents that each task of the power IoT node selects an MEC server or a cloud server to process the computing task. represents the cache capacity limit of the local MEC server e, ensuring that the total data size of the cached content on the MEC server does not exceed its cache capacity. represents the constraint on the total available computing resources of the local MEC server e, that is, the resources allocated to all offloading tasks cannot exceed the total resources provided by the MEC server. represents that the execution time of the task cannot exceed the maximum delay limit.
[0167] In the power Internet of Things, the tasks generated by the device side are diverse and heterogeneous, which requires the MEC server to accurately predict and respond to the requirements of the device side. The traditional Federated Averaging (FedAvg) method cannot fully capture the specific characteristics of the device-side tasks, resulting in inaccurate model updates. Therefore, the present invention proposes an adaptive federated learning strategy to guide the cache global prediction model to update parameters, so as to better adapt to the dynamics and heterogeneity of the power Internet of Things. As Figure 3 shown, the framework of the adaptive federated learning strategy proposed by the present invention includes two main parts: the device side (power Internet of Things) and the global side (MEC server). On the device side of the power Internet of Things, first extract the key features of the tasks to be offloaded key features , then perform model training, and assign adaptive weights to each device side of the power Internet of Things for federated learning according to the importance of the task features. The device side uploads the trained model parameters and their adaptive weights to the MEC server. The global side updates the model using the weighted average method instead of the traditional federated average method based on the uploaded parameters and weights, and then the model is sent to all device sides for guiding the task offloading decision in the next stage. The device side continues to perform local training and task feature recognition based on the new global model, iteratively optimizing the model performance, and using the performance feedback to further adjust the adaptive weight allocation strategy and update frequency.
[0168] In some examples, step S3 specifically includes the following steps: S31: Determine the weight allocation strategy of the power Internet of Things terminal based on the relationship between the task features and the task offloading decision learned in the process of training the cache global prediction model at the power Internet of Things terminal:
[0169] ;
[0170] in, is the weight of the power Internet of Things, is the weight obtained by the power Internet of Things in the previous round of training, To update the scale parameters; S32: deploy a trained cache global prediction model (uploaded by the power Internet of Things terminal) on each MEC server, upload the model parameters and weights of the trained cache global prediction model to each MEC server, and each MEC server uses an adaptive weighted average method to update its own deployed cache global prediction model, and sends the updated cache global prediction model to the power Internet of Things terminal; the power Internet of Things terminal performs network training and task feature recognition on the updated cache global prediction model, and further adjusts the weight allocation and update frequency of each MEC server according to the network training and task feature recognition results, until the cache global prediction model deployed by each MEC server meets user needs:
[0171] The formula used by the adaptive weighted average method is:
[0172] ;
[0173] in, is the number of power IoT nodes connected to the local MEC server e, is the information entropy of the task features generated by the current power Internet of Things node and the task features generated by other power Internet of Things, and L is the number of layers of the cached global prediction model.
[0174] It should be noted that an initial weight is assigned to each task feature, and the weight is dynamically adjusted according to the impact of the task feature on the model performance. In the relevant formula of the weight allocation strategy, Related to the task characteristics of power IoT node n, The larger the value, the smaller the task difference between the power Internet of Things task and other power Internet of Things tasks, and the smaller the willingness to update.
[0175] In some examples, in step S33, when a predetermined change in the task characteristics is detected, the update frequency is increased to quickly adapt to the new task characteristics, otherwise the update frequency is reduced to reduce communication overhead.
[0176] It should be noted that the present invention dynamically adjusts the model update frequency according to the characteristic changes of the tasks at the power Internet of Things end and the improvement of the model performance.
[0177] In some instances, in step S33, the performance of the cached global prediction model at the power Internet of Things side is periodically evaluated, and the adaptive weight allocation strategy and update frequency are further adjusted according to the performance feedback.
[0178] Each MEC server has a limited cache capacity. The MEC servers can cooperate to predict the required cache for tasks, thereby reducing the cost of task processing. Therefore, the present invention proposes a task offloading and migration model based on discrete DDPG to minimize the weighted delay and energy consumption cost. As Figure 4 shown, first, a task offloading and migration model is constructed, the state, action, and reward functions are defined, and then the task offloading and migration model is trained and tested to minimize the global task processing cost. The power Internet of Things node n generates a task at time slot t The state includes: task characteristics, the cache of the affiliated MEC server, the bandwidth of the MEC server, the remaining resources of the MEC server, and channel gain information. The state of task execution , is the size of the generated task , is the number of CPU clock cycles required to process the task , is the deadline for completing the task , is the cache capacity required to process the task , and the action of task execution is: task processing decision and cache configuration decision, and which MEC server or cloud server the task is to be offloaded or migrated to and whether the MEC server configures the cache required by the task. The action , and the reward function for task completion is the negative value of the cost, defined as: , where is the penalty constant when the task is not completed.
[0179] In some embodiments, step S4 specifically includes the following steps: S41: Based on the task offloading and migration model of discrete DDPG, a DDPG neural network model is deployed at each MEC server side, and the state , action , and reward function are defined;
[0180] S42: Initialize the network parameters of the prediction network, the network parameters of the target network, and the capacity of the experience replay pool included in the DDPG neural network model;
[0181] S43: Reset the training environment of each MEC server to the z-th training environment, and set the status of each MEC server to , with the initial reward being 0;
[0182] S44: Select T time slots. At the t-th time slot, execute step S45;
[0183] S45: In the i-th MEC server, according to the initial state , initialize the Gaussian noise vector , and process each MEC server using the adaptive federated learning strategy to obtain the processing result;
[0184] S46: Make all MEC servers execute the action , and obtain the rewards corresponding to each MEC server ;
[0185] S47: Store the sample < , , , > into the experience replay buffer pool, and select the mini-batch training samples in the experience replay buffer pool as the training samples for the prediction network of the (i + 1)-th MEC server, which is the state for the next time slot (empty in the first round);
[0186] S48: Replace the i-th MEC server with the (i + 1)-th MEC server, repeat steps S45 - S47 to obtain the rewards of all MEC servers, and calculate the average reward of all MEC servers;
[0187] S49: Calculate the gradient of the discriminator of the prediction network, and use the Adam optimizer to update the network parameters of the prediction network backward; calculate the gradient of the generator of the prediction network, and use the Adam optimizer to update the network parameters of the prediction network backward;
[0188] S410: Soft-update the network parameters of the target network using the network parameters of the prediction network;
[0189] S411: Replace the t-th time slot with the (t + 1)-th time slot, repeat steps S44 - S410 until the calculation of T time slots is completed;
[0190] S412: Calculate the average reward of all time slots, and guide the adaptive federated learning strategy to adaptively allocate weights and update the cached global prediction model for each MEC server according to the average reward of all time slots;
[0191] S413: Replace the z-th training environment with the (z + 1)-th training environment, and repeat steps S43 - S412 until the calculations for all training environments are completed.
[0192] It should be noted that the formula for calculating the average reward of all power IoT devices is: . Each edge server is an intelligent agent for deep learning. By adopting the method of decentralized training and decentralized execution, the dimension of the action space can be greatly reduced, and the efficiency of deep learning can be improved.
[0193] As Figure 5 shown, assume that the number of mobile MEC servers is N = 3, and W = 8 power IoT terminals are scattered at a distance of 80 - 100 meters from each MEC server. And the mobile MEC servers are connected to the macro base station through fiber optic links. Set the initial task arrival probability of each power IoT terminal to 0.6. Set the time slot to t = 1 ms. In addition, set all powers to 2W, = 10 MHz, = 10 MHz. To balance the cost of latency and power consumption, set the adjustment coefficient to 0.5. That is to say, the latency cost is equal to the energy consumption cost. The proposed BiGRU neural network here consists of an input layer, 100 GRU units, two fully connected layers, and an output layer. The proposed discrete DDPG neural network here consists of an input layer, two fully connected layers, and an output layer. The partial hyperparameters of the DDPG neural network of the task offloading and migration model are set as follows: the number of neurons in the two hidden layers are set to 300 and 200 respectively, the learning rate is set to , , the total size of the buffer pool is 50000, that is, it can store 50000 samples. The maximum number of episodes for training is set to 1000, and the time slots for training in each episode are set to 100 respectively, and the mini-batch is set to 64. The frequency of copying the main network parameters to the target network is set to 2048, and the penalty for not being able to complete the task within the deadline . It can be clearly seen from Figure 3 that the convergence speed and performance of the proposed algorithm are significantly stronger than the comparison algorithm. This is because the present invention first predicts task characteristics based on the BiGRU network and updates parameters based on the adaptive federated learning strategy, rather than equally distributing the proportion of updated parameters like the traditional federated averaging method. This enables the edge side of the present invention to adaptively select the local model parameter update ratio according to task characteristics, which can improve the accuracy of cache placement at the MEC server side and thus improve the learning efficiency of the MEC server agent.
[0194] As Figure 6As shown, although the algorithm performance degrades as the number of power IoT terminals accessing the MEC server increases, the performance of the present invention remains optimal compared with the other two baseline algorithms. Moreover, based on the discrete DDPG neural network model, the optimal task offloading and migration strategies are obtained, which can minimize the weighted average cost.
[0195] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in the disclosure of the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution disclosed in the present invention can be achieved. No limitation is imposed herein.
[0196] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub - combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A cloud-edge collaborative perception power Internet of Things unloading strategy and resource allocation optimization method, characterized in that: The specific steps include: S1: Build a cache global prediction model based on BiGRU, set the model parameters of the cache global prediction model and the device parameters of the cloud-edge collaborative task offloading model. The cloud-edge collaborative task offloading model includes the power Internet of Things, cloud servers, and MEC servers. S2: Use the task characteristics of the power Internet of Things to train a cache global prediction model, and use the trained cache global prediction model to predict the task cache category of the power Internet of Things; Calculate the latency and power consumption of the power IoT computing tasks when they are offloaded to the local MEC server, migrated to the adjacent MEC server, and migrated to the cloud server. S3: Build an adaptive federated learning strategy, deploy a trained cached global prediction model on the MEC server, and use the adaptive federated learning strategy to adaptively assign weights to the MEC server and update the cached global prediction model; S31: Based on the relationship between the task characteristics and task offloading decisions learned in the process of training the cache global prediction model on the power Internet of Things end, determine the weight allocation strategy of the power Internet of Things end: ; in, is the weight of the power Internet of Things, is the weight obtained by the power Internet of Things in the previous round of training, To update the scale parameter; S32: deploy a trained cache global prediction model on each MEC server, upload the model parameters and weights of the trained cache global prediction model to each MEC server, and each MEC server updates its own deployed cache global prediction model using an adaptive weighted average method, and sends the updated cache global prediction model to the power Internet of Things terminal; the power Internet of Things terminal performs network training and task feature recognition on the updated cache global prediction model, and further adjusts the weight allocation and update frequency of each MEC server according to the network training and task feature recognition results, until the cache global prediction model deployed by each MEC server meets user needs: The formula used by the adaptive weighted average method is: ; in, is the number of power IoT nodes connected to the local MEC server e, is the information entropy of the task features generated by the current power Internet of Things node and the task features generated by other power Internet of Things, and L is the number of layers of the cached global prediction model; S4: Construct a task offloading and migration model based on discrete DDPG, train the task offloading and migration model using the processing results of the adaptive federated learning strategy, and determine the task offloading and migration strategy using the trained task offloading and migration model.
2. According to the cloud-edge collaborative perception power Internet of Things unloading strategy and resource allocation optimization method of claim 1, it is characterized by: Before step S1, a cloud-edge collaborative task offloading model is constructed. The execution methods of the computing tasks of the power Internet of Things include offloading to the local MEC server for execution, migrating from the local MEC server to the adjacent MEC server for execution, and migrating from the local MEC server to the cloud server for execution. The execution priority of the computing tasks of the power Internet of Things is from high to low: local MEC server, adjacent MEC server, and cloud server.
3. According to the cloud-edge collaborative perception power Internet of Things unloading strategy and resource allocation optimization method of claim 1, it is characterized by: In step S1, the power Internet of Things includes N nodes, the number of cloud servers is one, the number of MEC servers is E, and each MEC server covers Power IoT nodes, .
4. According to the cloud-edge collaborative perception power Internet of Things unloading strategy and resource allocation optimization method of claim 1, it is characterized by: In step S2, the BiGRU-based cache global prediction model includes an input layer, a BiGRU network, a first fully connected layer, and a second fully connected layer that are connected in sequence.
5. According to the cloud-edge collaborative perception power Internet of Things unloading strategy and resource allocation optimization method of claim 3, it is characterized by: In step S2, the steps of calculating the latency and power consumption of each power IoT computing task being offloaded to a local MEC server for execution, migrated to an adjacent MEC server for execution, and migrated to a cloud server for execution include: Divide the continuous time period T into time slots, let each time slot be t, , the tasks generated by each power IoT node n in time slot t : ; in, To generate tasks The size of To handle tasks The number of CPU clock cycles required, To complete the task The deadline, To handle tasks Required cache capacity; The latency and power consumption of offloading computing tasks to the local MEC server: ; ; in, For the task The latency of offloading to the local MEC server, For the task Energy consumption offloaded to the local MEC server, For the task The transmission time from the power IoT node n to the local MEC server e, For the task After offloading from the power IoT node n to the local MEC server e, the task processing time of the local MEC server e is For the task The energy consumption of task transmission offloaded to the local MEC server, For the task Task processing energy consumption offloaded to the local MEC server; The latency and power consumption of computing tasks migrated to adjacent MEC servers: ; ; in, For the task The latency of offloading to the local MEC server and then migrating to the adjacent MEC server, For the task The power consumption after offloading to the local MEC server and then migrating to the adjacent MEC server, For the task The migration time from the local MEC server to the adjacent MEC server, The latency required for adjacent MEC servers to process tasks, For the task Energy consumption of migration from the local MEC server to the neighboring MEC server, The energy consumption required to process tasks in adjacent MEC servers; The latency and power consumption of computing tasks migrated to cloud servers: ; ; in, For the task The latency of offloading to the local MEC server and then to the cloud server, For the task The power consumption of offloading to the local MEC server and then to the cloud server, is the transmission time of the task from the power IoT node n to the local MEC server e and then to the cloud server. is the task processing delay after the task is offloaded from the power IoT node n to the local MEC server e and then to the cloud server. is the transmission power consumption of the task after it is offloaded from the power IoT node n to the local MEC server e and then to the cloud server. It is the task processing energy consumption after offloading the task from the power IoT node n to the local MEC server e and then to the cloud server.
6. The cloud-edge collaborative perception power Internet of Things unloading strategy and resource allocation optimization method according to claim 1 is characterized by: Step S4 specifically includes the following steps: S41: Based on the discrete DDPG task offloading and migration model, a DDPG neural network model is deployed on each MEC server and the state is defined ,action And the reward function ; S42: Initialize the network parameters of the prediction network, the network parameters of the target network and the capacity of the experience replay pool contained in the DDPG neural network model; S43: Reset the training environment of each MEC server to the zth training environment, and set the status of each MEC server to , the initial reward is is 0; S44: Select T time slots, and execute step S45 in the tth time slot; S45: In the i-th MEC server, according to the initial state , initialize the Gaussian noise vector ; S46: Make all MEC servers perform actions , get rewards corresponding to each MEC server ; S47: Sample < , , , >Store to the experience replay buffer pool, and select the minimum batch training samples in the experience replay buffer pool as the training samples of the prediction network of the i+1th MEC server, is the state of the next time slot; S48: Replace the i-th MEC server with the i+1-th MEC server, repeat steps S45-S47, obtain rewards for all MEC servers, and calculate the average reward for all MEC servers; S49: Calculate the gradient of the discriminator of the prediction network and use the Adam optimizer to reversely update the network parameters of the prediction network ; Calculate the gradient of the generator of the prediction network and use the Adam optimizer to reversely update the network parameters of the prediction network ; S410: Soft-update the network parameters of the target network using the network parameters of the predicted network; S411: Replace the tth time slot with the t+1th time slot, and repeat steps S44-S410 until the calculation of T time slots is completed; S412: Calculate the average reward of all time slots, and guide the adaptive federated learning strategy to adaptively assign weights to each MEC server and update the cached global prediction model according to the average reward of all time slots; S413: Replace the zth training environment with the z+1th training environment, and repeat steps S43-S412 until the calculation of all training environments is completed.