A fog computing task offloading method and system based on global cost minimization

By adopting the global cost minimization method in fog computing to calculate the feasible matching offloading ratio and cost of terminals and fog nodes, and using the Kuhn-Munkres algorithm to solve the task offloading decision matrix, the cost problem when offloading tasks in fog computing is solved. Efficient task offloading and economical cost management are achieved.

CN115297123BActive Publication Date: 2024-10-25HUAIAN KUNBO INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210937214.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-05
Publication Date
2024-10-25
Estimated Expiration
2042-08-05

AI Technical Summary

Technical Problem

In fog computing, existing technologies fail to effectively consider the cost of fog node processing tasks, making it difficult for terminal devices to balance delay requirements and costs when offloading tasks, and are unable to maximize the offloading rate and minimize costs.

Method used

A method based on global cost minimization is used to obtain fog network information, calculate the feasible matching offloading ratio and cost between terminals and fog nodes, and use the extended Kuhn-Munkres algorithm to solve the task offloading decision matrix to ensure that the overall weight of the network is maximized, thereby Implement task offloading decisions.

Benefits of technology

On the premise of ensuring the success rate of task offloading, the overall cost of the system is significantly reduced, local optimal situations are avoided, and a more economical task offloading effect is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115297123B_ABST
    Figure CN115297123B_ABST
Patent Text Reader

Abstract

The present invention discloses a fog computing task unloading method and system based on global cost minimization, the method comprising: S1, obtaining information of the entire fog network; S2, judging the unloading feasibility of each terminal and fog node according to the information obtained by S1, and calculating the optimal unloading ratio and corresponding cost of feasible matching; S3, calculating the weight between each terminal node and the fog node according to the information obtained by S2; S4, using the extended Kuhn-Munkres algorithm, according to the weight obtained by S3, with the goal of maximizing the overall weight of the network, solving the one-to-one matching between the terminal node and the fog node, and obtaining the task unloading decision matrix X; S5, using the decision matrix X obtained by S4 as an index, obtaining the unloading ratio and cost of the terminal node and the corresponding fog node, as well as the overall cost of the system. The present invention considers the scenario of multiple terminal nodes and multiple fog nodes, and minimizes the network unloading cost under the premise of maximizing the unloading success rate with a global idea, avoiding the local optimal situation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of terminal task offloading, and in particular relates to a fog computing task offloading method and system based on global cost minimization. Background Art

[0002] With the rapid development of the Internet of Things (IoT) and 5G services, more and more occasions require the connection of a large number of terminal devices, and in certain cases, the terminals are very sensitive to latency. However, due to the limitations of their size, energy consumption and cost, the computing power and available resources of the terminals are very limited. It is difficult to meet the latency requirements of certain tasks by relying solely on the local computing of the terminals, so some tasks of the terminals have to be offloaded to the fog nodes (FN) with more powerful computing power for calculation.

[0003] In fog computing, most existing studies have not considered the issue of charging for fog node processing tasks. In real scenarios, fog nodes cannot provide computing, storage and other services to terminals for free in most cases. On the one hand, fog nodes themselves need to consume certain resources and energy when providing services, and on the other hand, the institutions that provide these fog computing services also need to make profits. Therefore, it is more reasonable to consider charging a certain fee for the unit bit processing service provided by fog nodes. In this case, the terminal cannot offload too many tasks to the fog node, otherwise it will result in excessive costs or even unaffordable; however, performing calculations entirely locally may not meet the latency requirements. Summary of the invention

[0004] In order to solve the problem of how to perform task offloading in the scenario where there is an offloading cost in the prior art so as to minimize the global task offloading cost, the solution of the present invention has a practical reference for the operation of the actual fog network, and provides a fog computing task offloading method and system that can maximize the success rate of task offloading while minimizing the network offloading cost.

[0005] In order to achieve the above-mentioned object of the invention, the present invention adopts the following technical solutions:

[0006] A fog computing task offloading method based on global cost minimization includes the following steps:

[0007] S1, obtains the information of the entire fog network;

[0008] S2, judging the offloading feasibility of each terminal and fog node according to the information obtained in step S1, and calculating the optimal offloading ratio and corresponding cost of feasible matching;

[0009] S3, calculating the weights between each terminal node and the fog node according to the information calculated in step S2;

[0010] S4, using the extended Kuhn-Munkres algorithm, according to the weight of step S3, with the goal of maximizing the overall weight of the network, solve the one-to-one matching between the terminal node and the fog node, and obtain the task offloading decision matrix X;

[0011] S5, using the decision matrix X in step S4 as an index, obtain the unloading ratio and cost of the terminal node and the corresponding fog node, as well as the overall cost of the system.

[0012] As a preferred solution, in step S1, the network controller obtains information about the entire network. The fog network information includes:

[0013] The number of terminal nodes M, the amount of task data for each terminal node S i 、CPU frequency f i , the number of CPU cycles required for the CPU to process 1 bit of data η i , the maximum tolerable delay of the task Transmit power i=1,2,…,M, etc.;

[0014] The number of fog nodes N, the CPU frequency of each fog node f j , the number of CPU cycles required for the CPU to process 1 bit of data is η j , and the unit price C for processing 1 bit of data j , j=1,2,…,N, etc.

[0015] The distance d between terminal node i and fog node j ij , channel bandwidth B ij And the noise power

[0016] Furthermore, the present invention assumes that M<=N.

[0017] As a preferred solution, step S2 includes the following steps:

[0018] S2.1, calculate the path loss L between terminal node i and fog node j ij , channel gain G ij , data transmission rate r ij ;

[0019] S2.2, determine the feasibility of offloading between terminal node i and fog node j;

[0020] S2.3, calculate the optimal offloading ratio of terminal node i and fog node j where offloading is feasible and the corresponding unloading cost P ij ; Assign null values ​​to the costs of terminal node i and fog node j for which the calculation is not feasible.

[0021] As a preferred solution, in step S2.1:

[0022] Calculate the path loss L between terminal node i and fog node j ij The formula is: L ij =38.46+20log 10 (d ij );

[0023] Calculate the channel gain G between terminal node i and fog node j ij The formula is: Where L ij is the path loss between terminal node i and fog node j;

[0024] Calculate the data transmission rate r between terminal node i and fog node j ij The formula is:

[0025] As a preferred solution, in step S2.2:

[0026] The delay of task offloading can be divided into the delay of unloading subtasks at the terminal node, the delay required for the corresponding fog node calculation, and the transmission delay between the terminal node and the fog node;

[0027] The terminal node can arbitrarily divide the task into two subtasks and offload them to the terminal node and fog node respectively. The time delay required for the subtask to be calculated locally by the terminal node is expressed as:

[0028]

[0029] in, Indicates the proportion of tasks unloaded at the terminal node;

[0030] The computational delay required for the subtask to be offloaded to the fog node for computation is expressed as:

[0031]

[0032] Among them, λ ij represents the proportion of subtasks unloaded at fog node j, and has:

[0033]

[0034] X ij is an element in the task offloading decision matrix X, which is a 0-1 indicator variable. When the terminal node i matches the fog node j, X ij = 1, and unload the task to fog node j, otherwise X ij =0 means no matching relationship; and It means that any fog node (terminal node) can only match with one terminal node (fog node);

[0035] The outbound transmission delay between the terminal node and the fog node for data transmission is expressed as:

[0036]

[0037] The task delay can be expressed as the maximum value of the sum of the local computing delay and the fog node computing delay and the transmission delay, that is:

[0038]

[0039] When the local computing delay is equal to the sum of the fog node computing delay and the transmission delay, the task delay is the shortest, that is:

[0040]

[0041] Substituting equation (3) into equations (2) and (4), and then according to equation (6), the optimal unloading ratio at this time can be obtained as: Substituting it into formula (1), according to formula (6), we can get the shortest task offloading delay at this time:

[0042]

[0043] Only when the shortest task offloading delay Less than the maximum tolerable delay of the task When The task can meet the unloading condition; otherwise, when When , it means that the offloading feasibility condition is not met and the task will be discarded. Through formula (7), according to and The size relationship between can be used to determine the feasibility of offloading between terminal node i and fog node j.

[0044] As a preferred solution, in step S2.3:

[0045] In order to minimize the offloading cost, the terminal node will increase the proportion of tasks offloaded at the terminal node under the premise of satisfying the offloading feasibility. Therefore, for the pair of terminal node i and fog node j that meets the offloading feasibility, the optimal offloading proportion of the terminal node is determined according to the following formula:

[0046]

[0047] Finally, the optimal unloading cost P between terminal node i and fog node j is calculated according to the following formula: ij :

[0048]

[0049] For the terminal node i and fog node j that do not meet the uninstallation feasibility, that is Since the task is discarded, the uninstallation cost is the null value Null. Therefore, rewrite Equation (9) to obtain the uninstallation cost:

[0050]

[0051] As an optimal solution, the weight ω between the terminal node i and the fog node j in the step S3 ij is expressed as:

[0052]

[0053] where MaxP is a hyperparameter much larger than the maximum P ij of.

[0054] As an optimal solution, in the step S4, the objective function is used for modeling to maximize the total weight of the network. Since the Kuhn-Munkres algorithm can only solve the maximum weight matching in the case of M = N, when M < N, add N - M virtual terminal nodes. To not affect the matching result, set the weights of all virtual terminal nodes and any fog node to 0:

[0055] ω ij = 0, i ∈ {M + 1, M + 2, …, N}, j ∈ {1, 2, …, N} (12);

[0056] The objective function is rewritten as The optimal task offloading decision matrix X can be obtained using the Kuhn-Munkres algorithm.

[0057] As an optimal solution, in the step S5, the successfully matched terminal node i and fog node j are represented as X in the task offloading decision matrix ij = 1. Then, for the node pairs with X ij = 1, the offloading ratio is given by Equation (8), and the offloading cost is obtained from Equation (9); for the node pairs with X ij = 0, the task will be discarded and no cost will be generated; the total system cost is expressed as

[0058] The present invention also discloses a fog computing task offloading system based on the above method and based on global cost minimization, which includes the following modules:

[0059] Fog network information acquisition module: used to acquire the information of the entire fog network;

[0060] Optimal offloading ratio and corresponding cost calculation module: According to the information obtained by the fog network information acquisition module, the feasibility of offloading of each terminal and fog node is judged, and the optimal offloading ratio and corresponding cost of feasible matching are calculated;

[0061] Weight calculation module: Calculates the weight between each terminal node and fog node based on the optimal unloading ratio and the corresponding information obtained by the cost calculation module;

[0062] Task offloading decision matrix acquisition module: Using the extended Kuhn-Munkres algorithm, according to the weights obtained by the weight calculation module, with the goal of maximizing the overall network weight, solve the one-to-one matching between the terminal node and the fog node to obtain the task offloading decision matrix X;

[0063] Result acquisition module: Using the decision matrix X obtained by the task offloading decision matrix acquisition module as the index, the offloading ratio and cost of the terminal node and the corresponding fog node, as well as the overall cost of the system are obtained.

[0064] The technical solution of the present invention has the following advantages:

[0065] (1) The present invention introduces the unloading unit price of different fog nodes in the scenario where the task processing has a maximum tolerable delay, which has practical significance for actual operations.

[0066] (2) The present invention considers the scenarios of multiple terminal nodes and multiple fog nodes, and takes a global approach to minimize the network offloading cost while maximizing the offloading success rate, thus avoiding the local optimal situation. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 This is a flow chart of the fog computing task offloading method based on global cost minimization in Example 1;

[0068] Figure 2 This is a network model diagram of the fog computing task offloading method based on global cost minimization;

[0069] Figure 3 This is a comparison chart between the fog computing task offloading method based on global cost minimization and the greedy task offloading method in terms of the offloading effect function F.

[0070] Figure 4 This is a block diagram of the fog computing task offloading system based on global cost minimization in Example 2. DETAILED DESCRIPTION

[0071] The preferred embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0072] Example 1

[0073] Reference Figure 1, this embodiment provides a fog computing task offloading method based on global cost minimization, comprising the following steps:

[0074] S1, obtains the information of the entire fog network;

[0075] S2, judging the offloading feasibility of each terminal and fog node according to the information obtained in step S1, and calculating the optimal offloading ratio and corresponding cost of feasible matching;

[0076] S3, calculating the weights between each terminal node and the fog node according to the information calculated in step S2;

[0077] S4, using the extended Kuhn-Munkres algorithm, according to the weights obtained in step S3, with the goal of maximizing the overall network weight, solve the one-to-one matching between the terminal nodes and the fog nodes, and obtain the task offloading decision matrix X;

[0078] S5, using the decision matrix X obtained in step S4 as an index, obtain the unloading ratio and cost of the terminal node and the corresponding fog node, as well as the overall cost of the system.

[0079] This embodiment is applicable to fog computing network. The network model is as follows: Figure 2 As shown, in the network, fog nodes and terminal nodes are randomly distributed in a certain area. This embodiment makes the following assumptions:

[0080] (1) The number of fog nodes is not less than the number of terminal nodes, and each fog node can only serve one terminal node at a time.

[0081] (2) All terminal nodes have tasks to be calculated, and each calculation task has a maximum delay tolerance value.

[0082] (3) The task generated by the terminal node can be divided into two subtasks of arbitrary size, one of which is executed locally and the other is offloaded to the fog node for execution.

[0083] (4) Ignore the time of transmitting the computational results of the subtasks offloaded to the fog nodes.

[0084] Specifically, the specific process of each step is described in detail below:

[0085] In step S1, the network controller obtains information about the entire network. The fog network information includes:

[0086] The number of terminal nodes M, the amount of task data for each terminal node S i 、CPU frequency f i , the number of CPU cycles required for the CPU to process 1 bit of data η i , the maximum tolerable delay of the task Transmit power i=1,2,…,M, etc.;

[0087] The number of fog nodes N, the CPU frequency of each fog node f j , the number of CPU cycles required for the CPU to process 1 bit of data is η j , and the unit price C for processing 1 bit of data j , j=1,2,…,N, etc.

[0088] The distance d between terminal node i and fog node j ij , channel bandwidth B ij And the noise power

[0089] The step S2 comprises the steps of:

[0090] S2.1, calculate the path loss L between terminal node i and fog node j ij , channel gain G ij , data transmission rate r ij ;

[0091] S2.3, determine the feasibility of offloading between terminal node i and fog node j;

[0092] S2.3, calculate the optimal offloading ratio of terminal node i and fog node j where offloading is feasible and the corresponding unloading cost P i ; Assign null values ​​to the costs of terminal node i and fog node j for which the calculation is not feasible.

[0093] In the step S2.1:

[0094] Calculate the path loss L between terminal node i and fog node j ij The formula is: L ij =38.46+20log 10 (d ij );

[0095] Calculate the channel gain G between terminal node i and fog node j ij The formula is: Where L ij is the path loss between terminal node i and fog node j;

[0096] Calculate the data transmission rate r between terminal node i and fog node j ij The formula is:

[0097] In the step S2.2:

[0098] The delay of task offloading can be divided into the delay of unloading subtasks at the terminal node, the delay required for the corresponding fog node calculation, and the transmission delay between the terminal node and the fog node;

[0099] The terminal node can arbitrarily divide the task into two subtasks and offload them to the terminal node and fog node respectively. The time delay required for the subtask to be calculated locally by the terminal node is expressed as:

[0100]

[0101] in Indicates the proportion of tasks unloaded at the terminal node;

[0102] The time required to offload the subtask to the fog node for computation is expressed as:

[0103]

[0104] where λ ij , represents the proportion of tasks unloaded in fog nodes, and has:

[0105]

[0106] X ij is an element in the task offloading decision matrix X, which is a 0-1 indicator variable. When the terminal node i matches the fog node j, X ij = 1, and unload the task to fog node j, otherwise X ij =0 means no matching relationship; and It means that any fog node (terminal node) can only match with one terminal node (fog node);

[0107] The outbound transmission delay between the terminal node and the fog node for data transmission is expressed as:

[0108]

[0109] The delay of task offloading can be expressed as the maximum value of the sum of local computing delay, fog node computing delay and transmission delay, that is:

[0110]

[0111] When the local computing delay is equal to the sum of the fog node computing delay and the transmission delay, the task delay is the shortest, that is:

[0112]

[0113] Substituting equation (3) into equations (2) and (4), and then according to equation (6), the optimal unloading ratio at this time can be obtained as: Substituting it into formula (1), according to formula (6), we can get the shortest task offloading delay at this time:

[0114]

[0115] Only when the shortest task offloading delay Less than the maximum tolerable delay of the task When The task can meet the unloading condition; otherwise, when When , it means that the offloading feasibility condition is not met and the task will be discarded. Through formula (7), according to and The size relationship between can be used to determine the feasibility of offloading between terminal node i and fog node j.

[0116] In the step S2.3:

[0117] In order to minimize the offloading cost, the terminal node will increase the proportion of tasks offloaded at the terminal node under the premise of satisfying the offloading feasibility. Therefore, for the pair of terminal node i and fog node j that meets the offloading feasibility, the optimal offloading ratio of the terminal node is expressed as:

[0118]

[0119] Finally, the optimal unloading cost P between terminal node i and fog node j is calculated according to the following formula: ij :

[0120]

[0121] For terminal node i and fog node j that do not meet the offloading feasibility, that is, Since the task is discarded, the unloading cost is Null. Therefore, rewrite equation (9) to get the unloading cost:

[0122]

[0123] Furthermore, the weight ω between the terminal node i and the fog node j in step S3 is ij It is expressed as:

[0124]

[0125] Among them, MaxP is a value much larger than the maximum P ij Hyperparameters of .

[0126] Furthermore, in step S4, the objective function is adopted Modeling is performed to maximize the total weight of the network. Since the Kuhn-Munkres algorithm can only solve the maximum weight matching in the case of M = N, when M < N, N - M virtual terminal nodes are added. To not affect the matching result, the weights of all virtual terminal nodes and any fog node are set to 0:

[0127] ω ij = 0, i ∈ {M + 1, M + 2, …, N}, j ∈ {1, 2, …, N} (12);

[0128] The objective function is rewritten as The optimal task offloading decision matrix X can be obtained using the Kuhn-Munkres algorithm.

[0129] Furthermore, in step S5, the successfully matched terminal node i and fog node j are represented as X in the task offloading decision matrix X ij = 1. Thus, for the node pair with X ij = 1, the local computing ratio is given by equation (8), and the offloading cost is obtained from equation (9); for the node pair with X ij = 0, the task will be discarded and no cost is generated; the total system cost is expressed as

[0130] To prove that the present invention can indeed minimize the global system cost while ensuring that tasks are not discarded as much as possible in task offloading, the discard rate is defined Obviously, the smaller the discard rate, the fewer the discarded tasks.

[0131] This embodiment simulates the fog computing task offloading method based on global cost minimization (hereinafter referred to as KM task offloading) in a multi-user multi-fog node scenario. Assume that the bandwidth B between the terminal node and the fog node is 10 MHz, and the noise power density is -100 dBm / Hz. The average task data volume S of the terminal node i ∈ [3, 12] Mbits, the CPU frequency f of the terminal node i = 2 GHz, the number of CPU cycles required to process 1 bit of data is η i = 1000, the transmit power The maximum tolerable delay The CPU frequency f of the fog node j ∈ [4, 6] GHz, the number of CPU cycles required to process 1 bit of data is η j = 1000, the cost C charged for processing each bit of data j ∈ [0, 10 -6 yuan / bit. The number of terminal nodes M = 6, the number of fog nodes N = 10, and the number of simulation tasks is 12000.

[0132] In actual scenarios, sometimes discarding a task will bring great losses. Therefore, in order to more directly illustrate the advantages of the present invention, the discard rate and the total cost of the system are combined into one function. Therefore, an offloading effect function F is defined to measure the task offloading effect. Its definition is as follows:

[0133]

[0134] Among them, P LR is the loss caused by discarding the task, and its calculation formula is: P LR =D LR C lost , D LR is the number of tasks discarded, C lost is the loss caused by discarding a task. In this embodiment, C lost = 50. Obviously, the lower the system cost and the lower the discard rate, the smaller the unloading effect function F is, and the better the unloading effect is.

[0135] In addition, in order to provide an intuitive comparison, the present invention and the traditional greedy task offloading are also simulated and compared, and the simulation parameters are the same as above. In the traditional greedy task offloading method, when selecting fog nodes for task offloading, the terminal node only considers minimizing its own cost rather than minimizing the global cost, and does not use the KM algorithm for solution.

[0136] Reference Figure 3 As the task size increases, it can be found that the unloading effect function F of both increases, but it can be seen that the unloading effect function F of KM task unloading is always smaller than that of greedy task unloading. This shows that the fog computing task unloading method based on global cost minimization proposed in the present invention can ensure that tasks are not discarded as much as possible while minimizing the overall cost of the system, effectively ensuring the effect and economic benefits of task unloading. Figure 3 The results also show that when the task volume is small or particularly large, the effects of KM task offloading and greedy offloading are close. This is because when the task volume is small, it is basically calculated locally, and the offloading cost is small; when the task volume is particularly large, the computing power of the local terminal and fog node cannot be amplified synchronously, resulting in the task abandonment rate being basically close to 1. Therefore, the offloading effect function F is close in these two cases.

[0137] Example 2

[0138] See also Figure 4 This embodiment discloses a fog computing task offloading system based on global cost minimization based on the method of embodiment 1, which includes the following modules:

[0139] Fog network information acquisition module: used to obtain the information of the entire fog network;

[0140] Optimal offloading ratio and corresponding cost calculation module: Based on the information obtained by the fog network information acquisition module, the feasibility of offloading for each terminal and fog node is determined, and the optimal offloading ratio and corresponding cost of feasible matching are calculated;

[0141] Weight calculation module: Calculates the weight between each terminal node and fog node based on the optimal unloading ratio and the information obtained by the corresponding cost calculation module;

[0142] Task offloading decision matrix acquisition module: Using the extended Kuhn-Munkres algorithm, according to the weights obtained by the weight calculation module, with the goal of maximizing the overall network weight, solve the one-to-one matching between the terminal node and the fog node to obtain the task offloading decision matrix X;

[0143] Result acquisition module: Using the decision matrix X obtained by the task offloading decision matrix acquisition module as the index, the offloading ratio and cost of the terminal node and the corresponding fog node, as well as the overall cost of the system are obtained.

[0144] For other contents of this embodiment, please refer to Embodiment 1.

[0145] The above description is only a detailed description of the preferred embodiments and principles of the present invention. For ordinary technicians in this field, according to the ideas provided by the present invention, there will be changes in the specific implementation methods, and these changes should also be regarded as the protection scope of the present invention.

Claims

1. A fog computing task offloading method based on global cost minimization, Its characteristics are The steps include: S1, obtains the information of the entire fog network; S2, judging the offloading feasibility of each terminal and fog node according to the information obtained in step S1, and calculating the optimal offloading ratio and corresponding cost of feasible matching; S3, calculating the weights between each terminal node and the fog node according to the information obtained in step S2; S4, using the extended Kuhn-Munkres algorithm, according to the weights obtained in step S3, with the goal of maximizing the overall network weight, solve the one-to-one matching between the terminal nodes and the fog nodes, and obtain the task offloading decision matrix X; S5, using the decision matrix X obtained in step S4 as an index, obtain the unloading ratio and cost of the terminal node and the corresponding fog node, as well as the overall cost of the system; In step S1, the network controller obtains information of the entire network; The fog network information includes: The number of terminal nodes M, the amount of task data for each terminal node S i 、CPU frequency f i , the number of CPU cycles required for the CPU to process 1 bit of data η i , the maximum tolerable delay of the task Transmit power The number of fog nodes N, the CPU frequency of each fog node f j , the number of CPU cycles required for the CPU to process 1 bit of data is η j , and the unit price C for processing 1 bit of data j , j = 1, 2, ..., N; The distance d between terminal node i and fog node j ij , channel bandwidth B ij And the noise power M<=N; Step S2 specifically includes the following steps: S2.1, calculate the path loss L between terminal node i and fog node j ij , channel gain G ij , data transmission rate r ij ; S2.2, determine the feasibility of offloading between terminal node i and fog node j; S2.3, calculate the optimal offloading ratio of terminal node i and fog node j where offloading is feasible and the corresponding unloading cost P ij ; Calculate the cost of terminal node i and fog node j which is not feasible and assign null value; In step S2.2: The delay of task offloading is divided into the delay of unloading subtasks at the terminal node, the delay required for the corresponding fog node calculation, and the transmission delay between the terminal node and the fog node; The terminal node arbitrarily divides the task into two subtasks and offloads them to the terminal node and fog node respectively. The time delay required for the terminal node to calculate the subtask locally is expressed as: in, Indicates the proportion of tasks unloaded at the terminal node; The computational delay required for the subtask to be offloaded to the fog node for computation is expressed as: Among them, λ ij represents the proportion of subtasks unloaded at fog node j, and has: X ij is an element in the task offloading decision matrix X, which is a 0-1 indicator variable. When the terminal node i matches the fog node j, X ij = 1, and unload the task to fog node j, otherwise X ij =0 means no matching relationship; and This means that any fog node can only match one terminal node; The outbound transmission delay between the terminal node and the fog node for data transmission is expressed as: The task delay is expressed as the maximum value of the sum of the local computing delay and the fog node computing delay and the transmission delay, that is: When the local computing delay is equal to the sum of the fog node computing delay and the transmission delay, the task delay is the shortest, that is: Substituting equation (3) into equations (2) and (4), and then according to equation (6), the optimal unloading ratio at this time is obtained as: Substitute it into formula (1) and according to formula (6), we can get the shortest task offloading delay at this time: Only when the shortest task offloading delay Less than the maximum tolerable delay of the task When The task can meet the unloading condition; otherwise, when When , it means that the unloading feasibility condition is not met and the task will be discarded; through formula (7), according to and The size relationship between terminal node i and fog node j is used to determine the feasibility of unloading; In step S2.3: For the pair of terminal node i and fog node j that meets the offloading feasibility, the optimal offloading ratio of the terminal node is determined according to the following formula: Finally, the optimal unloading cost P between terminal node i and fog node j is calculated according to the following formula: ij : For terminal node i and fog node j that do not meet the offloading feasibility, that is, Since the task is discarded, the unloading cost is Null; therefore, rewrite equation (9) to obtain the unloading cost: In step S3, the weight ω between terminal node i and fog node j ij It is expressed as: Among them, MaxP is a value much larger than the maximum P ij Hyperparameters of .

2. A fog computing task offloading method based on global cost minimization as claimed in claim 1, Its characteristics are: In step S2.1: Calculate the path loss L between terminal node i and fog node j ij The formula is: L ij =38.46+20log 10 (d ij ); Calculate the channel gain G between terminal node i and fog node j ij The formula is: Among them, L ij is the path loss between terminal node i and fog node j; Calculate the data transmission rate r between terminal node i and fog node j ij The formula is:

3. A fog computing task offloading method based on global cost minimization as claimed in claim 2, Its characteristics are: In step S4, the objective function is used for modeling; since the Kuhn-Munkres algorithm can only solve the maximum weight matching in the case of M = N, when M < N, N - M virtual terminal nodes are added, and the weights of all virtual terminal nodes and any fog node are set to 0: ω ij =0,i∈{M+1,M+2,…,N},j∈{1,2,…,N} (12) The objective function can be rewritten as The optimal task offloading decision matrix X is obtained using the Kuhn-Munkres algorithm.

4. A fog computing task offloading method based on global cost minimization as claimed in claim 3, Its characteristics are: In step S5, the successfully matched terminal node i and fog node j are represented as X in the task offloading decision matrix X ij =1; for X ij = 1, the unloading ratio is given by formula (8), and the unloading cost is obtained by formula (9); for X ij = 0, the task will be discarded and no fee will be incurred; the total system cost is expressed as 5. A fog computing task offloading system based on global cost minimization, used to execute the method described in any one of claims 1 to 4, Its characteristics are Includes the following modules: Fog network information acquisition module: used to obtain the information of the entire fog network; Optimal offloading ratio and corresponding cost calculation module: Based on the information obtained by the fog network information acquisition module, the feasibility of offloading for each terminal and fog node is determined, and the optimal offloading ratio and corresponding cost of feasible matching are calculated; Weight calculation module: Calculates the weight between each terminal node and fog node based on the optimal unloading ratio and the information obtained by the corresponding cost calculation module; Task offloading decision matrix acquisition module: Using the extended Kuhn-Munkres algorithm, according to the weights obtained by the weight calculation module, with the goal of maximizing the overall network weight, solve the one-to-one matching between the terminal node and the fog node to obtain the task offloading decision matrix X; Result acquisition module: Using the decision matrix X obtained by the task offloading decision matrix acquisition module as the index, the offloading ratio and cost of the terminal node and the corresponding fog node, as well as the overall cost of the system are obtained.