Multi-task offloading method and system for maximizing speedup ratio under service cache constraint of fog computing-oriented service

CN122924993APending Publication Date: 2026-10-16LISHUI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610972880.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-01
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0006]鉴于上述现状,本发明提供了一种面向雾计算的服务缓存受限下最大化加速比的多任务卸载方法及系统,以解决现有雾计算卸载方案在处理异构任务时存在的决策误区、资源分配不公以及无法适应任务流行度动态变化等技术问题

Benefits of technology

[0118] This invention achieves maximum speedup for multi-task offloading under limited service caching by coordinating a centralized controller, fog nodes, and user terminals. The controller employs a two-stage PSHC algorithm (EDF combined with neighborhood HC search) to generate a high-quality global task scheduling sequence, effectively mitigating queue congestion caused by concurrent offloading by multiple users. Furthermore, it dynamically tracks service popularity using a Dynamic Caching and Scheduling Optimization (DCSO) algorithm, matching each task with the optimal fog server and offloading ratio to maximize speedup. This invention uses speedup instead of traditional absolute latency as the optimization criterion, effectively improving the performance speedup of all task offloading in the system. Simultaneously, it utilizes the diminishing marginal utility of the logarithmic function to spontaneously suppress resource monopolization by high-speedup tasks. This invention can maximize the utilization efficiency of computing resources and ensure the fairness of resource allocation in complex fog computing environments with limited service caching and dynamically evolving demands.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122924993A_ABST
    Figure CN122924993A_ABST
Patent Text Reader

Abstract

The application discloses a multi-task unloading method and system for maximizing acceleration ratio under fog computing service cache restriction, and the method is as follows: S1, a controller initializes a system service type set and a sliding window of each fog server; the fog server registers with the controller; S2, a user terminal generates a task requiring a specific service type, and sends task information to the controller; the controller drives the fog server to complete local service image updating at the start of a time slot; S3, a task processing delay model, an acceleration ratio model and an unloading proportion decision model based on terminal and fog server collaborative calculation are established; S4, an initial task execution order sequence that optimizes global expected acceleration ratio is generated; S5, joint scheduling is performed for each task, and a matching result of the task and the fog server and a task unloading proportion are obtained; and S6, the sliding window content of each fog server is updated, and the final matching result of the user terminal and the fog server and the unloading proportion are sent to the user terminal and the fog server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of information technology, specifically relating to a multi-task offloading method and system for maximizing speedup under service caching constraints in fog computing. Background Technology

[0002] With the rise of fog computing, offloading computationally intensive tasks from resource-constrained terminal devices to edge fog nodes has become a core approach to improving mobile application response speed and reducing device power consumption. Meanwhile, as terminal tasks become increasingly complex, each task requires the pre-installation of its necessary service applications. In an ideal fog offloading scenario, it is typically assumed that the fog server pre-installs all the service applications required by all user tasks, and task scheduling and offloading are based on this premise. However, traditional fog computing's multi-task offloading faces the following two challenges:

[0003] First, in practical fog computing network deployments, due to the highly limited physical resources of fog nodes, their service cache space is often insufficient to cover all the service applications required by user tasks; that is, the service cache of fog servers is limited. In existing technical solutions, when a user initiates a task request and the corresponding service application is not found locally on the fog server, the system must download it from the central controller or perform real-time configuration. This process not only generates significant configuration latency but may also cause drastic fluctuations in the overall system processing capacity due to frequent replacement of invalid caches. To address these issues, some existing research has proposed optimization models that jointly integrate service caching and task offloading using deep reinforcement learning or linear programming. However, most existing solutions assume that service popularity remains static, ignoring the dynamic changes in service popularity caused by the dynamic evolution of user preferences over time in real-world scenarios. This results in caching decisions based on static service popularity being unable to adapt to scenarios with dynamically changing service applications.

[0004] Second, current optimization goals mostly focus on reducing absolute latency, which has limitations in heterogeneous multi-task concurrent offloading scenarios. For example, suppose there are two heterogeneous tasks, A and B. Task A takes 3 seconds to process, while task B takes 30 seconds. Allocating the same fog server resources to task A reduces its processing time by 2 seconds; allocating them to task B reduces its processing time by 3 seconds. From an absolute latency reduction perspective, it should be allocated to task B. However, from a user experience perspective, allocating resources to A reduces its processing time to 1 second (a 3x performance improvement); allocating resources to B reduces its processing time to 27 seconds (approximately a 1.1x performance improvement). Clearly, this method of simply comparing absolute latency reductions fails to distinguish the real differences in user-end benefits, potentially leading to a misallocation of computing resources.

[0005] Therefore, there is an urgent need in this field for a task offloading and service caching joint optimization technology that can deeply integrate dynamic service popularity perception, break through the limitations of traditional absolute latency optimization, and be guided by real acceleration performance, so as to maximize the speedup of multi-task offloading in resource-constrained fog networks. Summary of the Invention

[0006] In view of the above situation, the present invention provides a multi-task offloading method and system for maximizing speedup under limited service caching for fog computing, in order to solve the technical problems of decision-making errors, unfair resource allocation, and inability to adapt to dynamic changes in task popularity in existing fog computing offloading schemes when handling heterogeneous tasks.

[0007] The objective of this invention is achieved through the following technical solution:

[0008] A multi-task offloading method for maximizing speedup under service caching constraints in fog computing involves several user terminals, multiple fog servers, and a centralized controller. The specific operation steps are as follows:

[0009] S1. System Initialization and Parameter Registration: The controller initializes the system service type set as follows: The system broadcasts this information to all fog servers, initializes the sliding window for each fog server to record historical service types and speedup gains, and registers its computing resources, service cache capacity, and initial service cache snapshot with the controller. The set of fog servers is denoted as [set name missing]. All user terminals register their identity and local computing capabilities with the controller; the set of user terminals is denoted as . .

[0010] S2. Information Awareness and Dynamic Cache Update: The user terminal generates tasks requiring specific service types based on the dual-mode Zipf smooth evolution model and sends the task information to the controller. The controller evaluates the popularity and average speedup gain of service types based on the sliding window mechanism, calculates the cache value of each service type, and then decides the cache content of each fog server based on the cache value of the service type. At the start of the time slot, the controller drives the fog server to complete the update of the local service image.

[0011] S3. Construction of task processing latency, speedup ratio and offloading ratio decision model: Under the known matching conditions between the terminal and the fog server, the controller combines the ideas of queuing offloading and partial offloading, as well as task information and scenario information, to establish a task processing latency model, speedup ratio model and offloading ratio decision model based on the collaborative computing of the terminal and the fog server.

[0012] S4. Global Task Virtual Scheduling Optimization: For concurrent task requests within this time slot, the controller first performs an initial sorting based on the earliest deadline first (EDF); then, based on the model established in step S3, it performs a virtual fog server offloading evaluation, and uses the neighborhood climbing (HC) search optimization algorithm to perform local position swaps and optimization target calculations within the set prefix search range, finally generating the initial task execution sequence that optimizes the global expected speedup.

[0013] S5. User Fog Server Matching and Unloading Decision: The controller performs joint scheduling for each task according to the initial task execution order generated in step S4, and determines whether the service type of the task hits the candidate fog server cache. If it hits, the controller aims to maximize the speedup ratio and solves the optimal matching and unloading ratio between the user and the fog server. If it does not hit or does not meet the latency constraint, the task is rejected for unloading.

[0014] S6. Sliding window update and result distribution: The controller updates the sliding window content of each fog server according to the order of step S4 and the result of step S5, and distributes the final user-fog server matching result and unloading ratio to the user and fog server.

[0015] More preferably, in step S1:

[0016] S11. The controller initializes and maintains four core data structures: Service type list. List User terminal list Fog Server List And the corresponding service application sliding window for each fog server .

[0017] S12, each fog server Register its calculation frequency with the controller (i.e., corresponding computing resources), service cache storage capacity limit and the current cached service image set (i.e., the initial service cache snapshot), that is = ∪ .

[0018] S13, Each user terminal Register its calculation frequency with the controller Possible service application types R i ,Right now = ∪ Service List =Service List ∪R i .

[0019] More preferably, in step S2:

[0020] S21. The user terminal generates tasks requiring specific service types based on the dual-mode Zipf smooth evolution model, as follows:

[0021] Construct two different Zipf-type target distributions and , respectively represented as:

[0022]

[0023]

[0024] Among them, P A,k and P B,k Let represent the popularity of the k-th service type. The true popularity of the service type in each time slot t is simulated using the following formula:

[0025]

[0026] in, These are time weights, which smoothly change between [0,1] over time, and are modeled as follows:

[0027]

[0028] in, Indicates the start time slot for the popularity switch. This indicates the number of transition duration slots. These two values ​​need to be preset in advance to simulate that the popularity of service types is not constant in actual applications.

[0029] At the start of each time slot, a set of tasks is generated based on service type popularity and randomly assigned to each user terminal, with one task per terminal. Let user terminal i's task request be recorded. ,in, For unit data calculation volume, The total amount of data for the task. The deadline is [date / time]. This refers to the service application type to which the task belongs. The task's data volume can be arbitrarily divided into local execution data volume. and the amount of data executed during unloading :

[0030]

[0031]

[0032] in, It is a task The uninstallation rate.

[0033] S22. The controller evaluates the popularity of service types and the average speedup gain based on a sliding window mechanism, and calculates the cache value of each service type based on the popularity of service types and the average speedup gain, as follows:

[0034] The controller reads each fog server Fog j The sliding window data is used to count the total number of times each service type appears, N. l Total potential speedup gain Total_S l Then calculate the current popularity P of service type l. l Average speedup gain Avg_S l :

[0035]

[0036] Where L represents the number of service types in the system.

[0037] Furthermore, the controller calculates the cache value (Value) for each service type l according to the following formula. l =P l ×Avg_S l .

[0038] S23. The controller sorts the cached service types in descending order of value, selects the top n service types as the cache decision for the current time slot fog server j, and drives the fog server to update its local service image at the start of the time slot. Here, n is the upper limit of the number of services that the fog server j can cache.

[0039] More preferably, step S3 is as follows:

[0040] S31, Controller Setup Based on the user terminal's local location and matching fog server The processing latency model for collaborative computing is as follows:

[0041] The computational latency of a task executed locally is expressed as:

[0042]

[0043] in, Indicates time slot The user who sent the request The local CPU computing power.

[0044] Correspondingly, it is unloaded to the fog server. The task computation latency can be expressed as:

[0045]

[0046] in, Fog server CPU computing power.

[0047] According to Shannon's Theorem, users Fog server The wireless transmission rate between them is modeled as follows:

[0048]

[0049] Among them, B j For the bandwidth of fog server j, For the user's transmission power, For users Fog server Channel gain between This represents the noise power spectral density.

[0050] Therefore, the transmission delay of the task unloading part can be expressed as:

[0051]

[0052] Once a decision is made to offload a task to a matching fog server, the task must be queued strictly according to the scheduling sequence. The mathematical expression for its queuing latency is as follows:

[0053]

[0054] Where Pre(i) represents the fog server In the buffer queue, there is a set of tasks whose queuing order is higher than the current task i.

[0055] Therefore, the total latency of unloading the task to the fog server j is expressed as:

[0056]

[0057] Since local processing of tasks and fog server processing can be parallelized, the task completion latency when user i is matched with fog server j is modeled as the maximum of the two completion latencies. That is, the task processing latency model based on edge-fog collaborative computing is:

[0058]

[0059] S32. The controller establishes the corresponding task speedup model.

[0060] user The baseline total latency when all task data is processed locally is:

[0061]

[0062] user Fog server After matching, the task speedup ratio based on the collaborative calculation of both (i.e., partial unloading of the task queue) is... The model is as follows:

[0063]

[0064] S33. The controller aims to maximize the task speedup ratio and establishes a task offloading ratio. The computational model.

[0065] In the task speedup model established by S32, the numerator is fixed, while the denominator is variable. To maximize the speedup, the denominator should be as small as possible. Since the denominator is the larger of the local computation latency and the fog service computation latency, therefore when hour, The maximum can be obtained to determine the optimal unloading ratio. The calculation model is as follows:

[0066]

[0067] S34. The controller constructs an optimization objective model that maximizes the long-term average task speedup ratio:

[0068]

[0069] in, This represents the maximum number of time slots, where t represents a time slot and i represents a task (user).

[0070] More preferably, in step S4, the initial sorting based on the earliest deadline (EDF) is as follows: the central controller collects the task parameters generated by all users within the current time slot and sorts them according to the task's calculation deadline. Sort all tasks in ascending order to generate an initial task scheduling sequence. .

[0071] More preferably, in step S4, the construction of the virtual evaluation benchmark (i.e., the virtual fog server evaluation model) involves the following specific steps:

[0072] S421, The controller calculates the average computing power of the real fog servers. With average bandwidth Then, a virtual fog server is abstracted, with a computing power of f. v The bandwidth is B v ;

[0073] S422, The controller calculates the channel gain from user i to virtual fog server v. h i,j The channel gain from user i to the real fog server j;

[0074] S423. Based on the scheduling sequence given in S41, calculate the task speedup ratio S for each task when it is matched with the virtual server v according to the model constructed in step S3. i,v (t), and the virtual objective function value of the entire scheduling sequence. (t):

[0075]

[0076] Where M is the number of users (tasks) in the system, and t is the time slot number.

[0077] More preferably, in step S4, a neighborhood hill-climbing search optimization algorithm is executed:

[0078] a. Set the neighborhood search range And the maximum number of iterations, and initialize the current optimal sequence. ,in, The initial scheduling sequence obtained in step 4 represents the scheduling order of the tasks; z is generally set to half the sequence length.

[0079] b. Randomly select a position p, and then select another position p' in the effective neighborhood range of that position [max(1, pz), min(Up, p+z )], where p≠p' and Up is the length of the sequence.

[0080] c. Middle position By swapping the two tasks of p', a new sequence is obtained. .

[0081] d. Calculate the virtual objective values ​​of the sequences before and after the swap, and determine the objective function gain. .

[0082] e. If Then accept the exchange, let .

[0083] f. Repeat step be until the maximum number of iterations is reached, and output the optimized task execution order set. This serves as input for subsequent unloading decisions.

[0084] More preferably, in step S5:

[0085] S51. Service application hit determination: from the set of task execution order. Take the first task from i Determine the taski Mapping service applications To determine if the cache of any fog server is hit, construct a candidate set of fog servers with cache hits. .

[0086] S52. Solve for the optimal unloading ratio (the optimal unloading ratio in step S33): If Not empty, for each candidate fog node in the set The task is to solve the model constructed according to step S3. i and The true optimal uninstallation ratio Compared to uninstallation speedup, S i,j Wherein, Pre(i) in step S31 is List of matched tasks.

[0087] S53. Select the optimal uninstallation decision (i.e., the best match between the user and the fog server as described in step S5): From Select the fog node with the highest acceleration ratio from the middle. And check whether the deadline constraint is met. If the conditions are met, then the fog node will be used as the final matching object. and task i Insert into The matching list.

[0088] S54. Repeat steps S51 to S53 until... Until it becomes an empty set.

[0089] More preferably, step S6 is as follows:

[0090] S61. The controller checks the final decision result of each task in sequence according to the order of steps S4.

[0091] S62. Based on the result of step S5, if task i Uninstallation successful, its matching server recorded. and optimal uninstallation ratio = and apply the service and acceleration ratio S i,j Enter into The tail of the sliding window queue.

[0092] S63, if task i If uninstallation fails, the task will be forced to run locally, and the optimal uninstallation ratio will be recorded. Find the closest spatial distance to i. Calculate task i and S during matchingi,k Then apply the service. and acceleration ratio S i,k Enter into The tail of the sliding window queue.

[0093] Furthermore, the sliding window length of each fog server is fixed, and it is managed using a first-in-first-out (FIFO) approach.

[0094] S64. The controller sends the final matching result and unloading ratio to the corresponding user terminal and fog server. The user terminal unloads the task to the matching fog server according to the result, and the fog server schedules the task for data processing according to the result.

[0095] This invention also discloses a multi-task offloading system for maximizing speedup under service caching constraints in fog computing, used to execute the above method, comprising:

[0096] User terminals: Distributed on the edge, they are the source of tasks, generating computing tasks with specific service application requirements in each time slot, and performing partial local computation based on the controller's decisions. Furthermore, the data of the generated computing tasks can be arbitrarily divided to achieve edge-fog collaborative processing, that is, the terminal and the fog server can utilize their respective CPU resources for parallel computing;

[0097] Fog servers, distributed at the edge, provide task offloading services to users, possessing strong computing resources and limited service storage space. Furthermore, they update their local service cache according to instructions from the central controller, and receive, process, and return calculation results for offloading tasks that hit the service cache.

[0098] The controller, acting as the core of global coordination, is responsible for collecting network-wide status information, building a global service image library and a dynamic service popularity model, and making unified decisions on service cache updates for each fog server and the unloading of each task, but it does not directly participate in the actual task unloading calculation. Furthermore, the task unloading decision includes the task unloading ratio and the end-to-fog matching result, i.e., which terminal's task is unloaded and executed on which fog server.

[0099] Preferably, the user terminal is the source of the tasks to be processed, and its main functions include task parameter acquisition and end-to-end collaborative computing, as detailed below:

[0100] (1) Register its identity with the central controller;

[0101] (2) Collect the service type, total data volume, computational complexity and deadline constraints of the tasks to be processed in real time, and upload the information to the centralized controller;

[0102] (3) Receive the computational task offloading decision (i.e., optimal offloading ratio) from the controller. ) and unloading object (i.e., the matching fog server Fog) j );

[0103] (4) Based on the unloading decision, the local computing process is started synchronously for processing. The proportion of data, and the remainder The proportional data and its required dependent service type information are uploaded to the matching fog server;

[0104] (5) After the task is completed, summarize the calculation results of the local and fog terminals.

[0105] Preferably, the fog server is a provider of task offloading computation and service caching, and its main operations include resource status reporting, service cache updating, and offloading task execution, as detailed below:

[0106] (1) Register its identity with the central controller;

[0107] (2) Monitor and report channel status information with user terminals;

[0108] (3) Receive and execute service cache update instructions from the controller, and download the specified service application image from the central controller during the time slot switching interval;

[0109] (4) Receive and process the data of the unload task that hits the service cache, perform queuing calculations strictly in accordance with the scheduling order issued by the controller, and send the results back to the user terminal.

[0110] Preferably, the centralized controller is the core for achieving global performance improvement and fair resource allocation. Its main functions include maintaining a global service image library, service popularity awareness, cache replacement decision-making, speedup performance evaluation, joint scheduling optimization, and decision distribution. The specific functions are as follows:

[0111] (1) Maintain a global image library: store the images of service applications required by all user tasks in the system, and provide the required service application images to the fog server when it needs to update its service cache;

[0112] (2) Service popularity perception: Collect the request frequency and uninstallation speedup ratio of the entire network service application based on the sliding window, and then estimate the current popularity and caching benefits of each service application;

[0113] (3) Cache replacement decision: Based on the cache value of the service application and the storage constraints of the fog server service cache, issue a service cache replacement instruction to ensure that service images with high acceleration gain and high popularity reside in the fog server service cache first;

[0114] (4) Speedup performance evaluation: For each user task offloading request, based on the queuing offloading and partial offloading models, combined with task information, channel information and computing resource information, the expected processing latency is evaluated;

[0115] (5) Joint scheduling optimization: First, determine whether the task application type hits the corresponding fog server cache. If it does, then take maximizing the logarithm of the system's long-term average speedup as the objective, and comprehensively consider communication bandwidth, node computing power and deadline constraints to calculate the optimal task offloading ratio. If no match is found, the task will be marked as local processing only. ;

[0116] (6) Decision distribution: Send the calculated cache update instruction to the fog server, send the task unloading decision to the corresponding user terminal, and monitor the execution status of the task to make parameter corrections for the next time slot.

[0117] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0118] This invention achieves maximum speedup for multi-task offloading under limited service caching by coordinating a centralized controller, fog nodes, and user terminals. The controller employs a two-stage PSHC algorithm (EDF combined with neighborhood HC search) to generate a high-quality global task scheduling sequence, effectively mitigating queue congestion caused by concurrent offloading by multiple users. Furthermore, it dynamically tracks service popularity using a Dynamic Caching and Scheduling Optimization (DCSO) algorithm, matching each task with the optimal fog server and offloading ratio to maximize speedup. This invention uses speedup instead of traditional absolute latency as the optimization criterion, effectively improving the performance speedup of all task offloading in the system. Simultaneously, it utilizes the diminishing marginal utility of the logarithmic function to spontaneously suppress resource monopolization by high-speedup tasks. This invention can maximize the utilization efficiency of computing resources and ensure the fairness of resource allocation in complex fog computing environments with limited service caching and dynamically evolving demands. Attached Figure Description

[0119] Figure 1 This is a general architecture diagram of an application scenario of a multi-task offloading method for maximizing speedup under limited service caching for fog computing, according to a preferred embodiment of the present invention.

[0120] Figure 2 This is an interaction diagram of a preferred embodiment of the present invention, which describes a multi-task offloading method for maximizing speedup under limited service caching conditions for fog computing.

[0121] Figure 3 This is a flowchart of a multi-task offloading method for maximizing speedup under limited service caching conditions for fog computing, according to a preferred embodiment of the present invention.

[0122] Figure 4 This is a schematic diagram of a sliding window according to a preferred embodiment of the present invention.

[0123] Figure 5 This is a comparison chart of the average speedup performance of different algorithms in a preferred embodiment of the present invention. Detailed Implementation

[0124] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0125] See attached document Figure 1-2 The preferred embodiment of the present invention provides a multi-task offloading method for maximizing speedup under limited service caching for fog computing, involving three parties: user terminal, fog server, and central controller (which may employ existing known technologies).

[0126] The user terminal is the source of computing tasks, and its main functions include task generation, task parameter reporting, local computation execution, and unloading data transmission. The user terminal registers its identity with the system; generates computing tasks with specific service requirements in real time, and collects information such as the task's data volume, computational complexity, and deadline, uploading it to the central controller; receives task unloading ratio decisions from the controller; executes the local portion of the computing task according to the unloading ratio, and sends the unloaded data and its corresponding service requirements to the matched fog server; after the task execution is completed, it summarizes the local computation results and the results returned by the fog server. Furthermore, in each time slot t, each user terminal generates one and only one task.

[0127] The fog server is a provider of edge computing and caching resources. Its main operations include resource registration, cache maintenance, and offloading task processing. The fog server registers its computing power, storage capacity, and current cache status with the system; periodically reports its channel status information and task queue backlog to the central controller; pulls or replaces service application images from the central controller during time slots according to the cache update instructions issued by the controller; receives offloading task data uploaded by user terminals, and performs computation processing on tasks that hit the local cache according to the scheduling sequence, finally returning the computation results to the corresponding user terminals.

[0128] The centralized controller is the core control unit for achieving global system optimization. Its main functions include global information collection, service popularity modeling, cache update decision-making, task sorting optimization, and offloading decision generation. Furthermore, the centralized controller maintains a unified global service image library, storing service application images of all types, and directly manages image distribution and replacement during fog server cache updates, without the need for additional cloud servers. The centralized controller collects task request information for each user terminal and maintains the cache status and historical service records for each fog server; it constructs a dynamic service popularity model based on a sliding window mechanism; it generates a fog server cache update strategy based on service popularity, speedup ratio, and cache constraints; for multi-task concurrent scenarios, it uses a two-stage optimization algorithm combining earliest deadline first and hill-climbing search to generate the globally optimal task execution sequence; under the premise of cache hit, it solves for the matching result between user terminals and fog servers and the optimal task offloading ratio with the goal of maximizing the overall system speedup ratio; it sends the final cache update instruction and task offloading decision to the fog server and user terminal respectively, and continuously monitors the task execution status for dynamic adjustments.

[0129] like Figure 3 As shown in the figure, this embodiment presents a multi-task offloading method for maximizing speedup under service caching constraints in fog computing. The specific process includes:

[0130] S1. System initialization and parameter registration phase:

[0131] S11. The controller starts, initializes and maintains four core data structures: Service type list. List User terminal list Fog Node List And the corresponding service application sliding window for each fog server The system service type set is as follows: Fog server set as The user terminal set is .

[0132] S12, Fog Nodes in the Network ( It initiates a registration request to the controller and reports its calculation frequency. Storage capacity limit and the current cached service image set The controller will add the successfully registered fog nodes, i.e. .

[0133] S13, various user terminals ( The system initiates a registration request to the controller, reporting its identity ID, local computing capabilities, and possible service application types (R). i The controller will add successfully registered user terminals. Service List =Service List ∪R i .

[0134] S2, Information Perception and Dynamic Cache Update Phase:

[0135] S21, User Terminal A task request with specific service requirements is generated based on a dual-mode Zipf smooth evolution model. , sent to the controller, where, For unit data calculation volume, The total amount of data for the task. The deadline is [date / time]. This refers to the service application type to which the task belongs. Task data can be adjusted based on the uninstallation ratio. Divided into local execution data volume and the amount of data executed during unloading .

[0136] The construction process of the dual-mode Zipf smooth evolution model is as follows: construct two different Zipf-type target distributions. and , respectively represented as:

[0137]

[0138]

[0139] P A,k and P B,k Let represent the popularity of the k-th service type. The true popularity of the service type in each time slot t is simulated using the following formula:

[0140]

[0141] in, These are time weights, which smoothly change between [0,1] over time, and are modeled as follows:

[0142]

[0143] in, Indicates the start time slot for the popularity switch. This indicates the number of transition duration slots. These two values ​​need to be preset in advance to simulate that the popularity of service types is not constant in actual applications.

[0144] S22. The controller evaluates the popularity of service types and the average speedup gain based on a sliding window mechanism, and calculates the cache value of each service type based on the popularity of service types and the average speedup gain, as follows:

[0145] The controller reads each fog server Fog j The sliding window data is used to count the total number of times each service type appears, N. l Total potential speedup gain Total_S l Then calculate the current popularity P of service type l. l Average speedup gain Avg_S l :

[0146]

[0147] Where L represents the number of service types in the system.

[0148] Furthermore, the controller calculates the cache value (Value) for each service type l according to the following formula. l =P l ×Avg_S l .

[0149] S23. The controller sorts the cached service types in descending order of value, selects the top n service types as the cache decision for the current time slot fog server j, and drives the fog server to update its local service image at the start of the time slot. Here, n is the upper limit of the number of services that the fog server j can cache.

[0150] S3. Construction of task processing latency model, speedup model, and offloading ratio decision model based on end-to-end fog collaborative computing. Specific steps are as follows:

[0151] S31. The controller evaluates the processing latency of the task locally and at the fog terminal. The local execution latency of the task is:

[0152]

[0153] Total latency of unloading part Including transmission delay Queue waiting time and execution delay .

[0154] Unload to fog server The task computation latency can be expressed as:

[0155]

[0156] in, Fog server CPU computing power.

[0157] Transmission delay can be expressed as:

[0158]

[0159] Where, r i,j It is the channel transmission rate.

[0160] The mathematical expression for queuing delay is as follows:

[0161]

[0162] Where, Pre(i) In the buffer queue, there is a set of tasks whose queuing order is higher than the current task i.

[0163] Since local processing and fog processing of a task can be performed in parallel, the total latency for task completion is the maximum of the two:

[0164]

[0165] S32, The controller establishes the corresponding task acceleration ratio. Model:

[0166]

[0167] in, The baseline latency for full local processing.

[0168] S33. The controller aims to maximize the task speedup ratio and establishes a task offloading ratio (offloading ratio). Computational model:

[0169]

[0170] S25. The controller constructs an optimization objective model that maximizes the long-term average task speedup ratio:

[0171]

[0172] Introducing a logarithmic mapping into the objective function :

[0173] 1) When the task is not uninstalled (i.e. When the gain is zero, it is strictly anchored to 0 to avoid artificially high values.

[0174] 2) By utilizing the strict concavity of the logarithmic function and the law of diminishing marginal utility, when the speedup ratio of lightweight tasks is high, the gain of the objective function for tilting resources to them decreases significantly. This forces the scheduling algorithm to spontaneously redistribute the system's idle computing power to heavy-load tasks whose speedup ratio is still low, thereby achieving fairness in the allocation of computing resources among heterogeneous tasks.

[0175] S4, Global Task Virtual Scheduling Optimization Phase:

[0176] S41. Initial sorting based on Earliest Deadline First (EDF): The central controller collects all task parameters within this time slot and sorts them according to... Sort the tasks in ascending order to generate an initial scheduling sequence. .

[0177] S42. Virtual Evaluation Benchmark Construction: An abstract, homogeneous virtual fog node is constructed to quickly estimate the expected queuing and processing latency under the scheduling sequence, thus obtaining the approximate objective function value. The specific steps are as follows:

[0178] S421, The controller calculates the average computing power of the real fog servers. With average bandwidth Then, a virtual fog server is abstracted, with a computing power of f. v The bandwidth is B v ;

[0179] S422, The controller calculates the channel gain from user i to virtual fog server v. h i,j The channel gain from user i to the real fog server j;

[0180] S423. Based on the scheduling sequence given in S41, calculate the task speedup ratio S for each task when it is matched with the virtual server v according to the model constructed in step S3. i,v (t), and the virtual objective function value of the entire scheduling sequence. (t):

[0181]

[0182] S43. Execute the neighborhood hill-climbing search optimization algorithm:

[0183] a. Set the neighborhood search range And the maximum number of iterations, and initialize the current optimal sequence. , where z is typically set to half the sequence length.

[0184] b. Randomly select a position p, and then select another position p' in the effective neighborhood range of that position [max(1, pz), min(Up, p+z )], where p≠p' and Up is the length of the sequence.

[0185] c. Exchange Middle position p' has two tasks: generating new sequences. .

[0186] d. Calculate the objective function gain .

[0187] e. If Then accept the exchange, let .

[0188] f. Execute the loop until the required number of iterations is reached, and output the set of optimal execution order. .

[0189] S5, User Fog Server Matching and Unloading Decision Phase:

[0190] for Each task The controller performs the following scheduling optimizations:

[0191] S51, Service Application Hit Determination: Determine... Service applications To determine if the caches of each fog server are hit, construct a candidate set of fog servers with cache hits. .

[0192] S52. Solve for the optimal unloading ratio: If Non-empty, for Each of them The task is to solve the model constructed according to step S3. i and The true optimal uninstallation ratio Compared to uninstallation speedup, S i,j Wherein, Pre(i) in step S31 is List of matched tasks.

[0193] S53. Selecting the optimal unloading decision: From Select the fog node with the highest acceleration ratio from the middle. And check if it meets the requirements. If the conditions are met, then the fog node will be used as the final matching object. and task i Insert into The matching list.

[0194] S54. Repeat steps S51 to S53 until... Until it becomes an empty set.

[0195] S6. Sliding window update and result distribution stage:

[0196] S61. The controller checks the final decision result of each task in sequence according to the order of steps S4.

[0197] S62. Based on the result of step S5, if task i Uninstallation successful, its matching server recorded. and optimal uninstallation ratio = and apply the service and acceleration ratio S i,j Enter into The tail of the sliding window queue.

[0198] S63, if task i If uninstallation fails, the task will be forced to run locally, and the optimal uninstallation ratio will be recorded. Find the closest spatial distance to i. Calculate task i and S during matching i,k Then apply the service. and acceleration ratio S i,k Enter into The tail of the sliding window queue.

[0199] Furthermore, such as Figure 4 As shown, the sliding window length of each fog server is fixed, and it is managed using a first-in-first-out (FIFO) approach.

[0200] S64. The controller sends the final matching result and unloading ratio to the corresponding user and fog server. The user unloads the task to the matching fog server according to the result, and the fog server schedules the task for data processing according to the result.

[0201] The following experiment will be conducted to verify the technical advantages of this invention.

[0202] In this experiment, N fog servers are uniformly deployed within a 500m × 500m area, and M active users are randomly generated within this area in each scheduling time slot. Communication between the fog servers and users is established via a wireless link, with channel attenuation modeled using a logarithmic distance path loss model. The background noise power spectral density is set to -174dBm / Hz according to the standard communication protocol. The local CPU processing frequency of the end users follows a uniform distribution within the range [0.5, 1.0] GHz; the CPU processing frequency of each fog server is randomly generated within the range [10, 15] GHz and remains constant throughout the simulation period. Due to physical storage limitations, the maximum local service cache capacity of each fog server is n. Furthermore, the dynamic evolution of service requests is generated by two independent Zipf distributions to characterize the time-varying and non-uniform nature of service hotspots.

[0203] Figure 5 In this context, the performance metric Speedup is calculated using the following formula:

[0204]

[0205] in, This represents the maximum number of time slots, where t represents a time slot, i represents a task (user), and S represents the maximum number of time slots. i (t) represents the final speedup ratio of task i in the t-th time slot. Figure 5 (a) illustrates the pattern of the system's average task speedup ratio changing with the number of users. As the number of users increases, the system's average task speedup ratio for each algorithm initially increases and then levels off. When the user base is small, the system load is low, and all algorithms can make full use of fog computing resources, thus achieving a certain performance improvement. As the number of users continues to increase, system computing and communication resources gradually become saturated, and task queuing and competition intensify, causing the speedup ratio to gradually slow down and stabilize. Among all the compared methods, the Slotted-Least Recently Used (SLF) service cache management method, due to its over-reliance on global historical access frequency, struggles to respond promptly to changes in service hotspots, leading to a decrease in cache hit efficiency and thus limiting task speedup performance. While the Slotted-Least Recently Used (SLF) service cache management method can alleviate the historical dependency problem to some extent, it is still difficult to reliably capture high-value services because it is based solely on local recent access characteristics. In contrast, the Dynamic Caching and Scheduling Optimization (DCSO) service cache management method proposed in this invention achieves a dynamic balance between speedup gains and recent popularity by introducing a sliding window mechanism, effectively improving the retention capacity of high-value services and thus maintaining optimal performance across different user scales. Experimental results show that DCSO improves the average system task speedup by 3.7% and 6.4% compared to Slotted-LFU and Slotted-LRU, respectively.

[0206] Figure 5 (b) illustrates the pattern of the system's average task speedup ratio as the number of service types increases. The average task speedup ratio generally decreases with the increase in the number of service types. This is because the increased service diversity significantly increases the pressure of cache space contention. With limited physical cache capacity, a higher number of service types leads to a higher probability of hot services being replaced, thus reducing cache hit rate and offloading efficiency, ultimately suppressing overall speedup performance. In this complex scenario, Slotted-LFU, due to its long-term reliance on global frequency statistics, struggles to adapt to rapid changes in service distribution, exacerbating cache pollution. While Slotted-LRU has some dynamic response capability, it is still prone to missing potentially high-return services in a high-dimensional service space. In contrast, the present invention, DCSO, combines a sliding window mechanism with local dynamic demand and historical benefit evaluation, effectively identifying and retaining key high-value services even in highly discrete service environments, thereby significantly improving system stability and overall performance. Experimental results show that DCSO improves the system's average task speedup ratio by 3.8% and 16.2% compared to Slotted-LFU and Slotted-LRU, respectively.

[0207] A preferred embodiment of the present invention also discloses a multi-task offloading system for maximizing speedup under service caching constraints in fog computing, used to execute the above method, comprising:

[0208] User terminals: Distributed on the edge, they are the source of tasks, generating computing tasks with specific service application requirements in each time slot, and performing partial local computation based on the controller's decisions. Furthermore, the data of the generated computing tasks can be arbitrarily divided to achieve edge-fog collaborative processing, that is, the terminal and the fog server can utilize their respective CPU resources for parallel computing;

[0209] Fog servers, distributed at the edge, provide task offloading services to users, possessing strong computing resources and limited service storage space. Furthermore, they update their local service cache according to instructions from the central controller, and receive, process, and return calculation results for offloading tasks that hit the service cache.

[0210] The controller, acting as the core of global coordination, is responsible for collecting network-wide status information, building a global service image library and a dynamic service popularity model, and making unified decisions on service cache updates for each fog server and the unloading of each task, but it does not directly participate in the actual task unloading calculation. Furthermore, the task unloading decision includes the task unloading ratio and the end-to-fog matching result, i.e., which terminal's task is unloaded and executed on which fog server.

[0211] Other aspects of this embodiment can be found in the above method embodiments.

[0212] Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

Claims

1. A multi-task offloading method for maximizing speedup under service caching constraints in fog computing, characterized by: The specific steps are as follows: S1. System Initialization and Parameter Registration: The controller initializes the system service type set and broadcasts it to all fog servers. It also initializes the sliding window of each fog server to record historical service types and speedup gains. All fog servers register their computing resources, service cache capacity, and initial service cache snapshot with the controller. All user terminals register their identity and local computing capabilities with the controller. S2. Information Awareness and Dynamic Cache Update: The user terminal generates tasks requiring specific service types based on the dual-mode Zipf smooth evolution model and sends the task information to the controller. The controller evaluates the popularity and average speedup gain of service types based on the sliding window mechanism, calculates the cache value of each service type, and then decides the cache content of each fog server based on the cache value of the service type. It then drives the fog server to complete the update of the local service image at the start of the time slot. S3. Construction of task processing latency, speedup ratio and offloading ratio decision model: Under the known matching conditions between user terminal and fog server, the controller combines queuing offloading and partial offloading mechanisms, as well as task information and scenario information, to establish a task processing latency model, speedup ratio model and offloading ratio decision model based on terminal and fog server collaborative computing. S4. Global Task Virtual Scheduling Optimization: For concurrent task requests within this time slot, the controller first performs an initial sorting based on the earliest deadline priority (EDF); then, based on the model established in step S3, it performs a virtual fog server offloading evaluation, and uses the neighborhood climbing HC search optimization algorithm to perform local position swaps and optimization target calculations within the set prefix search range to generate an initial task execution sequence that optimizes the global expected speedup. S5. User Fog Server Matching and Unloading Decision: The controller performs joint scheduling for each task according to the initial task execution order generated in step S4, and determines whether the service type of the task hits the candidate fog server cache; if it hits, the controller solves the optimal matching and unloading ratio between the user and the fog server with the goal of maximizing the speedup ratio; if it does not hit or does not meet the latency constraint, the task is rejected for unloading. S6. Sliding window update and result distribution: The controller updates the sliding window content of each fog server according to the order of step S4 and the result of step S5, and distributes the final matching result of user terminal and fog server and the unloading ratio to user terminal and fog server.

2. The multi-task offloading method for maximizing speedup under service caching constraints for fog computing as described in claim 1, characterized in that, In step S1: S11. The controller initializes and maintains four data structures: Service type list. List User terminal list Fog Server List And the corresponding service application sliding window for each fog server ; S12, each fog server Register its calculation frequency with the controller Service cache storage capacity limit and the current cached service image set ; S13, Each user terminal Initiate a registration request to the controller, reporting its identity ID, local computing capabilities, and possible service application types R. i .

3. The multi-task offloading method for maximizing speedup under service caching constraints for fog computing as described in claim 2. Its characteristic is that, in step S2: S21. The user terminal generates tasks requiring specific service types based on the dual-mode Zipf smooth evolution model, as follows: Construct two different Zipf-type target distributions and , respectively represented as: Among them, P A,k and P B,k Let k represent the popularity of the k-th service type, k=1,2,…,L; the actual popularity of the service type in each time slot t is simulated using the following formula: in, These are time weights, which smoothly change between [0,1] over time, and are modeled as follows: in, Indicates the start time slot for the popularity switch. Indicates the number of transition duration slots; At the beginning of each time slot, a set of tasks is generated based on the popularity of service type and randomly assigned to each user terminal, with one task per terminal; the task request of user terminal i is recorded. ,in, For unit data calculation volume, The total amount of data for the task. The deadline is [date / time]. The task is categorized by the service application type it belongs to; the task's data volume is arbitrarily divided into local execution data volume. and the amount of data executed during unloading : in, It is a task The uninstallation rate; S22. The controller evaluates the popularity of service types and the average speedup gain based on a sliding window mechanism, and calculates the cache value of each service type based on the popularity of service types and the average speedup gain, as follows: The controller reads each fog server Fog j The sliding window data is used to count the total number of times each service type appears, N. l Total potential speedup gain Total_S l Then calculate the current popularity P of service type l. l Average speedup gain Avg_S l : Where L represents the number of service types in the system; The controller calculates the cache value for each service type l using the following formula: Value l =P l ×Avg_S l S23. The controller sorts the service types in descending order of their cache value, takes the top n service types as the cache decision for the current time slot fog server j, and drives the fog server to complete the local service image update at the start of the time slot.

4. The multi-task offloading method for maximizing speedup under service caching constraints for fog computing as described in claim 3, characterized in that, Step S3 is as follows: S31, Controller establishes task request Based on the user terminal's local location and matching fog server The processing latency model for collaborative computing is as follows: The computational latency of a task executed locally is expressed as: in, Indicates time slot The user who sent the request Local CPU computing power; Unload to fog server The task computation latency is expressed as: in, Fog server CPU computing power; user Fog server The wireless transmission rate between them is modeled as follows: Among them, B j For the bandwidth of fog server j, For the user's transmission power, For users Fog server Channel gain between The noise power spectral density; Therefore, the transmission delay of the task unloading part is expressed as: Once the decision is made to offload the task to a matching fog server, the task must be queued strictly according to the scheduling sequence; the mathematical expression for queuing latency is as follows: Where Pre(i) represents the fog server In the buffer queue, there is a set of tasks whose queuing order is higher than that of the current task i; Therefore, the total latency of unloading the task to the fog server j is expressed as: Since local processing of tasks and fog server processing can be parallelized, the task completion latency when user i is matched with fog server j is modeled as the maximum of the two completion latencies. The task processing latency model based on edge-fog collaborative computing is as follows: S32. The controller establishes the corresponding task speedup model; user The baseline total latency when all task data is processed locally is: user Fog server After matching, the task speedup based on collaborative computation between the two is higher. The model is as follows: S33. The controller establishes an unloading ratio decision model, i.e., the optimal unloading ratio, with the goal of maximizing the task speedup ratio: S34. The controller constructs an optimization objective model that maximizes the long-term average task speedup ratio: in, This represents the maximum number of time slots, where t represents a time slot, i represents a task, M is the number of tasks, and S... i (t) represents the final speedup ratio for task i.

5. The multi-task offloading method for maximizing speedup under service caching constraints for fog computing as described in claim 4, characterized in that, In step S4, the initial sorting based on the earliest deadline EDF is as follows: The central controller collects the task parameters generated by all users within this time slot, and sorts them according to the task's calculation deadline. Sort all tasks in ascending order to generate an initial task scheduling sequence. .

6. The multi-task offloading method for maximizing speedup under service caching constraints for fog computing as described in claim 5, characterized in that, In step S4, a virtual fog server offloading assessment is performed based on the model established in step S3. The specific steps are as follows: S421, The controller calculates the average computing power of the real fog servers. With average bandwidth Then, abstract a virtual fog server; N is the number of fog servers, f j The actual computing power of each fog server; S422, The controller calculates the channel gain from user i to virtual fog server v. h i,j The channel gain from user i to the real fog server j; S423. Based on the scheduling sequence given in step S41, calculate the task speedup ratio S when each task is matched with the virtual server v according to the model constructed in step S3. i,v (t), and the virtual objective function value of the entire scheduling sequence. (t): Where M is the number of users in the system, and t is the time slot number.

7. The multi-task offloading method for maximizing speedup under service caching constraints for fog computing as described in claim 6, characterized in that, In step S4, the neighborhood hill-climbing search optimization algorithm is executed, as follows: a. Set the neighborhood search range And the maximum number of iterations, and initialize the current optimal sequence. ;in, This is the initial scheduling sequence for step 4; b. Randomly select a position p, and then select another position p' in the effective neighborhood range of that position [max(1, pz), min(Up, p+z)], where p≠p', and Up is the length of the sequence; c. Exchange Middle position p' has two tasks: generating new sequences. ; d. Calculate the virtual objective values ​​of the sequences before and after the swap, and determine the objective function gain. ; e. If Then accept the exchange, let ; f. Repeat step be until the maximum number of iterations is reached, and output the optimized task execution order set. .

8. The multi-task offloading method for maximizing speedup under service caching constraints for fog computing as described in claim 7. Its characteristic is that step S5 middle: S51. Service application hit determination: from the set of task execution order. Take the first task from the middle i Determine the task i Mapping service applications To determine if the cache of any fog server is hit, construct a candidate set of fog servers with cache hits. ; S52. Solve for the optimal unloading ratio: If Not empty, for each candidate fog node in the set The task is to solve the model constructed according to step S3. i and The true optimal uninstallation ratio Compared to uninstallation speedup, S i,j In step S31, Pre(i) is... The list of matched tasks, i.e., the set of other tasks preceding i; S53. Selecting the optimal unloading decision: From Select the fog node with the highest acceleration ratio from the middle. And check whether the deadline constraint is met. If the conditions are met, then the fog node will be used as the final matching object. and task i Insert into In the matching list; S54. Repeat steps S51 to S53 until... Until it becomes an empty set.

9. The multi-task offloading method for maximizing speedup under service caching constraints for fog computing as described in claim 8, characterized in that, Step S6 is as follows: S61. The controller checks the final decision result of each task in sequence according to the order of steps S4. S62. Based on the result of step S5, if task i Uninstallation successful, its matching server recorded. and optimal uninstallation ratio = and apply the service and acceleration ratio S i,j Enter into The tail of the sliding window queue; S63, if task i If uninstallation fails, the task will be forced to run locally, and the optimal uninstallation ratio will be recorded. Find the closest spatial distance to i. Calculate task i and S during matching i,k Then apply the service. and acceleration ratio S i,k Enter into The tail of the sliding window queue; S64. The controller sends the final matching result and unloading ratio to the corresponding user terminal and fog server. The user terminal unloads the task to the matching fog server according to the result, and the fog server schedules the task for data processing according to the result.

10. A multi-task offloading system for maximizing speedup under service caching constraints for fog computing, used to perform the method as described in any one of claims 1-9, characterized in that, It includes several user terminals, multiple fog servers, and one controller, wherein: User terminal: Generates computing tasks with specific service application requirements in each time slot, and performs partial local computing based on the controller's decisions; Fog server: Updates the local service cache according to the controller's instructions, and receives, processes, and returns the calculation results of the unloading tasks that hit the service cache; Controller: Responsible for collecting network-wide status information, building a global service image library and a dynamic service popularity model, and making unified decisions on service cache updates for each fog server and unloading decisions for each task, but does not directly participate in the actual task unloading calculation.