A smart grid task allocation method, device and electronic equipment
By constructing an objective function and solving for the optimal solution, the optimal allocation ratio and transmission power of terminals, fog nodes, and cloud computing centers are determined, which solves the problem of high computational latency in computing tasks in smart grids, realizes efficient allocation and processing of computing tasks, and improves the task processing capability of smart grids.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID HEBEI ELECTRIC POWER CO LTD
- Filing Date
- 2023-01-16
- Publication Date
- 2026-05-29
AI Technical Summary
Traditional power grids suffer from network congestion and latency issues in data transmission and computing task processing, making it difficult to meet the requirements of high data transmission rates and low transmission latency. In particular, computing tasks in smart grids have high computational latency, which affects service quality.
By constructing an objective function that minimizes the total computational latency of computing tasks, the optimal solution is obtained, the optimal allocation ratio and transmission power of terminals, fog nodes, and cloud computing centers are determined, and computing tasks are divided into multiple sub-tasks and sent to each fog node, thus realizing three-layer computing collaboration between edge, terminal, and cloud.
It reduces the computation latency of computing tasks generated by terminals in smart grids, improves task processing capabilities, and achieves efficient allocation and processing of computing tasks.
Smart Images

Figure CN117149370B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power grid technology, and in particular to a task allocation method, apparatus and electronic equipment for a smart grid. Background Technology
[0002] In recent years, the rapid development of mobile communication and Internet of Things (IoT) technologies has greatly promoted the intelligent transformation and upgrading of industry, represented by smart grids, and industry has begun to enter the intelligent information age. With the improvement of industrialization levels, the application scenarios of smart grids are becoming more complex and specialized. The number of power devices is increasing dramatically, and the scale and complexity of the data sensed by their terminal devices are also showing an explosive growth trend. This leads to increasingly higher demands on service quality, such as real-time data transmission and efficient processing of computing tasks, and correspondingly, higher requirements are placed on the communication and computing capabilities of smart grids.
[0003] To meet these demands, in recent years, smart grids have integrated next-generation information and communication technologies and manufacturing technologies such as 5G, artificial intelligence, cloud computing, and big data analytics. Through intelligent means, they sense environmental information, support the access of numerous heterogeneous devices, and enable real-time analysis and efficient processing of massive amounts of multi-source data, while also generating a large number of computational task requests. Traditional power data processing involves transmitting data to centralized cloud servers for computation. While cloud servers have strong computing power and can handle large-scale tasks, centralized processing of large amounts of data can lead to severe network congestion. Furthermore, long-distance transmission can cause latency issues, affecting the overall service quality of various applications within the smart grid. This also presents significant challenges to traditional power networks, demanding higher data transmission rates, lower transmission latency, and the ability to process large amounts of computational tasks. However, due to limited communication resources such as bandwidth and power, it is difficult to rely solely on network communication capabilities to meet the ever-increasing demands for data transmission and computational tasks. Summary of the Invention
[0004] This invention provides a task allocation method, apparatus, and electronic device for smart grids, which can reduce the computation latency of computing tasks generated by terminals in smart grids and improve the task processing capability of smart grids.
[0005] In a first aspect, the present invention provides a task allocation method for a smart grid, the smart grid including terminals, multiple fog nodes, and a cloud computing center; the task allocation method includes: acquiring computing tasks generated by the terminals; constructing an objective function with the goal of minimizing the total computational latency of the computing tasks, solving for the optimal solution, the optimal solution including the optimal allocation ratio of the terminals, fog nodes, and cloud computing center in executing computing tasks, and the transmission power of the terminals when sending data to each fog node; based on the optimal allocation ratio, dividing the computing tasks into multiple sub-tasks corresponding to each fog node; and sending the sub-tasks corresponding to each fog node to each fog node using the transmission power of the terminals when sending data to each fog node.
[0006] In one possible implementation, an objective function is constructed with the goal of minimizing the total computational latency of the computational task, and the optimal solution is found. This includes: determining the objective function with computation offloading strategy, computational resources, and transmission power as independent variables, and minimizing the total computational latency of the computational task as the objective; the computation offloading strategy includes the proportion of computational tasks executed by terminals and the proportion of computational tasks migrated to each fog node executed by each fog node; the computational resources include the computational rate when terminals execute computational tasks and the computational rate when each fog node executes computational tasks; the transmission power includes the transmission power when terminals send computational tasks to each fog node and the transmission power when each fog node sends computational tasks to the cloud computing center; the limits of the computation offloading strategy, computational resources, and transmission power, as well as the limit of the total computational latency, are used as constraints on the objective function; and the optimal solution is found based on the objective function and its constraints.
[0007] In one possible implementation, the optimal solution is found based on the objective function and constraints, including: determining the objective function based on the following formula;
[0008]
[0009]
[0010]
[0011] Where χ represents the set of computation offloading strategies, and T represents the total computation latency of the computation task. Represents a collection of computing resources. T represents the set of transmitted power. k This represents the computation delay of terminal k. This represents the maximum limit of computation latency for terminal k. Represents a set of terminals. This represents the computational energy of terminal k. This indicates that terminal k will sub-task
[0012] The power consumption of transmitting data to fog node f. This represents the energy consumption limit for terminal k to perform computing tasks. This represents the computing speed allocated to terminal k for executing the computing task. This represents the maximum computing speed allocated to terminal k for executing computing tasks. This represents the computing speed allocated to fog node f for performing computational tasks. This represents the maximum computing speed limit allocated to fog node f for executing computational tasks. This indicates the computing speed allocated to the cloud computing center for executing computing tasks. This indicates the maximum computing speed allocated to a cloud computing center for executing computing tasks. Let k represent any terminal k belonging to the terminal set. Let f and p represent any fog node f that belongs to the set of fog nodes. k This represents the transmission power of terminal k. p represents the maximum transmit power limit of terminal k. f,c This represents the transmit power of fog node f. x represents the maximum transmit power limit of fog node f. k x represents the proportion of computing tasks performed by the terminal. k,f C1 represents the proportion of subtasks migrated to fog node f that are executed by fog node f; C2 represents the computation latency limit of the computation task; C2 represents the energy limit of terminal k; C3 represents the computation resource limit of the computation task; C4 represents the transmission power limit of terminal k; and C5 represents the computation offloading policy limit of the computation task.
[0013] In one possible implementation, the optimal solution is found based on the objective function and constraints, including: decoupling the independent variables in the objective function based on the computational offloading strategy, computational resources, and transmission power, transforming the multi-objective into multiple independent single-objective functions; performing consistency optimization on the multiple independent single-objective functions to obtain optimized single-objective functions; constructing an enhanced Lagrangian function based on the optimized single-objective functions; performing iterative calculations using the gradient descent method to solve for the enhanced Lagrangian function; and determining the solution of the enhanced Lagrangian function as the optimal solution.
[0014] In one possible implementation, an enhanced Lagrangian function is constructed based on multiple optimized single-objective functions, including:
[0015]
[0016] Among them, L ρ (x, x0, λ) represents the enhanced Lagrangian function, where x represents the set of multiple optimization variables of the objective function. i Let x0 represent the i-th optimization variable in the objective function, and f represent the uniformization variable. i(x i Let ) denote the continuous cost function of the i-th optimization variable, h(x0) denote the normalization function, and λ denote the first set of penalty factors, where λ > 0. Let ρ represent the i-th first penalty factor, ρ represent the second penalty factor, and N represent the number of optimization variables.
[0017] In one possible implementation, iterative calculations are performed based on gradient descent to solve for the enhanced Lagrangian function, including: determining the iterative variables in the iterative calculation process based on the following formula;
[0018]
[0019] in, This represents the value of the uniformization variable in the (t+1)th iteration. This represents the value of the i-th optimization variable in the (t+1)-th iteration. This represents the value of the i-th first penalty factor in the (t+1)-th iteration. This represents the value of the i-th first penalty factor in the t-th iteration. Let represent the initial value of the i-th first penalty factor, h(x0) represent the normalization function, x0 represent the initial value of the uniformized variable, ρ represent the second penalty factor, and x i Let represent the i-th optimization variable in the objective function, and N represent the number of optimization variables.
[0020] In one possible implementation, iterative calculations are performed based on gradient descent to solve for the enhanced Lagrangian function, including: determining the iterative variables in the iterative calculation process based on the following formula;
[0021]
[0022]
[0023] c0 = 1
[0024]
[0025] Where, x t+1 Let x represent the set of optimization variables at the (t+1)th iteration; t y represents the set of optimization variables at the t-th iteration; t+1 y represents the set of intermediate variables at the (t+1)th iteration; t y represents the set of intermediate variables at the t-th iteration; t-1 c represents the set of intermediate variables at the (t-1)th iteration; c0 represents the initial acceleration iteration step size; c t c represents the acceleration step size in the t-th iteration; t-1c represents the acceleration step size in the (t-1)th iteration; t+1 α represents the acceleration iteration step size in the (t+1)th iteration; α represents the fixed iteration step size. The function f(x) represents the expression for x. t The gradient value.
[0026] Secondly, embodiments of the present invention provide a task allocation device for a smart grid, the smart grid including a terminal, multiple fog nodes, and a cloud computing center; the task allocation device includes: a communication module for acquiring computing tasks generated by the terminal; a processing module for constructing an objective function with the goal of minimizing the total computational latency of the computing tasks, solving for an optimal solution, the optimal solution including the optimal allocation ratio of the terminal, each fog node, and the cloud computing center in executing computing tasks, and the transmission power of the terminal when sending data to each fog node; based on the optimal allocation ratio, dividing the computing tasks into multiple sub-tasks corresponding to each fog node; and sending the sub-tasks corresponding to each fog node to each fog node using the transmission power of the terminal when sending data to each fog node.
[0027] In one possible implementation, the processing module is specifically used to determine an objective function with computation offloading strategy, computational resources, and transmission power as independent variables, and minimizing the total computational latency of computational tasks as the objective. The computation offloading strategy includes the proportion of computational tasks executed by terminals and the proportion of subtasks migrated to each fog node being executed by each fog node. The computational resources include the computational rate when terminals execute computational tasks and the computational rate when each fog node executes computational tasks. The transmission power includes the transmission power when terminals send computational tasks to each fog node and the transmission power when each fog node sends computational tasks to the cloud computing center. The limits of the computation offloading strategy, computational resources, and transmission power, as well as the limit of the total computational latency, are used as constraints on the objective function. Based on the objective function and the constraints of the objective function, the optimal solution is solved.
[0028] In one possible implementation, the processing module is specifically used to determine the objective function based on the following formula;
[0029]
[0030] Where χ represents the set of computation offloading strategies, and T represents the total computation latency of the computation task. Represents a collection of computing resources. T represents the set of transmitted power. k This represents the computation delay of terminal k. This represents the maximum limit of computation latency for terminal k. Represents a set of terminals. This represents the computational energy of terminal k. This represents the transmission energy consumption of terminal k when transmitting the subtask to fog node f. This represents the energy consumption limit for terminal k to perform computing tasks. This represents the computing speed allocated to terminal k for executing the computing task. This represents the maximum computing speed allocated to terminal k for executing computing tasks. This represents the computing speed allocated to fog node f for performing computational tasks. This represents the maximum computing speed limit allocated to fog node f for executing computational tasks. This indicates the computing speed allocated to the cloud computing center for executing computing tasks. This indicates the maximum computing speed allocated to a cloud computing center for executing computing tasks. Let k represent any terminal k belonging to the terminal set. Let f and p represent any fog node f that belongs to the set of fog nodes. k This represents the transmission power of terminal k. p represents the maximum transmit power limit of terminal k. f,c This represents the transmit power of fog node f. x represents the maximum transmit power limit of fog node f. k x represents the proportion of computing tasks performed by the terminal. k,f C1 represents the proportion of subtasks migrated to fog node f that are executed by fog node f; C2 represents the computation latency limit of the computation task; C2 represents the energy limit of terminal k; C3 represents the computation resource limit of the computation task; C4 represents the transmission power limit of terminal k; and C5 represents the computation offloading policy limit of the computation task.
[0031] In one possible implementation, the processing module is specifically used to decouple the independent variables in the objective function based on the computational offloading strategy, computational resources, and transmission power, transforming the multi-objective into multiple independent single-objective functions; perform consistency optimization on the multiple independent single-objective functions to obtain multiple optimized single-objective functions; construct an enhanced Lagrangian function based on the multiple optimized single-objective functions; perform iterative calculations based on the gradient descent method to solve for the enhanced Lagrangian function; and determine the solution of the enhanced Lagrangian function as the optimal solution.
[0032] In one possible implementation, the processing module is specifically used to construct the enhanced Lagrange function based on the following formula:
[0033]
[0034] Among them, L ρ (x, x0, λ) represents the enhanced Lagrangian function, where x represents the set of multiple optimization variables of the objective function. i Let x0 represent the i-th optimization variable in the objective function, and f represent the uniformization variable. i (xi Let ) denote the continuous cost function of the i-th optimization variable, h(x0) denote the normalization function, and λ denote the set of first penalty factors, where λ > 0. Let ρ represent the i-th first penalty factor, ρ represent the second penalty factor, and N represent the number of optimization variables.
[0035] In one possible implementation, the processing module is specifically used to determine the iterative variables in the iterative calculation process based on the following formula;
[0036]
[0037] in, This represents the value of the uniformization variable in the (t+1)th iteration. This represents the value of the i-th optimization variable in the (t+1)-th iteration. This represents the value of the i-th first penalty factor in the (t+1)-th iteration. This represents the value of the i-th first penalty factor in the t-th iteration. Let represent the initial value of the i-th first penalty factor, h(x0) represent the normalization function, x0 represent the initial value of the uniformized variable, ρ represent the second penalty factor, and x i Let represent the i-th optimization variable in the objective function, and N represent the number of optimization variables.
[0038] In one possible implementation, the processing module is specifically used to determine the iterative variables in the iterative calculation process based on the following formula;
[0039]
[0040]
[0041] c0 = 1
[0042]
[0043] Where, x t+1 Let x represent the set of optimization variables at the (t+1)th iteration; t y represents the set of optimization variables at the t-th iteration; t+1 y represents the set of intermediate variables at the (t+1)th iteration; t y represents the set of intermediate variables at the t-th iteration; t-1 c represents the set of intermediate variables at the (t-1)th iteration; c0 represents the initial acceleration iteration step size; c t c represents the acceleration step size in the t-th iteration; t-1 c represents the acceleration step size in the (t-1)th iteration; t+1α represents the acceleration iteration step size in the (t+1)th iteration; α represents the fixed iteration step size. The function f(x) represents the expression for x. t The gradient value.
[0044] Thirdly, embodiments of the present invention provide an electronic device, characterized in that the electronic device includes a memory and a processor, the memory storing a computer program, and the processor being configured to call and run the computer program stored in the memory to perform the steps of the method as described in the first aspect and any possible implementation thereof.
[0045] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, it implements the steps of the method as described in the first aspect and any possible implementation thereof.
[0046] This invention provides a task allocation method, apparatus, and electronic device for smart grids. By constructing an objective function that minimizes the total computational latency of computational tasks, the optimal solution is obtained. This calculates the optimal allocation ratio for computational tasks executed by terminals, fog nodes, and the cloud computing center, as well as the transmission power of the terminals when sending data to the fog nodes. Subsequently, computational tasks are divided according to the optimal allocation ratio, and each sub-task is sent to the fog nodes according to its transmission power. This achieves three-layer computational collaboration between the edge, terminal, and cloud, improving the computational efficiency of terminal-generated computational tasks, reducing the computational latency of terminal-generated computational tasks in the smart grid, and enhancing the task processing capability of the smart grid. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention, 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.
[0048] Figure 1 This is a schematic diagram illustrating an application scenario of a task allocation method for a smart grid provided in an embodiment of the present invention;
[0049] Figure 2 This is a flowchart illustrating a task allocation method for a smart grid provided in an embodiment of the present invention;
[0050] Figure 3 This is a flowchart illustrating another task allocation method for a smart grid provided in an embodiment of the present invention;
[0051] Figure 4This is a schematic diagram of the structure of a task allocation device for a smart grid provided in an embodiment of the present invention;
[0052] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0053] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.
[0054] In the description of this invention, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" and "more than one" refer to two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.
[0055] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner to facilitate understanding.
[0056] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or modules is not limited to the steps or modules listed, but may optionally include other steps or modules not listed, or may optionally include other steps or modules inherent to such process, method, product, or device.
[0057] To make the objectives, technical solutions, and advantages of the present invention clearer, the following description will be provided in conjunction with the accompanying drawings and specific embodiments.
[0058] Figure 1 This is a schematic diagram illustrating an application scenario of a task allocation method for a smart grid provided in an embodiment of the present invention. Figure 1This paper presents a system architecture for a smart grid. The smart grid includes terminals, multiple fog nodes, and a cloud computing center. Fog nodes, acting as access nodes for the terminals, are configured with edge servers. The terminals, fog nodes, and cloud computing center constitute a cellular-free massive MIMO architecture, introducing a three-layer "end-edge-cloud" computing collaboration architecture to intelligently offload the terminal's computing tasks to the associated access nodes and cloud computing center. This endows the power terminals with the ability to rapidly respond to changes in complex grid environments and to perform real-time computing and synchronous processing of tasks such as distribution network inspection information analysis and processing, and power grid transmission line inspection image recognition. Then, a computing offloading and communication link model is established, modeling the computing and communication resource allocation problem with the goal of minimizing computing task latency. Finally, a first-order dual-acceleration algorithm based on ADMM, Nesterov, and Heavy-ball momentum is proposed to jointly optimize communication and computing resources. This enables the real-time execution of massive smart grid computing tasks under power consumption and latency constraints within a cellular-free massive MIMO network architecture.
[0059] Figure 2 This is a flowchart illustrating a task allocation method for a smart grid according to an embodiment of the present invention. The execution entity of this method is a task allocation device. The method includes steps S101-S104.
[0060] S101. Obtain the computing tasks generated by the terminal.
[0061] S102. Construct an objective function with the goal of minimizing the total computational delay of the computational task, and solve for the optimal solution.
[0062] In this embodiment, the optimal solution includes the optimal allocation ratio of computing tasks performed by the terminal, each fog node, and the cloud computing center, as well as the transmission power when the terminal sends data to each fog node.
[0063] To more clearly illustrate the task allocation method for smart grids provided by this invention, such as... Figure 3 The diagram illustrates a flowchart of another task allocation method for a smart grid provided by an embodiment of the present invention. To fully utilize the computing potential of the terminal itself, the edge servers of the access nodes, and the remote cloud computing center, considering the concept of "computing collaboration," the computing tasks of each terminal device can be executed locally on the terminal, partially migrated to the AP node cluster via the wireless access link, and the remaining portion can be further migrated to the CPU for execution via the backhaul link. The process for completing its computing tasks is as follows: Figure 3As shown in the diagram, firstly, it is assumed that a certain proportion of computing tasks are executed locally on the terminal. Then, the remaining computing task data is sent to its associated AP node, but the AP's computing power is limited, and it can only execute a portion of the received computing tasks. Finally, the remaining computing task data is further sent to the cloud computing center. In this way, the present invention achieves three-layer computing collaboration between the edge, terminal, and cloud, improving the computing efficiency of terminal-generated computing tasks, reducing the computing latency of terminal-generated computing tasks in the smart grid, and improving the task processing capacity of the smart grid.
[0064] For example, suppose a cellular-free massive MIMO system based on a converged wireless network includes a cloud computing center, F fog nodes with edge computing capabilities, and K terminals. The set of fog nodes is used... Indicates. Terminal set is used This indicates that each terminal... Generate a computation task I k ={λ k ,γ k ,τ k}
[0065] Where, λ k Indicates Task I k The size of the input data, γ k Indicates completion of task I k The required computational cost, τ k Indicates the execution of task I k Maximum latency limit.
[0066] It should be noted that, considering the concept of "computational collaboration", the computing tasks of each terminal device can be executed locally on the device, or part of them can be migrated to the fog node cluster through the wireless access link, and the remaining part can be further migrated to the cloud computing center for execution through the backhaul link.
[0067] Therefore, this invention defines a set of computational unloading strategies. Where, x k This represents the ratio of computational tasks generated by terminal k to those executed locally; in other words, the proportion of computational tasks executed by terminal k. k,f This represents the proportion of computational tasks migrated to fog node f for execution, i.e., the proportion of subtasks migrated to fog node f that are executed by fog node f. The set of transmit power for the terminal and fog nodes. Where, p k p represents the transmission power of terminal k. f,c This represents the transmission power of fog node f. This represents the maximum limit of the transmission power of terminal k. This represents the maximum transmit power limit of fog node f. The respective computing rate sets at service nodes such as terminals, fog nodes, and cloud computing centers are defined as follows:
[0068]
[0069] in, This represents the computing speed allocated to terminal k for executing the computing tasks generated by terminal k; that is, the computing speed allocated to terminal k for executing the computing tasks. This represents the maximum computing speed allocated to terminal k for executing computing tasks. This represents the computing speed allocated to fog node f for performing computational tasks. This represents the maximum computing speed limit allocated to fog node f for executing computational tasks. This indicates the computing speed allocated to the cloud computing center for executing computing tasks. This indicates the maximum computing speed allocated to a cloud computing center for executing computing tasks.
[0070] The process for completing its computational task is as follows: First, assume that in the terminal... The amount of computational task performed locally is x k γ k This allows us to obtain the execution time required for the computation task. Computational energy of terminal k Then, the remaining computational task data (1-x) k )λ k If the data is sent to its associated fog node f, then the data transmission delay required for terminal k to send the computation task to fog node f is... and transmission energy consumption They can be expressed as the following formulas.
[0071]
[0072]
[0073] Where, γ k Let B be the size of the computational task generated by terminal k, and let h be the transmission bandwidth between terminal k and fog node f. k,f Let σ be the channel gain between terminal k and fog node f. 2 Let be the noise variance of the transmitted signal between terminal k and fog node f.
[0074] Understandably, the fog node f has limited computing power and can only execute a portion of the received computational tasks, i.e., (1-x) k )x k,f γ k Accordingly, the execution time required to perform the computation task at the fog node f can be obtained as follows: Finally, the remaining computational task data (1-x) k (1-x) k , f )λ k The data transmission latency required for fog node f to send the computing task to the cloud computing center can be expressed by the following formula.
[0075]
[0076] in, Let f be the channel gain between the fog node f and the cloud computing center. The remaining computational workload (1-x) after the cloud computing center completes its tasks... k (1-x) k,f )γ k The execution time required for a cloud computing center to perform a computing task can be expressed as:
[0077] In summary, the latency consumed in completing the computing tasks generated by the terminal device can be expressed as:
[0078]
[0079] Accordingly, the total time to complete all computational tasks can be expressed as
[0080]
[0081] Since the amount of information in the calculation results is very small, this invention ignores the transmission latency and energy consumption caused by the access node and cloud computing center transmitting the calculation results to the terminal device.
[0082] By analyzing different calculation methods, it can be understood that the task completion latency is mainly determined by the computation offloading strategy, computational resources, and transmission power. Therefore, this invention aims to minimize task completion latency. With the goal of calculating the unloading strategy χ and computing resources, and transmission power This is an optimization problem with variables such as computational latency limit C1, terminal energy limit C2, computational resource limit C3, transmission power limit C4, and computational offloading strategy limit C5 as constraints. The goal is to find the optimal solution to reduce the computational latency of computational tasks generated by the terminal.
[0083] As one possible implementation, the task allocation device can construct and solve the objective function based on steps S1021-S1023.
[0084] S1021. Using the computational offloading strategy, computational resources, and transmission power as independent variables, and minimizing the total computational delay of the computational task as the objective, determine the objective function.
[0085] In some embodiments, the computation offloading strategy includes the proportion of computation tasks performed by the terminal and the proportion of subtasks migrated to each fog node being performed by each fog node.
[0086] In some embodiments, computing resources include the computing speed when the terminal performs computing tasks and the computing speed when each fog node performs computing tasks.
[0087] In some embodiments, the transmission power includes the transmission power when the terminal sends computing tasks to each fog node and the transmission power when each fog node sends computing tasks to the cloud computing center.
[0088] S1022. The constraints of the objective function are the limits on the calculation of the offloading strategy, the calculation of resources and the transmission power, and the limit on the calculation of the total delay.
[0089] As one possible implementation, the task allocation device can determine the objective function based on the following formula.
[0090]
[0091]
[0092] in, Let T represent the set of computation offloading strategies, and let T represent the total computation latency of the computation task. Represents a collection of computing resources. T represents the set of transmitted power. k This represents the computation delay of terminal k. This represents the maximum limit of computation latency for terminal k. Represents a set of terminals. This represents the computational energy of terminal k. This represents the transmission energy consumption of terminal k when transmitting the subtask to fog node f. This represents the energy consumption limit for terminal k to perform computing tasks. This represents the computing speed allocated to terminal k for executing the computing task. This represents the maximum computing speed allocated to terminal k for executing computing tasks. This represents the computing speed allocated to fog node f for performing computational tasks. This represents the maximum computing speed limit allocated to fog node f for executing computational tasks. This indicates the computing speed allocated to the cloud computing center for executing computing tasks. This indicates the maximum computing speed allocated to a cloud computing center for executing computing tasks. Let k represent any terminal k belonging to the terminal set. Let f and p represent any fog node f that belongs to the set of fog nodes.k This represents the transmission power of terminal k. p represents the maximum transmit power limit of terminal k. f,c This represents the transmit power of fog node f. x represents the maximum transmit power limit of fog node f. k x represents the proportion of computing tasks performed by the terminal. k,f C1 represents the proportion of subtasks migrated to fog node f that are executed by fog node f; C2 represents the computation latency limit of the computation task; C2 represents the energy limit of terminal k; C3 represents the computation resource limit of the computation task; C4 represents the transmission power limit of terminal k; and C5 represents the computation offloading policy limit of the computation task.
[0093] For example, the objective function This can be expressed as the following formula:
[0094]
[0095] in, This represents the execution time required for terminal k to perform the computation task. This represents the data transmission latency required for terminal k to send the computation task to fog node f. This represents the execution time required for fog node f to perform its computational task. This represents the data transmission latency required for fog node f to send computing tasks to the cloud computing center. The h represents the execution time required for a cloud computing center to perform a computing task. k,f This represents the channel gain between terminal k and fog node f. This represents the channel gain from fog node f to the cloud computing center.
[0096] S1023. Solve for the optimal solution based on the objective function and its constraints.
[0097] As one possible implementation, the task allocation device can solve for the optimal solution of the objective function based on steps A1-A5.
[0098] A1. Based on the computational offloading strategy, computational resources, and transmission power, the independent variables in the objective function are decoupled, and the multi-objective function is transformed into multiple independent single-objective functions.
[0099] It should be noted that the task allocation device can transform the objective function into the following formula, thereby converting a multi-objective function into multiple independent single-objective functions.
[0100]
[0101] Where x represents the set of computational offloading strategies, computational resources, and transmission power, that is, the set of multiple optimization variables of the objective function, f i h(x) is a continuous cost function, and h(x) is a convex but not continuous normalization function.
[0102] It should be noted that f i (x) can be an objective function that takes any optimization variable as a variable and aims to minimize the total computational latency of the computation task. For example, f i (x) can be an objective function that takes the calculation of the unloading strategy as a variable. Or, f i (x) can also be an objective function with computational resources as the variable. Or, f i (x) can also be an objective function with transmission power as the variable.
[0103] It should be noted that h(x) can be the proportion of computational tasks allocated to each fog node. The sum of the proportions of computational tasks allocated to each fog node equals 1.
[0104] A2. Perform consistency optimization on multiple independent single-objective functions to obtain multiple optimized single-objective functions.
[0105] For example, the task allocation device can perform consistency optimization based on the following formula.
[0106]
[0107] Where, x i This represents the i-th optimization variable in the objective function. For example, x i This can be used to calculate offloading strategies, computing resources, or transmission power. x0 represents a consistency variable, which is an intermediate variable value for optimization. N represents the number of optimization variables. For example, N can be 3 * number of terminals + 2 * (number of terminals + number of fog nodes).
[0108] A3. Based on the optimized single-objective functions, construct the enhanced Lagrangian function.
[0109] A4. Based on the gradient descent method, perform iterative calculations to solve for the enhanced Lagrangian function.
[0110] For example, the task allocation device can construct an enhanced Lagrange function based on the following formula:
[0111]
[0112] Among them, L ρ (x, x0, λ) represents the enhanced Lagrangian function, where x represents the set of multiple optimization variables of the objective function. iLet x0 represent the i-th optimization variable in the objective function, and f represent the uniformization variable. i (x i Let ) denote the continuous cost function of the i-th optimization variable, h(x0) denote the normalization function, and λ denote the set of first penalty factors. Let ρ represent the i-th first penalty factor, ρ represent the second penalty factor, and N represent the number of optimization variables.
[0113] For example, the task allocation device can use gradient descent to assign values to variable x based on the following formula. i x0, λ i The process is updated to determine the iterative variables during the iterative calculation.
[0114]
[0115] in, This represents the value of the uniformization variable in the (t+1)th iteration. This represents the value of the i-th optimization variable in the (t+1)-th iteration. This represents the value of the i-th first penalty factor in the (t+1)-th iteration. This represents the value of the i-th first penalty factor in the t-th iteration. Let represent the initial value of the i-th first penalty factor, h(x0) represent the normalization function, x0 represent the initial value of the uniformized variable, ρ represent the second penalty factor, and x i Let represent the i-th optimization variable in the objective function, and N represent the number of optimization variables.
[0116] As another example, in order to accelerate its convergence speed, this invention proposes a first-order dual-acceleration algorithm by combining Nesterov and Heavy-ball momentum techniques to improve the rate of global and local convergence of the algorithm.
[0117] For example, the task allocation device can determine the iterative variables in the iterative calculation process based on the following formula.
[0118]
[0119] Where, x t+1 Let x represent the set of optimization variables at the (t+1)th iteration; t y represents the set of optimization variables at the t-th iteration; t+1 y represents the set of intermediate variables at the (t+1)th iteration; t y represents the set of intermediate variables at the t-th iteration; t-1 c represents the set of intermediate variables at the (t-1)th iteration; c0 represents the initial acceleration iteration step size; c tc represents the acceleration step size in the t-th iteration; t-1 c represents the acceleration step size in the (t-1)th iteration; t+1 α represents the acceleration iteration step size in the (t+1)th iteration; α represents the fixed iteration step size. The function f(x) represents the expression for x. t The gradient value.
[0120] It should be noted that y t -y t- 1 refers to the heavy-ball acceleration term, used to speed up local convergence; x t+1 -x t The Nesterov acceleration term is used to speed up global convergence; by adjusting the direction of each iteration, the first-order algorithm can quickly converge to the optimal solution. The dual acceleration algorithm based on Nesterov and Heavy-ball momentum can solve each subproblem independently, significantly reducing computational complexity while improving both local and global convergence rates.
[0121] A5. The solution that enhances the Lagrange function is determined as the optimal solution.
[0122] S103. Based on the optimal allocation ratio, the computation task is divided into multiple sub-tasks corresponding to each fog node.
[0123] S104. Using the transmission power when the terminal sends data to each fog node, send the subtask corresponding to each fog node.
[0124] This invention provides a task allocation method for smart grids. By constructing an objective function that minimizes the total computational latency of computational tasks, the optimal solution is obtained. This solution yields the optimal allocation ratio for computational tasks executed by terminals, fog nodes, and the cloud computing center, as well as the transmission power of terminals when sending data to fog nodes. Subsequently, computational tasks are divided according to the optimal allocation ratio, and each sub-task is sent to each fog node according to its transmission power. This achieves three-layer computational collaboration between the edge, terminal, and cloud, improving the computational efficiency of terminal-generated computational tasks, reducing the computational latency of terminal-generated computational tasks in the smart grid, and enhancing the task processing capacity of the smart grid.
[0125] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0126] The following are device embodiments of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.
[0127] Figure 4A schematic diagram of a task allocation device for a smart grid provided in an embodiment of the present invention is shown. The task allocation device 200 includes a communication module 201 and a processing module 202.
[0128] The communication module 201 is used to acquire computing tasks generated by the terminal.
[0129] The processing module 202 is used to construct an objective function with the goal of minimizing the total computational latency of the computing task, and solve for the optimal solution. The optimal solution includes the optimal allocation ratio of the terminal, each fog node, and the cloud computing center to execute the computing task, as well as the transmission power when the terminal sends data to each fog node. Based on the optimal allocation ratio, the computing task is divided into multiple sub-tasks corresponding to each fog node. The sub-tasks corresponding to each fog node are sent to each fog node according to the transmission power when the terminal sends data to each fog node.
[0130] In one possible implementation, the processing module 202 is specifically used to determine an objective function with computation offloading strategy, computational resources, and transmission power as independent variables, and minimizing the total computational latency of computational tasks as the objective. The computation offloading strategy includes the proportion of computational tasks executed by terminals and the proportion of subtasks migrated to each fog node being executed by each fog node. The computational resources include the computational rate when terminals execute computational tasks and the computational rate when each fog node executes computational tasks. The transmission power includes the transmission power when terminals send computational tasks to each fog node and the transmission power when each fog node sends computational tasks to the cloud computing center. The limits of the computation offloading strategy, computational resources, and transmission power, as well as the limit of the total computational latency, are used as constraints on the objective function. Based on the objective function and the constraints of the objective function, the optimal solution is solved.
[0131] In one possible implementation, the processing module 202 is specifically used to determine the objective function based on the following formula;
[0132]
[0133] Where χ represents the set of computation offloading strategies, and T represents the total computation latency of the computation task. Represents a collection of computing resources. T represents the set of transmitted power. k This represents the computation delay of terminal k. This represents the maximum limit of computation latency for terminal k. Represents a set of terminals. This represents the computational energy of terminal k. This represents the transmission energy consumption of terminal k when transmitting the subtask to fog node f. This represents the energy consumption limit for terminal k to perform computing tasks. This represents the computing speed allocated to terminal k for executing the computing task. This represents the maximum computing speed allocated to terminal k for executing computing tasks. This represents the computing speed allocated to fog node f for performing computational tasks. This represents the maximum computing speed limit allocated to fog node f for executing computational tasks. This indicates the computing speed allocated to the cloud computing center for executing computing tasks. This indicates the maximum computing speed allocated to a cloud computing center for executing computing tasks. Let k represent any terminal k belonging to the terminal set. Let f and p represent any fog node f that belongs to the set of fog nodes. k This represents the transmission power of terminal k. p represents the maximum transmit power limit of terminal k. f,c This represents the transmit power of fog node f. x represents the maximum transmit power limit of fog node f. k x represents the proportion of computing tasks performed by the terminal. k,f C1 represents the proportion of subtasks migrated to fog node f and executed by fog node f; C2 represents the computation latency limit of the computation task; C3 represents the energy limit of terminal k; C4 represents the computation resource limit of the computation task; C5 represents the transmission power limit of terminal k; and C5 represents the computation offloading policy limit of the computation task.
[0134] In one possible implementation, the processing module 202 is specifically used to decouple the independent variables in the objective function based on the computational offloading strategy, computational resources, and transmission power, transforming the multi-objective into multiple independent single-objective functions; perform consistency optimization on the multiple independent single-objective functions to obtain multiple optimized single-objective functions; construct an enhanced Lagrangian function based on the multiple optimized single-objective functions; perform iterative calculations based on the gradient descent method to solve the enhanced Lagrangian function; and determine the solution of the enhanced Lagrangian function as the optimal solution.
[0135] In one possible implementation, processing module 202 is specifically used to construct the enhanced Lagrange function based on the following formula:
[0136]
[0137] Among them, L ρ (x, x0, λ) represents the enhanced Lagrangian function, where x represents the set of multiple optimization variables of the objective function. i Let x0 represent the i-th optimization variable in the objective function, and f represent the uniformization variable. i (x iLet ) denote the continuous cost function of the i-th optimization variable, h(x0) denote the normalization function, and λ denote the set of first penalty factors, where λ > 0. Let ρ represent the i-th first penalty factor, ρ represent the second penalty factor, and N represent the number of optimization variables.
[0138] In one possible implementation, the processing module 202 is specifically used to determine the iterative variables in the iterative calculation process based on the following formula;
[0139]
[0140] in, This represents the value of the uniformization variable in the (t+1)th iteration. This represents the value of the i-th optimization variable in the (t+1)-th iteration. This represents the value of the i-th first penalty factor in the (t+1)-th iteration. This represents the value of the i-th first penalty factor in the t-th iteration. Let represent the initial value of the i-th first penalty factor, h(x0) represent the normalization function, x0 represent the initial value of the uniformized variable, ρ represent the second penalty factor, and x i Let represent the i-th optimization variable in the objective function, and N represent the number of optimization variables.
[0141] In one possible implementation, the processing module 202 is specifically used to determine the iterative variables in the iterative calculation process based on the following formula;
[0142]
[0143] Where, x t+1 Let x represent the set of optimization variables at the (t+1)th iteration; t y represents the set of optimization variables at the t-th iteration; t+1 y represents the set of intermediate variables at the (t+1)th iteration; t y represents the set of intermediate variables at the t-th iteration; t-1 c represents the set of intermediate variables at the (t-1)th iteration; c0 represents the initial acceleration iteration step size; c t c represents the acceleration step size in the t-th iteration; t-1 c represents the acceleration step size in the (t-1)th iteration; t+1 α represents the acceleration iteration step size in the (t+1)th iteration; α represents the fixed iteration step size. The function f(x) represents the expression for x. t The gradient value.
[0144] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. For example... Figure 5 As shown, the electronic device 300 of this embodiment includes: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301. When the processor 301 executes the computer program 303, it implements the steps in the above-described method embodiments, for example... Figure 2 Steps 101 to 104 are shown. Alternatively, when the processor 301 executes the computer program 303, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 4 The functions of the communication module 201 and the processing module 202 shown are illustrated.
[0145] For example, the computer program 303 can be divided into one or more modules / units, which are stored in the memory 302 and executed by the processor 301 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 303 in the electronic device 300. For example, the computer program 303 can be divided into... Figure 4 The communication module 201 and the processing module 202 are shown.
[0146] The processor 301 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0147] The memory 302 can be an internal storage unit of the electronic device 300, such as a hard disk or memory of the electronic device 300. The memory 302 can also be an external storage device of the electronic device 300, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD) card, flash card, etc., equipped on the electronic device 300. Furthermore, the memory 302 can include both internal and external storage units of the electronic device 300. The memory 302 is used to store the computer program and other programs and data required by the terminal. The memory 302 can also be used to temporarily store data that has been output or will be output.
[0148] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0149] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0150] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0151] In the embodiments provided by this invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0152] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0153] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0154] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0155] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A task allocation method for a smart grid, characterized in that, The smart grid includes terminals, multiple fog nodes, and a cloud computing center; the task allocation method includes: Acquire computing tasks generated by the terminal; Construct an objective function with the goal of minimizing the total computational latency of the computing task, and solve for the optimal solution. This includes: determining the objective function with computation offloading strategy, computing resources, and transmission power as independent variables, and minimizing the total computational latency of the computing task as the objective; the computation offloading strategy includes the proportion of the computing task executed by the terminal and the proportion of the computing task executed by each fog node for subtasks migrated to each fog node; the computing resources include the computing speed of the terminal executing the computing task and the computing speed of each fog node executing the computing task; the transmission power includes the transmission power of the terminal sending the computing task to each fog node and the transmission power of each fog node sending the computing task to the cloud computing center; using the limits of the computation offloading strategy, the computing resources, and the transmission power, as well as the limit of the total computational latency, as constraints on the objective function; and solving for the optimal solution based on the objective function and its constraints; the optimal solution includes the optimal allocation ratio of the terminal, each fog node, and the cloud computing center executing the computing task, and the transmission power of the terminal sending data to each fog node. Based on the optimal allocation ratio, the computation task is divided into multiple sub-tasks corresponding to each fog node; Based on the transmission power when the terminal sends data to each fog node, a subtask corresponding to each fog node is sent to each fog node. The step of solving for the optimal solution based on the objective function and its constraints includes: decoupling the independent variables in the objective function based on the computation offloading strategy, the computational resources, and the transmission power, transforming the multi-objective into multiple independent single-objective functions; performing consistency optimization on the multiple independent single-objective functions to obtain optimized single-objective functions; constructing an enhanced Lagrangian function based on the optimized single-objective functions; performing iterative calculations using the gradient descent method to solve for the enhanced Lagrangian function; and determining the solution of the enhanced Lagrangian function as the optimal solution. The enhanced Lagrange function is: ; in, This represents the enhanced Lagrange function. This represents the set of multiple optimization variables for the objective function. This represents the i-th optimization variable in the objective function. Representing a uniform variable, Let i represent the continuous cost function of the i-th optimization variable. Represents the normalization function. Denotes the set of first penalty factors. >0, Denotes the i-th first penalty factor. Indicates the second penalty factor. This indicates the number of optimization variables.
2. The task allocation method for a smart grid according to claim 1, characterized in that, Solving for the optimal solution based on the objective function and the constraints includes: The objective function is determined based on the following formula; in, This represents the set of computational unloading strategies. This represents the total computational latency of the computational task. This represents the set of computing resources. The set representing the transmission power, Indicates terminal The computational delay, Indicates terminal The maximum limit of computational delay, Represents a set of terminals. Indicates terminal Calculate energy, Indicates terminal The energy consumption of transmitting subtasks to fog node f. Indicates terminal Energy consumption limits for performing the computational task. Indicates terminal The computing speed allocated to perform the computing task. Indicates terminal The maximum limit of the computing speed allocated to perform the computing task. Fog node The computing speed allocated to perform the computing task. Fog node The maximum limit of the computing speed allocated to perform the computing task. This indicates the computing speed allocated to the cloud computing center for executing the aforementioned computing task. This indicates the maximum computing speed allocated to the cloud computing center for executing the aforementioned computing task. Represents any terminal belonging to the terminal set. , Represents any fog node belonging to the set of fog nodes. , Indicates terminal The transmission power, Indicates terminal The maximum limit of the transmission power, Fog node The transmission power, Fog node The maximum limit of the transmission power, This indicates the proportion of the computing task performed by the terminal. Indicates migration to fog node Subtasks and fog nodes The proportion of execution; This indicates the computation latency limit for the computation task. Indicates terminal Energy limitation, This indicates the computational resource limitations of the computational task. Indicates terminal Transmit power limit, This indicates the computation offloading strategy restrictions for the computation task.
3. The task allocation method for a smart grid according to claim 1, characterized in that, The step of iteratively calculating and solving the enhanced Lagrangian function based on the gradient descent method includes: The iterative variables in the iterative calculation process are determined based on the following formula; ; in, This represents the value of the uniformization variable in the (t+1)th iteration. This represents the value of the i-th optimization variable in the (t+1)-th iteration. This represents the value of the i-th first penalty factor in the (t+1)-th iteration. This represents the value of the i-th first penalty factor in the t-th iteration. This represents the initial value of the i-th first penalty factor. Represents the normalization function. Represents the initial value of the uniformization variable. Indicates the second penalty factor. This represents the i-th optimization variable in the objective function. This indicates the number of optimization variables.
4. The task allocation method for a smart grid according to claim 1, characterized in that, The step of iteratively calculating and solving the enhanced Lagrangian function based on the gradient descent method includes: The iterative variables in the iterative calculation process are determined based on the following formula; in, This represents the set of optimization variables at the (t+1)th iteration; Let represent the set of optimization variables at the t-th iteration; This represents the set of intermediate variables at the (t+1)th iteration; This represents the set of intermediate variables at the t-th iteration; This represents the set of intermediate variables at the (t-1)th iteration; Indicates the initial acceleration iteration step size; This indicates the acceleration step size in the t-th iteration; This indicates the acceleration step size in the (t-1)th iteration; This indicates the acceleration step size in the (t+1)th iteration; Indicates a fixed iteration step size; Representation function against The gradient value.
5. A task allocation device for a smart grid, characterized in that, The smart grid includes terminals, multiple fog nodes, and a cloud computing center; the task allocation device includes: The communication module is used to acquire computing tasks generated by the terminal. The processing module is used to construct an objective function with the goal of minimizing the total computational latency of the computing task, and solve for the optimal solution. The optimal solution includes the optimal allocation ratio of the terminal, each fog node, and the cloud computing center in executing the computing task, as well as the transmission power of the terminal when sending data to each fog node. Based on the optimal allocation ratio, the computing task is divided into multiple sub-tasks corresponding to each fog node. The sub-tasks corresponding to each fog node are sent to each fog node using the transmission power of the terminal when sending data to each fog node. The processing module is specifically used to determine an objective function with computation offloading strategy, computational resources, and transmission power as independent variables, and minimizing the total computational latency of the computational task as the objective. The computation offloading strategy includes the proportion of the computational task executed by the terminal and the proportion of the computational task executed by each fog node for subtasks migrated to each fog node. The computational resources include the computational rate when the terminal executes the computational task and the computational rate when each fog node executes the computational task. The transmission power includes the transmission power when the terminal sends the computational task to each fog node and the transmission power when each fog node sends the computational task to the cloud computing center. The limits of the computation offloading strategy, the computational resources, and the transmission power, as well as the limit of the total computational latency, are used as constraints on the objective function. Based on the objective function and the constraints of the objective function, the optimal solution is solved. The processing module is specifically configured to, based on the computation offloading strategy, the computing resources, and the transmission power, decouple the independent variables in the objective function, transforming the multi-objective into multiple independent single-objective functions; perform consistency optimization on the multiple independent single-objective functions to obtain optimized single-objective functions; construct an enhanced Lagrangian function based on the optimized single-objective functions; perform iterative calculations using the gradient descent method to solve the enhanced Lagrangian function; and determine the solution of the enhanced Lagrangian function as the optimal solution; the enhanced Lagrangian function is: ; in, This represents the enhanced Lagrange function. This represents the set of multiple optimization variables for the objective function. This represents the i-th optimization variable in the objective function. Representing a uniform variable, Let i represent the continuous cost function of the i-th optimization variable. Represents the normalization function. Denotes the set of first penalty factors. >0, Denotes the i-th first penalty factor. Indicates the second penalty factor. This indicates the number of optimization variables.
6. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor being configured to invoke and run the computer program stored in the memory to perform the method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 4 above.