Task offloading method, device and electronic device based on edge computing

By obtaining task information in the power system, determining priority and building resource allocation functions, and optimizing task offloading ratio, the task allocation problem between local computing of power equipment and edge server computing is solved, and the efficiency and flexibility of edge computing is improved. Reduces total energy consumption.

CN117891591BActive Publication Date: 2024-11-26STATE GRID HEBEI ELECTRIC POWER CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311649574.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-04
Publication Date
2024-11-26
Estimated Expiration
2043-12-04

AI Technical Summary

Technical Problem

In the prior art, all tasks in the power system are retained locally in the power equipment or are completely offloaded in the edge server to calculate, resulting in low efficiency and flexibility in edge computing, which leads to higher overall energy consumption.

Method used

By obtaining task information for each power equipment, determining task priority, and building resource allocation functions based on priority and allowable delay, optimizing task offload ratio to minimize total energy consumption, reasonably segment tasks and on local and edge servers of power equipment Calculation tasks are allocated between them.

Benefits of technology

It improves the efficiency and flexibility of edge computing, effectively reduces total energy consumption, and realizes the rationality of task processing and efficient allocation of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117891591B_ABST
    Figure CN117891591B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of edge computing technology, and provides a task offloading method, device and electronic device based on edge computing. The method includes: obtaining task information of tasks corresponding to each power device in the target area, determining the priority of each task according to the task information; determining the range interval of the offloading ratio corresponding to each task according to the priority of each task; using the range interval of the offloading ratio corresponding to each task and the allowed delay of each task as constraints, the offloading ratio corresponding to each task as the optimization variable, and the minimum total energy consumption of each task as the optimization goal, to construct a resource allocation function; solving the resource allocation function, determining the optimal offloading ratio corresponding to each task, and sending the optimal offloading ratio to the corresponding power device. The present application can reasonably divide each task and retain it in the local calculation of the power device or offload it to the edge server for calculation, thereby improving the efficiency and flexibility of edge computing and effectively reducing the total energy consumption of edge computing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of edge computing technology, and specifically to a task offloading method, device and electronic device based on edge computing. Background Art

[0002] In the power system scenario, it is necessary to access a large number of power devices such as various sensors, which generate a large amount of data and computing tasks. However, the local computing capacity of power devices is limited and it is difficult to meet a large number of computing tasks. Therefore, Mobile Edge Computing (MEC) is proposed as a new communication and computing architecture. By deploying edge servers at the edge of the network close to each power device, it can provide intelligent analysis and processing services close to the data source, reduce latency, improve efficiency, enhance security and privacy protection, and relieve the pressure of local computing of power equipment.

[0003] In the related technology, for each task, the task is usually kept entirely in the local calculation of the power equipment or completely offloaded to the edge server for calculation, which affects the rationality of task processing, resulting in low efficiency and flexibility of edge computing, and further leads to high overall energy consumption of edge computing. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a task offloading method, device and electronic device based on edge computing to solve the technical problem in the related technology that all tasks are usually retained in the local calculation of the power equipment or all tasks are offloaded to the edge server for calculation, resulting in low efficiency and flexibility of edge computing and high overall energy consumption of edge computing.

[0005] In the first aspect, an embodiment of the present application provides a task offloading method based on edge computing, including: obtaining task information of tasks corresponding to each power equipment in the target area, and determining the priority of each task according to the task information; determining the range of unloading ratios corresponding to each task according to the priority of each task; wherein the unloading ratio indicates the proportion of the corresponding task calculated on the edge server; using the range of unloading ratios corresponding to each task and the allowed delay of each task as constraints, the unloading ratio corresponding to each task as an optimization variable, and the minimum total energy consumption of each task as the optimization goal, to construct a resource allocation function; solving the resource allocation function, determining the optimal unloading ratio corresponding to each task, and sending the optimal unloading ratio to the corresponding power equipment.

[0006] In a possible implementation of the first aspect, task information includes task type and task size, and different task types have different delay requirements; determining the priority of each task based on the task information includes: determining a first processing score for each task based on the delay requirement corresponding to the task type of each task, and a correspondence between a preset delay requirement and a processing score; discretizing the task size of each task to obtain a discrete result, and determining a second processing score for each task based on the discrete result; determining the priority of each task based on the first processing score and the second processing score of each task.

[0007] In a possible implementation of the first aspect, the resource allocation function is expressed as:

[0008]

[0009] Among them, J is the resource allocation function, x i is the offloading ratio corresponding to the i-th task, i = 1, 2, ..., I, I is determined according to the number of tasks, s i is the task size of the ith task, f 1i is the local calculation frequency of the power equipment corresponding to the i-th task, f 2i is the computation frequency assigned to the i-th task by the edge server, P i is the local data transmission power of the power equipment corresponding to the i-th task, R i is the local data transmission rate of the power equipment corresponding to the i-th task.

[0010] In a possible implementation of the first aspect, the constraint condition of the resource allocation function is expressed as follows:

[0011]

[0012] In the formula, x i is the offloading ratio corresponding to the i-th task, i = 1, 2, ..., I, I is determined according to the number of tasks, [a i , b i ] is the range of the unloading ratio corresponding to the i-th task, a i <b i ; T i is the total delay corresponding to the i-th task, T i_max is the maximum allowed delay corresponding to the i-th task; s i is the task size of the ith task, f 1i is the local calculation frequency of the power equipment corresponding to the i-th task, f 1i_max is the local maximum allowable calculated frequency of the power equipment corresponding to the i-th task; f 2i is the computation frequency assigned to the i-th task by the edge server, f2_max is the maximum allowed computing frequency of the edge server; P i is the local data transmission power of the power equipment corresponding to the i-th task, P i_max is the local maximum permissible data transmission power of the power equipment corresponding to the i-th task; R i is the local data transmission rate of the power equipment corresponding to the i-th task, R i_max is the local maximum allowed data transmission rate of the power equipment corresponding to the i-th task.

[0013] In a possible implementation of the first aspect, a resource allocation function is solved to determine the optimal unloading ratio corresponding to each task, including: based on the resource allocation function, iteratively optimizing the unloading ratio corresponding to each task until the iteration termination condition is met to obtain the optimal unloading ratio corresponding to each task; wherein the iteration termination condition is that the total energy consumption of each task is minimized, the total energy consumption of each task is less than a preset energy consumption threshold, or the maximum number of iterations is reached.

[0014] In a possible implementation of the first aspect, a range of unloading ratios corresponding to each task is determined according to the priority of each task, including: determining the range of unloading ratios corresponding to each task according to the priority of each task and a correspondence between a preset priority and a range of unloading ratios.

[0015] In a second aspect, an embodiment of the present application provides a task offloading device based on edge computing, including:

[0016] The information acquisition module is used to obtain the task information of the tasks corresponding to each power equipment in the target area and determine the priority of each task according to the task information.

[0017] The interval determination module is used to determine the range interval of the offloading ratio corresponding to each task according to the priority of each task; wherein the offloading ratio indicates the proportion of the corresponding task calculated on the edge server to the corresponding task.

[0018] The model building module is used to construct a resource allocation function with the range of the unloading ratio corresponding to each task and the allowed delay of each task as constraints, the unloading ratio corresponding to each task as the optimization variable, and the minimum total energy consumption of each task as the optimization goal.

[0019] The ratio determination module is used to solve the resource allocation function, determine the optimal unloading ratio corresponding to each task, and send the optimal unloading ratio to the corresponding power equipment.

[0020] In a possible implementation of the second aspect, the task information includes a task type and a task size, and different task types have different delay requirements; the interval determination module includes:

[0021] The first determination module is used to determine the first processing score of each task according to the delay requirement corresponding to the task type of each task and the corresponding relationship between the preset delay requirement and the processing score.

[0022] The second determination module is used to discretize the task size of each task to obtain a discrete result, and determine the second processing score of each task according to the discrete result.

[0023] The third determination module is used to determine the priority of each task according to the first processing score and the second processing score of each task.

[0024] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the edge computing-based task offloading method as described in any one of the first aspects is implemented.

[0025] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the edge computing-based task offloading method as described in any one of the first aspects.

[0026] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device executes the edge computing-based task offloading method described in any one of the first aspects above.

[0027] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

[0028] The edge computing-based task offloading method, device and electronic device provided in the embodiments of the present application consider each task as a divisible task, and determine the range of the offloading ratio corresponding to each task according to the priority of each task, use the range of the offloading ratio corresponding to each task and the allowed delay of each task as constraints, take the minimum total energy consumption of each task as the optimization goal, take the offloading ratio corresponding to each task as the optimization variable, construct a resource allocation function and solve it, and obtain the optimal offloading ratio corresponding to each task. Each task can be reasonably divided, and part of it can be retained in the local calculation of the corresponding power equipment according to the optimal offloading ratio, and part of it can be offloaded to the edge server for calculation, thereby improving the efficiency and flexibility of edge computing and effectively reducing the total energy consumption of edge computing.

[0029] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0031] Figure 1 It is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0032] Figure 2 It is a flowchart of a task offloading method based on edge computing provided by an embodiment of the present application;

[0033] Figure 3 It is a structural diagram of a task offloading device based on edge computing provided by an embodiment of the present application;

[0034] Figure 4 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0035] The present application is described more clearly below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the effects of the present application, but are not intended to limit the present application in any form. It should be noted that, for those of ordinary skill in the art, several variations and improvements may be made without departing from the concept of the present application. These all fall within the scope of protection of the present application.

[0036] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0037] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0038] In the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0039] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0040] In addition, the “plurality” mentioned in the embodiments of the present application should be interpreted as two or more.

[0041] In the power system scenario, it is necessary to access a large number of power equipment such as various sensors, etc., which generates a large amount of data and computing tasks. However, the local computing capacity of power equipment is limited and it is difficult to meet a large number of computing tasks. Therefore, mobile edge computing is proposed as a new communication and computing architecture. By deploying edge servers at the edge of the network close to each power device, intelligent analysis and processing services can be provided close to the data source, reducing latency, improving efficiency, improving security and privacy protection, and alleviating the pressure of local computing of power equipment. In related technologies, for each task, the task is usually retained in the local computing of the power equipment or completely offloaded to the edge server computing, which affects the rationality of task processing, resulting in low efficiency and flexibility of edge computing, and then leads to high overall energy consumption of edge computing.

[0042] Based on the above problems, the inventors have discovered through research that when processing each task, each task is treated as a divisible task, with part of it retained in the local calculation of the corresponding power equipment and part of it offloaded to the edge server for calculation. The total energy consumption of each task is minimized as the optimization goal, and the offloading ratio corresponding to each task is used as the optimization variable. A resource allocation function is constructed to determine the optimal offloading ratio, which can reduce the overall energy consumption of edge computing.

[0043] Figure 1 Schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, the application scenario corresponding to the edge computing-based task offloading method provided in the embodiment of the present application includes: multiple power devices 100, edge servers 200 and electronic devices 300. The multiple power devices 100 include power device 1, power device 2, ..., power device m.

[0044] The power equipment 100 refers to different types of sensors and high-definition video equipment deployed in the power system, which are not limited here. The edge server 200 refers to a server or server cluster with certain data storage, processing and analysis capabilities. The electronic device 300 can exchange information with multiple power devices 100 and edge servers 200 through the network, obtain the task information of the power device 100 and the relevant information of the edge server 200, and determine the optimal unloading ratio of the corresponding task of the power device 100, so as to reasonably divide each task, retain part of it in the local calculation of the corresponding power device, and unload part of it to the edge server for calculation, so as to improve the efficiency and flexibility of edge computing and effectively reduce the total energy consumption of edge computing.

[0045] Figure 2 FIG. 1 is a flow chart of a task offloading method based on edge computing provided in an embodiment of the present application. Figure 2 As shown, the method in the embodiment of the present application may include:

[0046] Step 101: Obtain task information of tasks corresponding to each power equipment in a target area, and determine the priority of each task according to the task information.

[0047] Exemplarily, in this embodiment, the target area includes multiple power equipment, and each power equipment corresponds to a task to be calculated. Task information includes task type and task size, and different task types have different delay requirements. For example, delay requirements may include first-level delay requirements, second-level delay requirements, and third-level delay requirements, among which the importance of first-level delay requirements is higher than that of second-level delay requirements, and the importance of second-level delay requirements is higher than that of third-level delay requirements. Among them, urgent task types with very high real-time requirements correspond to first-level delay requirements, task types with generally high real-time requirements correspond to second-level delay requirements, and task types with low real-time requirements correspond to third-level delay requirements.

[0048] In a possible implementation manner, this embodiment may include S1 to S3 when determining the priority of each task according to the task information.

[0049] S1. Determine a first processing score for each task according to a delay requirement corresponding to a task type of each task and a correspondence between a preset delay requirement and a processing score.

[0050] S2. Discretize the task size of each task to obtain a discrete result, and determine the second processing score of each task according to the discrete result.

[0051] S3. Determine the priority of each task according to the first processing score and the second processing score of each task.

[0052] Optionally, in this embodiment, after the delay requirement corresponding to each task is determined according to the task type of each task, the first processing score of each task is determined according to the correspondence between the preset delay requirement and the processing score. The correspondence between the preset delay requirement and the processing score can be set as needed, for example, the first delay requirement corresponds to 30 points, the second delay requirement corresponds to 20 points, and the third delay requirement corresponds to 10 points.

[0053] Exemplarily, in this embodiment, the task size of each task is discretized to obtain a discrete result. For example, the tasks whose task size ranges from (0, 300], (301, 600], and (601, 900] are coded as 001, 002, and 003, respectively. That is, the tasks whose task size ranges from (0, 300], (301, 600], and (601, 900] have corresponding discrete results of 001, 002, and 003, respectively. And the second processing score of each task is determined according to the discrete result. For example, code 001 corresponds to 15 points, code 002 corresponds to 25 points, and code 003 corresponds to 35 points.

[0054] Optionally, this embodiment calculates a weighted average of the first processing score and the second processing score of each task to obtain a score corresponding to each task, wherein each weighting coefficient is set as required. Then, the priority corresponding to each task is determined according to the score corresponding to each task and the correspondence between the preset score and the priority.

[0055] Step 102: Determine the range of the unloading ratio corresponding to each task according to the priority of each task.

[0056] In this embodiment, the offloading ratio indicates the proportion of the portion of the corresponding task calculated on the edge server to the corresponding task. In determining the range of the offloading ratio corresponding to each task, this embodiment may include: determining the range of the offloading ratio corresponding to each task according to the priority of each task and the correspondence between the preset priority and the range of the offloading ratio.

[0057] For example, the correspondence between the preset priority and the unloading ratio range in this embodiment can be set as needed. For example, the higher the priority, the larger the values ​​of a and b in the corresponding unloading ratio range [a, b], where a<b, a is 0 at the minimum, and b is 1 at the maximum.

[0058] Step 103: construct a resource allocation function with the range of the unloading ratio corresponding to each task and the allowed delay of each task as constraints, the unloading ratio corresponding to each task as optimization variable, and the minimum total energy consumption of each task as optimization target.

[0059] Exemplarily, the expression of the resource allocation function in this embodiment is:

[0060]

[0061] Where J is the resource allocation function, x i is the offloading ratio corresponding to the i-th task, i = 1, 2, ..., I, I is determined according to the number of tasks, s i is the task size of the ith task, f 1i is the local calculation frequency of the power equipment corresponding to the i-th task, f 2i is the computation frequency assigned to the i-th task by the edge server, P i is the local data transmission power of the power equipment corresponding to the i-th task, R i is the local data transmission rate of the power equipment corresponding to the i-th task.

[0062] Optionally, the constraint condition of the resource allocation function in this embodiment is expressed as:

[0063]

[0064] In the formula, x i is the offloading ratio corresponding to the i-th task, i = 1, 2, ..., I, I is determined according to the number of tasks, [a i , b i ] is the range of the unloading ratio corresponding to the i-th task, a i <b i , a i The minimum value is 0, b i Maximum is 1; T i is the total delay corresponding to the i-th task, T i_max is the maximum allowed delay corresponding to the i-th task; s i is the task size of the ith task, f 1i is the local calculation frequency of the power equipment corresponding to the i-th task, f 1i_max is the local maximum allowable calculated frequency of the power equipment corresponding to the i-th task; f 2i is the computation frequency assigned to the i-th task by the edge server, f 2_max is the maximum allowed computing frequency of the edge server; P i is the local data transmission power of the power equipment corresponding to the i-th task, P i_max is the local maximum permissible data transmission power of the power equipment corresponding to the i-th task; R i is the local data transmission rate of the power equipment corresponding to the i-th task, R i_max is the local maximum allowed data transmission rate of the power equipment corresponding to the i-th task.

[0065] When processing the tasks corresponding to each power device, this embodiment considers each task as a divisible task, partially retaining the local calculation of the corresponding power device and partially offloading to the edge server for calculation. At the same time, the range of the unloading ratio corresponding to each task is determined according to the priority of each task. The range of the unloading ratio corresponding to each task and the allowed delay of each task are used as constraints, the total energy consumption of each task is minimized as the optimization goal, and the unloading ratio corresponding to each task is used as the optimization variable to construct a reasonable and effective resource allocation function, so as to solve the above resource allocation function in subsequent steps to reasonably and effectively determine the optimal unloading ratio corresponding to each task.

[0066] Step 104: Solve the resource allocation function to determine the optimal unloading ratio corresponding to each task, and send the optimal unloading ratio to the corresponding power equipment.

[0067] In a possible implementation, when solving the resource allocation function and determining the optimal unloading ratio corresponding to each task, this embodiment may include: based on the resource allocation function, iteratively optimizing the unloading ratio corresponding to each task until the iteration termination condition is met, thereby obtaining the optimal unloading ratio corresponding to each task.

[0068] Among them, the iteration termination condition in this embodiment is that the total energy consumption of each task is the smallest, the total energy consumption of each task is less than a preset energy consumption threshold, or the maximum number of iterations is reached.

[0069] Exemplarily, in this embodiment, algorithms such as particle swarm optimization algorithm, simulated annealing algorithm or ant colony optimization algorithm can be used to iteratively optimize the resource allocation function, and the iteration is terminated after the iteration termination condition is met to determine the optimal offloading ratio corresponding to each task.

[0070] Optionally, after determining the optimal unloading ratio corresponding to each task, this embodiment sends the optimal unloading ratio to the corresponding power equipment, so that each power equipment divides the corresponding task according to the corresponding optimal unloading ratio and retains it for local calculation in the power equipment or offloads it to the edge server for calculation.

[0071] The task offloading method based on edge computing provided in the embodiment of the present application considers each task as a divisible task, and determines the range of the offloading ratio corresponding to each task according to the priority of each task, takes the range of the offloading ratio corresponding to each task and the allowed delay of each task as constraints, takes the minimum total energy consumption of each task as the optimization goal, takes the offloading ratio corresponding to each task as the optimization variable, constructs a resource allocation function and solves it, and obtains the optimal offloading ratio corresponding to each task. Each task can be reasonably divided, and part of it is retained in the local calculation of the corresponding power equipment according to the optimal offloading ratio, and part is offloaded to the edge server for calculation, thereby improving the efficiency and flexibility of edge computing and effectively reducing the total energy consumption of edge computing.

[0072] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean 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 application.

[0073] Figure 3 Schematic diagram of the structure of a task offloading device based on edge computing provided by an embodiment of the present application. Figure 3 As shown, the edge computing-based task offloading device provided in this embodiment may include: an information acquisition module 201, an interval determination module 202, a model construction module 203 and a ratio determination module 204.

[0074] The information acquisition module 201 is used to acquire task information corresponding to tasks of each power device in the target area, and determine the priority of each task according to the task information.

[0075] The interval determination module 202 is used to determine the range interval of the offloading ratio corresponding to each task according to the priority of each task; wherein the offloading ratio indicates the proportion of the portion of the corresponding task calculated on the edge server to the corresponding task.

[0076] The model building module 203 is used to build a resource allocation function with the range of the unloading ratio corresponding to each task and the allowed delay of each task as constraints, the unloading ratio corresponding to each task as optimization variable, and the minimum total energy consumption of each task as optimization target.

[0077] The ratio determination module 204 is used to solve the resource allocation function, determine the optimal unloading ratio corresponding to each task, and send the optimal unloading ratio to the corresponding power equipment.

[0078] Optionally, the task information includes the task type and the task size, and different task types have different delay requirements; the interval determination module 202 includes:

[0079] The first determination module is used to determine the first processing score of each task according to the delay requirement corresponding to the task type of each task and the corresponding relationship between the preset delay requirement and the processing score.

[0080] The second determination module is used to discretize the task size of each task to obtain a discrete result, and determine the second processing score of each task according to the discrete result.

[0081] The third determination module is used to determine the priority of each task according to the first processing score and the second processing score of each task.

[0082] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0083] Figure 4 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 4 As shown, the electronic device 300 of this embodiment includes: a processor 310 and a memory 320, wherein the memory 320 stores a computer program 321 that can be run on the processor 310. When the processor 310 executes the computer program 321, the steps in any of the above method embodiments are implemented, for example Figure 2 Alternatively, when the processor 310 executes the computer program 321, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Figure 3 Functions of modules 201 to 204 are shown.

[0084] Exemplarily, the computer program 321 may be divided into one or more modules / units, one or more modules / units are stored in the memory 320, and are executed by the processor 310 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 321 in the electronic device 300.

[0085] Those skilled in the art will understand that Figure 4 These are merely examples of electronic devices and do not constitute a limitation of the electronic device. The electronic device may include more or fewer components than those shown in the figure, or a combination of certain components, or different components, such as input and output devices, network access devices, buses, etc.

[0086] The processor 310 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0087] The memory 320 may be an internal storage unit of the electronic device, such as a hard disk or memory of the electronic device, or an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. The above-mentioned memory 320 may also include both an internal storage unit of the electronic device and an external storage device. The above-mentioned memory 320 is used to store computer programs and other programs and data required by the electronic device. The memory 320 may also be used to temporarily store data that has been output or is to be output.

[0088] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by 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 embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0089] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0090] Those skilled in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0091] In the embodiments provided by the present invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0092] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0093] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0094] If the integrated module / unit is implemented in the form of 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, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0095] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A task offloading method based on edge computing, characterized in that: include: Obtaining task information corresponding to tasks of each power device in the target area, and determining the priority of each task according to the task information; Determine the range of the offloading ratio corresponding to each task according to the priority of each task; wherein the offloading ratio indicates the proportion of the portion of the corresponding task calculated on the edge server to the corresponding task; The resource allocation function is constructed by taking the range of the unloading ratio corresponding to each task and the allowed delay of each task as constraint conditions, the unloading ratio corresponding to each task as optimization variable, and the minimum total energy consumption of each task as optimization target; Solving the resource allocation function, determining the optimal unloading ratio corresponding to each task, and sending the optimal unloading ratio to the corresponding power equipment; Wherein, the expression of the resource allocation function is: Among them, J is the resource allocation function, x i is the unloading ratio corresponding to the i-th task, i=1,2,…,I, I is determined according to the number of tasks, s i is the task size of the ith task, f 1i is the local calculation frequency of the power equipment corresponding to the i-th task, f 2i is the computation frequency assigned to the i-th task by the edge server, P i is the local data transmission power of the power equipment corresponding to the i-th task, R i is the local data transmission rate of the power equipment corresponding to the i-th task; The expression of the constraint condition of the resource allocation function is: In the formula, x i is the unloading ratio corresponding to the i-th task, i=1,2,…,I, I is determined according to the number of tasks, [a i ,b i ] is the range of the unloading ratio corresponding to the i-th task, a i i ; T i is the total delay corresponding to the i-th task, T i_max is the maximum allowed delay corresponding to the i-th task; s i is the task size of the ith task, f 1i is the local calculation frequency of the power equipment corresponding to the i-th task, f 1i_max is the local maximum allowable calculated frequency of the power equipment corresponding to the i-th task; f 2i is the computation frequency assigned to the i-th task by the edge server, f 2_max is the maximum allowed computing frequency of the edge server; P i is the local data transmission power of the power equipment corresponding to the i-th task, P i_max is the local maximum permissible data transmission power of the power equipment corresponding to the i-th task; R i is the local data transmission rate of the power equipment corresponding to the i-th task, R i_max is the local maximum allowed data transmission rate of the power equipment corresponding to the i-th task.​ 2. The task offloading method based on edge computing according to claim 1 is characterized in that: The task information includes task type and task size, and different task types have different delay requirements; Determining the priority of each task according to the task information includes: Determine a first processing score for each task according to a latency requirement corresponding to a task type of each task and a correspondence between a preset latency requirement and a processing score; Discretize the task size of each task to obtain a discrete result, and determine the second processing score of each task according to the discrete result; The priority of each task is determined according to the first processing score and the second processing score of each task.

3. The task offloading method based on edge computing according to claim 1 is characterized in that: Solving the resource allocation function to determine the optimal offloading ratio corresponding to each task includes: Based on the resource allocation function, the unloading ratio corresponding to each task is iteratively optimized until the iteration termination condition is met, so as to obtain the optimal unloading ratio corresponding to each task; wherein the iteration termination condition is that the total energy consumption of each task is minimized, the total energy consumption of each task is less than a preset energy consumption threshold, or the maximum number of iterations is reached.

4. The task offloading method based on edge computing according to any one of claims 1 to 3, characterized in that: Determining the range of the uninstallation ratio corresponding to each task according to the priority of each task includes: The range of the unloading ratio corresponding to each task is determined according to the priority of each task and the correspondence between the preset priority and the range of the unloading ratio.

5. A task offloading device based on edge computing, characterized in that: include: An information acquisition module is used to acquire task information corresponding to tasks of each power device in the target area, and determine the priority of each task according to the task information; An interval determination module, used to determine the range interval of the offloading ratio corresponding to each task according to the priority of each task; wherein the offloading ratio indicates the proportion of the portion of the corresponding task calculated on the edge server to the corresponding task; A model building module, used to build a resource allocation function with the range of the unloading ratio corresponding to each task and the allowed delay of each task as constraints, the unloading ratio corresponding to each task as an optimization variable, and the minimum total energy consumption of each task as an optimization goal; A ratio determination module, used to solve the resource allocation function, determine the optimal unloading ratio corresponding to each task, and send the optimal unloading ratio to the corresponding power equipment; Wherein, the expression of the resource allocation function is: Among them, J is the resource allocation function, x i is the unloading ratio corresponding to the i-th task, i=1,2,…,I, I is determined according to the number of tasks, s i is the task size of the ith task, f 1i is the local calculation frequency of the power equipment corresponding to the i-th task, f 2i is the computation frequency assigned to the i-th task by the edge server, P i is the local data transmission power of the power equipment corresponding to the i-th task, R i is the local data transmission rate of the power equipment corresponding to the i-th task; The expression of the constraint condition of the resource allocation function is: In the formula, x i is the unloading ratio corresponding to the i-th task, i=1,2,…,I, I is determined according to the number of tasks, [a i ,b i ] is the range of the unloading ratio corresponding to the i-th task, a i i ; T i is the total delay corresponding to the i-th task, T i_max is the maximum allowed delay corresponding to the i-th task; s i is the task size of the ith task, f 1i is the local calculation frequency of the power equipment corresponding to the i-th task, f 1i_max is the local maximum allowable calculated frequency of the power equipment corresponding to the i-th task; f 2i is the computation frequency assigned to the i-th task by the edge server, f 2_max is the maximum allowed computing frequency of the edge server; P i is the local data transmission power of the power equipment corresponding to the i-th task, P i_max is the local maximum permissible data transmission power of the power equipment corresponding to the i-th task; R i is the local data transmission rate of the power equipment corresponding to the i-th task, R i_max is the local maximum allowed data transmission rate of the power equipment corresponding to the i-th task.​ 6. The task offloading device based on edge computing according to claim 5 is characterized in that: The task information includes task type and task size, and different task types have different delay requirements; The interval determination module includes: A first determination module, configured to determine a first processing score for each task according to a latency requirement corresponding to a task type of each task and a correspondence between a preset latency requirement and a processing score; A second determination module is used to discretize the task size of each task to obtain a discrete result, and determine a second processing score of each task according to the discrete result; The third determination module is used to determine the priority of each task according to the first processing score and the second processing score of each task.

7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the edge computing-based task offloading method as described in any one of claims 1 to 4 is implemented.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the edge computing-based task offloading method as described in any one of claims 1 to 4 is implemented.