A computational task offloading method based on deep reinforcement learning in power Internet of Things

Through deep reinforcement learning and double-delay deep deterministic policy gradient algorithm, the computing task offloading of drones in the power Internet of Things is optimized, which solves the problems of difficult computing task processing and limited drone resources in the power Internet of Things, and achieves a better Efficient task offloading and resource management.

CN114065963BInactive Publication Date: 2024-10-22HUBEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111297200.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-04
Publication Date
2024-10-22
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the power Internet of Things, due to the huge data, high heterogeneity and real-time demand-side management solutions that are sensitive to delays, computing tasks are difficult to process. The limited battery life and computing power of drones make it challenging to provide effective mobile edge computing services. .

Method used

Using a computing task offloading method based on deep reinforcement learning, the delay and energy consumption of drones serving the power Internet of Things are optimized by establishing a Markov model for patrol drone flight position following and a double-delay deep deterministic policy gradient algorithm. , to achieve the optimal strategy for task offloading.

Benefits of technology

It effectively solves the non-convexity problem of UAV computing task offloading in the power Internet of Things system, improves learning ability and generalization ability, achieves safer and more efficient computing task offloading, and reduces delay and energy consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FDA0004997942960000011
    Figure FDA0004997942960000011
  • Figure FDA0004997942960000012
    Figure FDA0004997942960000012
  • Figure FDA0004997942960000021
    Figure FDA0004997942960000021
Patent Text Reader

Abstract

The present invention discloses a computing task offloading method based on deep reinforcement learning in the electric power Internet of Things, aiming to minimize energy consumption and delay by jointly optimizing the position of drones, transmission power and task division variables. First, in view of the non-convexity of the computing task offloading problem, a Markov decision process is formulated by designing the state, action space and reward function. The reward function is based on the electric power Internet of Things system model for transmission line inspection, involving the interaction between collection equipment, inspection drones and edge servers, and describes the computing task offloading problem. On this basis, since the Markov model has a continuous action space, a double-delay deep deterministic policy gradient algorithm is proposed to obtain the optimal strategy for task offloading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of wireless communications, and in particular relates to a method for offloading computing tasks based on deep reinforcement learning in an electric power Internet of Things. Background Art

[0002] The power Internet of Things is the application of Internet of Things technology in smart grids, which can play a role in the power generation, transmission, transformation, distribution, and consumption of smart grids. The power Internet of Things integrates communication infrastructure resources with power infrastructure resources, and uses advanced information and communication technologies to achieve information exchange between interconnected devices, further improving the unified efficiency of the power system. Specifically, the power Internet of Things deploys different types of sensor devices (such as global positioning systems, cameras, infrared sensors, and radio frequency identification devices) and advanced metering infrastructure equipment in different geographical areas, so it can perceive the physical world, collect monitoring data for processing, and further make intelligent decisions on energy management solutions.

[0003] However, the data collected by the power Internet of Things is likely to be huge and highly heterogeneous, which places strict requirements on both communication and computing resources. In addition, some real-time demand-side management solutions are often sensitive to latency, which makes data processing tasks more difficult. Although the computing power of smart devices has been improved in recent years, it is still difficult to handle complex tasks under strict latency constraints. Fortunately, mobile edge computing is an ultra-low latency technology that enables data analysis near the data source. It pushes the frontier of services and data from a centralized cloud to the edge of a mobile network with computing and storage resources, and then uses cloud computing deployed at the edge of the mobile network to support resource-intensive and latency-sensitive applications.

[0004] However, when providing mobile edge computing services to devices in the power Internet of Things, a dedicated wireless connection is required between the edge server and the power Internet of Things devices, but this wireless communication is difficult to provide effective mobile edge computing services to the power Internet of Things devices due to signal congestion and shadow obstruction. To this end, drones are deployed as small edge clouds with embedded computing modules. In the power Internet of Things system, the power Internet of Things devices need to process the generated data quickly, but their communication, computing and storage resources are very limited. Therefore, drones use their own computing modules to provide computing services to the power Internet of Things devices. However, considering the limited battery life and computing power of drones, it is necessary to design efficient computing task offloading methods. Summary of the invention

[0005] In order to overcome the non-convexity of the existing computing task offloading problem, the purpose of the present invention is to propose a method based on deep reinforcement learning to optimize the delay and energy consumption of drones serving the power Internet of Things.

[0006] In order to achieve the above object, the technical solution adopted by the present invention is: a computing task offloading method based on deep reinforcement learning in the power Internet of Things, the method comprising the following steps:

[0007] Step 1: Establish a Markov model for the inspection drone’s flight position following the deep reinforcement learning algorithm:

[0008] The five-tuple (S, A, O, R, γ) of the Markov decision process MDP is modeled, where S is the input state set of the inspection drone, A is the output action set of the inspection drone, O is the state transition probability function, R is the reward function, and γ is the discount coefficient;

[0009] Step 1.1, define the input state set S of the inspection drone, and determine the input state s of the inspection drone at each time slot t t =[u t h t ],u t represents the horizontal coordinate of the inspection drone at time slot t, h t is the height of the inspection drone at time slot t; s t Belongs to the input state set S;

[0010] Step 1.2, define the output action set A of the inspection drone, A represents the set of all actions that the inspection drone can take based on its own input state after receiving the following external feedback values: When the inspection drone flies out of the inspection area of ​​the transmission line, it will select a random direction angle Φ t Fly back; when the inspection drone flies at a height of h t When the altitude exceeds the range, it will remain at the minimum altitude H min or maximum height H max Once the inspection drone covers all the collection devices, the inspection drone remains stationary and is ready to adjust the transmission power; when the task division variable When the inspection drone will execute Operation to obtain the task division variable β again nm t ; The output action a of the inspection drone in each time slot t t Includes: t , Φ t , Δh t 、p t , β nm t ;

[0011] Among them, l t ∈{0,l1} represents the horizontal distance that the inspection UAV is currently flying in time slot t, l1 represents the maximum horizontal distance that the inspection UAV flies in each time slot t; Φ t∈{0,2π} represents the direction angle of the inspection drone at time slot t; Δh t =(h t -h t-1 )∈{-l2,l2} represents the vertical moving distance of the inspection drone in time slot t, h t and h t-1 represents the height of the inspection UAV at time slot t and the previous time slot respectively, l2 represents the maximum vertical distance of the inspection UAV in each time slot t; p t ∈{0,P} represents the transmission power of the inspection UAV at time slot t, and P represents the maximum transmission power of the inspection UAV; β nm t represents the proportion of fault identification and foreign object detection tasks received from the nth acquisition device processed on the mth edge server, that is, the task division variable {β nm t |n∈N,m∈M}, N and M represent the set of collection devices and edge servers in the system respectively;

[0012] Step 1.3, define the inspection drone to enter state s at the current time slot t t , and the action amount is a t Under the condition of t+1 The probability of is the state transition probability function O;

[0013] Step 1.4, define the reward function R, which represents the input state s of the inspection drone at the current time slot t t Next, select an action a t After that, the instantaneous feedback is obtained. When when When

[0014] Among them, the horizontal angle of the inspection drone is Φ t and height h t Determines the radius R of the coverage of the acquisition equipment t , If the distance between the inspection drone and the collection device is less than the coverage radius, it means that the collection device is covered by the inspection drone. N' is the number of collection devices within the coverage range, ξ1 is the penalty coefficient related to the coverage degree, ξ n 2. The limit is exceeded when dividing the fault identification and foreign body detection tasks on the nth acquisition device. The penalty coefficient when nm t and β n0 tis the proportion of tasks received from the nth collection device in time slot t that are processed on the mth edge server and the inspection drone respectively, T t n is the total service delay of the nth acquisition device in time slot t, E t n is the task arrival rate λ of the nth acquisition device in time slot t n The total energy consumption of the inspection drone at that time;

[0015] T 1 n,t is the uplink transmission delay from the nth collection device to the inspection drone in time slot t, D n is the amount of input data when all tasks of the nth collection device have been offloaded to the inspection drone, v n t is the uplink transmission data rate, α n t is the uplink channel gain from the nth collection device to the inspection drone, W n and p n They represent the bandwidth and transmission power allocated to the nth acquisition device respectively. represents the noise power of the inspection UAV; E 1 n,t is the uplink transmission energy consumption in time slot t, E 1 n,t = p T 1 n,t ;

[0016] T 2 n,t is the delay of the inspection drone calculating the task received from the nth acquisition device in time slot t. C n is the number of CPU cycles required to process the unit task data volume, f n is the computing resource allocated by the inspection drone to the nth collection device, {β t n0 ∈[0,1],n∈N}; E 2 n,t is the energy consumption of the inspection drone in time slot t, E 2 n,t =κ(f n ) 3 T 2 n,t , κ is the effective switching capacitor, and the energy consumption of the central processor in the inspection drone is modeled as κ(f n ) 3;

[0017] T 1 nm,t is the downlink transmission delay in time slot t, v m t is the downlink transmission data rate, W m represents the bandwidth allocated to the mth edge server, α m t is the downlink channel gain from the inspection drone to the mth edge server in time slot t, p t represents the transmission power of the inspection drone in time slot t, {β nm t ∈[0,1],n∈N,m∈M};E 1 nm,t is the downlink transmission energy consumption, E 1 nm,t =p t T 1 nm,t ;

[0018] T 2 nm,t is the computation delay of the mth edge server in time slot t, f nm is the computing resource allocated by the mth edge server to the nth collection device in time slot t;

[0019] Step 1.5, define γ∈(0,1) as the discount coefficient, which is used to calculate the cumulative value of returns in the whole process. The closer the discount coefficient is to 1, the more emphasis is placed on long-term returns;

[0020] Step 1.6: In a limited period T, learn the best strategy to obtain the maximum expected long-term return: where r t′ is the reward function at time slot t′, and the state s t Corresponding action a t The expected reward under the state-action value function Q(s t , a t )=E[G t |s t ,a t ], where E[] is the expectation operator;

[0021] Step 2: Based on the Markov decision quintuple (S, A, O, R, γ) modeled in step 1, the double-delayed deep deterministic policy gradient (TD3) algorithm is used to implement the UAV action training. The steps are as follows:

[0022] Step 2.1, using two independent neural networks: 2 Actor networks and 4 Critic networks. The Actor network includes a Current-Actor network with parameter ω and a Target-Actor network with parameter ω'; the Critic network includes 2 Current-Critic networks with parameters θ1 and θ2 and 2 Target-Critic networks with parameters θ1' and θ2'. The experience replay memory F, the parameters of the Current-Actor network and the Current-Critic network are randomly initialized, and ω' = ω, θ1' = θ1, and θ2' = θ2 are set.

[0023] Step 2.2, set the maximum number of training rounds EP, set T time slots for each round, and initialize the number of training rounds ep = 1;

[0024] Step 2.3, initialize T = 0, time slot t = 0, and initialize the input state s0 of the inspection drone;

[0025] Step 2.4: The inspection drone observes the input status s of the current power IoT system t , and according to the strategy function π of the initial Current-Actor network ω (s t ) takes action, adds Gaussian noise σ to disturb the action, and obtains action a t =π ω (s t )+σ;

[0026] Step 2.5, in the input state s t Next, perform action a t , get the instantaneous feedback, and calculate the current reward function r of the inspection drone according to step 1.4 t , use steps 1.1 to 1.2 to get the next input state s again t+1 , the experience bar (s t , a t , r t ,s t+1 ) is stored in the experience playback memory F, the experience bars in the experience playback memory F are stored in sequence, and when the number of experience bars reaches the capacity of the experience playback memory F, new records are stored from the beginning, forming a cycle;

[0027] Step 2.6, randomly extract mini-batch samples from the experience replay memory F and input them into the Actor and Critic networks. The i-th mini-batch sample (s i , a i , r i ,s i+1) indicates that the inspection drone is in state s i When taking action a i , and gave a reward of r i , and transform the environment to the next state s i+1 , where mini-batch refers to randomly selecting small batches of data in the training data;

[0028] Step 2.7, s i As the input of the Current-Actor network, the updated Current-Actor network is updated according to s i Calculate the new action a i ,(s i , a i ) as the input of the two Current-Critic networks. The Current-Critic network uses the input s i and a i Calculate separately and s i+1 As the input of the Target-Actor network and the two Target-Critic networks, the updated Target-Actor network is updated according to s i+1 Calculate the new action a i+1 , then add noise, and use the target policy smoothing regularization method to calculate the noisy target action; As the input of the two Target-Critic networks, the Target-Critic network is based on the input s i+1 and Calculate and Pick and The smaller value of y is used to calculate the target value y i ; Finally, use the target value y i Update the parameters θ1 and θ2 of the two Current-Critic networks by minimizing the mean square Bellman error loss function;

[0029] Step 2.8, update the Current-Actor network parameter ω through the deterministic policy gradient algorithm;

[0030] Step 2.9: To stabilize the training process, the soft update method is used to further update the parameters of the Target-Actor and the parameters of the two Target-Critics θ1′ and θ2′, thereby stabilizing the training process.

[0031] Step 3: Train the model using the following steps:

[0032] Step 3.1, if the inspection UAV covers all the acquisition devices and the task division variable does not exceed its limit, then go to Step 3.2; otherwise, let t be incremented by 1, and determine t. If t < T, then jump to Step 2.4; if t ≥ T, enter Step 3.2;

[0033] Step 3.2, let the number of training epochs ep be incremented by 1, and determine ep. If ep < EP, then jump to Step 2.3; otherwise, when ep ≥ EP, enter Step 3.3;

[0034] Step 3.3, the iteration is completed, terminate the neural network training process, and save the current Target-Actor network data and Target-Actor network data. Load the saved data into the inspection UAV system, so as to execute the flight action to complete the optimization of the delay and energy consumption of the UAV service for the power Internet of Things.

[0035] Furthermore, in Step 2.7, calculate the noisy target action where the noise component is the noise component clipped by the constant c from a normal distribution with mean zero and variance ε′, and π ω′ (s i+1 ) is the policy function of the Target-Actor network with parameter ω′ at the next state s i+1 ;

[0036] The target value y i : where r i is the reward function and γ is the discount factor;

[0037] Minimize the mean squared Bellman error loss function to update the parameters θ1 and of the two Current-Critic networks, where L(θ j ) is the mean squared Bellman error loss function, M is the number of randomly selected small batches of samples, and

[0038] are the state-action value functions of the two Current-Critic networks with parameters θ1 and θ2. where represents the policy gradient under the parameters ω of the Current-Actor network, M is the number of randomly selected small batches of samples, and are the gradients of the state-action value function of the Current-Critic network with parameter θ1 and the policy function gradient of the Current-Actor network with parameter ω respectively, and π ω (si ) indicates the input state s in the Current-Actor network i The action strategy selected when Indicates the input state s i When taking action a = π ω (s i )’s Current-Critic network state-behavior value function.

[0039] Furthermore, in step 2.9, the parameter ω′ of the Target-Actor is updated: ω′←μω+(1-μ)ω′, and the parameters θ1′ and θ2′ of the two Target-Critics are updated: θ1′←μθ1+(1-μ)θ1′, θ2′←μθ2+(1-μ)θ2′, where μ represents the update proportional coefficient.

[0040] Beneficial effects of the present invention:

[0041] (1) The power Internet of Things computing task offloading model for actual power transmission line inspection established by the method of the present invention is complete. Since the model environment is unknown, through the continuous interaction between the inspection drone and the system environment, autonomous learning enables the inspection drone to find the optimal target strategy for computing task offloading, which has high practical application value.

[0042] (2) The double-delay deep deterministic policy gradient (TD3) algorithm used in the method of the present invention effectively solves the problem of continuous control of inspection drones. Through the Target-Actor and Target-Critic network, it effectively solves the problem of the state-action function value of the inspection drone being continuously overestimated, making the training of the inspection drone more stable, thereby finding a better unloading strategy.

[0043] (3) The method of the present invention combines reinforcement learning with deep neural networks, which improves the learning and generalization capabilities of the inspection drone, avoids the tediousness and roughness of manually operating the inspection drone to offload computing tasks in an uncertain environment, and enables the inspection drone to complete the computing task offloading more safely and efficiently. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is the overall framework diagram of the computing task offloading method based on TD3 in the power Internet of Things;

[0045] Figure 2 It is a flow chart of the computational task offloading algorithm based on TD3 in the power Internet of Things. DETAILED DESCRIPTION

[0046] In order to facilitate those skilled in the art to understand and implement the present invention, the present invention is further described in detail below in conjunction with embodiments. It should be understood that the implementation examples described herein are only used to illustrate and explain the present invention and are not used to limit the present invention.

[0047] Firstly, a power Internet of Things system model for transmission line inspection is established, which involves the interaction between acquisition equipment, inspection drones and edge servers, and describes the problem of computing task offloading. Secondly, in view of the non-convexity of the problem of computing task offloading, this paper proposes a method based on deep reinforcement learning, and formulates a Markov decision process by designing the state, action space and reward function. On this basis, since the Markov model has a continuous action space, a double-delay deep deterministic policy gradient algorithm is proposed to obtain the optimal strategy for task offloading.

[0048] The optimal strategy is to jointly optimize the position q of the inspection drone t , task division variable β nm t and β n0 t And the transmission power p t , so that the total service delay of all collection devices and the total energy consumption of the inspection drone are minimized, that is:

[0049]

[0050] Assume that the position of the inspection drone at time slot t is represented by q t =(u t ,h t ), where u t is the horizontal coordinate of the inspection drone, h t ∈[H min , H max ] is the height of the inspection drone, H min and H max are the minimum vertical distance and maximum vertical distance of the inspection drone, respectively. The maximum horizontal distance and maximum vertical distance of the inspection drone in each time slot t are l1 and l2 respectively. Among them, N and M represent the collection devices and edge servers, T t n represents the total service delay of the nth acquisition device in time slot t, E t n represents the total energy consumption of the inspection drone when unloading and calculating the tasks on the nth collection device in time slot t, P is the maximum transmission power of the inspection drone, represents the Euclidean norm of the vector, u t+1 represents the horizontal coordinate of the inspection drone in the next time slot, h t+1represents the vertical coordinate of the inspection drone in the next time slot. Based on the above analysis and description of the task offloading problems such as fault identification and foreign object detection in transmission line inspection, it can be seen that the problem has strong non-convexity and combinatoriality, so it is difficult to find a global optimal solution. In addition, since the information and channel conditions of the acquisition equipment in the power Internet of Things system for transmission line inspection are not easy to obtain, the traditional optimization strategy will be more challenging.

[0051] A method for offloading computing tasks based on deep reinforcement learning in an electric power Internet of Things comprises the following steps:

[0052] Step 1: Establish a Markov model for the inspection drone’s flight position following the deep reinforcement learning algorithm:

[0053] The five-tuple (s, A, O, R, γ) of the Markov decision process MDP is modeled, where s is the input state of the inspection drone, A is the output action set of the inspection drone, O is the state transition probability function, R is the reward function, and γ is the discount coefficient; s t Belongs to the input state set S;

[0054] Step 1.1, determine the input state s of the inspection drone at each time slot t t =[u t h t ],u t represents the horizontal coordinate of the inspection drone at time slot t, h t is the height of the inspection drone at time slot t;

[0055] Step 1.2, define the output action set A of the inspection drone, A represents the set of all actions that the inspection drone can take based on its own input state after receiving the following external feedback values: When the inspection drone flies out of the inspection area of ​​the transmission line, it will select a random direction angle Φ t Fly back; when the inspection drone flies at a height of h t When the altitude exceeds the range, it will remain at the minimum altitude H min or maximum height H max Once the inspection drone covers all the collection devices, the inspection drone remains stationary and is ready to adjust the transmission power; when the task division variable When the inspection drone will execute Operation to obtain the task division variable β again nm t ; The output action a of the inspection drone in each time slot t t Includes: t , Φ t , Δh t 、p t , β nmt ;

[0056] Among them, l t ∈{0,l1} represents the horizontal distance that the inspection UAV is currently flying in time slot t, l1 represents the maximum horizontal distance that the inspection UAV flies in each time slot t; Φ t ∈{0,2π} represents the direction angle of the inspection drone at time slot t; Δh t =(h t -h t+1 )∈{-l2,l2} represents the vertical moving distance of the inspection drone in time slot t, h t and h t+1 represents the height of the inspection drone at time slot t and the next time slot, respectively; l2 represents the maximum vertical distance the inspection drone flies in each time slot t; p t ∈{0,P} represents the transmission power of the inspection UAV at time slot t, and P represents the maximum transmission power of the inspection UAV; β nm t represents the proportion of fault identification and foreign object detection tasks received from the nth acquisition device processed on the mth edge server, that is, the task division variable {β nm t |n∈N,m∈M}, N and M represent the set of collection devices and edge servers in the system respectively;

[0057] Step 1.3, define the inspection drone to enter state s at the current time slot t t , and the action amount is a t Under the condition of t+1 The probability of is the state transition probability function O;

[0058] Step 1.4, define the reward function R, which represents the input state s of the inspection drone at the current time slot t t Next, select an action a t After that, the instantaneous feedback is obtained. When when When

[0059] Among them, the horizontal angle of the inspection drone is Φ t and height h t Determines the radius R of the coverage of the acquisition equipment t , If the horizontal position of the inspection drone is s t =[u t h t] is less than the coverage radius, it means that the collection device is covered by the inspection drone. The horizontal coordinate of the collection device is a fixed value known quantity. N' is the number of collection devices covered by the inspection drone. ξ1 is the penalty coefficient related to the coverage degree. n 2. The limit is exceeded when dividing the fault identification and foreign body detection tasks on the nth acquisition device. The penalty coefficient, β nm t , β n0 t ,T t n ,E t n , according to the power Internet of Things system model; β nm t and β n0 t is the proportion of tasks received from the nth collection device in time slot t that are processed on the mth edge server and the inspection drone respectively, T t n is the total service delay of the nth acquisition device in time slot t, E t n is the task arrival rate λ of the nth acquisition device in time slot t n The total energy consumption of the inspection drone at that time; A. Power Internet of Things system model

[0060] The power Internet of Things system for transmission line inspection includes 1 inspection drone, N information collection devices such as micro-weather stations, sensors, and high-definition cameras, and M edge servers. The collection devices and edge servers are denoted as N and M, respectively. After the inspection drone receives computing tasks such as fault identification and foreign object detection from the collection device through the uplink communication link, it assigns part or all of the tasks to the edge server through the downlink communication link.

[0061] 1) Uplink transmission delay and energy consumption:

[0062] Assume that the broadband frequency division multiple access protocol is shared between the acquisition devices when tasks such as fault identification and foreign object detection are offloaded. According to Shannon's law, in time slot t, considering the uplink channel gain α from the nth acquisition device to the inspection drone n t , then the uplink transmission data rate can be obtained as:

[0063]

[0064] Where W n and p nThey represent the bandwidth and transmission power allocated to the nth acquisition device respectively. represents the noise power of the inspection drone. Therefore, considering that all tasks of the nth acquisition device have been offloaded to the inspection drone, the input data volume D n , then the uplink transmission delay in time slot t is Considering the received power p of the inspection drone, the uplink transmission energy consumption in time slot t is E 1 n,t = p T 1 n,t .

[0065] 2) Computational latency and energy consumption of inspection drones:

[0066] After receiving tasks such as fault identification and foreign object detection from the collection equipment, the inspection drone will decide whether to assign the task to itself for processing or offload it to the edge server for processing. n0 t ∈[0,1], n∈N} represents the proportion of tasks received from the nth collection device in time slot t that are processed on the inspection drone, where N represents the set of collection devices in the system. Therefore, considering the number of CPU cycles C required to process the unit task data volume n and the computing resources f allocated by the inspection drone to the nth collection device n , the computational delay of the inspection drone in time slot t is Where D n represents the amount of task input data of the nth collection device. In addition, considering that the energy consumption of the central processor in the inspection drone is modeled as κ(f n ) 3 , where κ is the effective switching capacitance, the energy consumption of the inspection drone in time slot t can be obtained as E 2 n,t =κ(f n ) 3 T 2 n,t .

[0067] 3) Downlink transmission delay and energy consumption:

[0068] For simplicity, it is assumed that the noise power of the inspection drone and the edge server is the same. In time slot t, considering the downlink channel gain α from the inspection drone to the mth edge server m t , then the downlink transmission data rate is:

[0069]

[0070] Where W m and denote the bandwidth allocated to the mth edge server and the noise power of the edge server, respectively, and p t represents the transmission power of the inspection drone in time slot t. Since the edge server has more communication, computing, and storage resources than the inspection drone, the inspection drone is more likely to offload tasks such as fault identification and foreign object detection to the edge server for processing, thereby reducing system latency. Considering the proportion of tasks received from the nth acquisition device in time slot t that are processed on the mth edge server {β nm t ∈[0,1], n∈N, m∈M}, where N and M represent the collection devices and edge servers in the system respectively, then the downlink transmission delay is Among them, D n represents the task input data volume of the nth collection device. In addition, in time slot t, considering the transmission power p of the inspection drone t , then the downlink transmission energy consumption is E 1 nm,t =p t T 1 nm,t .

[0071] 4) Computation delay on edge server:

[0072] The edge server will start the calculation process only after receiving all the task data such as fault identification and foreign object detection unloaded by the inspection drone. Therefore, in time slot t, considering the computing resources f allocated by the mth edge server to the nth acquisition device nm , then the computation delay of the mth edge server is Among them C n It represents the number of CPU cycles required to process the unit task data volume, D n represents the task input data volume of the nth acquisition device, β nm t It represents the proportion of tasks received from the nth collection device in time slot t that are processed on the mth edge server.

[0073] 5) System total service delay and energy consumption:

[0074] Assume that the inspection drone can only start processing tasks such as fault identification and foreign object detection after the uplink communication channel completes the data transmission. In general, considering that the communication and computing modules on the drone are separated, the inspection drone can offload tasks to the edge server through the downlink communication channel while performing local task calculations. In addition, the edge server can only start task processing after all data transmission is completed. Therefore, in time slot t, the total service delay of the nth acquisition device is:

[0075]

[0076] Among them, T 1 n,t is the uplink transmission delay from the nth collection device to the inspection drone in time slot t, T 2 n,t is the delay of the inspection drone calculating the task received from the nth acquisition device in time slot t, T 1 nm,t is the downlink transmission delay from the inspection drone to the mth edge server in time slot t, T 2 nm,t The computation delay of the mth edge server in time slot t, where M represents the set of edge servers in the system.

[0077] In addition, within time slot t, considering the task arrival rate λ of the nth acquisition device n , then the total energy consumption of the inspection drone is:

[0078]

[0079] Where E 1 n,t is the uplink transmission energy consumption of the inspection UAV receiving the task from the nth collection device in time slot t, E 2 n,t is the energy consumption of the inspection drone in time slot t for tasks such as fault identification and foreign object detection of the nth acquisition device, E 1 nm,t is the downlink transmission energy consumption when the inspection UAV offloads tasks to the mth edge server in time slot t.

[0080] Considering that the network information in the communication process of the power Internet of Things system for transmission line inspection is unknown, the policy optimization based on the Markov model cannot adopt the traditional iterative method. In deep reinforcement learning, the inspection drone only needs to optimize one action through state information, and does not need complete environmental information. Considering that the state and action space in the context of task offloading such as fault identification and foreign object detection are continuous, and the value function will be continuously overestimated in the training of the deep deterministic policy gradient algorithm, the double-delayed deep deterministic policy gradient (TD3) algorithm is adopted, which also combines the policy function-based (Actor network) and the behavior value function-based (Critic network).

[0081] Step 1.5, define γ∈(0,1) as the discount coefficient, which is used to calculate the cumulative value of returns in the whole process. The closer the discount coefficient is to 1, the more emphasis is placed on long-term returns;

[0082] Step 1.6: In a limited period T, learn the best strategy to obtain the maximum expected long-term return: where r t′ is the reward function at time slot t′, and the state s t Corresponding action a t The expected reward under the state-action value function Q(s t , a t )=E[G t |s t ,a t ], where E[] is the expectation operator.

[0083] The TD3 architecture consists of the Current-Network and the Target-Network. The Current-Network includes the Current-Actor network and the Current-Critic network: The Current-Actor network with parameter ω will be used to select the action strategy function π ω (s t ) is passed to the Current-Critic network, which is used to estimate the state-value function and The Current-Critic network contains two Current-Critic networks with the same structure but whose parameters θ1 and θ2 are initialized and trained independently. They are used to calculate the Q value according to the input state and the selected action, and update the Current-Actor network based on the deterministic policy gradient. Since the Current-Network will constantly overestimate the Q value, resulting in unstable network training, TD3 uses the Target-Network to slowly track the updates of the Current-Actor and Current-Critic networks. The Target-Network contains a Target-Actor network with a parameter of ω′ and two Target-Critic networks with parameters of θ1′ and θ2′. The Target-Actor network passes the policy function to the Target-Critic network, which is used to estimate the state-value function; the Target-Critic network contains two Target-Critic networks with the same structure but whose parameters are initialized and trained independently. They are used to calculate the Q value according to the input state and the selected action, calculate the target value based on the smaller Q value, and then update the Current-Critic network.

[0084] Step 2: Based on the Markov decision quintuple (S, A, O, R, γ) modeled in step 1, the double-delayed deep deterministic policy gradient (TD3) algorithm is used to implement the UAV action training. The steps are as follows:

[0085] Step 2.1, using 2 Actor networks and 4 Critic networks, the Actor network includes a Current-Actor network with parameter ω and a Target-Actor network with parameter ω'; the Critic network includes 2 Current-Critic networks with parameters θ1 and θ2 and 2 Target-Critic networks with parameters θ1' and θ2', and randomly initialize the experience replay memory F, the parameters of the Current-Actor network and the Current-Critic network, setting ω' = ω, θ1' = θ1, θ2' = θ2;

[0086] Step 2.2, set the maximum number of training rounds EP, set T time slots for each round, and initialize the number of training rounds ep = 1;

[0087] Step 2.3, initialize T = 0, time slot t = 0, and initialize the input state s0 of the inspection drone;

[0088] Step 2.4: The inspection drone observes the input status s of the current power IoT system t , and according to the strategy function π of the initial Current-Actor network ω (s t ) takes action, adds Gaussian noise σ to disturb the action, and obtains action a t =π ω (s t )+σ; strategy function π ω (s t ) is the inspection drone’s decision in the input state s t Take output action a t way;

[0089] Step 2.5, in the input state s t Next, perform action a t , get the instantaneous feedback, and calculate the current reward function r of the inspection drone according to step 1.4 t , use steps 1.1 to 1.2 to get the next input state s again t+1 , the experience bar (s t , a t , r t ,s t+1 ) is stored in the experience playback memory F, the experience bars in the experience playback memory F are stored in sequence, and when the number of experience bars reaches the capacity of the experience playback memory F, new records are stored from the beginning, forming a cycle;

[0090] Steps 2.2 to 2.5 are the strategy exploration phase. The offline device environment is used as the training environment. The Current-Actor network observes the input state s at time slot t. t And as input, output recommended action a t , inspection drone selects a t , the state is determined by s t Transformed into t+1 , and give reward feedback r t , the Current-Actor network is based on the new state s t+1 A new recommended action is generated, and the strategy exploration is repeated in this way. The experience records of the strategy exploration are stored as experience in the experience playback storage F.

[0091] The network update phase is as follows: the Current-Actor network no longer needs to interact with the user environment, but instead samples from the experience replay storage F for experience replay.

[0092] Step 2.6, randomly extract mini-batch samples from the experience replay memory F and input them into the Actor and Critic networks. The i-th mini-batch sample (s i , a i , r i ,s i+1 ) indicates that the inspection drone is in state s i When taking action a i , and gave a reward of r i , and transform the environment to the next state s i+1 , where mini-batch refers to randomly selecting small batches of data in the training data;

[0093] Step 2.7, s i As the input of the Current-Actor network, the updated Current-Actor network is updated according to s i Calculate the new action a i ,(s i , a i ) as the input of the two Current-Critic networks. The Current-Critic network uses the input s i and a i Calculate and s i+1 As the input of the Target-Actor network and the two Target-Critic networks, the updated Target-Actor network is updated according to s i+1 Calculate the new action a i+1, followed by adding noise, and using the target policy smoothing regularization method to calculate the noisy target action The noise component is the noise component clipped by a constant c in a normal distribution with a mean of zero and a variance of ε′, π ω′ (s i+1 ) is the Target-Actor network with parameter ω′ in the next state s i+1 The policy function under As the input of the two Target-Critic networks, the Target-Critic network is based on the input S i+1 and Calculate and Pick and The smaller value of y is used to calculate the target value y i : where r i is the reward function, γ is the discount factor; finally, using the target value y i Update the parameters θ1 and θ2 of the two Current-Critic networks by minimizing the mean square Bellman error loss function. Where L(θj ) is the mean square Bellman error loss function, M is the number of randomly selected mini-batch samples, is the state-behavior value function of the Current-Critic network with two parameters θ1 and θ2;

[0094] Step 2.8, update the Current-Actor network parameter ω through the deterministic policy gradient algorithm: in represents the policy gradient under the Current-Actor network parameter ω, M is the number of randomly selected mini-batch samples, and They are the state-behavior value function gradient of the Current-Critic network with parameter θ1 and the policy function gradient of the Current-Actor network with parameter ω, π ω (s i ) indicates the input state s in the Current-Actor network i The action strategy selected when Indicates the input state s i When taking action a = π ω (s i )’s Current-Critic network state-behavior value function;

[0095] Step 2.9, to stabilize the training process, the parameters ω′ of the Target - Actor are further updated using the soft - update method: ω′←μω+(1 - μ)ω′, and the parameters θ1′ and θ2′ of the two Target - Critics: θ1′←μθ1+(1 - μ)θ1′, θ2′←μθ2+(1 - μ)θ2′, where μ represents the update ratio coefficient.

[0096] TD3 reduces the update frequency of the Current - Actor network and the Target - Network. The Current - Actor network and the Target - Network are updated only once every d updates of the Current - Critic network.

[0097] Step 3, the model is trained using the following steps:

[0098] Step 3.1, if the inspection UAV covers all the acquisition devices and the task division variable does not exceed its limit, then go to Step 3.2; otherwise, increment t by 1 and determine t. If t < T, jump to Step 2.4; if t≥T, go to Step 3.2.

[0099] Step 3.2, increment the training episode number ep by 1 and determine ep. If ep < EP, jump to Step 2.3; otherwise, when ep≥EP, go to Step 3.3.

[0100] Step 3.3, the iteration is completed, the neural network training process is terminated, and the current Target - Actor network data and Target - Actor network data are saved. The saved data is loaded into the inspection UAV system to perform flight actions to complete the optimization of the delay and energy consumption of the UAV - served power IoT.

Claims

1. A computing task offloading method based on deep reinforcement learning in power Internet of Things, characterized in that: It includes the following steps: Step 1, establish a Markov model of the patrol UAV flight position following the deep reinforcement learning algorithm: Model the five-tuple (S, A, O, R, γ) of the Markov decision process MDP, where S is the input state set of the patrol UAV, A is the output action set of the patrol UAV, O is the state transition probability function, R is the reward function, and γ is the discount factor; Step 1.1, define the input state set S of the inspection drone, and determine the input state s of the inspection drone at each time slot t t =[u t h t ],u t represents the horizontal coordinate of the inspection drone at time slot t, h t is the height of the inspection drone at time slot t; s t Belongs to the input state set S; Step 1.2, define the output action set A of the inspection drone, A represents the set of all actions that the inspection drone can take based on its own input state after receiving the following external feedback values: When the inspection drone flies out of the inspection area of ​​the transmission line, it will select a random direction angle Φ t Fly back; when the inspection drone flies at a height of h t When the altitude exceeds the range, it will remain at the minimum altitude H min or maximum height H max Once the inspection drone covers all the collection devices, the inspection drone remains stationary and is ready to adjust the transmission power; when the task division variable When the inspection drone will execute Operation to obtain the task division variable β again nm t ; Patrol The output action a of the drone at each time slot t t Includes: t , Φ t , Δh t 、p t , β nm t ; Among them, l t ∈{0,l1} represents the horizontal distance that the inspection UAV is currently flying in time slot t, l1 represents the maximum horizontal distance that the inspection UAV flies in each time slot t; Φ t ∈{0,2π} represents the direction angle of the inspection drone at time slot t; Δh t =(h t -h t-1 )∈{-l2,l2} represents the vertical moving distance of the inspection drone in time slot t, h t and h t-1 represents the height of the inspection drone at time slot t and the previous time slot, respectively; l2 represents the maximum vertical distance that the inspection drone flies in each time slot t; p t ∈{0,P} represents the transmission power of the inspection UAV at time slot t, and P represents the maximum transmission power of the inspection UAV; β nm t represents the proportion of fault identification and foreign object detection tasks received from the nth acquisition device processed on the mth edge server, that is, the task division variable {β nm t |n∈N,m∈M}, N and M represent the set of collection devices and edge servers in the system respectively; Step 1.3, define the inspection drone to enter state s at the current time slot t t , and the action amount is a t Under the condition of t+1 The probability of is the state transition probability function O; Step 1.4, define the reward function R, which represents the input state s of the inspection drone at the current time slot t t Next, select an action a t After that, the instantaneous feedback is obtained. When when When Among them, the horizontal angle of the inspection drone is Φ t and height h t Determines the radius of coverage of the collection equipment If the distance between the inspection drone and the collection device is less than the coverage radius, it means that the collection device is covered by the inspection drone. N' is the number of collection devices within the coverage range, ξ1 is the penalty coefficient related to the coverage degree, ξ n 2. The limit is exceeded when dividing the fault identification and foreign body detection tasks on the nth acquisition device. The penalty coefficient when nm t and β n0 t is the proportion of tasks received from the nth collection device in time slot t that are processed on the mth edge server and the inspection drone respectively, T t n is the total service delay of the nth acquisition device in time slot t, E t n is the task arrival rate λ of the nth acquisition device in time slot t n The total energy consumption of the inspection drone at that time; T 1 n,t is the uplink transmission delay from the nth collection device to the inspection drone in time slot t, D n is the amount of input data when all tasks of the nth collection device have been offloaded to the inspection drone, v n t is the uplink transmission data rate, α n t is the uplink channel gain from the nth collection device to the inspection drone, W n and p n They represent the bandwidth and transmission power allocated to the nth acquisition device respectively. represents the noise power of the inspection UAV; E 1 n,t is the uplink transmission energy consumption in time slot t, E 1 n,t = p T 1 n,t ; T 2 n,t is the delay of the inspection drone calculating the task received from the nth acquisition device in time slot t. C n is the number of CPU cycles required to process the unit task data volume, f n is the computing resource allocated by the inspection drone to the nth collection device, {β t n0 ∈[0,1],n∈N}; E 2 n,t is the energy consumption of the inspection drone in time slot t, E 2 n,t =κ(f n ) 3 T 2 n,t , κ is the effective switching capacitor, and the energy consumption of the central processor in the inspection drone is modeled as κ(f n ) 3 ; T 1 nm,t is the downlink transmission delay in time slot t, v m t is the downlink transmission data rate, W m represents the bandwidth allocated to the mth edge server, α m t is the downlink channel gain from the inspection drone to the mth edge server in time slot t, p t represents the transmission power of the inspection drone in time slot t, {β nm t ∈[0,1],n∈N,m∈M};E 1 nm,t is the downlink transmission energy consumption, E 1 nm,t =p t T 1 nm,t ; T 2 nm,t is the computation delay of the mth edge server in time slot t, f nm is the computing resource allocated by the mth edge server to the nth collection device in time slot t; Step 1.5, define γ ∈ (0, 1) as the discount factor, which is used to calculate the cumulative return value in the whole process. The closer the discount factor is to 1, the more it emphasizes long-term benefits; Step 1.6: In a limited period T, learn the best strategy to obtain the maximum expected long-term return: where r t′ is the reward function at time slot t′, and the state s t Corresponding action a t The expected reward under the state-action value function Q(s t , a t )=E[G t |s t ,a t ], where E[] is the expectation operator; Step 2, according to the Markov decision five-tuple (S, A, O, R, γ) modeled in Step 1, use the Twin Delayed Deep Deterministic Policy Gradient TD3 algorithm to implement the action training of the UAV. The steps are as follows: Step 2.1, adopt two independent neural networks: 2 Actor networks and 4 Critic networks. The Actor network includes a Current-Actor network with parameters ω and a Target-Actor network with parameters ω'. The Critic network includes 2 Current-Critic networks with parameters θ1 and θ2 and 2 Target-Critic networks with parameters θ1' and θ2'. Randomly initialize the experience replay memory F, the parameters of the Current-Actor network and the Current-Critic network, and set ω' = ω, θ1' = θ1, and θ2' = θ2; Step 2.2, set the maximum number of training process rounds EP, set T time slots in each round, and initialize the training round number ep = 1; Step 2.3, initialize T = 0, time slot t = 0, and initialize the input state s0 of the patrol UAV; Step 2.4: The inspection drone observes the input status s of the current power IoT system t , and according to the strategy function π of the initial Current-Actor network ω (s t ) takes action, adds Gaussian noise σ to disturb the action, and obtains action a t =π ω (s t )+σ; Step 2.5, in the input state s t Next, perform action a t , get the instantaneous feedback, and calculate the current reward function r of the inspection drone according to step 1.4 t , use steps 1.1 to 1.2 to get the next input state s again t+1 , the experience bar (s t , a t , r t ,s t+1 ) is stored in the experience playback memory F, the experience bars in the experience playback memory F are stored in sequence, and when the number of experience bars reaches the capacity of the experience playback memory F, new records are stored from the beginning, forming a cycle; Step 2.6, randomly extract mini-batch samples from the experience replay memory F and input them into the Actor and Critic networks. The i-th mini-batch sample (s i , a i , r i ,s i+1 ) indicates that the inspection drone is in state s i When taking action a i , and gave a reward of r i , and transform the environment to the next state s i+1 , where mini-batch refers to randomly selecting small batches of data in the training data; Step 2.7, s i As the input of the Current-Actor network, the updated Current-Actor network is updated according to s i Calculate the new action a i ,(s i , a i ) as the input of the two Current-Critic networks. The Current-Critic network uses the input s i and a i Calculate and s i+1 As the input of the Target-Actor network and the two Target-Critic networks, the updated Target-Actor network is updated according to s i+1 Calculate the new action a i+1 , then add noise, and use the target policy smoothing regularization method to calculate the noisy target action; As the input of the two Target-Critic networks, the Target-Critic network is based on the input s i+1 and Calculate and Pick and The smaller value of y is used to calculate the target value y i ; Finally, use the target value y i Update the parameters θ1 and θ2 of the two Current-Critic networks by minimizing the mean square Bellman error loss function; Step 2.8, update the parameters ω of the Current-Actor network through the deterministic policy gradient algorithm; Step 2.9, to stabilize the training process, use the soft update method to further update the parameters of the Target-Actor and the parameters θ1' and θ2' of the 2 Target-Critic, so as to stabilize the training process; Step 3, train the model using the following steps: Step 3.1, if the patrol UAV covers all the collection devices and the task division variable does not exceed its limit, then enter Step 3.2, otherwise let t increase by 1, and determine t. If t < T, jump to Step 2.

4. If t ≥ T, enter Step 3.2; Step 3.2, let the training round number ep increase by 1, and determine ep. If ep < EP, jump to Step 2.

3. Otherwise, when ep ≥ EP, enter Step 3.3; Step 3.3, the iteration is completed, terminate the neural network training process, and save the current Target-Actor network data and Target-Actor network data. Load the saved data into the patrol UAV system to execute the flight action to complete the optimization of the delay and energy consumption of the UAV service power Internet of Things.

2. The computing task offloading method based on deep reinforcement learning in the electric power Internet of Things according to claim 1 is characterized in that: Calculate the noise target action in step 2.7 The noise component σ′~clip(N(0,ε′),-c,c) is the noise component clipped by the constant c in the normal distribution with mean zero and variance ε′, π ω′ (s i+1 ) is the Target-Actor network with parameter ω′ in the next state s i+1 The policy function under Target value y i : where r i is the reward function, γ is the discount factor; Minimize the mean square Bellman error loss function to update the parameters θ1 and θ2 of the two Current-Critic networks: Where L(θ j ) is the mean square Bellman error loss function, M is the number of randomly selected mini-batch samples, is the state-behavior value function of the Current-Critic network with two parameters θ1 and θ2.

3. The computing task offloading method based on deep reinforcement learning in the electric power Internet of Things according to claim 1 is characterized in that:The update formula of the Current-Actor network in step 2.8 is as follows: in represents the policy gradient under the Current-Actor network parameter ω, M is the number of randomly selected mini-batch samples, and They are the state-behavior value function gradient of the Current-Critic network with parameter θ1 and the policy function gradient of the Current-Actor network with parameter ω, π ω (s i ) indicates the input state s in the Current-Actor network i The action strategy selected when Indicates the input state s i When taking action a = π ω (s i )’s Current-Critic network state-behavior value function.

4. The computing task offloading method based on deep reinforcement learning in the electric power Internet of Things according to claim 1 is characterized in that: In step 2.9, update the parameters ω′ of the Target-Actor: ω′←μω+(1-μ)ω′, and update the parameters θ1′ and θ2′ of the two Target-Critics: θ1′←μθ1+(1-μ)θ′1, θ′2←μθ2+(1-μ)θ′2, where μ represents the update proportional coefficient.