A mobile edge computing task offloading method based on bacterial foraging algorithm
By improving the many-to-many edge computing offloading model of the bacterial foraging algorithm, the problems of latency and energy consumption in the offloading of large-scale mobile edge computing tasks are solved, and the system achieves efficient optimization and reasonable offloading strategy.
Patent Information
- Application Number
- CN202410824006.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-06-25
AI Technical Summary
Existing heuristic algorithms struggle to find high-quality offloading strategies for large-scale mobile edge computing task offloading problems, and the original bacterial foraging algorithm has an unsatisfactory convergence speed in high-dimensional heterogeneous scale problems, making it difficult to escape local optima.
We construct a many-to-many edge computing offloading model involving multiple mobile devices, multiple computing tasks, and multiple edge servers. We improve the bacterial foraging algorithm to a single-layer loop architecture that combines chemotaxis and migration. We introduce relative position movement and dropout strategies, combine Gaussian distribution to determine the migration direction, and optimize bacterial position to find the optimal offloading strategy.
It effectively reduces system latency and energy consumption, ensures that mobile devices can reasonably offload computing tasks to edge servers or local processing, and improves the convergence speed and optimization capability of algorithms on large-scale problems.
Smart Images

Figure CN118870434B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Internet of Things computing offloading, and particularly relates to a mobile edge computing task offloading method based on a bacterial foraging algorithm. BACKGROUND
[0002] Industry 4.0 brings many opportunities to modern manufacturing, but also brings challenges; the digital revolution is leading a new round of industrial revolution, with the manufacturing industry changing from automation to digitization and intelligence, a large number of mobile devices are applied to intelligent factories for information collection and service support, these mobile devices can collect and utilize operation data that have not been paid much attention to in the past, so that the management personnel of the factory can more clearly and timely understand the status of machines and materials, which is an important support for intelligent decision-making and manufacturing. However, high-frequency collection and massive data also bring more challenges to the communication and computing capacity of the network.
[0003] Edge computing is an effective solution to this problem in recent years, and its core idea is to keep the computing task on the network edge close to the device or data source. Edge computing integrates network, computing, storage, application and other core capabilities to provide intelligent interconnection services on the nearby edge, and meets the key needs of industry digitization in agile connection, real-time business, data optimization, application intelligence, security and privacy protection. Edge computing is a good complement to cloud computing. Through edge computing technology, the data collected by mobile devices can be cleaned and calculated locally or on the edge side, so that only a small amount of data needs to be uploaded to the cloud for decision-making, thereby ensuring the stable operation of the entire network and meeting the requirements of low latency and high reliability.
[0004] Generally, the solution of the computing offloading strategy needs to be converted into an integer nonlinear optimization problem, so it is difficult to directly solve to obtain the best decision, and the heuristic algorithm is a good solution to solve this problem. The advantage of the heuristic algorithm is that it is more efficient than the general search algorithm, and the best offloading strategy can also be obtained in a shorter number of iterations. However, the biggest disadvantage of the heuristic search algorithm is that the quality of the algorithm is related to the size of the problem. In small-scale problems, better results can usually be obtained, but in large-scale problems, the quality of the final solution depends too much on the initial solution.
[0005] It should be pointed out that since the swarm intelligence algorithm does not depend on the initial solution, the bacterial foraging algorithm is an evolutionary algorithm simulating the foraging behavior of Escherichia coli, which belongs to a kind of swarm intelligence algorithm. Compared with other swarm behaviors, bacteria as an ancient organism have more complexity and chaos, and the chemotaxis sensing phenomenon also proves their intelligent emergence. However, the original bacterial foraging algorithm adopts random flipping direction and fixed step length in the iteration process, which leads to unsatisfactory convergence speed in high-dimensional heterogeneous problems and difficulty in jumping out of local extremum. SUMMARY
[0006] The present application aims at the deficiencies of the prior art and provides a mobile edge computing task offloading method based on a bacterial foraging algorithm, which first constructs a many-to-many edge computing offloading model based on multiple mobile devices, multiple computing tasks and multiple edge servers, and then obtains an optimal objective function considering time delay and energy consumption, and then uses an improved bacterial foraging algorithm to calculate the computing tasks generated by all mobile devices to find the optimal computing offloading strategy to minimize the system optimization objective, so as to ensure that all mobile devices in the system can reasonably offload computing tasks to edge servers or process them on the mobile devices themselves, and reduce system time delay and energy consumption.
[0007] To achieve the above-mentioned purpose, the present application realizes the technical scheme as follows.
[0008] A mobile edge computing task offloading method based on a bacterial foraging algorithm, comprising the following steps, in particular:
[0009] Step S1, in the intelligent workshop scene, a many-to-many edge computing offloading model based on multiple mobile devices, multiple computing tasks and multiple edge servers is constructed;
[0010] Step S2, the related parameters of mobile devices and edge servers are initialized, and the time delay model and energy consumption model of edge servers and mobile devices are established according to the related parameters;
[0011] Step S3, the edge servers and mobile devices all have computing capabilities, the computing tasks generated by each mobile device can be offloaded to edge servers for calculation or calculated on the mobile devices themselves, the longest time delay on the edge servers and mobile devices is taken as the total time delay of the system, the total energy consumption is taken as the system energy consumption, the weighted system optimization total objective is obtained, the improved bacterial foraging algorithm is used to obtain the system optimal objective and the optimal offloading result;
[0012] Step S4, the three-layer loop nested structure of the bacterial foraging algorithm is modified, and the bacterial foraging algorithm is changed to a single-layer loop architecture with parallel chemotaxis and migration, the strategy based on relative position movement and the Dropout strategy are introduced in the chemotaxis process, the migration strategy based on Gaussian distribution to determine the direction is introduced in the migration operation, and the improved bacterial foraging algorithm is used to continuously update the bacterial position and obtain the best offloading strategy and system optimization objective;
[0013] In the process of using the improved bacterial foraging algorithm to continuously update the bacterial position and obtain the best offloading strategy, the steps include:
[0014] Step S41: Set the bacterial population in the algorithm and initialize the relevant parameters;
[0015] Step S42: After multiple iterations, the bacterial positions in each optimization are continuously updated, and finally the bacterial positions with the best fitness values are found. These positions are then substituted into the computational unloading system model built in step S1 to obtain the optimal unloading strategy.
[0016] Specifically, step S1 includes:
[0017] Step S11: Each mobile device in the smart workshop will generate N. l There are (l = 1, 2, ..., K) tasks to be computed, where K represents the number of mobile devices in the smart workshop. Each task has its own task data size and computational complexity. That is, each task is represented by a binary Task = {S, C}, where S is the data size and C is the computational complexity, which is represented by the number of CPU cycles required to process each bit of the computation task.
[0018] Specifically, step S2 includes:
[0019] Step S21: Use the longest completion time across all edge servers and mobile devices as the total latency of the model, which can be expressed as: minf1 = max{T j}, j=1,2,…,M+K; where K represents the number of mobile devices in the smart factory, and M represents the number of edge servers in the smart factory; T j It is the time for the j-th device to complete the computing task. This device can be an edge computing server (j = 1, 2, ..., M) or a mobile device (j = M+1, M+2, ..., M+K).
[0020] The sum of the completion times of all tasks assigned to the device is expressed as: in This is the total number of tasks; X ij =1 indicates that the i-th task is assigned to the j-th device; otherwise, X ij =0;T ij It is the computation time of the i-th task on the j-th device;
[0021] Step S22: The system's energy consumption target comes from the task computing consumption of mobile devices and the transmission consumption to the edge server, which can be specifically expressed as:
[0022]
[0023] Among them, P j It is the computing power of mobile devices, X ij= 1 only when the jth device is the device to which the ith task belongs;
[0024] Step S23, the system model has the following constraints, which are specifically represented as:
[0025] X ij = 0 or 1;
[0026]
[0027] wherein X ij is a 0-1 variable, the only constraint of the system model is that each task can be assigned to only one mobile device or edge server for execution, when it is represented as 0, then the task is offloaded to the server for calculation; when it is represented as 1, then the task is calculated in the local mobile device.
[0028] wherein the step S21 includes the following two cases, specifically:
[0029] Case 1, if the device processing the calculation task is a mobile device, then it represents that the task is executed locally, and the time delay T ij is the calculation time of the device itself;
[0030] T ij = Tl ij ;
[0031] Tl ij = S i *C i / Fl j ;
[0032] wherein Tl ij represents the calculation time of the task assigned to the mobile device itself, and Fl j is the CPU frequency of the local mobile device;
[0033] Case 2, if the device processing the calculation task is an edge server, then the time delay T ij is composed of the transmission time Tt ij from the mobile device to the edge server and the calculation time Te ij on the edge server, which is specifically represented as:
[0034] T ij = Tt ij + Te ij ;
[0035] wherein Tt ij is the transmission time of the calculation task from the mobile device to the edge server, and Te ij is the calculation time of the task on the edge server, specifically:
[0036] Tt ij =S i / TS ij ;
[0037] Te ij =S i *C i / Fe j ;
[0038] wherein, Fe j is the CPU frequency of the jth edge server, TS ij is the transmission speed from the mobile device to which the ith task belongs to the jth edge server, and TS ij is confirmed by the Shannon theorem, and is expressed as: B is the bandwidth, is the transmission power of the mobile device to which the ith task belongs, H ij is the channel gain from the device to the jth edge server, and N0 is the background noise power.
[0039] The step S3 specifically comprises:
[0040] The step S31, in the smart workshop scene, comprehensively considers the delay target and the energy consumption target, adopts a weighted summation manner to transform the two targets into a single target problem, and is specifically expressed as:
[0041]
[0042] wherein, f1 is the delay target, f2 is the energy consumption target, the weight coefficient is set as 1 / M, so that the changes on the two targets are kept on similar scales, thereby making the two targets have similar sensitivities and can be optimized, so as to guarantee the rationality of the comprehensive target.
[0043] The S42 specifically comprises:
[0044] The step S421, the three-layer loop nesting structure of the original bacterial foraging algorithm is modified into a single-layer loop nesting structure, in each iteration process, after the bacteria perform chemotaxis, the bacteria migrate with a certain probability, and the reproduction and death operations are no longer executed separately; and the termination judgment condition of the algorithm is changed from ending the last migration to reaching the maximum function evaluation times;
[0045] The step S422, in the chemotaxis process, a mobile strategy based on relative position is introduced, the bacteria can realize information interaction between groups, accelerate the convergence speed, and find the optimization direction faster, and the improved formula is as shown in the following:
[0046] X(i) = X(i) + rand*(X better -X(i));
[0047] Wherein, X(i) represents the position of the individual bacteria, X better represents a position of another random individual with better fitness than the current position, and rand is a random number between 0 and 1.
[0048] Step S423, in the chemotaxis process, a topology based on dropout strategy is introduced, a parameter named dropout-rate is set, before the position update described in step S422, according to the dropout-rate, a proportion of the hidden bacteria individual positions are allowed to move towards the relatively superior direction among the remaining connected individuals;
[0049] Step S424, in the migration process, a migration operation based on Gaussian distribution to determine the direction is introduced, when migrating, with a probability of 50%, it is migrated to a random position in the search space, and with a probability of 50%, it is generated near the global optimal position found at present through Gaussian mutation, which is specifically represented as:
[0050] X (i) = X best *Gaussian(0, 1);
[0051] Wherein, X best represents the position of the optimal solution found at present, and Gaussian(0, 1) is a set of Gaussian distributed random numbers.
[0052] Step S425, the optimal optimization target value of the current is obtained through the bacteria position of this round, and the corresponding bacteria position is recorded;
[0053] Step S426, the optimal optimization target value obtained in this round is compared with the global optimal optimization target value, if the optimal optimization target value obtained in this round is better than the global optimal optimization target value, the global optimal optimization target value is updated to the optimal optimization target value of the current;
[0054] Step S427: it is judged whether the iteration number of this round reaches the maximum iteration number, if not, step S42 is performed again, otherwise, the best unloading strategy and the corresponding optimization target value are outputted.
[0055] Compared with the prior art, the mobile edge computing task offloading method based on the bacterial foraging algorithm has the following beneficial effects: the mobile edge computing task offloading method based on the bacterial foraging algorithm constructs a many-to-many edge computing offloading model based on multiple mobile devices, multiple computing tasks and multiple edge servers, and then obtains an optimal objective value function considering time delay and energy consumption at the same time, and then the improved bacterial foraging algorithm is used to calculate and offload the computing tasks generated by all mobile devices, and the optimal computing offloading strategy is found to make the system optimization objective value lowest, so as to ensure that all mobile devices in the system can reasonably offload the computing tasks to the edge server or process the computing tasks on the mobile devices, and reduce the system time delay and energy consumption. BRIEF DESCRIPTION OF DRAWINGS
[0056] The application will be further described below by using the drawings, but the embodiments in the drawings do not constitute any limitation on the application.
[0057] Figure 1 It is a many-to-many edge computing offloading model diagram in the intelligent workshop scenario of the application.
[0058] Figure 2 It is a flow diagram of the improved bacterial foraging algorithm cycle nesting structure of the application.
[0059] Figure 3 It is a pseudocode of the chemotaxis step of the improved bacterial foraging algorithm in the application.
[0060] Figure 4 It is a result diagram of introducing a dropout strategy and testing different dropout rates of the application.
[0061] Figure 5 It is a pseudocode of the migration step of the improved bacterial foraging algorithm in the application.
[0062] Figure 6 It is an iteration comparison diagram of the final optimization results of task offloading under four algorithms (comparison of different edge server quantities).
[0063] Figure 7 It is an iteration comparison diagram of the final optimization results of task offloading under four algorithms (comparison of different task quantities). DETAILED DESCRIPTION
[0064] The application will be described below in combination with specific embodiments.
[0065] Embodiment one, a mobile edge computing task offloading method based on a bacterial foraging algorithm, including the following steps, specifically:
[0066] Step S1, as Figure 1As shown, in the smart workshop scenario, a many-to-many edge computing offloading model based on multiple mobile devices, multiple computing tasks and multiple edge servers is constructed.
[0067] In step S2, the related parameters of the mobile device and the edge server are initialized, and the time delay model and the energy consumption model of the edge server and the mobile device are established according to the related parameters.
[0068] In step S3, the edge server and the mobile device both have computing capabilities. The computing task generated by each mobile device can be offloaded to the edge server for computing or computed on the mobile device itself. The longest time delay on the edge server and the mobile device is taken as the total time delay of the system, and the total energy consumption is taken as the system energy consumption. The weighted system optimization total target is obtained. The improved bacterial foraging algorithm is used to obtain the system optimal target and the optimal offloading result.
[0069] As shown in step S4, Figure 2 The three-layer loop nested structure of the bacterial foraging algorithm is modified, and the bacterial foraging algorithm is changed to a single-layer loop structure in parallel with chemotaxis and migration. As shown in Figure 3 and Figure 4 In the chemotaxis process, the strategy based on relative position movement and the Dropout strategy are introduced. As shown in Figure 5 In the migration operation, the migration strategy based on Gaussian distribution to determine the direction is introduced, and the improved bacterial foraging algorithm is used to continuously update the bacterial position and obtain the best offloading strategy and system optimization target. Wherein, Figure 6 and Figure 7 represent the final optimization result iteration comparison of task offloading under four different algorithms. Specifically, Figure 6 represent the final optimization result iteration comparison of task offloading under four different algorithms under different edge server quantity comparison, Figure 7 represent the final optimization result iteration comparison of task offloading under four different algorithms under different task quantity comparison.
[0070] In the process of using the improved bacterial foraging algorithm to continuously update the bacterial position and obtain the best offloading strategy, the steps include:
[0071] In step S41, the bacterial population in the algorithm is set and the related parameters are initialized.
[0072] In step S42, after multiple iterations, the bacterial position in each optimization is continuously updated, and the bacterial position with the best fitness value is finally found out. The bacterial position is substituted into the computing offloading system model established in step S1 to obtain the best offloading strategy.
[0073] Through the above steps, the mobile edge computing task offloading method based on the bacterial foraging algorithm of the first embodiment has the following advantages. Specifically:
[0074] 1. The mobile edge computing task offloading method based on the bacterial foraging algorithm first constructs a computing offloading model in a smart workshop scenario, then converts the solution of the computing offloading strategy into an integer nonlinear optimization problem, and iteratively solves the problem to obtain the best computing offloading strategy by combining the improved bacterial foraging algorithm.
[0075] 2. The mobile edge computing task offloading method based on the bacterial foraging algorithm modifies the algorithm structure to a single-layer loop structure with parallel chemotaxis and migration, introduces a relative position-based movement strategy and a dropout strategy in the chemotaxis operation, and introduces a strategy of determining the direction based on a Gaussian distribution in the migration operation, which accelerates the convergence speed of the algorithm while maintaining the search for the global, thereby improving the optimization ability of the algorithm and ensuring that each mobile device in the system model can reasonably offload tasks to local mobile devices or edge servers to reduce system energy consumption and computing latency.
[0076] Embodiment Two, the difference between this embodiment two and embodiment one is that the step S1 specifically comprises:
[0077] Step S11, each mobile device in the smart workshop will generate N l (l = 1, 2,..., K) tasks to be calculated, K represents the number of mobile devices in the smart workshop, each task has its own task data size and computing complexity, i.e. each task is represented by double Task = {S, C}, where S is the data size and C is the computing complexity, which is represented by the number of CPU cycles required to process each Bit of the task.
[0078] Embodiment Three, the difference between this embodiment three and embodiment one is that the step S2 specifically comprises:
[0079] Step S21, use the longest completion time on all edge servers and mobile devices as the total delay time of the model, which can be represented as: min f1 = max {T j},j = 1, 2,..., M + K; where K represents the number of mobile devices in the smart workshop, and M represents the number of edge servers in the smart workshop; T j is the completion time of the jth device to complete the computing task, which can be an edge computing server (j = 1, 2,..., M) or a mobile device (j = M + 1, M + 2,..., M + K);
[0080] The total sum of the completion times of all tasks assigned to the device is represented as: where is the total number of tasks; X ij = 1 indicates that the ith task is assigned to the jth device, otherwise X ij = 0; Tij is the computation time of the ith task on the jth device;
[0081] In step S22, the energy consumption target of the system is from the task computation consumption of the mobile device and the transmission consumption of the transmission to the edge server, which can be specifically expressed as:
[0082]
[0083] Wherein, P j is the computation power of the mobile device, X ij = 1 only when the jth device is the device to which the ith task belongs;
[0084] In step S23, the system model has the following constraints, which can be specifically expressed as:
[0085] X ij = 0 or 1;
[0086]
[0087] Wherein, X ij is a 0-1 variable, and the only constraint of the system model is that each task can only be assigned to a mobile device or an edge server for execution. When it is expressed as 0, the task is unloaded to the server for computation; when it is expressed as 1, the task is calculated in the local mobile device.
[0088] Embodiment four, the difference between this embodiment four and embodiment three is that: the step S21 includes the following two cases, specifically:
[0089] Case 1, if the device processing the computing task is a mobile device, it means that the task is executed locally, and the time delay T ij is the computation time of the device itself;
[0090] T ij = Tl ij ;
[0091] Tl ij = S i *C i / Fl j ;
[0092] Wherein, Tl ij represents the computation time of the task assigned to the mobile device itself, and Fl j is the CPU frequency of the local mobile device;
[0093] Case 2, if the device processing the computing task is an edge server, the time delay T ij is the transmission time Tt ijand the computing time Te on the edge server ij Composition, specifically represented as:
[0094] T ij = Tt ij + Te ij ;
[0095] Wherein, Tt ij refers to the transmission time of the computing task from the mobile device to the edge server, Te ij refers to the computing time of the task on the edge server, specifically:
[0096] Tt ij = S i / TS ij ;
[0097] Te ij = S i * C i / Fe j ;
[0098] Wherein, Fe j is the CPU frequency of the jth edge server, TS ij is the transmission speed of the mobile device to which the ith task belongs to the jth edge server, and TS ij is confirmed by Shannon theorem, and is expressed as: B is the bandwidth, is the transmission power of the mobile device to which the ith task belongs, H ij is the channel gain from the device to the jth edge server, and N0 is the background noise power.
[0099] Embodiment five, the difference between this embodiment five and embodiment one is that: the step S3 specifically comprises:
[0100] Step S31, in the intelligent workshop scene, the delay target and the energy consumption target are comprehensively considered, and the weighted sum method is used to convert the two targets into a single target problem, specifically represented as:
[0101]
[0102] Wherein, f1 is the delay target, f2 is the energy consumption target, the weight coefficient is set to 1 / M, so that the change on the two targets is kept in similar scale, so that the two targets have similar sensitivity and can be optimized, so as to ensure the rationality of the comprehensive target.
[0103] Embodiment six, the difference between this embodiment six and embodiment one is that: the S42 specifically comprises:
[0104] Step S421, modify the three-layer loop nesting structure of the original bacterial foraging algorithm to a single-layer loop nesting structure. In each iteration process, the bacteria perform chemotaxis, then migrate with a certain probability, and no longer perform the reproduction and death operations separately; the termination condition of the algorithm is changed from ending the last migration to reaching the maximum number of function evaluations;
[0105] Step S422, in the chemotaxis process, introduce a movement strategy based on relative position. The bacteria can realize inter-group information interaction, speed up the convergence speed, and find the optimization direction faster. The improved formula is as follows:
[0106] X(i)=X(i)+rand*(X better -X(i));
[0107] Where X(i) represents the position of the bacterial individual, X better represents the position of another random individual with better fitness than the current position, and rand is a random number between 0 and 1;
[0108] Step S423, in the chemotaxis process, introduce a topology based on dropout strategy. A parameter named dropout-rate is set. Before the position update described in step S422, according to the dropout-rate, hide a proportion of the bacterial individual positions, and let individual i move towards the relatively superior direction among the remaining connected individuals;
[0109] Step S424, in the migration process, introduce a migration operation based on Gaussian distribution to determine the direction. When migrating, with a probability of 0.5, migrate to a random position in the search space, and with a probability of 0.5, generate around the currently found global optimal position through Gaussian mutation, which is specifically represented as:
[0110] X (i) =X best *Gaussian(0,1);
[0111] Where X best represents the currently found optimal solution position, and Gaussian(0,1) is a set of Gaussian distributed random numbers;
[0112] Step S425, obtain the current optimal optimization target value through the bacterial position of this round, and record the corresponding bacterial position;
[0113] Step S426, compare the optimal optimization target value obtained in this round with the global optimal optimization target value. If the optimal optimization target value obtained in this round is better than the global optimal optimization target value, update the global optimal optimization target value to the current optimal optimization target value;
[0114] Step S427: judging whether the iteration number of the current round reaches the maximum iteration number, if not, re-performing step S42, otherwise outputting the optimal unloading strategy and the corresponding optimization target value.
[0115] The above merely describes the preferred embodiments of the present application, and for those skilled in the art, according to the idea of the present application, the specific implementation manner and application scope can be changed, and the content of the description should not be understood as a limitation of the present application.
Claims
1. A method for unloading mobile edge computing tasks based on a bacterial foraging algorithm, characterized in that, It includes the following steps, specifically: Step S1: In the smart workshop scenario, construct a many-to-many edge computing offloading model based on multiple mobile devices, multiple computing tasks, and multiple edge servers; Specifically, step S1 includes: Step S11: Each mobile device in the smart workshop will generate N. l There are (l = 1, 2, ..., K) tasks to be computed, where K represents the number of mobile devices in the smart workshop. Each task has its own task data size and computational complexity. That is, each task is represented by a double Task = {S, C}, where S is the data size and C is the computational complexity, which is represented by the number of CPU cycles required to process each bit of the computation task. Step S2: Initialize the relevant parameters of the mobile device and the edge server, and establish the latency model and energy consumption model of the edge server and the mobile device based on the relevant parameters; Step S3: Edge servers and mobile devices all have computing capabilities. The computing tasks generated by each mobile device can be offloaded to the edge server for computing or computed on the mobile device itself. The longest latency on the edge server and mobile device is taken as the total latency of the system, and the total energy consumption is taken as the system energy consumption. The weighted average is used to obtain the overall optimization goal of the system. The improved bacterial foraging algorithm is used to obtain the optimal goal of the system and the optimal offloading result. Step S4: Modify the three-layer nested loop structure of the bacterial foraging algorithm and change the bacterial foraging algorithm to a single-layer loop architecture that combines chemotaxis and migration. In the chemotaxis process, introduce strategies based on relative position movement and Dropout strategy. In the migration operation, introduce a migration strategy based on Gaussian distribution to determine the direction. Use the improved bacterial foraging algorithm to iteratively update the bacterial position and obtain the best unloading strategy and system optimization goal. The process of iteratively updating bacterial locations and obtaining the optimal unloading strategy using an improved bacterial foraging algorithm includes the following steps: Step S41: Set the bacterial population in the algorithm and initialize the relevant parameters; Step S42: After multiple iterations, the bacterial positions in each optimization are continuously updated, and finally the bacterial positions with the best fitness values are found. These positions are then substituted into the computational unloading system model built in step S1 to obtain the optimal unloading strategy. Specifically, step S2 includes: Step S21: Use the longest completion time across all edge servers and mobile devices as the total latency of the model, which can be expressed as: minf1 = max{T j }, j=1,2,…,M+K; where K represents the number of mobile devices in the smart factory, and M represents the number of edge servers in the smart factory; T j It is the time for the j-th device to complete the computing task. This device can be an edge computing server (j = 1, 2, ..., M) or a mobile device (j = M+1, M+2, ..., M+K). The sum of the completion times of all tasks assigned to the device is expressed as: in This is the total number of tasks; X ij =1 indicates that the i-th task is assigned to the j-th device; otherwise, X ij =0;T ij It is the computation time of the i-th task on the j-th device; Step S22: The system's energy consumption target comes from the task computing consumption of mobile devices and the transmission consumption to the edge server, which can be specifically expressed as: Among them, P j It is the computing power of mobile devices, X ij =1 only if the j-th device is the device to which the i-th task belongs; Step S23: The system model has the following constraints, specifically expressed as follows: X ij =0or1; Among them, X ij The system model uses variables ranging from 0 to 1. The only constraint is that each task can only be assigned to one mobile device or edge server for execution. When represented as 0, the task is offloaded to the server for computation; when represented as 1, the task is computed on the local mobile device. Step S21 includes the following two situations, specifically: Scenario 1: If the device processing the computing task is a mobile device, then the task is executed locally with a time delay T. ij This refers to the device's own calculation time; T ij =Tl ij 4 Tl ij =S i *C i / Fl j ; Among them, Tl ij Fl represents the computation time allocated to the mobile device itself for the task. j It is the CPU frequency of the local mobile device; Scenario 2: If the device processing the computing task is an edge server, then the time delay T ij Transmission time Tt from mobile device to edge server ij Computation time Te on edge servers ij Composition, specifically represented as: T ij =Tt ij +You ij ; Among them, Tt ij This refers to the transmission time of computing tasks from mobile devices to edge servers. ij This refers to the computation time of the task on the edge server, specifically: Tt ij =S i / TS ij ; Te ij =S i *C i / Fe j ; Among them, Fe j It is the CPU frequency of the j-th edge server, TS ij It is the transmission speed from the mobile device to the j-th edge server, as confirmed by Shannon's theorem. TS ij Represented as: B is bandwidth. H is the transmission power of the mobile device to which the i-th task belongs. ij N is the channel gain from the device to the j-th edge server, and N0 is the background noise power. Specifically, step S3 includes: Step S31: In the smart factory scenario, considering both latency and energy consumption targets, a weighted summation method is used to transform the two targets into a single objective problem, specifically expressed as: Where f1 is the time delay target and f2 is the energy consumption target, the weight coefficient is set to 1 / M, so that the changes on the two targets are kept at a similar scale, so that the two targets have similar sensitivity and can be optimized, thus ensuring the rationality of the comprehensive target. Specifically, step S42 includes: Step S421: Modify the original three-level nested loop structure of the bacterial foraging algorithm into a single-level nested loop structure. In each iteration, after the bacteria undergo chemotaxis, they migrate with a certain probability and no longer perform reproduction and extinction operations separately. The termination condition of the algorithm is changed from ending the last migration to reaching the maximum number of function evaluations. Step S422: During chemotaxis, a relative position-based movement strategy is introduced, enabling bacteria to exchange information among themselves, accelerating convergence, and finding the optimization direction more quickly. The improved formula is shown below: X(i)=X(i)+rand*(X better -X(i)); Where X(i) represents the location of an individual bacterium, X better This represents the position of another random individual with better fitness than the current position. rand is a random number between 0 and 1. Step S423: During the chemotaxis process, a topology based on the dropout strategy is introduced. A parameter called dropout-rate is set. Before the position update described in step S422, the position of the bacterial individual is hidden according to the proportion of the dropout-rate, and the individual i is moved towards the relatively better direction among the remaining connected individuals. Step S424: During the migration process, a migration operation based on Gaussian distribution to determine the direction is introduced. During migration, there is a 50% probability that the device will migrate to a random location in the search space, and the other 50% probability that it will be generated near the currently found global optimal location through Gaussian mutation, specifically expressed as follows: X (i) =X best *Gaussian(0,1); Among them, X best This represents the position of the currently found optimal solution, and Gaussian(0,1) is a set of Gaussian distributed random numbers. Step S425: Obtain the current optimal target value based on the bacterial positions in this round, and record the corresponding bacterial positions; Step S426: Compare the optimal optimization objective value obtained in this round with the global optimal optimization objective value. If the optimal optimization objective value obtained in this round is better than the global optimal optimization objective value, then update the global optimal optimization objective value to the current optimal optimization objective value. Step S427: Determine whether the number of iterations in this round has reached the maximum number of iterations. If not, repeat step S42; otherwise, output the optimal unloading strategy and the corresponding optimization target value.
Citation Information
Patent Citations
Edge computing unloading method based on Internet of Things scene
CN116827992A