Method and device for dynamic service migration and resource allocation for edge internet of things
By constructing a joint optimization model and utilizing Lyapunov optimization and deep reinforcement learning algorithms, optimal service migration and resource allocation strategies are generated, solving the problems of high cost and instability caused by service migration in edge IoT, and improving service continuity and system stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2026-03-31
AI Technical Summary
In edge IoT, the additional costs and energy consumption caused by service migration are too high. Frequent migration affects system stability, and the inability to accurately perform service migration and resource allocation leads to a decline in service quality.
By acquiring edge computing data, a joint optimization model is constructed. Using Lyapunov optimization methods and deep reinforcement learning algorithms, optimal service migration and resource allocation strategies are generated to predict user mobility and adjust resource configuration in real time, thus avoiding frequent migrations.
It effectively ensures service continuity and system stability, reduces migration overhead, reduces energy consumption and bandwidth usage, and improves system performance.
Smart Images

Figure CN120499005B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of edge Internet of Things (IoT) information technology, particularly to the field of artificial intelligence technology, and especially to a method and apparatus for dynamic service migration and resource allocation for edge IoT. Background Technology
[0002] In the field of edge IoT information technology, service migration following users is an effective mechanism to ensure service continuity. However, service migration in related technologies brings several challenges. For example, performing service migration increases additional migration costs, and frequent service migrations can lead to excessive energy consumption during long-term migrations, affecting system stability. When the target edge server has fewer resources than the original edge server, it may not be able to allocate sufficient resources to IoT users, inevitably increasing the computation and communication time of tasks after service migration, ultimately resulting in ineffective service migrations and reduced service quality. Due to the uncertainty and suddenness of IoT user movement behavior, accurate and effective service migration and resource allocation are impossible, leading to frequent service migrations and an inability to guarantee service continuity. Summary of the Invention
[0003] One objective of this invention is to provide a dynamic service migration and resource allocation method for edge IoT, capable of predicting user mobility and, based on user mobility and the dynamic nature of the edge IoT system, sensing real-time changes in the system environment, flexibly adjusting the optimal service migration and resource allocation strategy, minimizing service migration overhead, and performing effective service migration and resource allocation operations in advance, effectively ensuring service continuity and system stability, and avoiding frequent service migrations. Another objective of this invention is to provide a dynamic service migration and resource allocation apparatus for edge IoT. A further objective of this invention is to provide a computer-readable medium. A still other objective of this invention is to provide a computer device.
[0004] To achieve the above objectives, this invention discloses a method for dynamic service migration and resource allocation for edge IoT, comprising:
[0005] The total cost of task processing is generated based on the edge computing data between the acquired IoT users and the edge server.
[0006] Based on preset constraints, a joint optimization model for dynamic service migration and resource allocation is constructed with the goal of minimizing the total cost of task processing.
[0007] By employing Lyapunov optimization methods and deep reinforcement learning algorithms, the joint optimization model is optimized and solved to generate the optimal service migration and resource allocation strategy.
[0008] Preferably, the edge computing data includes first edge computing data where the service does not migrate with the IoT user and second edge computing data where the service migrates with the IoT user;
[0009] Based on the edge computing data acquired between IoT users and edge servers, the total task processing cost is generated, including:
[0010] Within a preset time interval, based on preset preference weights and first edge computing data, the first task processing cost is generated so that the service does not migrate with IoT users.
[0011] Within a preset time interval, based on preset preference weights and second edge computing data, a second task processing cost is generated to support the migration of IoT users.
[0012] Based on the preset service migration decision weights, and the processing costs of the first and second tasks, the total task processing cost is generated.
[0013] Preferably, the constraints include the association function between IoT users and edge servers, the computing resource allocation constraint function, the communication resource allocation constraint function, the long-term task processing energy consumption constraint function, and the service migration decision weight constraint function.
[0014] Preferably, the joint optimization model is optimized and solved using Lyapunov optimization methods and deep reinforcement learning algorithms to generate optimal service migration and resource allocation strategies, including:
[0015] The joint optimization model is decoupled using the Lyapunov optimization method to generate an independent time-slot policy optimization model;
[0016] A Markov decision process is constructed to reconstruct the independent time slot policy optimization model, and the solution is obtained by deep reinforcement learning algorithm to generate the optimal service migration and resource allocation strategy.
[0017] Preferably, the joint optimization model is decoupled using the Lyapunov optimization method to generate an independent time-slot policy optimization model, including:
[0018] Define an energy queue update function based on the energy consumption queue backlog in each time slot;
[0019] Based on the energy queue update function, define the Lyapunov drift function and the Lyapunov drift plus penalty term;
[0020] Based on the upper bounds of the Lyapunov drift function and the Lyapunov drift plus penalty term, the joint optimization model is decoupled to generate an independent time-slot policy optimization model.
[0021] Preferably, a Markov decision process is constructed to reconstruct the independent time-slot policy optimization model, and the solution is obtained through a deep reinforcement learning algorithm to generate the optimal service migration and resource allocation strategy, including:
[0022] Construct a Markov decision process, which includes the time slot state of the IoT user, the time slot action space of the IoT user, and the reward function;
[0023] The time slot action space is divided into discrete action space and continuous action space, and the policy network and Q network are defined based on the discrete action space and continuous action space.
[0024] Based on the time slot status, time slot action space, and reward function of IoT users, the network parameters of the policy network and the Q network are iteratively updated using the gradient descent algorithm according to the preset loss function until the convergent optimal solution is obtained, thereby generating the optimal service migration and resource allocation strategy.
[0025] This invention also discloses a dynamic service migration and resource allocation device for edge IoT, comprising:
[0026] The task total cost generation unit is used to generate the total task processing cost based on the edge computing data between the acquired IoT user and the edge server.
[0027] The joint optimization model building unit is used to construct a joint optimization model for dynamic service migration and resource allocation based on preset constraints, with the goal of minimizing the total cost of task processing.
[0028] The optimization unit is used to optimize the joint optimization model using Lyapunov optimization methods and deep reinforcement learning algorithms, and generate the optimal service migration and resource allocation strategy.
[0029] The present invention also discloses a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0030] The present invention also discloses a computer device, including a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, wherein the processor executes the program to implement the method described above.
[0031] The present invention also discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the method described above.
[0032] This invention generates the total task processing cost based on edge computing data acquired between IoT users and edge servers. Based on preset constraints, and with the goal of minimizing the total task processing cost, a joint optimization model for dynamic service migration and resource allocation is constructed. The joint optimization model is then optimized and solved using Lyapunov optimization and deep reinforcement learning algorithms to generate optimal service migration and resource allocation strategies. This approach can predict user mobility and, based on user mobility and the dynamic nature of the edge IoT system, perceive real-time changes in the system environment, flexibly adjust the optimal service migration and resource allocation strategies, minimize service migration overhead, and perform effective service migration and resource allocation operations in advance. This effectively ensures service continuity and system stability, and avoids frequent service migrations. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 A flowchart illustrating a dynamic service migration and resource allocation method for edge IoT provided in an embodiment of the present invention;
[0035] Figure 2 A flowchart of a method for optimizing a joint optimization model is provided in an embodiment of the present invention;
[0036] Figure 3 A flowchart illustrating another dynamic service migration and resource allocation method for edge IoT provided in this embodiment of the invention;
[0037] Figure 4 A flowchart of a first task processing cost generation method provided in an embodiment of the present invention;
[0038] Figure 5 A flowchart of a second task processing cost generation method provided in an embodiment of the present invention;
[0039] Figure 6 A schematic diagram of a dynamic service migration and resource allocation device for edge IoT provided in an embodiment of the present invention;
[0040] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] It should be noted that the method and apparatus for dynamic service migration and resource allocation for edge IoT disclosed in this application can be used in the field of artificial intelligence technology, or in any field other than artificial intelligence technology. The application field of the method and apparatus for dynamic service migration and resource allocation for edge IoT disclosed in this application is not limited.
[0043] To facilitate understanding of the technical solution provided in this application, the relevant content of the technical solution will be explained below. Mobile edge computing, as a key supporting technology for the development of the Internet of Things (IoT), effectively compensates for the high transmission latency problem caused by the long physical distance of traditional centralized cloud servers by deploying computing and storage resources on edge servers close to users. However, the signal coverage of each edge server is limited. When a user moves from the coverage area of one edge server to the coverage area of another, if the user still accesses the original edge server, the significantly increased communication distance will not only lead to increased communication latency but also significantly increase device energy consumption, and may even cause service interruption. Service migration changes the relationship between IoT users and edge servers. The optimal service migration and resource allocation strategy should be able to predict user mobility, perceive the dynamic changes in the system environment in real time, flexibly adjust service migration and resource allocation strategies, and execute effective service migration and resource allocation operations in advance to ensure service continuity. This application comprehensively analyzes issues such as user mobility, user resource requirements and the time-varying nature of system resources, service migration costs, and system stability, and provides an efficient modeling method and optimization mechanism. In practical applications, this method can dynamically adjust service migration and resource allocation strategies in real time based on the status of the edge computing system and the surrounding environment. This reduces service migration costs, maintains the stability of long-term migration energy consumption, and avoids invalid and frequent service migrations. Furthermore, the dynamic service migration and resource allocation method for stable edge IoT systems provided in this application is highly automated, easy to deploy and implement, and suitable for use in large-scale edge IoT environments.
[0044] The following uses a dynamic service migration and resource allocation device for edge IoT as an example to illustrate the implementation process of the dynamic service migration and resource allocation method for edge IoT provided in this embodiment of the invention. It is understood that the execution entities of the dynamic service migration and resource allocation method for edge IoT provided in this embodiment of the invention include, but are not limited to, dynamic service migration and resource allocation devices for edge IoT.
[0045] Figure 1 A flowchart illustrating a dynamic service migration and resource allocation method for edge IoT provided in this embodiment of the invention is shown below. Figure 1 As shown, the method includes:
[0046] Step 101: Generate the total task processing cost based on the edge computing data obtained between the IoT user and the edge server.
[0047] In this embodiment of the invention, the edge computing data includes first edge computing data where the service does not migrate with the IoT user and second edge computing data where the service migrates with the IoT user.
[0048] Specifically, during the preset time interval t, if the service does not migrate with the IoT user, the IoT user will continue to access the original edge server. The weighted sum of task processing latency and task processing energy consumption under the condition that the service does not migrate is calculated based on the first edge computing data, and this weighted sum is used as the first task processing cost under the condition that the service does not migrate.
[0049] During a preset time interval t, when the service follows the migration of IoT users, the IoT users will access the target edge server. The weighted sum of task processing latency and task processing energy consumption under the service migration scenario is calculated based on the second edge computing data, and this weighted sum is used as the second task processing cost under the service migration scenario.
[0050] Using binary service migration decisions as weights, calculate the weighted sum of the first task processing cost under the service migration scenario and the second task processing cost under the service migration scenario, and use this weighted sum as the total task processing cost.
[0051] Step 102: Based on preset constraints, construct a joint optimization model for dynamic service migration and resource allocation with the goal of minimizing the total cost of task processing.
[0052] In this embodiment of the invention, the constraints are set according to the actual situation. The constraints include the association function between IoT users and edge servers, the computing resource allocation constraint function, the communication resource allocation constraint function, the long-term task processing energy consumption constraint function, and the service migration decision weight constraint function.
[0053] Step 103: Optimize the joint optimization model using the Lyapunov optimization method and deep reinforcement learning algorithm to generate the optimal service migration and resource allocation strategy.
[0054] Figure 2 A flowchart of a method for optimizing a joint optimization model is provided as an embodiment of the present invention, such as... Figure 2 As shown, step 103 specifically includes:
[0055] Step 1031: Decouple the joint optimization model using the Lyapunov optimization method to generate an independent time slot policy optimization model.
[0056] In this embodiment of the invention, the original problem is decoupled into an independent time slot policy optimization problem using Lyapunov optimization theory. This is mainly to simplify complex dynamic resource allocation or service migration problems, making them easier to handle and solve. This method is suitable for scenarios that require maintaining system stability and performance over a long period of time.
[0057] Step 1032: Construct a Markov decision process to reconstruct the independent time slot policy optimization model, and solve it using a deep reinforcement learning algorithm to generate the optimal service migration and resource allocation strategy.
[0058] In this embodiment of the invention, a Markov decision process is constructed, defining the state as the user's position at the next time step predicted by the Long Short-Term Memory (LSTM) network algorithm, the position of the target edge server closest to the user's position at the next time step, the resources allocated to the user by the original edge server, the available resources of the target edge server, and the energy queue; defining the action as service migration and resource allocation decisions; and defining the reward function as the negative value of the optimization objective in the independent time slot policy optimization problem.
[0059] In the technical solution provided by this invention, a total task processing cost is generated based on the edge computing data between the acquired IoT user and the edge server. Based on preset constraints, a joint optimization model for dynamic service migration and resource allocation is constructed with the goal of minimizing the total task processing cost. The joint optimization model is then optimized and solved using the Lyapunov optimization method and deep reinforcement learning algorithm to generate the optimal service migration and resource allocation strategy. This approach can predict user mobility and, based on user mobility and the dynamics of the edge IoT system, perceive real-time changes in the system environment, flexibly adjust the optimal service migration and resource allocation strategy, minimize service migration overhead, and perform effective service migration and resource allocation operations in advance. This effectively ensures service continuity and system stability, and avoids frequent service migrations.
[0060] Figure 3A flowchart illustrating another dynamic service migration and resource allocation method for edge IoT provided in this embodiment of the invention is shown below. Figure 3 As shown, the method includes:
[0061] Step 201: Within a preset time interval, generate the first task processing cost that the service does not follow the migration of IoT users, based on preset preference weights and first edge computing data.
[0062] In this embodiment of the invention, the first edge computing data includes, but is not limited to, the size of the IoT user input data, the data transmission rate between the IoT user and the original edge server, the data transmission power between the IoT user and the original edge server, the number of CPU loops required to compute 1 bit of data, and the computing resources allocated by the original edge server to the IoT user.
[0063] Figure 4 A flowchart of a first task processing cost generation method provided in an embodiment of the present invention is shown below. Figure 4 As shown, step 201 specifically includes:
[0064] Step 2011: Within a preset time interval, based on the first edge computing data, calculate the task transmission latency and task transmission energy consumption between the user and the original edge server when the computing service does not follow the migration of IoT users.
[0065] Specifically, the calculation formula is as follows:
[0066]
[0067] Where t is the time interval. For task transmission delay, d u,e (t) represents the size of the IoT user input data, r u,e (t) represents the data transmission rate between the IoT user and the original edge server. For task transmission power consumption, p u,e (t) represents the data transmission power between the IoT user and the original edge server.
[0068] It is worth noting that the time interval can be set according to actual needs, and the embodiments of the present invention do not limit this.
[0069] Step 2012: Within a preset time interval, based on the first edge computing data, calculate the task computing latency and task computing energy consumption of the original edge server when the computing service does not follow the migration of IoT users.
[0070] Specifically, the calculation formula is as follows:
[0071]
[0072] Where t is the time interval. Calculate the latency for the task, d u,e (t) represents the size of the IoT user input data, c u,e (t) represents the number of CPU loops required to compute 1 bit of data, f u,e (t) represents the computing resources originally allocated by the edge server to IoT users. The energy consumption for the task is calculated, where k is the capacitor switching coefficient.
[0073] It is worth noting that the time interval can be set according to actual needs, and the embodiments of the present invention do not limit this.
[0074] Step 2013: Based on the preset preference weights, the task transmission latency and energy consumption between the user and the original edge server when the service does not follow the IoT user migration, and the task computation latency and energy consumption of the original edge server when the service does not follow the IoT user migration, generate the first task processing cost when the service does not follow the IoT user migration.
[0075] Specifically, the sum of the task transmission latency and task computation latency when the computing service does not migrate with IoT users is used as the task processing latency when the service does not migrate with IoT users.
[0076]
[0077] in, To mitigate task processing delays when services do not migrate with IoT users; For task transmission delay; Calculate the delay for the task.
[0078] The sum of the energy consumption for task transmission and the energy consumption for task computation when the computing service does not migrate with IoT users is taken as the task processing energy consumption when the service does not migrate with IoT users.
[0079]
[0080] in, Energy consumption for task processing in situations where services do not migrate with IoT users; Energy consumption for task transmission; Calculate energy consumption for the task.
[0081] Based on preset preference weights, the weighted sum of task processing latency and energy consumption is calculated for the scenario where the service does not migrate with IoT users. This weighted sum is then used as the first task processing cost when the service does not migrate with IoT users.
[0082]
[0083] in, The cost of processing the first task; λ u For preference weights, To mitigate task processing delays when services do not migrate with IoT users; Energy consumption for task processing when services do not migrate with IoT users.
[0084] Step 202: Within a preset time interval, generate a second task processing cost for the service to follow the migration of IoT users based on preset preference weights and second edge computing data.
[0085] In this embodiment of the invention, the second edge computing data includes, but is not limited to, the size of the IoT user's state context data, the computing power of the service functions required by the IoT user, the percentage of computing resources allocated to the embedded checkpoint function for the service functions, the processing intensity required for the IoT user to pause and resume service instances, the data transmission rate between the IoT user and the target edge server, the data transmission power between the IoT user and the target edge server, and the computing resources allocated to the user by the target edge server.
[0086] Figure 5 A flowchart of a second task processing cost generation method provided in an embodiment of the present invention is shown below. Figure 5 As shown, step 202 specifically includes:
[0087] Step 2021: Within a preset time interval, calculate the migration latency and migration energy consumption generated by migrating the service from the original edge server to the target edge server based on the second edge computing data.
[0088] Specifically, the calculation formula is as follows:
[0089]
[0090] Where t is the time interval; For migration delay; The size of the state context data for IoT user u is represented in bits; Instances of service suspension for IoT user u; α u (t) represents the percentage of computational resources allocated to the embedded checkpoint function for the service function; The computing power required for the service functions needed by IoT user u is expressed in CPU cycles per second; The processing intensity required to restore a service instance is expressed in CPU cycles / bits; r e,e′ (t) represents the data transfer rate from the original edge server to the target edge server; For migration energy consumption; p e,e′(t) represents the data transmission power from the original edge server to the target edge server;
[0091] It is worth noting that the time interval can be set according to actual needs, and the embodiments of the present invention do not limit this.
[0092] Step 2022: Within a preset time interval, based on the second edge computing data, calculate the task transmission latency and task transmission energy consumption between the user and the target edge server when the computing service follows the migration of IoT users.
[0093] Specifically, the calculation formula is as follows:
[0094]
[0095] Where t is the time interval. For task transmission delay, d u,e (t) represents the size of the IoT user input data, r u,e′ (t) represents the data transmission rate between the IoT user and the target edge server. For task transmission power consumption, p u,e′ (t) represents the data transmission power between the IoT user and the target edge server.
[0096] It is worth noting that the time interval can be set according to actual needs, and the embodiments of the present invention do not limit this.
[0097] Step 2023: Within a preset time interval, based on the second edge computing data, calculate the task computing latency and task computing energy consumption of the target edge server when the computing service follows the migration of IoT users.
[0098] Specifically, the calculation formula is as follows:
[0099]
[0100] Where t is the time interval. Calculate the latency for the task, d u,e (t) represents the size of the IoT user input data, c u,e (t) represents the number of CPU loops required to compute 1 bit of data, f u,e′ (t) represents the computing resources allocated by the target edge server to IoT users. The energy consumption for the task is calculated, where k is the capacitor switching coefficient.
[0101] It is worth noting that the time interval can be set according to actual needs, and the embodiments of the present invention do not limit this.
[0102] Step 2024: Based on the preset preference weights, the migration delay and migration energy consumption generated when migrating the service from the original edge server to the target edge server, the task transmission delay and task transmission energy consumption between the user and the target edge server when the service follows the IoT user migration, and the task computing delay and task computing energy consumption of the target edge server when the service follows the IoT user migration, generate the second task processing cost for the service following the IoT user migration.
[0103] Specifically, the sum of migration latency, task transmission latency, and task computation latency in the case of service migration following IoT user migration is used as the task processing latency in this scenario.
[0104]
[0105] in, To reduce task processing latency when services migrate with IoT users; For migration delay; For task transmission latency between IoT users and target edge servers; Calculate latency for the task on the target edge server.
[0106] The sum of migration energy consumption, task transmission energy consumption, and task computing energy consumption when the computing service migrates with the IoT user is used as the task processing energy consumption when the service migrates with the IoT user.
[0107]
[0108] in, Energy consumption for task processing when services migrate with IoT users; For energy consumption during migration; Energy consumption for task transmission between IoT users and target edge servers; Calculate the energy consumption for the target edge server's tasks.
[0109] Based on preset preference weights, a weighted sum of task processing latency and energy consumption is calculated for the scenario where the service migrates with IoT users. This weighted sum is then used as the second task processing cost for the service migrating with IoT users.
[0110]
[0111] in, For the processing cost of the second task; λ u For preference weights, To reduce task processing latency when services migrate with IoT users; Energy consumption for task processing when services migrate with IoT users.
[0112] Step 203: Based on the preset service migration decision weights, and based on the first task processing cost and the second task processing cost, generate the total task processing cost.
[0113] In this embodiment of the invention, the value of the service migration decision weight is binary. If the service migration decision weight is 0, it means that the service does not migrate with the IoT user; if the service migration decision weight is 1, it means that the service migrates according to the IoT user.
[0114] Specifically, the calculation formula is as follows:
[0115]
[0116] Where t is the time interval, and Cost u (t) represents the total cost of task processing, w u (t) represents the service migration decision weights. The cost of processing the first task. Cost of processing the second task.
[0117] Step 204: Based on preset constraints, construct a joint optimization model for dynamic service migration and resource allocation with the goal of minimizing the total cost of task processing.
[0118] In this embodiment of the invention, the constraints include the association function between IoT users and edge servers, the computing resource allocation constraint function, the communication resource allocation constraint function, the long-term task processing energy consumption constraint function, and the service migration decision weight constraint function.
[0119] Specifically, with minimizing the total task processing cost as the optimization objective, service migration and resource allocation strategies as decision variables, and the relationships between IoT users and edge servers, computing resource allocation, communication resource allocation, long-term task processing energy consumption, and service migration decisions as constraints, a joint optimization model P1 for service migration and resource allocation is established:
[0120]
[0121] Cost u (t) represents the total cost of task processing, where t∈T={1,2,…,T} is a time slot; C1 is the association function between IoT users and edge servers, ρ u,e' (t) represents the relationship between IoT users and edge servers, if ρ u,e' A value of 1 for ρ indicates a correlation between the IoT user and the edge server. u,e'A value of 0 for (t) indicates that there is no connection between the IoT user and the edge server; C2 is the computing resource allocation constraint function, indicating that the computing resources allocated to the target edge server are less than the preset maximum available computing resources, f u,e' (t) represents the computing resources allocated by the target edge server e' to the IoT user u, F e' (t) represents the preset maximum available computing resources; C3 is the communication resource allocation constraint function, indicating that the communication resources allocated to the target edge server are less than the preset maximum available communication resources, b u,e' (t) represents the communication resources allocated by the target edge server e' to the IoT user u, B e' (t) represents the preset maximum available communication resources; C4 is the long-term average task processing energy consumption constraint function, indicating that the long-term average task processing energy consumption is less than the preset migration energy consumption threshold. For task processing energy consumption, E avg (t) represents the preset energy consumption threshold, w u (t) represents the service migration decision weights. To address the energy consumption of task processing in scenarios where services do not migrate with IoT users, λ u For preference weights, C5 represents the task processing energy consumption when the service migrates with the IoT user; C5 is the service migration decision weight constraint function, indicating that the service migration decision weight is binary. If the service migration decision weight is 0, it means that the service does not migrate with the IoT user; if the service migration decision weight is 1, it means that the service migrates according to the IoT user.
[0122] For example: The system has E edge servers and U users, where e represents the e-th base station and u represents the u-th IoT user. At time t, when IoT user u moves from the original edge server e to the signal range of the target edge server e', if IoT user u chooses to continue the service migration on the original edge server e, the processing cost of the first task can be calculated if user u does not migrate. If IoT user u chooses to perform service migration, the second task processing cost under the IoT user u migration scenario can be calculated. Then, calculate the total cost of task processing. Finally, with the goal of minimizing the total task processing cost for all IoT users in each time slot, a joint optimization model P1 for service migration and resource allocation is constructed.
[0123] This invention constructs a joint optimization model with the goal of minimizing the total cost of task processing, and solves it using the following method. This can significantly reduce cost factors such as energy consumption and bandwidth usage while ensuring service quality.
[0124] Step 205: Define the energy queue update function based on the energy consumption queue backlog in each time slot.
[0125] In this embodiment of the invention, the energy queue is defined as the queue backlog of energy consumption in each time slot, and an energy queue update function is given for the energy queue update process. Specifically, the energy queue Q is defined. u (t) represents the energy queue of user u, and the energy queue update function is:
[0126] Q u (t+1)=max{Q u (t)-E avg (t),0}+E u (t)
[0127] Among them, Q u (t) represents the energy queue of user u, Q u (t+1) represents the updated energy queue for user u, E u (t) represents the energy consumption for task processing, E avg (t) represents the preset energy consumption threshold.
[0128] Step 206: Define the Lyapunov drift function and the Lyapunov drift penalty term based on the energy queue update function.
[0129] In this embodiment of the invention, the Lyapunov function is defined. Define the Lyapunov drift function ΔL(Q) u (t))=L(Q u (t+1))-L(Q u (t)), through mathematical derivation, the function ΔL(Q) is obtained. u The upper bound of (t) is ΔL(Q(t))≤C+Q u (t)(E u (t)-E avg (t)), where, Among them, L(Q) u (t) is a Lyapunov function, Q is... u (t) represents the energy queue, ΔL(Q) u (t) is the Lyapunov drift function, Q u (t+1) represents the updated energy queue, E u (t) represents the energy consumption for task processing, E avg (t) is the preset energy consumption threshold, and C is an intermediate parameter.
[0130] In this embodiment of the invention, a Lyapunov drift penalty term is defined. The upper bound of the Lyapunov drift penalty term is obtained through mathematical derivation. Where, ΔQ u (t) represents the Lyapunov drift, β is the penalty term weight, and Cost is... u (t) represents the total cost of task processing, Q. u Let Q(t) be the energy queue of user u, and let Q(t) be the set of all user energy queues. u (t) represents the energy consumption for task processing, E avg (t) represents the preset energy consumption threshold. As expected.
[0131] Step 207: Decouple the joint optimization model based on the upper bound of the Lyapunov drift function and the upper bound of the Lyapunov drift plus penalty term to generate an independent time slot policy optimization model.
[0132] In this embodiment of the invention, by removing the constant term based on the upper bound of the Lyapunov drift function and the upper bound of the Lyapunov drift penalty term, the joint optimization model P1 can be transformed into an independent time-slot policy optimization model P2.
[0133]
[0134] Among them, Q u (t) represents the energy queue; E u (t) represents the energy consumption for task processing; β represents the weight of the penalty term; Cost u (t) represents the total cost of task processing; C1 is the association function between IoT users and edge servers, ρ u,e' (t) represents the relationship between IoT users and edge servers, if ρ u,e' A value of 1 for ρ indicates a correlation between the IoT user and the edge server. u,e' A value of 0 for (t) indicates that there is no connection between the IoT user and the edge server; C2 is the computing resource allocation constraint function, indicating that the computing resources allocated to the target edge server are less than the preset maximum available computing resources, f u,e' (t) represents the computing resources allocated by the target edge server e' to the IoT user u, F e' (t) represents the preset maximum available computing resources; C3 is the communication resource allocation constraint function, indicating that the communication resources allocated to the target edge server are less than the preset maximum available communication resources, b u,e' (t) represents the communication resources allocated by the target edge server e' to the IoT user u, B e' (t) represents the preset maximum available communication resources; C5 is the service migration decision weight constraint function, indicating that the service migration decision weights are binary, w u(t) represents the service migration decision weight. If the service migration decision weight is 0, it means that the service does not migrate with the IoT user; if the service migration decision weight is 1, it means that the service migrates according to the IoT user.
[0135] This invention uses the Lyapunov optimization method to transform complex long-term optimization problems into a series of simpler optimization problems within a single time slot, thus reducing the difficulty of solving them.
[0136] Step 208: Construct a Markov decision process, which includes the time slot state of the IoT user, the time slot action space of the IoT user, and the reward function.
[0137] In this embodiment of the invention, a Markov decision process is constructed, defining the time slot state as the IoT user's location predicted by the LSTM algorithm at the next time step, the location of the target edge server closest to the IoT user's location at the next time step, the resources allocated to the IoT user by the original edge server, the available resources of the target edge server, and the energy queue; the action is defined as service migration and resource allocation decisions; and the reward function is defined as the negative value of the optimization objective in the independent time slot policy optimization problem.
[0138] Specifically, the time slot state of IoT user u at time t is defined as:
[0139]
[0140] Among them, s u (t) represents the time slot state of IoT user u at time t; This indicates the position of IoT user u predicted by the LSTM algorithm at the next moment; Indicates distance The nearest target edge server location; f u,e (t) represents the computing resources originally allocated by the edge server to IoT user u; b u,e (t) represents the communication resources originally allocated by the edge server to IoT user u; F e′ (t) represents the available computing resources of the target edge server; B e′ (t) represents the available communication resources of the target edge server; Q u (t) represents the energy queue.
[0141] Specifically, the time slot action space of IoT user u at time t is defined as:
[0142]
[0143] Among them, a u (t) represents the time-slot action space of IoT user u at time t; w u (t) represents the service migration decision weights, fu,e′ (t) represents the computing resources allocated by the target edge server to IoT user u; b u,e′ (t) represents the communication resources allocated by the target edge server to IoT user u.
[0144] Specifically, the reward function is defined as follows:
[0145]
[0146] Where r(t) is the reward function; For expectation; E u (t) represents the energy consumption for task processing; Q u (t) represents the energy queue; β represents the penalty term weight; Cost u (t) represents the total cost of task processing.
[0147] Step 209: Divide the time slot action space to generate a discrete action space and a continuous action space, and define the policy network and Q network based on the discrete action space and the continuous action space.
[0148] In this embodiment of the invention, the core idea of the reinforcement learning algorithm (Parametrized Deep Q-Network, abbreviated as PDQN) is to combine discrete action selection with continuous action parameter optimization by parameterizing continuous actions, thereby efficiently handling the discrete-continuous mixed action space problem. It utilizes a policy network (x-network) to generate the probability distribution of discrete actions and the parameters of continuous actions, while simultaneously using a Q-network (Q-network) to estimate the expected reward of taking a certain discrete action in a specific state and using specific continuous action parameters.
[0149] In this embodiment of the invention, the x-network is initialized. Q-network Q(s,(k,m) k ); θ), target network and its update frequency Learning rate {α} t ,β t} t≥0 Mini-batch sample size N, empirical replay buffer R and its size B, user location l u And training step length Z.
[0150] The time-slot action space is divided into two parts, denoted by k, where {w} is the discrete action space. u (t)}, using m k Represents the continuous action space {f u,e′ (t),b u,e′ The partitioned action space is: (t)},
[0151]
[0152] Will Approximate as a deterministic network function It was named the x-network; and through a neural network, it directly maps states to continuous deterministic actions, thus... Approximately It is named the Q-network, and the Bellman equation can be expressed as follows:
[0153]
[0154] Among them, s t The time slot state at time t; k t Let be the discrete action space at time t; Let r be the continuous action space at time t; t The reward at time t; For expectation; γ t s is the discount factor; t+1 This represents the time slot state at time t+1; Let x be the x-network at time t+1.
[0155] Step 210: Based on the time slot status of IoT users, the time slot action space of IoT users, and the reward function, the network parameters of the policy network and the Q network are iteratively updated using the gradient descent algorithm according to the preset loss function until the convergent optimal solution is obtained, thereby generating the optimal service migration and resource allocation strategy.
[0156] Specifically, the time slot state of the IoT user at time t, the time slot action space of the IoT user, and the reward function are: (s t ,a t ,s t+1 ,r t The data is stored in the experience replay buffer and randomly sampled according to the preferred experience replay technique. The loss functions for the Q-network and x-network are calculated using the following formulas:
[0157]
[0158] in, Here is the loss function for the Q-network; For Q-network parameters; L ζ (θ) is the loss function corresponding to the x-network; θ is the x-network parameter; y i The target Q value; s i This represents the state of the i-th time slot; For application to x-networks based on time slot state s i The x-network parameters θ are used to obtain the action type k i Specific action selection; r iThe reward for the i-th time slot; γ i Let be the discount factor for the i-th time slot; For application to the target network based on time slot state s i+1 and target network (x-network) parameters θ - The obtained action type k i+1 Specific action selection; These are the parameters for the target network (Q-network).
[0159] The gradient descent method was used to analyze the parameters of the Q-network and x-network. and θ t The process involves updating the parameters and re-executing the iterative solution steps based on the updated service migration and resource allocation strategies. This continues until a convergent optimal solution is obtained, at which point the iteration stops, and the optimal service migration and resource allocation strategy is derived.
[0160] This application utilizes the Lyapunov optimization method to dynamically monitor system status by constructing virtual queues and achieves long-term optimization by minimizing drift and imposing penalties. This approach helps ensure system stability, especially when facing dynamically changing workloads. Deep reinforcement learning provides a method for automatically learning optimal policies, reducing the workload of manually designing complex rules. Combined with deep reinforcement learning algorithms, the system can effectively explore the environment and learn optimal policies, thereby further improving system performance. This combined approach allows the system to quickly respond to real-time changes in data flow and service requests, enhancing its adaptability to dynamic environments. Whether it's changes in user demand or fluctuations in network conditions, service migration and resource allocation strategies can be flexibly adjusted. These technologies enable more rational allocation of computing and storage resources, avoiding resource waste or overuse and improving resource utilization. This combination not only improves the efficiency and effectiveness of service migration and resource allocation in edge computing environments but also provides a solid technical foundation for addressing various future challenges, such as supporting large-scale edge Internet of Things (IoT) device access, ensuring service quality, and reducing operating costs. This makes the entire system more robust, flexible, and efficient.
[0161] It is worth noting that the acquisition, storage, use, and processing of data in the technical solution of this application all comply with relevant laws and regulations. The user information in the embodiments of this application was obtained through legal and compliant means, and the acquisition, storage, use, and processing of user information have been authorized and agreed upon by the client.
[0162] It is worth noting that the information collected in this application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant countries and regions, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding operation portals are provided for users to choose to authorize or refuse.
[0163] It is worth noting that the technical solution provided in this application provides users with a corresponding operation entry point, allowing users to choose to agree to or reject the automated decision-making result; if the user chooses to reject, the process will proceed to the expert decision-making process.
[0164] The technical solution of the dynamic service migration and resource allocation method for edge IoT provided in this invention involves generating a total task processing cost based on the edge computing data between IoT users and edge servers; constructing a joint optimization model for dynamic service migration and resource allocation based on preset constraints and with the goal of minimizing the total task processing cost; and optimizing and solving the joint optimization model using the Lyapunov optimization method and deep reinforcement learning algorithm to generate the optimal service migration and resource allocation strategy. This method can predict user mobility and, based on user mobility and the dynamics of the edge IoT system, perceive the dynamic changes in the system environment in real time, flexibly adjust the optimal service migration and resource allocation strategy, minimize service migration overhead, and perform effective service migration and resource allocation operations in advance, effectively ensuring service continuity and system stability and avoiding frequent service migrations.
[0165] Figure 6 This is a schematic diagram of a dynamic service migration and resource allocation device for edge IoT provided in an embodiment of the present invention. This device is used to execute the aforementioned dynamic service migration and resource allocation method for edge IoT, such as... Figure 6 As shown, the device includes: a task total cost generation unit 11, a joint optimization model construction unit 12, and an optimization solution unit 13.
[0166] The task total cost generation unit 11 is used to generate the total task processing cost based on the edge computing data between the acquired IoT user and the edge server.
[0167] The joint optimization model building unit 12 is used to build a joint optimization model for dynamic service migration and resource allocation based on preset constraints, with the goal of minimizing the total cost of task processing.
[0168] The optimization and solution unit 13 is used to optimize the joint optimization model using the Lyapunov optimization method and deep reinforcement learning algorithm to generate the optimal service migration and resource allocation strategy.
[0169] In this embodiment of the invention, the edge computing data includes first edge computing data where the service does not migrate with the IoT user and second edge computing data where the service does migrate with the IoT user. The total task cost generation unit 11 is specifically used to generate a first task processing cost where the service does not migrate with the IoT user within a preset time interval, based on preset preference weights and the first edge computing data; generate a second task processing cost where the service migrates with the IoT user within a preset time interval, based on preset preference weights and the second edge computing data; and generate a total task processing cost based on preset service migration decision weights, the first task processing cost, and the second task processing cost.
[0170] In this embodiment of the invention, the constraints include the association function between IoT users and edge servers, the computing resource allocation constraint function, the communication resource allocation constraint function, the long-term task processing energy consumption constraint function, and the service migration decision weight constraint function.
[0171] In this embodiment of the invention, the optimization and solution unit 13 is specifically used to decouple the joint optimization model using the Lyapunov optimization method to generate an independent time slot policy optimization model; to reconstruct the independent time slot policy optimization model by constructing a Markov decision process, and to solve it using a deep reinforcement learning algorithm to generate the optimal service migration and resource allocation strategy.
[0172] In this embodiment of the invention, the optimization solution unit 13 is specifically used to define an energy queue update function based on the energy consumption queue backlog of each time slot; define a Lyapunov drift function and a Lyapunov drift plus penalty term based on the energy queue update function; and decouple the joint optimization model based on the upper bound of the Lyapunov drift function and the upper bound of the Lyapunov drift plus penalty term to generate an independent time slot strategy optimization model.
[0173] In this embodiment of the invention, the optimization and solution unit 13 is specifically used to construct a Markov decision process, which includes the time slot state of the IoT user, the time slot action space of the IoT user, and the reward function; the time slot action space is divided to generate a discrete action space and a continuous action space, and a policy network and a Q network are defined based on the discrete action space and the continuous action space; based on the time slot state of the IoT user, the time slot action space of the IoT user, and the reward function, the network parameters of the policy network and the network parameters of the Q network are iteratively updated using a gradient descent algorithm according to a preset loss function until a convergent optimal solution is obtained, thereby generating an optimal service migration and resource allocation strategy.
[0174] In the scheme of this invention embodiment, the total task processing cost is generated based on the edge computing data between the acquired IoT user and the edge server. Based on preset constraints, a joint optimization model for dynamic service migration and resource allocation is constructed with the goal of minimizing the total task processing cost. The joint optimization model is optimized and solved using the Lyapunov optimization method and deep reinforcement learning algorithm to generate the optimal service migration and resource allocation strategy. This can predict user mobility and, based on the user mobility and the dynamics of the edge IoT system, perceive the dynamic changes in the system environment in real time, flexibly adjust the optimal service migration and resource allocation strategy, minimize service migration overhead, and execute effective service migration and resource allocation operations in advance, effectively ensuring service continuity and system stability, and avoiding frequent service migrations.
[0175] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer device, specifically, a computer device can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.
[0176] This invention provides a computer device including a memory and a processor. The memory stores information including program instructions, and the processor controls the execution of the program instructions. When the program instructions are loaded and executed by the processor, they implement the steps of the above-described embodiment of the dynamic service migration and resource allocation method for edge IoT. For a detailed description, please refer to the above-described embodiment of the dynamic service migration and resource allocation method for edge IoT.
[0177] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer device 600 suitable for implementing the embodiments of this application.
[0178] like Figure 7 As shown, the computer device 600 includes a central processing unit (CPU) 601, which can perform various appropriate tasks and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the computer device 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0179] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal feedback (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed in storage section 608 as needed.
[0180] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program including program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611.
[0181] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0182] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0183] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0184] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0185] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0186] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0187] The acquisition, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.
[0188] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
[0189] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0190] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0191] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0192] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of the claims of this application.
Claims
1. A method for dynamic service migration and resource allocation for edge Internet of Things, characterized in that, The method comprises: According to the obtained edge computing data between the Internet of Things user and the edge server, a total task processing cost is generated, the edge computing data comprising first edge computing data in which the service does not follow the migration of the Internet of Things user and second edge computing data in which the service follows the migration of the Internet of Things user, and specifically comprising: Within a preset time interval, a first task processing cost in which the service does not follow the migration of the Internet of Things user is generated according to a preset preference weight and the first edge computing data, and specifically comprising: a weighted sum of task processing delay and task processing energy consumption under the condition that the service does not migrate is calculated according to the first edge computing data, and the weighted sum is taken as the first task processing cost under the condition that the service does not migrate; Within a preset time interval, a second task processing cost in which the service follows the migration of the Internet of Things user is generated according to a preset preference weight and the second edge computing data, and specifically comprising: a weighted sum of task processing delay and task processing energy consumption under the condition that the service migrates is calculated according to the second edge computing data, and the weighted sum is taken as the second task processing cost under the condition that the service migrates; According to a preset service migration decision weight, the first task processing cost and the second task processing cost are used to generate the total task processing cost; Based on a preset constraint condition, a joint optimization model of dynamic service migration and resource allocation is constructed with the objective of minimizing the total task processing cost; The joint optimization model is optimized and solved by a Lyapunov optimization method and a deep reinforcement learning algorithm to generate an optimal service migration and resource allocation strategy, and specifically comprising: The joint optimization model is decoupled by the Lyapunov optimization method to generate an independent time slot strategy optimization model; A Markov decision process is constructed to reconfigure the independent time slot strategy optimization model, and the deep reinforcement learning algorithm is used to solve the independent time slot strategy optimization model to generate the optimal service migration and resource allocation strategy, comprising: a Markov decision process is constructed, a state is defined as a next time user position predicted by a long short-term memory network algorithm, a target edge server position closest to the next time user position, a resource allocated to the user by an original edge server, an available resource of the target edge server and an energy queue; an action is defined as a service migration and resource allocation decision; and a reward function is defined as a negative value of an optimization objective in the independent time slot strategy optimization problem. 2.The edge-intemet-of-things oriented dynamic service migration and resource allocation method according to claim 1, characterized in that, The constraint condition comprises an association relationship function between the Internet of Things user and the edge server, a computing resource allocation constraint function, a communication resource allocation constraint function, a long-term task processing energy consumption constraint function and a service migration decision weight constraint function. 3.The edge-intemet-of-things oriented dynamic service migration and resource allocation method according to claim 1, characterized in that, The joint optimization model is decoupled by the Lyapunov optimization method to generate the independent time slot strategy optimization model, comprising: An energy queue update function is defined according to a queue backlog of each time slot energy consumption; A Lyapunov drift function and a Lyapunov drift penalty term are defined according to the energy queue update function; The joint optimization model is decoupled according to an upper bound of the Lyapunov drift function and an upper bound of the Lyapunov drift penalty term to generate the independent time slot strategy optimization model.
4. The edge-intemet-of-things oriented dynamic service migration and resource allocation method of claim 1, wherein, The constructed Markov decision process reconstructs the independent time slot strategy optimization model and is solved by a deep reinforcement learning algorithm to generate an optimal service migration and resource allocation strategy, including: A Markov decision process is constructed, including a time slot state of the Internet of Things user, a time slot action space of the Internet of Things user, and a reward function; The time slot action space is divided to generate a discrete action space and a continuous action space, and a policy network and a Q network are defined according to the discrete action space and the continuous action space; According to the time slot state of the Internet of Things user, the time slot action space of the Internet of Things user, and the reward function, the network parameters of the policy network and the network parameters of the Q network are iteratively updated by a gradient descent algorithm according to a preset loss function until a convergent optimal solution is obtained, to generate the optimal service migration and resource allocation strategy.
5. An apparatus for dynamic service migration and resource allocation for edge-oriented Internet of Things, characterized in that, The device comprises: a task total cost generation unit configured to generate a task processing total cost according to acquired edge computing data between the Internet of Things user and the edge server; a joint optimization model construction unit configured to construct a joint optimization model of dynamic service migration and resource allocation based on a preset constraint condition, with the objective of minimizing the task processing total cost; an optimization solving unit configured to optimize and solve the joint optimization model by a Lyapunov optimization method and a deep reinforcement learning algorithm to generate an optimal service migration and resource allocation strategy. The edge computing data includes first edge computing data in which a service does not follow the migration of an Internet of Things user and second edge computing data in which a service follows the migration of an Internet of Things user, and the task total cost generation unit is specifically configured to generate a first task processing cost in which a service does not follow the migration of an Internet of Things user according to a preset preference weight and the first edge computing data within a preset time interval, specifically including calculating a weighted sum of task processing delay and task processing energy consumption under a service non-migration condition according to the first edge computing data, and taking the weighted sum as the first task processing cost under the service non-migration condition; generate a second task processing cost in which a service follows the migration of an Internet of Things user according to a preset preference weight and the second edge computing data within a preset time interval, specifically including calculating a weighted sum of task processing delay and task processing energy consumption under a service migration condition according to the second edge computing data, and taking the weighted sum as the second task processing cost under the service migration condition; and generate the task processing total cost according to a preset service migration decision weight and according to the first task processing cost and the second task processing cost. The optimization solving unit is specifically configured to decouple the joint optimization model by the Lyapunov optimization method to generate an independent time slot strategy optimization model; construct a Markov decision process to reconfigure the independent time slot strategy optimization model, and solve the independent time slot strategy optimization model by a deep reinforcement learning algorithm to generate an optimal service migration and resource allocation strategy, including: constructing a Markov decision process, defining a state as a next time user position predicted by a long short-term memory network algorithm, a target edge server position closest to the next time user position, original edge server resources allocated to the user, available resources of the target edge server, and an energy queue; defining an action as a service migration and resource allocation decision; and defining a reward function as a negative value of an optimization objective in the independent time slot strategy optimization problem.
6. A computer readable medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the edge Internet of Things-oriented dynamic service migration and resource allocation method of any one of claims 1 to 4.
7. A computer device comprising a memory for storing information including program instructions, and a processor for controlling execution of the program instructions, characterized in that, The program instructions are loaded and executed by the processor to implement the edge Internet of Things-oriented dynamic service migration and resource allocation method of any one of claims 1 to 4.
8. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instructions are executed by the processor to implement the edge Internet of Things-oriented dynamic service migration and resource allocation method of any one of claims 1 to 4.
Citation Information
Patent Citations
Task unloading method based on Lyapunov and deep reinforcement learning
CN118733143A