Task allocation method and device for cloud service system, equipment and medium
By generating an initial allocation scheme at fog nodes and iteratively optimizing it using a differential evolution algorithm, the problem of data transmission latency in cloud computing mode is solved, and efficient, real-time task allocation in cloud service systems is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-04-14
AI Technical Summary
In the traditional cloud computing model, data from IoT devices needs to be transmitted to the cloud through multiple layers of networks, which increases network bandwidth burden and data transmission latency, making it difficult to meet the needs of application scenarios with high real-time requirements.
After receiving a task, the fog node generates multiple initial allocation schemes, obtains the state information of the cloud data center and the fog node, iterates the initial allocation schemes using the differential evolution algorithm to generate candidate allocation schemes, and selects the target allocation scheme based on the fitness function to optimize the allocation of tasks between the cloud data center and the fog node.
It reduces task processing latency, improves the real-time performance of data processing in cloud service systems, balances efficiency and resource utilization, and ensures optimal performance of task allocation in dynamic environments.
Smart Images

Figure CN121864787A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of task allocation technology, and in particular to a task allocation method and a task allocation device for a cloud service system. Background Technology
[0002] With the rapid development of IoT technology, massive amounts of real-time data are continuously generated by numerous terminal devices. While traditional cloud computing offers powerful data processing and storage capabilities, its architecture—typically located at the network core layer and physically distant from edge data sources—leads to a series of performance bottlenecks. Data must traverse multiple network layers to reach the cloud, increasing network bandwidth requirements and causing significant data transmission latency, making it difficult to meet the demands of applications with high real-time requirements. Summary of the Invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide a task allocation method, apparatus, device and medium for a cloud service system that overcomes or at least partially solves the above problems.
[0004] According to a first aspect of the present invention, a task allocation method for a cloud service system is provided, the cloud service system including a cloud data center and multiple fog nodes, the method comprising: After receiving a task submitted by an IoT device, the fog node generates multiple initial allocation schemes for the task; Obtain the status information of the cloud data center and the multiple fog nodes; Based on the state information of the cloud data center and the multiple fog nodes, the multiple initial allocation schemes are iterated using the differential evolution algorithm to generate multiple candidate allocation schemes. The iteration stops when the iteration termination condition is met. From the plurality of candidate allocation schemes, a target allocation scheme is determined, and the tasks are allocated according to the target allocation scheme.
[0005] Optionally, based on the state information of the cloud data center and the multiple fog nodes, the multiple initial allocation schemes are iterated using a differential evolution algorithm to generate multiple candidate allocation schemes, including: The fitness function is determined based on the state information; the fitness function is used to evaluate the performance of the allocation scheme. Based on the fitness function, the multiple initial allocation schemes are iterated using the differential evolution algorithm to generate multiple candidate allocation schemes.
[0006] Optionally, the differential evolution algorithm includes mutation and crossover operations. The step of iterating through the multiple initial allocation schemes based on the fitness function using the differential evolution algorithm to generate multiple candidate allocation schemes includes: By performing mutation operations on the multiple initial allocation schemes, a first candidate allocation scheme after multiple mutation operations is generated. By performing cross operations on the multiple initial allocation schemes, a second candidate allocation scheme is generated after multiple cross operations. Based on the fitness function, the first candidate allocation scheme and the second candidate allocation scheme are iterated to generate multiple third candidate allocation schemes.
[0007] Optionally, the plurality of initial allocation schemes can be mutated using the following formula:
[0008] in, This represents the allocation scheme after the mutation operation. , , For the initial allocation scheme, It is a variable factor.
[0009] Optionally, the multiple initial allocation schemes can be cross-operated using the following formula:
[0010] in, Indicates the allocation scheme after crossover operation. The j-th element in This represents the element after the intersection. Indicates the current element, This is a random number indicating whether to perform a crossover operation on the j-th element. For the cross ratio, This indicates that the j-th element must undergo a crossover operation.
[0011] Optionally, the iteration termination condition includes at least one of the following: satisfying the target iteration number, or the change in the fitness function value determined by the fitness function being less than a threshold.
[0012] Optionally, determining the target allocation scheme from the plurality of candidate allocation schemes includes: The fitness values corresponding to the multiple candidate allocation schemes are determined according to the fitness function; The allocation scheme with the highest fitness value is selected as the target allocation scheme.
[0013] According to a second aspect of the present invention, a task allocation apparatus for a cloud service system is provided, the cloud service system including a cloud data center and multiple fog nodes, the apparatus comprising: An initial allocation scheme generation module is used to generate multiple initial allocation schemes for the task after the fog node receives the task submitted by the IoT device. The status information acquisition module is used to acquire the status information of the cloud data center and the multiple fog nodes; The iteration module is used to iterate the multiple initial allocation schemes based on the state information of the cloud data center and the multiple fog nodes using the differential evolution algorithm to generate multiple candidate allocation schemes. The iteration stops when the iteration termination condition is met. The target allocation scheme determination module is used to determine the target allocation scheme from the plurality of candidate allocation schemes and allocate the task according to the target allocation scheme.
[0014] Optionally, the iterative module includes: The fitness function determination submodule is used to determine the fitness function based on the state information; the fitness function is used to evaluate the performance of the allocation scheme. The iterative submodule is used to iterate the multiple initial allocation schemes based on the fitness function and the differential evolution algorithm to generate multiple candidate allocation schemes.
[0015] Optionally, the differential evolution algorithm includes mutation and crossover operations, and the iterative submodule includes: The mutation unit is used to generate a first candidate allocation scheme after multiple mutation operations by performing mutation operations on the multiple initial allocation schemes. A crossover unit is used to generate a second candidate allocation scheme after multiple crossover operations by performing crossover operations on the multiple initial allocation schemes; An iterative unit is used to iterate the first candidate allocation scheme and the second candidate allocation scheme according to the fitness function to generate a plurality of third candidate allocation schemes.
[0016] Optionally, the plurality of initial allocation schemes can be mutated using the following formula:
[0017] in, This represents the allocation scheme after the mutation operation. , , For the initial allocation scheme, It is a variable factor.
[0018] Optionally, the multiple initial allocation schemes can be cross-operated using the following formula:
[0019] in, Indicates the allocation scheme after crossover operation. The j-th element in This represents the element after the intersection. Indicates the current element, This is a random number indicating whether to perform a crossover operation on the j-th element. For the cross ratio, This indicates that the j-th element must undergo a crossover operation.
[0020] Optionally, the iteration termination condition includes at least one of the following: satisfying the target iteration number, or the change in the fitness function value determined by the fitness function being less than a threshold.
[0021] Optionally, the target allocation scheme determination module includes: The fitness value determination submodule is used to determine the fitness value corresponding to the multiple candidate allocation schemes according to the fitness function; The target allocation scheme determination submodule is used to select the allocation scheme with the highest fitness value as the target allocation scheme.
[0022] According to a third aspect of the present invention, an electronic device is provided, the electronic device comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the task allocation method of the cloud service system as described in any of the preceding claims.
[0023] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, wherein when executed by a processor, the computer program implements the steps of the task allocation method of the cloud service system as described in any of the preceding claims.
[0024] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects: This invention provides a task allocation method, apparatus, device, and medium for a cloud service system. The cloud service system includes a cloud data center and multiple fog nodes. After receiving tasks submitted by IoT devices at the fog nodes, multiple initial task allocation schemes are generated. The status information of the cloud data center and the multiple fog nodes is acquired. Based on the status information, the multiple initial allocation schemes are iterated using a differential evolution algorithm to generate multiple candidate allocation schemes. Iteration stops when an iteration termination condition is met. A target allocation scheme is determined from the multiple candidate allocation schemes, and tasks are allocated according to the target allocation scheme. This invention, considering the status information of the cloud data center and fog nodes, uses a differential evolution algorithm to perform multiple rounds of iterative optimization of the task allocation scheme, generating an allocation scheme that balances efficiency and resource utilization. This reduces task processing latency and improves the real-time performance of data processing in the cloud service system. Attached Figure Description
[0025] Figure 1 This is a flowchart illustrating the steps of a task allocation method for a cloud service system provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a task allocation method for a cloud service system provided in an embodiment of the present invention; Figure 3 This is a flowchart of the steps of another task allocation method for a cloud service system provided in an embodiment of the present invention; Figure 4 This is a structural block diagram of a task allocation device for a cloud service system provided in an embodiment of the present invention. Detailed Implementation
[0026] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0027] One of the core concepts of this invention is that, based on the state information of the cloud data center and fog nodes, a differential evolution algorithm is used to iteratively optimize the task allocation scheme through multiple rounds, generating an allocation scheme that balances efficiency and resource utilization. This reduces task processing latency and improves the real-time performance of data processing in the cloud service system.
[0028] Reference Figure 1 The diagram illustrates a flowchart of a task allocation method for a cloud service system provided by an embodiment of the present invention. The method may specifically include the following steps: Step 101: After the fog node receives the task submitted by the IoT device, it generates multiple initial allocation schemes for the task. Reference Figure 2This illustration shows a scenario diagram of a task allocation method for a cloud service system provided by an embodiment of the present invention. The task allocation scenario of the cloud service system includes multiple IoT devices (device 1, device 2, device 3, and device 4) acting as task initiators, fog nodes 1 and 2 located at the network edge for receiving and processing IoT tasks, and a cloud data center located at a remote end of the network. When any fog node (e.g., fog node 1) receives a task submitted by an IoT device (e.g., device 1), it can act as a scheduling controller, executing a scheduling process based on its own, other fog nodes (fog node 2), and the real-time resource status of the cloud data center to generate an optimal task allocation scheme between the fog nodes and the cloud data center.
[0029] For example, in a fog computing architecture, IoT devices typically submit tasks to nearby fog nodes first, but this does not mean that the task must be executed locally on that fog node. Since the system comprises multiple fog nodes and a cloud data center, each computing node differs in computing power, load, network conditions, and security capabilities. A single, fixed allocation strategy is insufficient to adapt to dynamically changing task requirements and system states. Therefore, upon task arrival, the system needs to immediately generate multiple initial allocation schemes as the starting point for subsequent intelligent optimization. These initial schemes represent various candidate strategies for assigning tasks to different target nodes (such as local fog nodes, other fog nodes, or the cloud), constituting the basic population required by the differential evolution algorithm. Generating diverse initial solutions through random or heuristic methods can effectively cover different regions of the solution space, preventing the algorithm from prematurely falling into local optima.
[0030] Step 102: Obtain the status information of the cloud data center and the multiple fog nodes; For example, status information can be real-time. Obtaining status information from cloud data centers and each fog node is a prerequisite and foundation for achieving efficient and accurate task allocation. Status information typically includes memory utilization, storage occupancy, network bandwidth usage, current task queue length, security level, latency, and energy consumption levels. This data comprehensively reflects the system's current resource supply capacity and operating load. Without this information, it's impossible to determine whether a fog node is overloaded, a link is congested, or the cloud is idle, which may lead to tasks being allocated to performance bottleneck nodes, causing latency spikes, task failures, or even system crashes. For example, allocating a computationally demanding task to a fog node with 95% memory utilization is clearly less reasonable than offloading it to the resource-rich cloud. Furthermore, status information directly affects task execution latency, reliability, and cost (such as bandwidth consumption and energy consumption). In dynamically changing edge environments, node status fluctuates rapidly over time; decisions based on the latest status are crucial to ensuring the timeliness and effectiveness of allocation schemes.
[0031] Step 103: Based on the state information of the cloud data center and the multiple fog nodes, iterate the multiple initial allocation schemes using the differential evolution algorithm to generate multiple candidate allocation schemes. Stop the iteration when the iteration termination condition is met. For example, the fitness function can be determined based on state information, which dictates the search direction and the quality of the final solution. State information is a crucial input for constructing this function because the quality of task allocation schemes is not absolute but highly dependent on the current system environment. For instance, the same allocation scheme might perform excellently when resources are idle, but cause severe latency under high load. Therefore, based on real-time state information (such as node load and network bandwidth), the quantitative performance of each scheme in terms of latency, resource balance, bandwidth consumption, and security is dynamically calculated, and a comprehensive score is formed through weighted fusion. This state-based fitness function can truly reflect the actual performance of the scheme in the current environment. For example, when a fog node experiences bandwidth constraints, the fitness function automatically reduces the score of schemes involving high data transmission volumes to that node; when cloud resources are abundant, it may increase the weight of schemes offloading data to the cloud. Furthermore, the fitness function transforms a multi-objective optimization problem into a single-objective maximization problem, enabling differential evolution algorithms to make effective selections by comparing fitness values.
[0032] Differential evolution is a highly efficient global optimization method. Its core idea is to continuously explore better solutions in the solution space by simulating the biological evolution process. While initial allocation schemes are diverse, most are randomly or roughly generated, making it difficult to directly meet complexity performance requirements. Therefore, a fitness function is used as the evaluation criterion to perform multiple rounds of iterative "mutation-crossover-selection" operations on these initial schemes: mutation introduces new directions to expand the search range, crossover integrates superior genes to enhance local development capabilities, and selection retains schemes with higher fitness for the next generation. This process causes the population to gradually converge towards high-performance regions, continuously generating better candidate allocation schemes. Iteration continues until a preset termination condition is met (such as reaching the maximum number of iterations, fitness improvement stagnating, or finding a solution that meets a threshold). At this point, the algorithm considers the solution space sufficiently explored and close to the optimal solution; continuing iteration will lead to diminishing marginal returns or even waste of computational resources. In resource-constrained fog computing environments, timely termination is particularly important to avoid excessive scheduling overhead affecting task real-time performance.
[0033] For example, status information may include at least one of resource utilization, latency, and data security level. The current fitness function can be determined by determining the weights corresponding to the normalized latency, resource utilization, and data security level. The weight values can be determined based on the overall efficiency of the cloud service system and the quality of task integrity.
[0034] Step 104: Determine the target allocation scheme from the multiple candidate allocation schemes, and allocate the tasks according to the target allocation scheme.
[0035] For example, in task scheduling based on differential evolution algorithms, a large number of candidate allocation schemes are generated. These schemes represent different allocation strategies for tasks between cloud data centers and multiple fog nodes. However, a real system can only choose one specific scheme to execute a task at any given time. Therefore, it is necessary to select the optimal solution from numerous candidate solutions as the final decision, i.e., the "target allocation scheme." This process is the culmination and value of the entire optimization process: without a final selection, the initialization, mutation, crossover, and iteration in the early stages will be meaningless and cannot be transformed into actual scheduling actions. Determining the target scheme is not only for completing task allocation but also to ensure that the selected strategy can achieve optimal overall performance under the current system state (such as resource load, network conditions, security requirements, etc.), such as minimizing latency, balancing resource usage, ensuring data security, or reducing energy consumption. Especially in scenarios sensitive to service quality, such as the Industrial Internet of Things and intelligent transportation, a suboptimal or even incorrect allocation may lead to task timeouts, service interruptions, or security risks.
[0036] This invention provides a task allocation method for a cloud service system, which includes a cloud data center and multiple fog nodes. After receiving tasks submitted by IoT devices at the fog nodes, the method generates multiple initial task allocation schemes; acquires the state information of the cloud data center and the multiple fog nodes; iterates the multiple initial allocation schemes based on the state information using a differential evolution algorithm to generate multiple candidate allocation schemes; stops iteration when a termination condition is met; and determines the target allocation scheme from the multiple candidate schemes, then allocates tasks according to the target scheme. This invention, considering the state information of the cloud data center and fog nodes, uses a differential evolution algorithm to perform multiple rounds of iterative optimization of the task allocation scheme, generating an allocation scheme that balances efficiency and resource utilization. This reduces task processing latency and improves the real-time performance of data processing in the cloud service system.
[0037] Reference Figure 3 The diagram illustrates a flowchart of another task allocation method for a cloud service system provided by an embodiment of the present invention. The method may specifically include the following steps: Step 201: After the fog node receives the task submitted by the IoT device, it generates multiple initial allocation schemes for the task. For example, in a fog computing architecture, IoT devices typically submit tasks to nearby fog nodes first, but this does not mean that the task must be executed locally on that fog node. Since the system comprises multiple fog nodes and a cloud data center, each computing node differs in computing power, load, network conditions, and security capabilities. A single, fixed allocation strategy is insufficient to adapt to dynamically changing task requirements and system states. Therefore, upon task arrival, the system needs to immediately generate multiple initial allocation schemes as the starting point for subsequent intelligent optimization. These initial schemes represent various candidate strategies for assigning tasks to different target nodes (such as local fog nodes, other fog nodes, or the cloud), constituting the basic population required by the differential evolution algorithm. Generating diverse initial solutions through random or heuristic methods can effectively cover different regions of the solution space, preventing the algorithm from prematurely falling into local optima.
[0038] Step 202: Obtain the status information of the cloud data center and the multiple fog nodes; For example, status information can be real-time. Obtaining status information from cloud data centers and each fog node is a prerequisite and foundation for achieving efficient and accurate task allocation. Status information typically includes memory utilization, storage occupancy, network bandwidth usage, current task queue length, security level, latency, and energy consumption levels. This data comprehensively reflects the system's current resource supply capacity and operating load. Without this information, it's impossible to determine whether a fog node is overloaded, a link is congested, or the cloud is idle, which may lead to tasks being allocated to performance bottleneck nodes, causing latency spikes, task failures, or even system crashes. For example, allocating a computationally demanding task to a fog node with 95% memory utilization is clearly less reasonable than offloading it to the resource-rich cloud. Furthermore, status information directly affects task execution latency, reliability, and cost (such as bandwidth consumption and energy consumption). In dynamically changing edge environments, node status fluctuates rapidly over time; decisions based on the latest status are crucial to ensuring the timeliness and effectiveness of allocation schemes.
[0039] Step 203: Determine the fitness function based on the state information; the fitness function is used to evaluate the performance of the allocation scheme. For example, the fitness function determines the search direction of the algorithm and the quality of the final solution. State information is a key input to construct this function because the quality of task allocation schemes is not absolute but highly dependent on the current system environment. For instance, the same allocation scheme may perform excellently when resources are idle, but cause severe latency under high load. Therefore, based on real-time state information (such as node load and network bandwidth), the quantitative performance of each scheme in terms of latency, resource balance, bandwidth consumption, and security is dynamically calculated, and a comprehensive score is formed through weighted fusion. This state-based fitness function can truly reflect the actual performance of the scheme in the current environment. For example, when a fog node has limited bandwidth, the fitness function will automatically reduce the score of schemes involving high data transmission volumes to that node; when cloud resources are abundant, it may increase the weight of schemes offloading to the cloud. Furthermore, the fitness function transforms a multi-objective optimization problem into a single-objective maximization problem, enabling differential evolution algorithms to make effective selections by comparing fitness values.
[0040] For example, status information may include at least one of resource utilization, latency, and data security level. The current fitness function can be determined by determining the weights corresponding to the normalized latency, resource utilization, and data security level. The weight values can be determined based on the overall efficiency of the cloud service system and the quality of task integrity.
[0041] Step 204: Based on the fitness function, iterate the multiple initial allocation schemes using the differential evolution algorithm to generate multiple candidate allocation schemes. Stop the iteration when the iteration termination condition is met. For example, differential evolution is an efficient global optimization method. Its core idea is to continuously explore better solutions in the solution space by simulating the biological evolution process. While initial allocation schemes are diverse, most are randomly or roughly generated, making it difficult to directly meet complexity performance requirements. Therefore, a fitness function is used as the evaluation criterion to perform multiple rounds of iterative "mutation-crossover-selection" operations on these initial schemes: mutation introduces new directions to expand the search range, crossover integrates superior genes to enhance local development capabilities, and selection retains schemes with higher fitness for the next generation. This process causes the population to gradually converge towards high-performance regions, continuously generating better candidate allocation schemes. Iteration continues until a preset termination condition is met (such as reaching the maximum number of iterations, fitness improvement stagnating, or finding a solution that meets a threshold). At this point, the algorithm considers the solution space sufficiently explored and close to the optimal solution; continuing iteration will lead to diminishing marginal returns or even waste of computational resources. In resource-constrained fog computing environments, timely termination is particularly important to avoid excessive scheduling overhead affecting task real-time performance. Therefore, the fitness function-driven differential evolution iteration mechanism can efficiently select the optimal solution from a massive number of possible allocation strategies within a limited time, ensuring both high-quality scheduling results and computational efficiency. It is a key technical path for achieving intelligent and adaptive task allocation.
[0042] In one embodiment, step 204 includes the following sub-steps: Sub-step S11: By performing mutation operations on the multiple initial allocation schemes, a first candidate allocation scheme after multiple mutation operations is generated; For example, in differential evolution algorithms, while initial assignment schemes provide diverse starting points, they are typically randomly generated and may be far from the true optimal solution region. Through mutation—that is, performing vector differencing on three different individuals in the population, scaling them, and then superimposing them onto a fourth individual—a "first candidate assignment scheme" with new characteristics can be generated. This operation essentially introduces a directed perturbation into the current solution space, utilizing the differences within the population to explore potentially better regions. For instance, if some fog nodes are lightly loaded while others are overloaded, mutation may automatically generate a new scheme to "migrate" tasks from high-load nodes to low-load nodes. The generated first candidate scheme is not directly used for execution but can also serve as input for subsequent crossover operations, providing the algorithm with a rich selection of options. Without mutation, the population would lack diversity and be highly susceptible to getting trapped in local optima. Therefore, mutation is the fundamental guarantee that differential evolution algorithms possess powerful global search capabilities; it ensures that task assignment strategies can continuously explore more efficient and balanced possibilities in the complex cloud-fog resource space.
[0043] Sub-step S12 involves performing cross operations on the multiple initial allocation schemes to generate a second candidate allocation scheme after multiple cross operations. For example, crossover plays a role in balancing exploration and development and preserving superior genes in differential evolution. While mutation can generate novel solutions, its changes can be too drastic, causing some originally excellent allocation decisions to be completely discarded. Crossover generates a "second candidate allocation scheme" by mixing the mutation vectors with a certain probability, thereby introducing new information while preserving the superior characteristics of the original individuals. For instance, if an initial scheme correctly allocates a node to a trusted fog node when handling high-security tasks, while the mutation scheme performs better in reducing latency, crossover may combine to create a new scheme that meets both security requirements and has lower latency. In particular, crossover forces at least one dimension to come from the mutation vector (through...). This ensures that new individuals are different from their parents, preventing algorithmic stagnation. This "genetic recombination" mechanism significantly improves the diversity and robustness of the population, allowing the algorithm to both inherit the structure of historically excellent solutions and absorb the innovation brought by mutation. The generated second candidate solution represents a potentially better solution after information fusion in the current iteration, providing a high-quality comparison object for subsequent fitness-based selection. Therefore, crossover is the bridge connecting mutation and selection, and an indispensable part of achieving efficient and stable optimization.
[0044] Sub-step S13: Based on the fitness function, iterate the first candidate allocation scheme and the second candidate allocation scheme to generate multiple third candidate allocation schemes.
[0045] For example, within the framework of differential evolution, the "first candidate allocation scheme" generated by mutation is combined with the "second candidate allocation scheme" generated by crossover, and iteration driven by a fitness function is used to generate a "third candidate allocation scheme." Essentially, this aims to achieve a closed-loop intelligent optimization process of survival of the fittest and continuous evolution. A more accurate understanding of the "third candidate scheme" is: after fitness evaluation and selection, the set of high-quality schemes retained for the next generation. The core of this process is that each newly generated candidate scheme (derived from mutation and crossover) must compete one-to-one with its corresponding parent individual under the fitness function. If the new scheme has a higher fitness (i.e., better overall performance), it is selected for the next generation; otherwise, the parent is retained. This fitness-based selection mechanism ensures that the overall quality of the population steadily improves with iteration, inefficient or unreasonable allocation strategies are gradually eliminated, while schemes that balance low latency, high resource utilization, good security, and bandwidth efficiency are inherited and strengthened. Through multiple rounds of such iterations, the algorithm not only avoids blind search but also adaptively converges to a high-quality solution region in complex cloud-fog resource spaces. Therefore, "generating a third candidate allocation scheme" is essentially a fitness-guided selection process that filters out truly superior individuals from the potential solutions generated by mutation and crossover, forming a new generation of the population and laying the foundation for the next round of optimization. This mechanism ensures that the task allocation scheme continuously approaches the global optimum in a dynamic environment, and is the key to the efficient and robust scheduling decision-making of the differential evolution algorithm.
[0046] For example, five tasks with different real-time requirements (task 1, task 2, task 3, task 4, and task 5) can be obtained. These five tasks need to be scheduled between three fog nodes (A, B, and C) and one cloud data center. The three fog nodes have different computing capabilities, generating multiple initial allocation schemes: Scheme 1: [A, B, C, Cloud, A], Scheme 2: [B, C, Cloud, A, B], Scheme 3: [C, A, B, Cloud, C], and Scheme 4: [Cloud, B, A, C, Cloud].
[0047] The mutation operation can randomly select two tasks and swap their allocation nodes. For example, for scheme 1: [A, B, C, Cloud, A], swap the allocation nodes for tasks 2 and 4. The mutated scheme 1 is: [A, Cloud, C, B, A]. The crossover operation can randomly select one task and swap the allocation nodes at the crossover point. For example, for scheme 2: [B,C, Cloud, A, B] and scheme 3: [C, A, B, Cloud, C], the intersection points are chosen as tasks 3, 4, and 5: after the intersection, scheme 2 is [B, C, B, Cloud, C], and scheme 3 is [C, A, Cloud, A, B]. The fitness value of each scheme is determined according to the fitness function, and the four schemes with the highest fitness values are selected for the next round of iteration. For example, the mutated scheme 1 is [A, Cloud, C, B, A], the intersection scheme 2 is [B, C, B, Cloud, C], the intersection scheme 3 is [C, A, Cloud, A, B], and scheme 4 is [Cloud, B, A, C, Cloud].
[0048] Step 205: Determine the target allocation scheme from the multiple candidate allocation schemes, and allocate the tasks according to the target allocation scheme.
[0049] For example, in task scheduling based on differential evolution algorithms, a large number of candidate allocation schemes are generated. These schemes represent different allocation strategies for tasks between cloud data centers and multiple fog nodes. However, a real system can only choose one specific scheme to execute a task at any given time. Therefore, it is necessary to select the optimal solution from numerous candidate solutions as the final decision, i.e., the "target allocation scheme." This process is the culmination and value of the entire optimization process: without a final selection, the initialization, mutation, crossover, and iteration in the early stages will be meaningless and cannot be transformed into actual scheduling actions. Determining the target scheme is not only for completing task allocation but also to ensure that the selected strategy can achieve optimal overall performance under the current system state (such as resource load, network conditions, security requirements, etc.), such as minimizing latency, balancing resource usage, ensuring data security, or reducing energy consumption. Especially in scenarios sensitive to service quality, such as the Industrial Internet of Things and intelligent transportation, a suboptimal or even incorrect allocation may lead to task timeouts, service interruptions, or security risks.
[0050] In one embodiment, step 205 includes the following sub-steps: Sub-step S21: Determine the fitness values corresponding to the multiple candidate allocation schemes according to the fitness function; For example, the fitness function is a unified quantitative standard for measuring the merits of task allocation schemes, and calculating the corresponding fitness value for each candidate scheme is a prerequisite for achieving scientific and objective comparison. In complex cloud-fog environments, task allocation involves multi-dimensional and multi-objective trade-offs, such as task latency, bandwidth consumption, node resource utilization, and data security level. These indicators have different properties and dimensions, making direct comparison impossible. The fitness function, by introducing weighting coefficients, integrates these heterogeneous indicators into a single value—the fitness value—thus providing a comparable "score" for all candidate schemes. This score is not a subjective judgment but is dynamically calculated based on real-time collected system state information, truly reflecting the comprehensive performance of the scheme in the current environment. For example, a scheme that allocates highly sensitive tasks to low-security-level fog nodes, even with very low latency, will have a low overall fitness due to its extremely low security score. By calculating the fitness value, the scheduler can transcend the limitations of a single indicator and evaluate the overall effectiveness of the scheme from a global perspective. This process also provides a basis for iterative selection in differential evolution algorithms, ensuring that only truly excellent schemes can enter the next generation or be ultimately adopted.
[0051] Sub-step S22: Select the allocation scheme with the highest fitness value as the target allocation scheme.
[0052] For example, determining the candidate allocation scheme with the highest fitness value as the target allocation scheme directly reflects the maximization of the overall system performance and is also the fundamental optimization goal of evolutionary algorithms such as differential evolution. The fitness function is designed to encode the multidimensional requirements of task scheduling (such as low latency, high resource efficiency, and strong security) into a maximizable objective function. Therefore, the higher the fitness value, the better the scheme can balance various performance indicators under the current weight configuration and system state, and the closer it is to the "ideal solution". Differential evolution algorithms continuously approach the global optimum through multiple generations of evolution. In the end, high-fitness individuals in the population have usually fully explored the solution space, and their optimal individuals have high reliability. Using this scheme as the target and executing task allocation can not only effectively meet the service quality requirements of the task, but also improve resource utilization efficiency, reduce system energy consumption, and enhance security compliance, thereby maximizing the overall performance of the cloud-fog collaborative system.
[0053] In one embodiment, the plurality of initial allocation schemes are mutated using the following formula:
[0054] in, This represents the allocation scheme after the mutation operation. , , For the initial allocation scheme, It is a variable factor.
[0055] For example, the mutation factor F(t) controls the magnitude of the mutation operation, affecting the generation of new individuals. A larger F(t) value helps the population explore new search spaces, while a smaller F(t) value helps refine the search. The value of F(t) is crucial; it can be gradually reduced during iteration to allow for a broad search in the early stages and a finer search in the later stages.
[0056]
[0057] in, and These are the maximum and minimum values of the mutation factor, respectively. T is the maximum number of iterations, and t is the current number of iterations.
[0058] In one embodiment, the multiple initial allocation schemes are cross-operated using the following formula:
[0059] in, Indicates the allocation scheme after crossover operation. The j-th element in This represents the element after the intersection. Indicates the current element, This is a random number indicating whether to perform a crossover operation on the j-th element. For the cross ratio, This indicates that the j-th element must undergo a crossover operation.
[0060] For example, the element can be the task number, and the j-th element can be multiple task allocation schemes. The j-th task in the cross ratio This determines the degree of variation. Higher... Values help preserve the properties of the mutation vector; lower values... The value helps preserve the characteristics of the target vector. During the iteration process, it is gradually increased. The value of is determined so that more target vector characteristics are preserved in the early stage, and the mutation vector is utilized more fully in the later stage.
[0061]
[0062] in, and These are the maximum and minimum crossover probabilities, respectively. T is the maximum number of iterations, and t is the current number of iterations.
[0063] In one embodiment, the iteration termination condition includes at least one of satisfying a target number of iterations, or the fitness function value determined by the fitness function changing less than a threshold.
[0064] For example, "reaching the maximum number of iterations" prevents the algorithm from running indefinitely, ensuring that the scheduling process meets real-time requirements; while "fitness change less than a threshold" indicates that the population has converged, and further iterations are unlikely to yield significant performance improvements. In this case, early termination saves computational resources. The combination of these two measures ensures that the algorithm has sufficient time to explore high-quality solutions while avoiding ineffective computations, thus improving the efficiency and practicality of the task allocation method.
[0065] This invention provides a task allocation method for a cloud service system, which includes a cloud data center and multiple fog nodes. After receiving tasks submitted by IoT devices at the fog nodes, the method generates multiple initial task allocation schemes; acquires the state information of the cloud data center and the multiple fog nodes; iterates the multiple initial allocation schemes based on the state information using a differential evolution algorithm to generate multiple candidate allocation schemes; stops iteration when a termination condition is met; and determines the target allocation scheme from the multiple candidate schemes, then allocates tasks according to the target scheme. This invention, considering the state information of the cloud data center and fog nodes, uses a differential evolution algorithm to perform multiple rounds of iterative optimization of the task allocation scheme, generating an allocation scheme that balances efficiency and resource utilization. This reduces task processing latency and improves the real-time performance of data processing in the cloud service system.
[0066] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0067] Reference Figure 4 The diagram illustrates a structural block diagram of a task allocation device for a cloud service system provided by an embodiment of the present invention, which may specifically include the following modules: The initial allocation scheme generation module 301 is used to generate multiple initial allocation schemes for the task after the fog node receives the task submitted by the IoT device. Status information acquisition module 302 is used to acquire status information of the cloud data center and the multiple fog nodes; The iteration module 303 is used to iterate the multiple initial allocation schemes based on the state information of the cloud data center and the multiple fog nodes using the differential evolution algorithm to generate multiple candidate allocation schemes, and to stop the iteration when the iteration termination condition is met. The target allocation scheme determination module 304 is used to determine a target allocation scheme from the plurality of candidate allocation schemes and allocate the task according to the target allocation scheme.
[0068] In one embodiment, the iteration module includes: The fitness function determination submodule is used to determine the fitness function based on the state information; the fitness function is used to evaluate the performance of the allocation scheme. The iterative submodule is used to iterate the multiple initial allocation schemes based on the fitness function and the differential evolution algorithm to generate multiple candidate allocation schemes.
[0069] In one embodiment, the differential evolution algorithm includes mutation and crossover operations, and the iterative submodule includes: The mutation unit is used to generate a first candidate allocation scheme after multiple mutation operations by performing mutation operations on the multiple initial allocation schemes. A crossover unit is used to generate a second candidate allocation scheme after multiple crossover operations by performing crossover operations on the multiple initial allocation schemes; An iterative unit is used to iterate the first candidate allocation scheme and the second candidate allocation scheme according to the fitness function to generate a plurality of third candidate allocation schemes.
[0070] In one embodiment, the plurality of initial allocation schemes are mutated using the following formula:
[0071] in, This represents the allocation scheme after the mutation operation. , , For the initial allocation scheme, It is a variable factor.
[0072] In one embodiment, the multiple initial allocation schemes are cross-operated using the following formula:
[0073] in, Indicates the allocation scheme after crossover operation. The j-th element in This represents the element after the intersection. Indicates the current element, This is a random number indicating whether to perform a crossover operation on the j-th element. For the cross ratio, This indicates that the j-th element must undergo a crossover operation.
[0074] In one embodiment, the iteration termination condition includes at least one of satisfying a target number of iterations, or the fitness function value determined by the fitness function changing less than a threshold.
[0075] In one embodiment, the target allocation scheme determination module includes: The fitness value determination submodule is used to determine the fitness value corresponding to the multiple candidate allocation schemes according to the fitness function; The target allocation scheme determination submodule is used to select the allocation scheme with the highest fitness value as the target allocation scheme.
[0076] This invention provides a task allocation device for a cloud service system, including a cloud data center and multiple fog nodes. After receiving tasks submitted by IoT devices at the fog nodes, the device generates multiple initial task allocation schemes; acquires the state information of the cloud data center and the multiple fog nodes; iterates the multiple initial allocation schemes based on the state information of the cloud data center and the multiple fog nodes using a differential evolution algorithm to generate multiple candidate allocation schemes; stops iteration when an iteration termination condition is met; determines the target allocation scheme from the multiple candidate allocation schemes, and allocates tasks according to the target allocation scheme. This invention, considering the state information of the cloud data center and fog nodes, uses a differential evolution algorithm to perform multiple rounds of iterative optimization of the task allocation scheme, generating an allocation scheme that balances efficiency and resource utilization. This reduces task processing latency and improves the real-time performance of data processing in the cloud service system.
[0077] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0078] This invention also provides an electronic device, comprising: It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described cloud service system task allocation method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0079] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the task allocation method embodiment of the cloud service system described above and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0080] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0081] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0082] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0083] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0085] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the present invention.
[0086] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0087] The above provides a detailed description of a task allocation method and a task allocation device for a cloud service system provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A task allocation method for a cloud service system, characterized in that, The cloud service system includes a cloud data center and multiple fog nodes, and the method includes: After receiving a task submitted by an IoT device, the fog node generates multiple initial allocation schemes for the task; Obtain the status information of the cloud data center and the multiple fog nodes; Based on the state information of the cloud data center and the multiple fog nodes, the multiple initial allocation schemes are iterated using the differential evolution algorithm to generate multiple candidate allocation schemes. The iteration stops when the iteration termination condition is met. From the plurality of candidate allocation schemes, a target allocation scheme is determined, and the tasks are allocated according to the target allocation scheme.
2. The task allocation method for a cloud service system according to claim 1, characterized in that, Based on the state information of the cloud data center and the multiple fog nodes, the system iterates through the multiple initial allocation schemes using a differential evolution algorithm to generate multiple candidate allocation schemes, including: The fitness function is determined based on the state information; the fitness function is used to evaluate the performance of the allocation scheme. Based on the fitness function, the multiple initial allocation schemes are iterated using the differential evolution algorithm to generate multiple candidate allocation schemes.
3. The task allocation method for a cloud service system according to claim 2, characterized in that, The differential evolution algorithm includes mutation and crossover operations. Based on the fitness function, the algorithm iterates through the multiple initial allocation schemes to generate multiple candidate allocation schemes, including: By performing mutation operations on the multiple initial allocation schemes, a first candidate allocation scheme after multiple mutation operations is generated. By performing cross operations on the multiple initial allocation schemes, a second candidate allocation scheme is generated after multiple cross operations. Based on the fitness function, the first candidate allocation scheme and the second candidate allocation scheme are iterated to generate multiple third candidate allocation schemes.
4. The task allocation method for a cloud service system according to claim 3, characterized in that, The multiple initial allocation schemes are mutated using the following formula: in, This represents the allocation scheme after the mutation operation. , , For the initial allocation scheme, It is a variable factor.
5. The task allocation method for a cloud service system according to claim 3, characterized in that, The multiple initial allocation schemes are cross-operated using the following formula: in, Indicates the allocation scheme after crossover operation. The j-th element in This represents the element after the intersection. Indicates the current element, This is a random number indicating whether to perform a crossover operation on the j-th element. For the cross ratio, This indicates that the j-th element must undergo a crossover operation.
6. The task allocation method for a cloud service system according to claim 3, characterized in that, The iteration termination condition includes at least one of the following: meeting the target number of iterations, or the change in the fitness function value determined by the fitness function being less than a threshold.
7. The task allocation method for a cloud service system according to claim 2, characterized in that, The step of determining the target allocation scheme from the plurality of candidate allocation schemes includes: The fitness values corresponding to the multiple candidate allocation schemes are determined according to the fitness function; The allocation scheme with the highest fitness value is selected as the target allocation scheme.
8. A task allocation device for a cloud service system, characterized in that, The cloud service system includes a cloud data center and multiple fog nodes, and the device includes: An initial allocation scheme generation module is used to generate multiple initial allocation schemes for the task after the fog node receives the task submitted by the IoT device. The status information acquisition module is used to acquire the status information of the cloud data center and the multiple fog nodes; The iteration module is used to iterate the multiple initial allocation schemes based on the state information of the cloud data center and the multiple fog nodes using the differential evolution algorithm to generate multiple candidate allocation schemes. The iteration stops when the iteration termination condition is met. The target allocation scheme determination module is used to determine the target allocation scheme from the plurality of candidate allocation schemes and allocate the task according to the target allocation scheme.
9. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the task allocation method of the cloud service system as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of the task allocation method of the cloud service system as described in any one of claims 1-7.