A cache-enhanced task offload optimization method
By introducing a cache-enhanced task offloading optimization method in the edge network, and leveraging caching strategies and community collaboration, the problems of limited mobile device resources and cloud computing latency are solved, achieving low-latency and efficient task offloading.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2023-04-25
- Publication Date
- 2026-07-21
Smart Images

Figure CN116489682B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of wireless communication technology and relates to a cache-enhanced task offloading optimization method. Background Technology
[0002] With the rapid development of mobile networks, smart devices such as smartphones, wearable devices, and in-vehicle terminals are becoming increasingly widespread, resulting in an astonishing growth in the number of mobile devices. Simultaneously, new applications are rapidly emerging, including computer vision, voice control, and object recognition. While these emerging services bring rich experiences, they also place enormous pressure on network infrastructure. However, resource-constrained mobile devices cannot meet the low latency and high reliability requirements of current resource-intensive applications.
[0003] Mobile Cloud Computing (MCC) was proposed to address this issue. By offloading resource-intensive tasks to a powerful remote cloud, MCC can extend mobile device battery life, support complex computing, and provide potentially unlimited storage. While offloading resource-intensive tasks to a powerful remote cloud can meet user needs, long-distance transmission between the cloud and the user can lead to high latency and jitter. This will severely impact user performance, and uploading massive amounts of tasks to the core network can cause network congestion.
[0004] MEC (Multi-access Edge Computing) has emerged as a viable architecture, providing services on the network side closer to people, things, or data sources to meet the needs of different business scenarios. It enables more secure and real-time responses to various business demands, effectively reducing latency and energy costs, and alleviating the load on the core network. In addition to powerful computing capabilities, MEC servers also possess caching capabilities, which can be directly applied to provide caching services at the edge. Caching frequently requested content closer to users reduces redundant data transmission, improves user experience, and effectively alleviates traffic pressure on the backhaul link. Compared to cloud computing, while MEC can compensate for the limitations of mobile devices themselves, its own storage and computing resources are still limited. Combining caching and computing resources is a feasible solution. This involves considering the combination of multi-dimensional resources to compensate for the deficiencies of single-dimensional resources. During task unloading, to avoid repeatedly transmitting the same tasks, edge caching can be used to dynamically deploy frequently requested tasks on the server based on user requests. Task unloading latency is mainly affected by transmission latency and computation latency. When the cache is hit, the transmission energy consumption and latency of unloading can be reduced, thereby further improving unloading costs. Summary of the Invention
[0005] In view of this, the purpose of this invention is to propose a cache-enhanced task offloading optimization method for the latency-sensitive mobile user task offloading problem in edge networks. This method considers the energy consumption and latency of task offloading and improves the cost of task offloading by planning a reasonable caching strategy.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A cache-enhanced task offloading optimization method is proposed, considering a city scenario of multi-user task offloading in an edge network. Based on user mobility, the method first models the energy consumption and latency of task execution. Then, considering that users in the region may repeatedly request the same task at different times, edge caching technology is introduced. According to the similarity of task requests between base stations, they are clustered into communities, and base stations within the community share information. A dual time scale is designed to update the community task popularity and base station task popularity in long and short time slots, respectively. Finally, a profit maximization model is established to transform the optimization problem into a 0-1 knapsack problem for solution.
[0008] Furthermore, the method specifically includes the following steps:
[0009] S1: System cold start: Determine the number of users and their movement speed, the total bandwidth of the system, and the computing and cache resources of the MEC server;
[0010] S2: Constructing the system model: Based on the information from step S1, establish the mobile device layer and the edge layer; the edge layer is located at the network edge near the data source and consists of base stations and mobile edge computing (MEC) servers;
[0011] S3: Determine the unloading cost: Based on the information in step S2, model the latency and energy consumption during task unloading; construct the unloading cost and introduce edge caching;
[0012] S4: Determine community division based on task similarity: Based on the information in step S3, collect the requested task information; establish a similarity matrix between base stations, and perform community clustering based on the Louvain algorithm;
[0013] S5: Dual-timescale update: Based on the information from step S4, update the task popularity at the community and base station using a dual-timescale approach within the community;
[0014] S6: Determine the caching strategy: Set the cache benefit, analyze the cache placement problem to maximize the cache benefit; transform the problem into a 0-1 knapsack problem for solution.
[0015] S7: Unloading Optimization: Based on the cache placement strategy obtained in step S6, when the unloading task is cached at the edge, the transmission latency and energy consumption are reduced, and the unloading cost is optimized.
[0016] Furthermore, step S2 specifically includes the following steps:
[0017] S21: Design a multi-user urban scenario where mobile users' speeds range from 0-60 m / s; deploy base stations along the road using a collection of... This indicates that the base station has a coverage radius of R and is equipped with one MEC server; the system bandwidth is represented by B, the MEC's computing resources are represented by F, and the MEC's cache resources are represented by... express; This represents N users within the coverage area of the base station;
[0018] At time t, each user initiates a task, and task n is defined as follows: c n T represents n Required computing resources, d n T represents n Size; This represents the maximum tolerable latency for task execution; it is assumed that each task has two processing modes: local execution and edge offloading.
[0019] The specific representation of UE n's task offloading decision is as follows:
[0020] C1:
[0021] The user set that takes the uninstallation is If there are at most N users executing the task, then the constraints are as follows:
[0022] C2:
[0023] Furthermore, step S3 specifically includes the following steps:
[0024] S31: Total task unloading delay for user n in compute unloading mode Including task upload time Server execution time and result transmission delay If a user's movement results in them moving outside the base station's coverage radius while downloading results, then the user is considered to be downloading results from an edge server of an adjacent base station. In this case, the result transmission delay is:
[0025]
[0026] Among them, B wired T represents the transmission speed of the optical fiber between base stations. n Total uninstallation time cost It is expressed as follows:
[0027]
[0028] Where, γ n For binary variables, γ n =1 indicates T n When the calculation is complete, the user has moved outside the radio radius of the base station and needs to receive the result from an adjacent base station; otherwise, it means that the user has not left the current base station.
[0029] According to Shannon's principle, at time t, T n Offloaded to base station uplink transmission rate r n (t) is represented as:
[0030]
[0031] p n For T n The transmission power of the access base station, H n (t) represents the channel gain from user n to the base station at time t:
[0032]
[0033] where dis n (t) represents the distance between user n and the base station at time t; assuming the user moves in a constant direction at a speed V, and the coordinates of the base station are (x0, y0), the two-dimensional coordinates of the user at time t are given by the vector L = {(x1(t), y1(t)), ..., (x... n (t),y n (t)),..(x N (t),y N (t))} represents; therefore, the distance between user n and the base station at time t is expressed as:
[0034]
[0035] α is the path loss exponent, h0 is the complex Gaussian channel coefficient following a complex normal distribution CN(0,1), and N0 is additive white Gaussian noise.
[0036] T n The transmission delay is defined as:
[0037]
[0038] f n This indicates that MEC is assigned to T. n Computing resources, T n The computation delay is defined as:
[0039]
[0040] pn T represents the transmit power of user n. n The unloading energy consumption is defined as:
[0041]
[0042] S32: Uninstall T n The unloading cost is expressed as:
[0043]
[0044] Where, θ e and θ t The weighting factors are time latency and energy consumption, respectively; the optimization objective is to minimize the offloading cost.
[0045]
[0046] stC1-C3.
[0047] Furthermore, step S4 specifically includes the following steps:
[0048] S41: Based on regional user preferences, base stations are divided into different communities according to user request preferences; users with similar preferences are served by base stations within the same community, and base stations within each community are configured to perform collaborative caching; base stations are divided into K communities: Social = {So k |k∈K}, where So k Let this be the set of base stations within the k-th community. Each base station can belong to only one community, and the following constraints must be satisfied:
[0049] C3:
[0050] The base stations are connected via optical fiber, and tasks initiated by users within each base station m are recorded in a file library J. m When a new task type arrives, it will be added to J. m Only a portion of the computational tasks for frequently requested tasks are cached in the MEC server. Represents the set of tasks cached by base station m; cache variables This is a binary variable; a value of 1 indicates that base station m has a buffer T. n A value of 0 indicates no cache; the capacity constraint of cached resources is expressed as:
[0051] C4:
[0052] S42: Divide base stations into different communities, and group base stations with similar task interests and preferences into the same community; within the same community, base stations cooperate with each other to respond to demands more quickly; define the similarity between base station m and base station z at time t1. The similarity between base stations is measured using the Jaccard coefficient, which can be used to describe the similarity between two sets; J m and J z Let represent the sets of task requests between base station m and base station z at time t, respectively. This represents the statistical average of the base station similarity between base station m and base station z from time t1-1 to time t1:
[0053]
[0054] Among them, J m ∩J z This indicates the same request between base station m and base station z; The larger the value, the higher the similarity between the two base stations;
[0055] S43: Thus, an M*M dimensional similarity matrix ψ between base stations is constructed. An undirected weighted graph G = {V, E} is constructed based on the similarity matrix ψ. Each vertex in the graph represents a base station, and the edge weights between base stations are represented by their similarity. A Louvain-based clustering algorithm is used to divide the base stations into different communities, thus obtaining a set called Social. Initially, each vertex represents a community. During vertex merging, only unmerged and reachable neighboring communities are considered. The module gain resulting from merging vertex i into community A is calculated using the following formula:
[0056]
[0057] Where, k in parentheses i,in The sum of edge weights between vertex i and community A; the numerator of the second term ∑ tot k i The sum represents the product of the sum of the weights of all edges connected to node i and the sum of the weights of all external edges connected to community A; the denominator sum represents the sum of all edge weights in the graph; i eventually chooses to move to the community with the largest ΔQ value, and when the largest ΔQ is less than 0, node i remains stationary; after completing a phase, each community is merged into a new super node, and the edge weight of the super node is the sum of the edge weights of all nodes in the original community, forming a new network; the above steps are repeated until a new move no longer brings any module gain and the algorithm stops.
[0058] Furthermore, step S5 specifically includes the following steps:
[0059] S51: Different spatial scales T n The popularity of each element is initialized according to the Zipf distribution as follows:
[0060]
[0061] Where 'a' is the Zipf factor, which controls the degree of difference in popularity between different tasks; as it increases, the difference in popularity between tasks intensifies; J represents the popularity ranking of the task; and r_f represents the ranking of the task in historical data.
[0062] Update the file popularity at different scales in each time slot t; the current time slot t represents x-1 times t. long , t long For the corresponding long update slot, x is a positive integer; therefore, the expression for updating the long-term global popularity is:
[0063]
[0064] in, and These represent the popularity of task n at the community and base station, respectively; and the corresponding short time slot t short The base station task popularity update expression is:
[0065]
[0066] Where β is the weighting factor, This represents the historical number of times task n has been requested.
[0067] Furthermore, step S6 specifically includes the following steps:
[0068] S61: Define Pro n,m The revenue value for caching task n at base station m is mainly related to three factors: task popularity, transmission latency, and transmission energy consumption. The specific communication resources allocated to the tasks for the latter two parameters are unknown during the pre-setting phase; therefore, a uniform bandwidth B is allocated to all tasks during the calculation.
[0069]
[0070] S62: Model the problem of maximizing cache benefits as:
[0071]
[0072] stC3-C4,
[0073] C5:
[0074] The objective function is to maximize cache revenue, and the optimization variable is the cache decision matrix D; C1 restricts the number of users in the community from exceeding the total number of users; C2 is a binary variable constraint for cache-related variables; and C3 is a base station cache capacity constraint.
[0075] S63: After obtaining a clear community division, determine the cache benefit; transform the cache placement problem into a knapsack problem, where each item has two attributes: price and weight; use low-complexity dynamic programming to solve the knapsack problem; describe the cache placement problem as a 0-1 knapsack problem, placing the item with the optimal cache benefit within a limited cache capacity; the limited capacity of the knapsack is analogous to the cache capacity St of base station m. m The revenue of a caching task is represented by the price of an item, and the weight of each item is represented by the size of the task. Each item has two states: placed and not placed. When the revenue of adding the task minus the cost of caching the task makes the overall revenue better than not placing the item, dp[i] = max(dp[i], dp[id[n]] + Pro n The task will be cached.
[0076] Furthermore, step S7 specifically includes the following steps:
[0077] S71: In a cache-enhanced MEC system architecture, introduce edge caching and determine the caching strategy. Then, when a user initiates a request, the base station checks if it has cached the task. If not, it searches its local community for a cached version. If a cache exists, only negligible data is uploaded for the base station to process. At this point, the task's transmission latency and energy consumption are significantly improved. The redefined cache-enhanced task transmission latency and energy consumption are as follows: and
[0078] When a user sends a request to base station m, the unloading task may be cached in the following three ways:
[0079] (1) Task n is cached at base station m: Task n does not need to be uploaded; task-related data can be obtained directly from the local base station without uploading.
[0080] (2) No task n is cached at base station m: The community to which base station m belongs caches task n, which is obtained from a cooperating base station z. t B2B Indicates the transmission delay between base stations;
[0081] (3) Neither the target base station nor other base stations within the community have cached task n: In this case, task n is only uploaded to the base station for processing via the wireless link.
[0082] The beneficial effects of this invention are as follows: By introducing edge caching during task unloading, popular computing tasks can be cached at the edge, effectively reducing upload time and energy costs when a request is successful. Furthermore, by dividing the work into collaborative communities among base stations, a dual-timescale approach is designed to update task popularity at both the base station and community levels. This method can track changes in short- and long-term popular content as much as possible while maintaining the overall popularity trend. It effectively solves the problem of duplicate popular request tasks within an urban area.
[0083] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0084] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:
[0085] Fig. 1 Network architecture diagram for community collaboration caching;
[0086] Fig. 2 Network architecture diagram for enhanced task offloading for caching;
[0087] Fig. 3 This is a flowchart of the cache enhancement method of the present invention. Detailed Implementation
[0088] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0089] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0090] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0091] Please see Figs. 1-3 This invention proposes a cache-enhanced task offloading optimization method for handling a large number of task offloading requests from mobile users in urban scenarios. Edge caching is introduced into task offloading, which can utilize cache resources more efficiently compared to conventional caching algorithms such as FIFO, Least Recently Used, and greedy caching. First, based on user mobility, the energy consumption and latency of task execution are modeled. Then, considering that users within a region may request the same task at different times, edge caching technology is introduced. Based on the similarity of task requests between base stations, they are clustered into communities, with base stations sharing information within each community. A dual time scale is designed to update the community task popularity and base station task popularity in both long and short time slots. Finally, a profit maximization model is established, transforming the optimization problem into a 0-1 knapsack problem for solution.
[0092] This method specifically includes the following steps:
[0093] Step 1: System cold start: Determine the number of users and their movement speed, the total bandwidth of the system, and the computing and cache resources of the MEC server;
[0094] Step 2: Construct the system model: Based on the information from step S1, establish the mobile device layer and the edge layer. The edge layer is located at the network edge, close to the data source, and consists of base stations and MEC servers. Specifically, it includes the following steps:
[0095] Step 2.1: Design a multi-user urban scenario where mobile users' speeds range from 0-60 m / s. Deploy base stations along the route using a set of... This indicates that the base station has a coverage radius of R and is equipped with one MEC server. System bandwidth is represented by B, MEC computing resources by F, and MEC caching resources by [missing information]. express. This represents N users within the coverage area of the base station.
[0096] At time t, each user initiates a task, and task n is defined as follows: cn T represents n Required computing resources, d n T represents n Size. This represents the maximum tolerable latency for task execution. It is assumed that each task has two processing modes: local execution and edge offloading.
[0097] The specific representation of UE n's task offloading decision is as follows:
[0098] C1:
[0099] The user set that takes the uninstallation is This indicates that there can be at most N users executing the task, and the constraints are as follows:
[0100] C2
[0101] Step 3: Determine the unloading cost: Based on the information in step S2, model the latency and energy consumption during task unloading.
[0102] Build offloading costs and introduce edge caching. Specifically, this includes the following steps:
[0103] Step 3.1: Calculate the total unloading delay of user n's task in unloading mode. Including task upload time Server execution time and result transmission delay When the user is at rest While the latency can be ignored, user mobility might mean that the user has moved outside the base station's coverage radius by the time they download the results. In this case, if the user downloads the results from an edge server of an adjacent base station, the transmission latency becomes significant.
[0104]
[0105] Among them, B wired This represents the transmission speed of the optical fiber between base stations. Therefore, T n Total uninstallation time cost It can be represented as follows:
[0106]
[0107] Where, γ n For binary variables, γ n =1 indicates T n When the calculation is complete, the user has moved outside the radio radius of the base station and needs to receive the result from a neighboring base station. Otherwise, it means the user has not left the current base station.
[0108] According to Shannon's principle, at time t, T n Offloaded to base station uplink transmission rate r n (t) can be expressed as:
[0109]
[0110] p n For T n The transmission power of the access base station. H n (t) represents the channel gain from user n to the base station at time t:
[0111]
[0112] Among them, dis n (t) represents the distance between user n and the base station at time t. Assume the user moves in a constant direction at a speed V, and the base station's coordinates are (x0, y0). The user's two-dimensional coordinates at time t are given by the vector L = {(x1(t), y1(t)), ..., (x...}. n (t),y n (t)),..(x N (t),y N (t))} represents the distance between user n and the base station at time t. Therefore, the distance between user n and the base station at time t can be expressed as:
[0113]
[0114] α is the path loss exponent, h0 is the complex Gaussian channel coefficient following a complex normal distribution CN(0,1), and N0 is additive white Gaussian noise.
[0115] T n The transmission delay can be defined as:
[0116]
[0117] f n This indicates that MEC is assigned to T. n Computing resources, T n The computation delay can be defined as:
[0118]
[0119] p n T represents the transmit power of user n. n The unloading energy consumption can be defined as:
[0120]
[0121] Step 3.2: Uninstall T n The unloading cost can be expressed as:
[0122]
[0123] Where, θ e and θ t These are the weighting factors for latency and energy consumption, respectively.
[0124] The optimization objective is to minimize the unloading cost:
[0125]
[0126] stC1-C3.
[0127] Step 4: Determine community segmentation based on task similarity: Based on the information from step S3, collect the requested task information. Establish a similarity matrix between base stations and perform community clustering based on the Louvain algorithm. This specifically includes the following steps:
[0128] Step 4.1: When a user-requested task is cache-hit, it can be quickly computed to reduce transmission latency and energy consumption. Based on user preferences and their regionality, base stations are divided into different communities according to user request preferences. Base stations within the same community serve users with similar preferences; therefore, base stations within each community can perform collaborative caching. Base stations are divided into K communities: Social = {So...} k |k∈K}, where So k Let this be the set of base stations within the k-th community. Each base station can belong to only one community, and the following constraints must be satisfied:
[0129] C3:
[0130] The base stations are connected via optical fiber, and tasks initiated by users within each base station m are recorded in a file library J. m When a new task type arrives, it will be added to J. m Due to caching resource limitations, only a portion of the computational tasks for frequently requested requests can be cached on the MEC server. This represents the set of tasks cached by base station m. (Cache variable) This is a binary variable; a value of 1 indicates that base station m has a buffer T. n A value of 0 indicates no caching. The capacity constraint of cached resources is expressed as:
[0131] C4:
[0132] Step 4.2: Although base stations differ in location, there is some overlap in the types of user requests within adjacent local areas. For example, users in residential areas tend to prefer entertainment-related information. To address this, base stations are divided into different communities, and base stations with similar task interests are assigned to the same community. Within the same community, base stations cooperate more quickly to respond to requests. Define the similarity between base station m and base station z at time t1. The similarity between base stations is measured using the Jaccard coefficient, which describes the similarity between two sets. m and J z Let represent the sets of task requests between base station m and base station z at time t, respectively. This represents the statistical average of the base station similarity between base station m and base station z from time t1-1 to time t1:
[0133]
[0134] Among them, J m ∩J z This indicates the same request between base station m and base station z; The larger the value, the higher the similarity between the two base stations.
[0135] Step 4.3: This constructs an M*M dimensional similarity matrix ψ between base stations. An undirected weighted graph G = {V, E} is constructed based on the similarity matrix ψ. Each vertex in the graph represents a base station, and the edge weights between base stations are represented by their similarity. A Louvain-based clustering algorithm is used to divide the base stations into different communities, thus obtaining the set Social. Louvain is a modularity-based community discovery algorithm. Its basic idea is to traverse all neighboring communities reachable from a node and select the community that maximizes the modular gain. Initially, each vertex represents a community. Each time a vertex is merged, only unmerged and distance-reachable neighboring communities are considered. The modular gain resulting from merging vertex i into community A is calculated using the following formula:
[0136]
[0137] Where, k in parentheses i,in The sum of edge weights between vertex i and community A; the numerator of the second term ∑ tot k iThe sum represents the product of the sum of the weights of all edges connected to node i and the sum of the weights of all external edges connected to community A; the denominator `sum` represents the sum of all edge weights in the graph. node i ultimately chooses to move to the community with the largest ΔQ value; when the largest ΔQ is less than 0, node i remains stationary. After completing Phase 1, each community is merged into a new supernode, whose edge weight is the sum of the edge weights of all nodes in the original community, forming a new network. The above steps are repeated until a new move no longer results in any module gain, at which point the algorithm stops.
[0138] Step 5: Dual-Time-Scale Update: Based on the information from Step S4, update the task popularity at the community and base station using a dual-time-scale approach. This includes the following steps:
[0139] Step 5.1: Different spatial scales T n The popularity of each element is initialized according to the Zipf distribution as follows:
[0140]
[0141] Where 'a' is the Zipf factor, which controls the degree of difference in popularity among different tasks; its increase exacerbates the difference in popularity between tasks. J represents the popularity ranking of the task; and r_f represents the ranking of the task in historical data.
[0142] Update the file popularity at different scales in each time slot t; the current time slot t represents x-1 times t. long , t long For the corresponding long update slot, x is a positive integer. The expression for updating the long-term global popularity is:
[0143]
[0144] in, and These represent the popularity of task n at the community and base station, respectively. The corresponding short time slot t... short The base station task popularity update expression is:
[0145]
[0146] Where β is the weighting factor, This represents the historical number of times task n has been requested.
[0147] Step 6: Determine the caching strategy: Define the caching reward, analyze the cache placement problem to maximize caching reward, and transform the problem into a 0-1 knapsack problem for solution. This includes the following steps:
[0148] Step 6.1: Define Pro n,mThe revenue value for caching task n at base station m is mainly related to three factors: task popularity, transmission latency, and transmission energy consumption. The specific communication resources allocated to the tasks are unknown during the pre-setting phase for the latter two parameters. Therefore, a uniform bandwidth B is allocated to all tasks during the calculation.
[0149]
[0150] Step 6.2: Model the problem of maximizing cache benefits as follows:
[0151]
[0152] stC3-C4,
[0153] C5:
[0154] The objective function is to maximize cache revenue, and the optimization variable is the cache decision matrix D. C1 restricts the number of users in the community from exceeding the total number of users. C2 is a binary variable constraint for cache-related variables. C3 is a base station cache capacity constraint.
[0155] Step 6.3: After obtaining a clear community division, determine the cache benefit. To achieve efficient utilization of cache resources, the caching scheme has a crucial impact on the cache's effectiveness. The cache placement problem is transformed into a knapsack problem, which describes how to place a set of items with the highest benefit within a limited knapsack capacity. Each item has two attributes: price and weight. There are generally four methods to solve the knapsack problem: brute force traversal of all feasible solutions (although it can find the optimal solution, its time complexity is often exponential); recursion and divide-and-conquer break down a large problem into multiple smaller, identical problems, but have high time complexity when the recursion depth is too deep; greedy algorithms often only obtain local optima; finally, consider using low-complexity dynamic programming. Therefore, the cache placement problem is described as a 0-1 knapsack problem, placing the items with the highest cache benefit within a limited cache capacity. The limited capacity of the knapsack is analogous to the cache capacity St of base station m. m The revenue from caching tasks can be represented as the price of an item, and the weight of each item can be represented by the size of the task. Each item has two states: placed and not placed. The overall revenue is better when the revenue from adding the task minus the cost of caching the task is better than not placing it (dp[i] = max(dp[i], dp[id[n]] + Pro). n Tasks will be cached. Dynamic programming can effectively and with low complexity backtrack from the knapsack problem to derive a cache placement strategy.
[0156] Step 7: Unloading Optimization: Based on the cache placement strategy obtained from S6, when the unloading task is cached at the edge, transmission latency and energy consumption can be reduced, thereby optimizing the unloading cost. This includes the following steps:
[0157] Step 7.1: In the cache-enhanced MEC system architecture, introduce edge caching and determine the caching strategy. Then, when a user initiates a request, the base station checks if it has the task cached. If not, it searches its local community for a cached version. If a cache exists, only negligible data needs to be uploaded for the base station to process. At this point, the task's transmission latency and energy consumption are significantly improved. The redefined cache-enhanced task transmission latency and energy consumption are as follows: and
[0158] When a user sends a request to base station m, the unloading task may be cached in the following three ways:
[0159] (1) Task n is cached at base station m: Task n does not need to be uploaded, and the task-related data can be obtained directly from the local base station without uploading.
[0160] (2) No task n is cached at base station m: The community to which base station m belongs caches task n, and task n can be obtained from a cooperating base station z. In this case, t B2B This indicates the transmission delay between base stations.
[0161] (3) Neither the target base station nor other base stations within the community have cached task n: In this case, task n can only be uploaded to the base station for processing via the wireless link.
[0162] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A cache-enhanced task offloading optimization method, characterized in that: Considering a city scenario with multi-user task offloading in an edge network, based on user mobility, we first model the energy consumption and latency of task execution. Then, considering that users within the same area may repeatedly request the same task at different times, we introduce edge caching technology. Based on the similarity of task requests between base stations, they are clustered into communities, and base stations within the community share information. We design a dual time scale to update the community task popularity and base station task popularity in long and short time slots, respectively. Finally, we establish a profit maximization model, transforming the optimization problem into a 0-1 knapsack problem for solution. The method specifically includes the following steps: S1: System cold start: Determine the number of users and their movement speed, the total bandwidth of the system, and the computing and cache resources of the MEC server; S2: Constructing the system model: Based on the information in step S1, establish the mobile device layer and the edge layer; the edge layer is located at the network edge near the data source and consists of base stations and mobile edge computing (MEC) servers; S3: Determine the unloading cost: Based on the information in step S2, model the latency and energy consumption during task unloading; construct the unloading cost and introduce edge caching; S4: Determine community division based on task similarity: Based on the information in step S3, collect the requested task information; establish a similarity matrix between base stations, and perform community clustering based on the Louvain algorithm; S5: Dual-timescale update: Based on the information from step S4, update the task popularity at the community and base station using a dual-timescale approach within the community; S6: Determine the caching strategy: Set the cache benefit, analyze the cache placement problem to maximize the cache benefit; transform the problem into a 0-1 knapsack problem for solution. S7: Unloading optimization: Based on the cache placement strategy obtained in step S6, when the unloading task has a cache at the edge, the transmission latency and energy consumption are reduced, and the unloading cost is optimized. Step S4 specifically includes the following steps: S41: Based on regional user preferences, base stations are divided into different communities according to user request preferences; user preferences for base station services within the same community are similar, and base stations within each community can be configured to perform collaborative caching; base stations are divided into... a community ,in Indicates the first A set of base stations within a community, where each base station can belong to only one community, must satisfy the following constraints: The base stations are connected by optical fiber, and each base station Tasks initiated by internal users are recorded in the file library. It will be added when a new task type arrives. Only a portion of the computational tasks for frequently requested tasks are cached in the MEC server. Indicates base station Cached task set; cache variables It is a binary variable; a value of 1 indicates a base station. There is a cache A value of 0 indicates no cache; the capacity constraint of cached resources is expressed as: S42: Divide base stations into different communities, and group base stations with similar task interests into the same community; within the same community, base stations cooperate with each other to respond to demands more quickly; define Time base station and base stations Similarity between The similarity between base stations is measured using the Jaccard coefficient, which can be used to describe the similarity between two sets. and They represent Time base station and base stations The set of task requests between them Indicates from At that time Base station and base stations Statistical average of base station similarity between them: in, Indicates base station and base stations The same request between them; The larger the value, the higher the similarity between the two base stations; S43: This establishes an inter-base station dimensional similarity matrix , According to the similarity matrix Construct an undirected weighted graph Each vertex in the graph represents a base station, and the edge weights between base stations are represented by their similarity. A Louvain-based clustering algorithm is used to divide the base stations into different communities, thus obtaining a set. Initially, each vertex represents a community. During vertex merging, only unmerged and reachable neighboring communities are considered. Vertex calculation... Merge into the community The resulting module gain is expressed by the following formula: The part in parentheses Represents vertices With the community The sum of the edge weights between them; the numerator of the second term Represents nodes The sum of the weights of all connected edges and the sum of all edges and the community The product of the sum of the weights of the connected external edges; denominator This represents the sum of all edge weights in the graph; Final choice to The community with the highest value, when the largest When less than 0, the node Keep it stationary; after completing a phase, merge each community into a new super node. The edge weight of the super node is the sum of the edge weights of all nodes in the original community, forming a new network; repeat the above steps until a new move no longer brings any module gain and the algorithm stops. Step S5 specifically includes the following steps: S51: Different Spatial Scales The popularity of each element is initialized according to the Zipf distribution as follows: in, Zipf factor It controls the degree of difference in popularity between different tasks; when it increases, the difference in popularity between tasks intensifies. This indicates the ranking of task popularity. This indicates the ranking of the task within historical data; Update the file popularity at different scales in each time slot t; current time slot express indivual , Corresponding to long update slots, If the integer is positive, then the long-term global popularity is updated using the following expression: in, and These represent the tasks at the community and the base station, respectively. Popularity; and the corresponding short time slot The base station task popularity update expression is: in, As a weighting factor, Indicates task The number of times the request has been made.
2. The task offloading optimization method with cache enhancement as described in claim 1, characterized in that: Step S2 specifically includes the following steps: S21: Design a multi-user urban scenario where mobile users' speeds range from 0-60 m / s; deploy base stations along the road using a collection of... This indicates that the coverage radius of the base station is... It is equipped with a MEC server; the system bandwidth is provided by This indicates that the computing resources of MEC are provided by This indicates that MEC's cache resources are provided by express; Indicates the area within the base station's coverage. One user; exist At any given moment, each user initiates a task. Defined as , express Required computing resources express Size; This represents the maximum tolerable latency for task execution; it is assumed that each task has two processing modes: local execution and edge offloading. The task unloading decision is specifically represented as follows: The user set that takes the uninstallation is Indicates; at most If multiple users execute tasks, the following constraints apply: 。 3. The task offloading optimization method with cache enhancement as described in claim 1, characterized in that: Step S3 specifically includes the following steps: S31: User Total task unloading latency in compute unloading mode Including task upload time Server execution time and result transmission delay If the user's movement causes them to move outside the base station's coverage radius when downloading results, then the user will be considered to be downloading results from an edge server of an adjacent base station. In this case, the result transmission delay is: in, This represents the transmission speed of the optical fiber between base stations. Total uninstallation time cost It is expressed as follows: in, It is a binary variable. express When the calculation is complete, the user has moved outside the radio radius of the base station and needs to receive the result from an adjacent base station; otherwise, it means that the user has not left the current base station. According to Shannon's principle At all times Offloaded to base station uplink transmission rate Represented as: for The transmission power of the access base station, express Always from the user Channel gain to base station: in express Time users The distance to the base station; assuming the user is moving in a constant direction at a speed V, the coordinates of the base station are... , The user's two-dimensional coordinates at any given time are determined by vectors. Indicate; therefore Time users The distance to the base station is expressed as: α is the path loss exponent. These are complex Gaussian channel coefficients that follow a complex normal distribution CN(0, 1); It is additive white Gaussian noise; The transmission delay is defined as: Indicates that MEC is assigned to Computing resources The computation delay is defined as: Indicates user The transmission power, The unloading energy consumption is defined as: S32: Uninstall The unloading cost is expressed as: in, and The weighting factors are time latency and energy consumption, respectively; the optimization objective is to minimize the offloading cost. 。 4. The task offloading optimization method with cache enhancement as described in claim 1, characterized in that: Step S6 specifically includes the following steps: S61: Definition For base stations Cache tasks The revenue value is mainly related to three factors: task popularity, transmission latency, and transmission energy consumption. The specific communication resources allocated to tasks are unknown during the pre-setting phase for the latter two parameters; therefore, a uniform bandwidth is allocated to all tasks during the calculation. : S62: Model the problem of maximizing cache benefits as: The objective function is to maximize cache revenue, and the optimization variable is the cache decision matrix. C1 restricts the number of users within the community to not exceed the total number of users; C2 is a binary variable constraint for cache-related variables; C3 is a constraint on the base station cache capacity. S63: After obtaining a clear community division, determine the cache benefit; transform the cache placement problem into a knapsack problem, where each item has two attributes: price and weight; use low-complexity dynamic programming to solve the knapsack problem; describe the cache placement problem as a 0-1 knapsack problem, placing the item with the optimal cache benefit within a limited cache capacity; the limited capacity of the knapsack is analogous to a base station. Cache capacity The revenue from caching tasks is represented by the price of the items, and the weight of each item is represented by the size of the task. Each item has two states: placed and not placed. The overall revenue is considered better when the revenue from adding the task minus the cost of caching the task is better than not placing it. The task will then be cached.
5. The task offloading optimization method with cache enhancement as described in claim 1, characterized in that: Step S7 specifically includes the following steps: S71: In a cache-enhanced MEC system architecture, introduce edge caching and determine the caching strategy. Then, when a user initiates a request, the base station checks if it has cached the task. If not, it searches its local community for a cached version. If a cache exists, only negligible data is uploaded for the base station to process. At this point, the task's transmission latency and energy consumption are significantly improved. The redefined cache-enhanced task transmission latency and energy consumption are as follows: and ; When the user sends a signal to the base station When a request is made, the unloading task may be cached in the following three ways: (1) Base station The task is cached there. :Task No need to upload; task-related data can be obtained directly from the local base station. ; (2) Base station There are no cached tasks. Base station The community to which it belongs cached the task ,Task From a certain cooperative base station At this time, , Indicates the transmission delay between base stations; (3) Neither the target base station nor other base stations in the community have cached tasks. : This task Only data is transmitted to the base station for processing via a wireless link; at this time, there is... .