A service dynamic decoupling and offloading method and system based on end-end cooperation

By employing an end-to-end collaborative service dynamic decoupling and offloading method, K-Means clustering and random forest classification are used to decompose services into sub-services. The NSGA-II algorithm is then combined to generate Pareto optimal solution sets, which solves the problem of poor adaptability of static strategies in dynamic environments and improves system performance and resource utilization.

CN121125728BActive Publication Date: 2026-04-07NANJING UNIV OF SCI & TECH
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-14
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing static service management strategies are poorly adapted to dynamic edge environments, decoupling methods lack classification accuracy, and offloading strategies have limited ability to balance load balancing and processing latency, leading to a decline in system performance.

Method used

We adopt a service dynamic decoupling and offloading method based on end-to-end collaboration. We decompose complex services into a set of sub-services through K-Means clustering and random forest classification, and use the NSGA-II algorithm to generate Pareto optimal solution sets. We dynamically manage resources to optimize service offloading.

Benefits of technology

It achieves reduced service response time and optimized system resource utilization in dynamic environments, and improves the dynamic adaptability and optimization efficiency of service unloading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121125728B_ABST
    Figure CN121125728B_ABST
Patent Text Reader

Abstract

This invention discloses a service dynamic decoupling and offloading method and system based on end-to-end collaboration. The method includes: establishing a distributed architecture composed of cloud servers and terminal devices; defining a service decoupling model, a service deployment model, a request latency model, and a service offloading optimization function including average processing time and load balancing; designing a service dynamic decoupling method based on K-Means clustering and random forest classification to achieve offline clustering and online prediction, obtaining a set of sub-services; addressing the limited load balancing and processing latency trade-off capability in sub-service dynamic offloading, designing a service dynamic offloading method based on the NSGA-II algorithm, introducing a time window mechanism to handle resource fluctuations and service dynamic changes, and generating a Pareto optimal solution set. This method can effectively reduce service response time, optimize load balancing among terminal devices, and improve the system's adaptability and stability in dynamic environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of edge computing and distributed resource management technology, and in particular, it is a method and system for dynamic decoupling and offloading of services based on end-to-end collaboration. Background Technology

[0002] With the rapid development of IoT, 5G communication, and edge computing technologies, the number of smart terminal devices has surged, generating massive amounts of data and complex computing tasks. Against this backdrop, optimizing service allocation to improve overall system performance, reduce latency, and increase resource utilization has become a research hotspot in both academia and industry. Traditional centralized cloud computing models transmit all data to the cloud for processing, providing powerful computing capabilities, but they struggle to meet the stringent requirements of low latency and high responsiveness for applications such as autonomous driving, industrial IoT, and augmented reality. To address this challenge, edge computing has emerged, its core idea being to push computing and storage resources down to the network edge, closer to the data source or end user.

[0003] End-to-end collaboration, a key collaboration mode in edge computing, allows for direct dynamic collaboration and resource sharing between terminal devices, further reducing reliance on centralized clouds, effectively reducing service response time, and optimizing resource utilization. Service decoupling and offloading are important technical means to achieve efficient resource scheduling. However, as services become increasingly diversified and complex, traditional centralized computing architectures are gradually revealing problems such as prolonged service times and decreased efficiency. Therefore, decoupling and offloading services to terminal devices to optimize resource utilization and further improve system performance has become crucial. Service decoupling and offloading refers to decomposing complex services into multiple independent sub-services and distributing these sub-services to terminal devices for execution, thereby reducing reliance on centralized cloud servers. By utilizing service decoupling and offloading, service response time can be significantly reduced, resource utilization optimized, system scalability improved, and adaptability to dynamically changing network environments enhanced. Current service decoupling and offloading strategies are mostly static solutions, suitable for scenarios with relatively stable service demands and minimal environmental changes, offering low computational complexity but lacking flexibility. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings and deficiencies of existing technologies by providing a service dynamic decoupling and offloading method and system based on end-to-end collaboration. This method aims to solve the problems of poor adaptability of static service management strategies in dynamic edge environments, insufficient classification accuracy of existing decoupling methods, and limited ability of offloading strategies to balance load balancing and processing latency, thereby reducing service response time and optimizing system resource utilization.

[0005] The technical solution to achieve the purpose of this invention is as follows: On the one hand, a method for dynamic decoupling and offloading of services based on end-to-end collaboration is provided, the method comprising the following steps:

[0006] Step 1: Establish a distributed system architecture consisting of cloud servers and multiple terminal devices, and establish service decoupling model, service deployment model, request latency model, and service offloading optimization functions including average processing time and load balancing.

[0007] Step 2: By using a service dynamic decoupling method based on K-Means clustering and random forest classification, complex services are decomposed into a set of sub-services;

[0008] Step 3: Generate the Pareto optimal solution set for dynamic service unloading using the NSGA-II algorithm-based service dynamic unloading method.

[0009] Furthermore, step 1 establishes a distributed system architecture consisting of a cloud server and multiple terminal devices, specifically including:

[0010] First, the cloud server collects all service requests from each terminal device and decouples the services.

[0011] Next, the cloud server offloads the decoupled set of sub-services and distributes the set of sub-services to terminal devices for processing.

[0012] Finally, if the terminal device sends a newly arrived request to the cloud server, the cloud server will reallocate services based on the current network conditions and resource distribution.

[0013] Throughout the process, the system needs to dynamically manage and schedule resources to ensure load balance across all terminal devices, avoid overloading some devices while leaving others idle, and also take into account the average processing time.

[0014] Furthermore, step 1 establishes a service decoupling model, which specifically includes:

[0015] remember The set of all generated service requests. Include One service, namely , Indicates the first One service;

[0016] Serve Can be decoupled into Individual services, namely , Indicates the first Individual services, and meet the conditions , , The first Individual services, the first Each sub-service includes several service fields, which include resource usage and resource request information. Resource usage refers to the consumption characteristics of CPU, memory, and storage resources during service operation, while resource request information refers to the resource specifications and types required when the service is initiated.

[0017] Furthermore, step 1 establishes a service deployment model, which specifically includes:

[0018] remember Indicates terminal device Have you subscribed to the sub-service? , , Indicates the total number of terminal devices; if terminal devices Subscribed to sub-service , indicating terminal device Generate sub-services The request is denoted as ,Right now:

[0019] .

[0020] Furthermore, step 1 establishes a request latency model, specifically including:

[0021] Assume that all terminal devices are wireless devices, meaning that terminal devices transmit information through wireless connections; the latency of sub-service requests in local processing only includes processing latency, while in remote processing it includes both transmission latency and processing latency; the remote processing refers to end-to-end collaborative processing, which means that the sub-service is offloaded to another collaborative terminal device for execution.

[0022] If a terminal device's service request can be processed directly locally, then only the processing time on the terminal device itself needs to be recorded. Terminal equipment Processing sub-services The total delay is then:

[0023]

[0024] In the formula, Calculate latency for local services, i.e.: , Sub-services The computational load, Indicates terminal device Computational power;

[0025] remember Represents the placement of sub-services Terminal equipment, record Terminal equipment Processing sub-services The total delay is then:

[0026]

[0027] In the formula, For transmission delay, that is: , Sub-services Size, Indicate i and Bandwidth between the two terminals; Calculate the latency for remote services, i.e.: , Serving the child The computational load, Indicates terminal device Its computing power.

[0028] Furthermore, step 1 establishes a service offloading optimization function that includes average processing time and load balancing, specifically including:

[0029] (1) Calculate the average processing time

[0030] Based on the request latency, the sub-service request latency locally only includes processing latency, while remote processing includes both transmission latency and processing latency. In terminal devices The request latency is expressed as:

[0031]

[0032] Define function Indicates condition Is it true? If it is true, then... Conversely ,Right now: Therefore, the terminal device provides sub-services Service request latency It is expressed as follows:

[0033]

[0034] Then there is a total time :

[0035]

[0036] in, Represents the set of all sub-services. express Size of the set;

[0037] For the entire system, the average processing time for:

[0038]

[0039] (2) Calculate load balancing

[0040] For a given terminal device, its computation time It is expressed as follows:

[0041]

[0042] Define terminal load balancing :

[0043]

[0044] Among them, the longest time for calculating the response service request in the terminal device. and the shortest time They are respectively:

[0045]

[0046]

[0047] (3) Establish the service offloading optimization function that includes average processing time and load balancing as follows:

[0048]

[0049] The meanings of the above constraints are as follows:

[0050] Each sub-service must be assigned to one and only one terminal device;

[0051] The total local computation time for each terminal device cannot exceed [a certain limit]. ;

[0052] The total amount of data allocated to each terminal device for sub-services cannot exceed the storage capacity. ;

[0053] The data transmission time between any two devices shall not exceed the maximum allowed transmission time. .

[0054] Furthermore, the service dynamic decoupling method based on K-Means clustering and random forest classification described in step 2 is divided into two stages: first, clustering the resource usage field of the service to achieve service decoupling in the offline stage; second, classifying the service resource request field with cluster labels to lay the foundation for service decoupling prediction in the online stage.

[0055] Furthermore, the service dynamic offloading method based on the NSGA-II algorithm in step 3 specifically includes:

[0056] Step 3.1: Encode a complete service allocation scheme into an integer sequence of length equal to the total number of sub-services in the current system. Each gene locus The value represents the terminal device number to which the sub-service is assigned. , This represents the total number of sub-services in the current system; if sub-services By terminal equipment The generation, and its corresponding gene locus This indicates that the sub-service is on the source terminal device. Execute locally; if sub-service By terminal equipment The generation, and its corresponding gene locus This indicates that the sub-service From source terminal equipment Uninstall to target terminal device The above execution, i.e., one end-to-end collaborative process; randomly initializes and generates a scale of parental population Find the optimal solution through iterative evolution, in each generation The specific execution steps are as follows:

[0057] Step 3.1.1, the current parent population Its offspring population produced through crossover mutation Merge to form a size of Complex population ;right All individuals, with system average processing time Load balancing with terminal devices As an optimization objective, a fast non-dominated sort is performed; based on Pareto dominance, the entire population is divided into several mutually exclusive frontier tiers. ,in It is a non-dominated optimal frontier;

[0058] Step 3.1.2, for the same non-dominated frontier For each individual within the area, calculate their crowding distance; for each individual Its crowded distance The calculation formula is as follows:

[0059] ,

[0060] in, and Individuals Two adjacent bodies in the same frontal line at the 1st The value of the objective function and These are the th species in the current composite population. The maximum and minimum values ​​of the objective function;

[0061] Define the priority comparison relationship between individuals: when two individuals are in different non-dominance levels, the individual with the higher level is better; when they are in the same non-dominance level, the individual with a greater crowding distance is better.

[0062] Step 3.1.3: Following the order of non-dominance levels from high to low, sequentially place the entire frontier into the new parent population. China; when joining the forefront This can lead to a population size exceeding [a certain threshold]. At that time, only The front of the most crowded area Individuals join to fill And maintain its size ;

[0063] Step 3.1.4, based on the tournament selection mechanism, from Select parent individuals from the selected individuals; assign probability to the selected parent individuals. Perform a single-point crossover operation and use probability. Random substitution mutations are performed on gene loci in the offspring chromosomes to generate a new offspring population. ;

[0064] Step 3.1.5: For all new individuals generated by the genetic operation, verify whether they meet all the constraints defined in the service offloading optimization function. For individuals that do not meet the constraints, redistribute the overloaded sub-services to terminal devices that meet the constraints to ensure the feasibility of all solutions in the population.

[0065] The iterative process terminates after reaching the preset maximum number of generations, outputting the first non-dominated layer in the final population. As a Pareto optimal solution set for dynamic service unloading;

[0066] Step 3.2 introduces a time window mechanism, dividing the system runtime into consecutive time windows, and executing the following dynamic optimization process within each time window:

[0067] The system senses the current resource status and newly arrived service requests; based on the sensed status, it executes step 3.1 to generate a service unloading decision for the current window; and it passes unfinished service requests to the next time window.

[0068] On the other hand, a service dynamic decoupling and offloading system based on end-to-end collaboration is provided, the system comprising:

[0069] The first module is used to establish a distributed system architecture consisting of cloud servers and multiple terminal devices, and to establish service decoupling models, service deployment models, request latency models, and service offloading optimization functions including average processing time and load balancing.

[0070] The second module is used to decompose complex services into a set of sub-services using a service dynamic decoupling method based on K-Means clustering and random forest classification.

[0071] The third module is used to generate the Pareto optimal solution set for dynamic service unloading using the NSGA-II algorithm-based method.

[0072] Compared with the prior art, the significant advantages of this invention are:

[0073] (1) Simple operation and strong practicality: For complex services that are difficult to decompose accurately, the service dynamic decoupling strategy based on K-Means clustering and random forest classification is used to achieve accurate decomposition of complex services; for the decoupled sub-services, a clear mathematical model is constructed with the goal of minimizing average processing time and load balancing, and the NSGA-II multi-objective optimization algorithm is used to solve it. This can automatically generate a series of Pareto solutions that make the best trade-off between the two, providing an intuitive and efficient quantitative basis for decision-making in different scenarios.

[0074] (2) Improved dynamic adaptability and optimization efficiency of service offloading: To address the problem of static strategies failing due to resource fluctuations and service request changes in dynamic environments, this invention introduces a dynamic mechanism across the entire service decoupling and offloading chain. At the decoupling level, a design combining offline clustering and online classification enables the service decomposition strategy to adapt to real-time changing service request characteristics. At the offloading level, a time window mechanism is introduced, decomposing the continuous optimization process into discrete time windows. Within each window, resource status and service queues are dynamically updated, and the entire process from service classification to NSGA-II optimization is re-executed. The overall strategy can perceive and adapt to environmental changes in real time, ensuring the quality of model solutions while continuously maintaining the system's high efficiency and stable operation.

[0075] The present invention will now be described in further detail with reference to the accompanying drawings. Attached Figure Description

[0076] Figure 1 This is a flowchart illustrating a service dynamic decoupling and unloading method based on end-to-end collaboration.

[0077] Figure 2 This is a schematic diagram of the system architecture model. Detailed Implementation

[0078] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0079] It should be noted that if the embodiments of the present invention involve descriptions such as "first" and "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" and "second" may explicitly or implicitly include at least one of those features. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

[0080] The service dynamic decoupling and offloading based on end-to-end collaboration proposed in this invention refers to designing a service dynamic decoupling method based on K-Means clustering and random forest classification to decompose complex services into multiple independent sub-services, and designing a service dynamic offloading method based on NSGA-II to distribute these sub-services to terminal devices for execution, thereby reducing dependence on centralized cloud servers.

[0081] In one embodiment, combined Figure 1 This paper provides a method for dynamic decoupling and unloading of services based on end-to-end collaboration, the method comprising the following steps:

[0082] Step 1: Establish a distributed system architecture consisting of cloud servers and multiple terminal devices, such as... Figure 2 As shown, a service decoupling model, a service deployment model, a request latency model, and a service offloading optimization function including average processing time and load balancing are established.

[0083] Step 2: To address the issue of insufficient classification accuracy in dynamic decoupling of complex services, a service dynamic decoupling method based on K-Means clustering and random forest classification is used to decompose complex services into a set of sub-services.

[0084] Step 3: Generate the Pareto optimal solution set for dynamic service unloading using the NSGA-II algorithm-based service dynamic unloading method.

[0085] Furthermore, in one embodiment, step 1, which establishes a distributed system architecture consisting of a cloud server and multiple terminal devices, specifically includes:

[0086] First, the cloud server collects all service requests from each terminal device and decouples the services.

[0087] Next, the cloud server offloads the decoupled set of sub-services and distributes the set of sub-services to terminal devices for processing.

[0088] Finally, if the terminal device sends a newly arrived request to the cloud server, the cloud server will reallocate services based on the current network conditions and resource distribution.

[0089] Throughout the process, the system needs to dynamically manage and schedule resources to ensure load balance across all terminal devices, avoid overloading some devices while leaving others idle, and also take into account the average processing time.

[0090] Furthermore, in one embodiment, step 1, establishing a service decoupling model, specifically includes:

[0091] remember The set of all generated service requests. Include One service, namely , Indicates the first One service;

[0092] Serve Can be decoupled into Individual services, namely , Indicates the first Individual services, and meet the conditions , , The first Individual services, the first Each sub-service includes several service fields, which include resource usage and resource request information. Resource usage refers to the consumption characteristics of CPU, memory, and storage resources during service operation, while resource request information refers to the resource specifications and types required when the service is initiated.

[0093] Furthermore, in one embodiment, step 1, establishing the service deployment model, specifically includes:

[0094] remember Indicates terminal device Have you subscribed to the sub-service? , , Indicates the total number of terminal devices; if terminal devices Subscribed to sub-service , indicating terminal device Generate sub-services The request is denoted as ,Right now:

[0095] .

[0096] Furthermore, in one embodiment, step 1, establishing the request latency model, specifically includes:

[0097] Assume that all terminal devices are wireless devices, meaning that terminal devices transmit information through wireless connections; the latency of sub-service requests in local processing only includes processing latency, while in remote processing it includes both transmission latency and processing latency; the remote processing refers to end-to-end collaborative processing, which means that the sub-service is offloaded to another collaborative terminal device for execution.

[0098] If a terminal device's service request can be processed directly locally, then only the processing time on the terminal device itself needs to be recorded. Terminal equipment Processing sub-services The total delay is then:

[0099]

[0100] In the formula, Calculate latency for local services, i.e.: , Sub-services The computational load, Indicates terminal device Computational power;

[0101] remember Represents the placement of sub-services Terminal equipment, record Terminal equipment Processing sub-services The total delay is then:

[0102]

[0103] In the formula, For transmission delay, that is: , Sub-services Size, Indicate i and Bandwidth between the two terminals; Calculate the latency for remote services, i.e.: , Serving the child The computational load, Indicates terminal device Its computing power.

[0104] Furthermore, in one embodiment, step 1 establishes a service offloading optimization function that includes average processing time and load balancing, specifically including:

[0105] (1) Calculate the average processing time

[0106] Based on the request latency, the sub-service request latency locally only includes processing latency, while remote processing includes both transmission latency and processing latency. In terminal devices The request latency is expressed as:

[0107]

[0108] Define function Indicates condition Is it true? If it is true, then... Conversely ,Right now: Therefore, the terminal device provides sub-services Service request latency It is expressed as follows:

[0109]

[0110] Then there is a total time :

[0111]

[0112] in, Represents the set of all sub-services. express Size of the set;

[0113] For the entire system, the average processing time for:

[0114]

[0115] (2) Calculate load balancing

[0116] For a given terminal device, its computation time It is expressed as follows:

[0117]

[0118] Define terminal load balancing :

[0119]

[0120] Among them, the longest time for calculating the response service request in the terminal device. and the shortest time They are respectively:

[0121]

[0122]

[0123] (3) Establish the service offloading optimization function that includes average processing time and load balancing as follows:

[0124]

[0125] The meanings of the above constraints are as follows:

[0126] Each sub-service must be assigned to one and only one terminal device;

[0127] The total local computation time for each terminal device cannot exceed [a certain limit]. ;

[0128] The total amount of data allocated to each terminal device for sub-services cannot exceed the storage capacity. ;

[0129] The data transmission time between any two devices shall not exceed the maximum allowed transmission time. .

[0130] Furthermore, in one embodiment, the service dynamic decoupling method based on K-Means clustering and random forest classification described in step 2 is divided into two stages: first, clustering the resource usage field of the service to achieve service decoupling in the offline stage; second, classifying the service resource request field with cluster labels to lay the foundation for service decoupling prediction in the online stage.

[0131] Preferably, in some embodiments, the service dynamic decoupling method based on K-Means clustering and random forest classification described in step 2 specifically includes:

[0132] Step 2.1, Offline Phase: Cluster the resource usage fields of the service to achieve service decoupling during the offline phase; details are as follows:

[0133] Step 2.1.1: Determine the optimal number of clusters; extract the service resource usage field from real-time service requests and calculate the sum of squared errors (SSE).

[0134]

[0135] In the formula, Indicates the first Clusters, Let be the cluster center of this cluster; let the number of clusters be . Draw an elbow diagram, i.e., different The relationship curve between the value and its corresponding SSE; selecting a curve that results in a relatively large contour coefficient and a slower descent rate of the elbow plot. The value is used as the optimal number of clusters;

[0136] Step 2.1.2, perform K-Means clustering; randomly select 10 data points were used as the initial cluster centers. Repeat the cluster allocation and centroid update steps until convergence: Cluster allocation refers to the process of updating the cluster center for each data point. Calculate its distance to the cluster center The Euclidean distance is calculated and assigned to the cluster containing the nearest cluster center. Assigned to cluster ,in Centroid update refers to the process of updating the centroid for each newly formed cluster. Recalculate its cluster centers, the new cluster centers It is the mean of all data points within the cluster, that is: The iteration terminates and the clustering process is complete when the moving distance of all cluster centers is less than a predetermined threshold or the preset maximum number of iterations is reached.

[0137] Step 2.1.3: Generate a set of sub-services; through the above clustering process, the service resource usage field is divided into... Each sub-service category represents a typical sub-service type, and its resource usage pattern is determined by the clustering of that cluster. Representation; Sub-service set This forms the offline foundation for dynamic decoupling of services;

[0138] Step 2.2, Online Phase: Extract resource request information fields from real-time service requests, and train a random forest classification model using the category labels obtained in Step 2.1; details are as follows:

[0139] Step 2.2.1, construct the training dataset; use the cluster labels generated in the offline phase as the true labels for supervised learning, and use the resource consumption feature vector of each service request. Its assigned cluster label Related to each other, they form labeled training samples. All training samples constitute the supervised learning training dataset. ,in N is the total number of training samples; extract the resource request information field from real-time service requests to construct an online feature vector;

[0140] Step 2.2.2, train the random forest model; set the number of decision trees in the random forest. The maximum number of features used during training of each tree Maximum depth of decision tree ,in , For the total number of features; for the th A decision tree, From the original training dataset The sample generated by sampling with replacement is of size Subdataset Starting from the root node, recursively perform node splitting until the maximum depth is reached, as follows:

[0141] Step 2.2.2.1, randomly select candidate features; on the data subset of the current node, select from all... Randomly selected from the features These features serve as the candidate splitting feature set for the current node;

[0142] Step 2.2.2.2: Find the optimal split point; for each feature in the candidate split feature set... and each of its potential split points , will the current node dataset Divided into two subsets and , Must meet , Must meet ; Calculate the weighted Gini impurity after partitioning :

[0143]

[0144] The Gini impurity of the dataset is defined as follows:

[0145]

[0146] in, Indicates that the data belongs to a category The sample proportion;

[0147] Step 2.2.2.3: Select the feature and split point that maximizes the reduction in Gini impurity. The optimal splitting scheme for the node; the reduction in Gini impurity is: ;

[0148] Nodes that no longer split are marked as leaf nodes, and the category with the most samples in that node is used as the prediction output for that leaf node;

[0149] Step 2.2.3: Perform online prediction and dynamic decoupling; when a new service request arrives, extract its feature vector. The input is fed into a trained random forest model; each decision tree independently outputs a predicted class. Random forests integrate the predictions of all trees using a majority voting method:

[0150] ,

[0151] in, This is an indicator function; its value is 1 when the condition is true, and 0 otherwise. For each category c, its predicted probability is calculated: The system allocates service requests to the corresponding workload types based on the final predicted category, thus completing the online dynamic decoupling of services.

[0152] Furthermore, in one embodiment, the service dynamic offloading method based on the NSGA-II algorithm in step 3 specifically includes:

[0153] Step 3.1: Encode a complete service allocation scheme into an integer sequence of length equal to the total number of sub-services in the current system. Each gene locus The value represents the terminal device number to which the sub-service is assigned. , This represents the total number of sub-services in the current system; if sub-services By terminal equipment The generation, and its corresponding gene locus This indicates that the sub-service is on the source terminal device. Execute locally; if sub-service By terminal equipment The generation, and its corresponding gene locus This indicates that the sub-service From source terminal equipment Uninstall to target terminal device The above execution, i.e., one end-to-end collaborative process; randomly initializes and generates a scale of parental population Find the optimal solution through iterative evolution, in each generation The specific execution steps are as follows:

[0154] Step 3.1.1, the current parent population Its offspring population produced through crossover mutation Merge to form a size of Complex population ;right All individuals, with system average processing time Load balancing with terminal devices As an optimization objective, a fast non-dominated sort is performed; based on Pareto dominance, the entire population is divided into several mutually exclusive frontier tiers. ,in It is a non-dominated optimal frontier;

[0155] Step 3.1.2, for the same non-dominated frontier For each individual within the area, calculate their crowding distance; for each individual Its crowded distance The calculation formula is as follows:

[0156] ,

[0157] in, and Individuals Two adjacent bodies in the same frontal line at the 1st The value of the objective function and These are the th species in the current composite population. The maximum and minimum values ​​of the objective function;

[0158] Define the priority comparison relationship between individuals: when two individuals are in different non-dominance levels, the individual with the higher level is better; when they are in the same non-dominance level, the individual with a greater crowding distance is better.

[0159] Step 3.1.3: Following the order of non-dominance levels from high to low, sequentially place the entire frontier into the new parent population. China; when joining the forefront This can lead to a population size exceeding [a certain threshold]. At that time, only The front of the most crowded area Individuals join to fill And maintain its size ;

[0160] Step 3.1.4, based on the tournament selection mechanism, from Select parent individuals from the selected individuals; assign probability to the selected parent individuals. Perform a single-point crossover operation and use probability. Random substitution mutations are performed on gene loci in the offspring chromosomes to generate a new offspring population. ;

[0161] Step 3.1.5: For all new individuals generated by the genetic operation, verify whether they meet all the constraints defined in the service offloading optimization function. For individuals that do not meet the constraints, redistribute the overloaded sub-services to terminal devices that meet the constraints to ensure the feasibility of all solutions in the population.

[0162] The iterative process terminates after reaching the preset maximum number of generations, outputting the first non-dominated layer in the final population. As a Pareto optimal solution set for dynamic service unloading;

[0163] Step 3.2 introduces a time window mechanism, dividing the system runtime into consecutive time windows, and executing the following dynamic optimization process within each time window:

[0164] The system senses the current resource status and newly arrived service requests; based on the sensed status, it executes step 3.1 to generate a service unloading decision for the current window; and it passes unfinished service requests to the next time window.

[0165] In one embodiment, a service dynamic decoupling and offloading system based on end-to-end collaboration includes:

[0166] The first module is used to establish a distributed system architecture consisting of cloud servers and multiple terminal devices, and to establish service decoupling models, service deployment models, request latency models, and service offloading optimization functions including average processing time and load balancing.

[0167] The second module is used to decompose complex services into a set of sub-services using a service dynamic decoupling method based on K-Means clustering and random forest classification.

[0168] The third module is used to generate the Pareto optimal solution set for dynamic service unloading using the NSGA-II algorithm-based method.

[0169] Specific limitations regarding the end-to-end collaborative service dynamic decoupling and offloading system can be found in the limitations of the end-to-end collaborative service dynamic decoupling and offloading method described above, and will not be repeated here. Each module in the aforementioned end-to-end collaborative service dynamic decoupling and offloading system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0170] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements:

[0171] Step 1: Establish a distributed system architecture consisting of cloud servers and multiple terminal devices, and establish service decoupling model, service deployment model, request latency model, and service offloading optimization functions including average processing time and load balancing.

[0172] Step 2: By using a service dynamic decoupling method based on K-Means clustering and random forest classification, complex services are decomposed into a set of sub-services;

[0173] Step 3: Generate the Pareto optimal solution set for dynamic service unloading using the NSGA-II algorithm-based service dynamic unloading method.

[0174] For specific limitations on each step, please refer to the limitations on the service dynamic decoupling and unloading method based on end-to-end collaboration mentioned above, which will not be repeated here.

[0175] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program being implemented when executed by a processor:

[0176] Step 1: Establish a distributed system architecture consisting of cloud servers and multiple terminal devices, and establish service decoupling model, service deployment model, request latency model, and service offloading optimization functions including average processing time and load balancing.

[0177] Step 2: By using a service dynamic decoupling method based on K-Means clustering and random forest classification, complex services are decomposed into a set of sub-services;

[0178] Step 3: Generate the Pareto optimal solution set for dynamic service unloading using the NSGA-II algorithm-based service dynamic unloading method.

[0179] For specific limitations on each step, please refer to the limitations on the service dynamic decoupling and unloading method based on end-to-end collaboration mentioned above, which will not be repeated here.

[0180] As a specific example, the invention will be further verified and illustrated in one embodiment.

[0181] In this embodiment, the steps of the method of the present invention are executed in sequence, wherein specifically, step 3.2 executes the following dynamic optimization process within each time window:

[0182] First, update the computing power of the terminal devices. Inter-device bandwidth To simulate resource fluctuations, the device's computing power is adjusted accordingly. Update, among which Representative equipment In the time window computing power This represents a normal distribution with a mean of 1 and a standard deviation of 0.1. Bandwidth matrix. We introduce Bernoulli congestion events to simulate resource fluctuations caused by hardware performance degradation and sudden network traffic bursts in a real environment. Indicates device With equipment In the time window The bandwidth. Service requests arrive following a Poisson process. Subscription device set Generated by sampling without replacement, satisfying Secondly, based on the system status under the current time window, step 3.1 is executed to obtain the optimal service unloading scheme under this window; finally, the unfinished services will participate in the next cycle of optimization, be added to a new round of optimization calculation, and form a continuous optimization cycle.

[0183] The method proposed in this invention is simple to operate, highly practical, and improves the dynamic adaptability and optimization efficiency of service decoupling and unloading.

[0184] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention without departing from its spirit and scope should be included within the protection scope of the present invention.

Claims

1. A method for dynamic decoupling and offloading of services based on end-to-end collaboration, characterized in that, The method includes the following steps: Step 1: Establish a distributed system architecture consisting of cloud servers and multiple terminal devices, and establish service decoupling model, service deployment model, request latency model, and service offloading optimization functions including average processing time and load balancing. Step 2: By using a service dynamic decoupling method based on K-Means clustering and random forest classification, complex services are decomposed into a set of sub-services; Step 3: Generate the Pareto optimal solution set for dynamic service unloading using the NSGA-II algorithm-based service dynamic unloading method; Step 1 involves creating a service offloading optimization function that includes average processing time and load balancing, specifically including: (1) Calculate the average processing time Based on the request latency, the sub-service request latency locally only includes processing latency, while remote processing includes both transmission latency and processing latency. In terminal devices The request latency is expressed as: ; Define function Indicates condition Is it true? If it is true, then... Conversely ,Right now: Therefore, the terminal device provides sub-services Service request latency It is expressed as follows: ; Then there is a total time : ; in, Represents the set of all sub-services. express Size of the set; For the entire system, the average processing time for: ; (2) Calculate load balancing For a given terminal device, its computation time It is expressed as follows: ; Define terminal load balancing : ; Among them, the longest time for calculating the response service request in the terminal device. and the shortest time They are respectively: ; ; (3) Establish the service offloading optimization function that includes average processing time and load balancing as follows: ; The above constraints , , , The meanings are as follows: Each sub-service must be assigned to one and only one terminal device; The total local computation time for each terminal device cannot exceed the local computation time limit. ; The total amount of data allocated to each terminal device for sub-services cannot exceed the storage capacity. ; The data transmission time between any two devices shall not exceed the maximum allowed transmission time. ; Calculate latency for local services, i.e.: , Sub-services The computational load, Indicates terminal device Computational power; For transmission delay, that is: , Sub-services Size, Indicate i and Bandwidth between the two terminals; Calculate the latency for remote services, i.e.: , Serving the child The computational load, Indicates terminal device Computational power; This represents the bandwidth between device i and device j.

2. The service dynamic decoupling and offloading method based on end-to-end collaboration according to claim 1, characterized in that, Step 1 establishes a distributed system architecture consisting of a cloud server and multiple terminal devices, specifically including: First, the cloud server collects all service requests from each terminal device and decouples the services. Next, the cloud server offloads the decoupled sub-service set and distributes the sub-service set to terminal devices for processing; Finally, if the terminal device sends a newly arrived request to the cloud server, the cloud server will reallocate services based on the current network conditions and resource distribution. Throughout the process, the system needs to dynamically manage and schedule resources to ensure load balance across all terminal devices, avoid overloading some devices while leaving others idle, and also take into account the average processing time.

3. The service dynamic decoupling and offloading method based on end-to-end collaboration according to claim 1, characterized in that, Step 1 establishes a service decoupling model, which specifically includes: remember The set of all generated service requests. Include One service, namely , Indicates the first One service; Serve Can be decoupled into Individual services, namely , Indicates the first Individual services, and meet the conditions , , The first Individual services, the first Each sub-service includes several service fields, which include resource usage and resource request information. Resource usage refers to the consumption characteristics of CPU, memory, and storage resources during service operation, while resource request information refers to the resource specifications and types required when the service is initiated.

4. The service dynamic decoupling and offloading method based on end-to-end collaboration according to claim 3, characterized in that, Step 1 involves establishing a service deployment model, which specifically includes: remember Indicates terminal device Have you subscribed to the sub-service? , , Indicates the total number of terminal devices; if terminal devices Subscribed to sub-service , indicating terminal device Generate sub-services The request is denoted as ,Right now: 。 5. The service dynamic decoupling and offloading method based on end-to-end collaboration according to claim 4, characterized in that, Step 1 establishes the request latency model, which specifically includes: Assume that all terminal devices are wireless devices, meaning that terminal devices transmit information through wireless connections; the latency of sub-service requests in local processing only includes processing latency, while in remote processing it includes both transmission latency and processing latency; the remote processing refers to end-to-end collaborative processing, which means that the sub-service is offloaded to another collaborative terminal device for execution. If a terminal device's service request can be processed directly locally, then only the processing time on the terminal device itself needs to be recorded. Terminal equipment Processing sub-services The total delay is then: ; In the formula, Calculate latency for local services, i.e.: , Sub-services The computational load, Indicates terminal device Computational power; remember Represents the placement of sub-services Terminal equipment, record Terminal equipment Processing sub-services The total delay is then: ; In the formula, For transmission delay, that is: , Sub-services Size, Indicate i and Bandwidth between the two terminals; Calculate the latency for remote services, i.e.: , Serving the child The computational load, Indicates terminal device Its computing power.

6. The service dynamic decoupling and offloading method based on end-to-end collaboration according to claim 5, characterized in that, The service dynamic decoupling method based on K-Means clustering and random forest classification described in step 2 consists of two stages. The first stage is to cluster the resource usage field of the service to achieve service decoupling in the offline stage. The second stage is to classify the service resource request field with the clustering labels to lay the foundation for service decoupling prediction in the online stage.

7. The service dynamic decoupling and offloading method based on end-to-end collaboration according to claim 6, characterized in that, The service dynamic decoupling method based on K-Means clustering and random forest classification described in step 2 specifically includes: Step 2.1, Offline Phase: Cluster the resource usage fields of the service to achieve service decoupling during the offline phase; details are as follows: Step 2.1.1: Determine the optimal number of clusters; extract the service resource usage field from real-time service requests and calculate the sum of squared errors (SSE). ; In the formula, Indicates the first Clusters, for One of the elements, Let be the cluster center of this cluster; let the number of clusters be . Draw an elbow diagram, i.e., different The relationship curve between the value and its corresponding SSE; select all values ​​that slow down the descent rate of the elbow plot. The profile coefficient is relatively large in the values. The value is used as the optimal number of clusters; Step 2.1.2, perform K-Means clustering; randomly select 10 data points were used as the initial cluster centers. Repeat the cluster allocation and centroid update steps until convergence: Cluster allocation refers to the process of updating the cluster center for each data point. Calculate its distance to the cluster center The Euclidean distance is calculated and assigned to the cluster containing the nearest cluster center. Assigned to cluster ,in Centroid update refers to the process of updating the centroid for each newly formed cluster. Recalculate its cluster centers, the new cluster centers It is the mean of all data points within the cluster, that is: The iteration terminates and the clustering process is complete when the moving distance of all cluster centers is less than a predetermined threshold or the preset maximum number of iterations is reached. Step 2.1.3: Generate a set of sub-services; through the above clustering process, the service resource usage field is divided into... Each sub-service category represents a typical sub-service type, and its resource usage pattern is determined by the clustering of that cluster. Representation; Sub-service set This forms the offline foundation for dynamic decoupling of services; Step 2.2, Online Phase: Extract resource request information fields from real-time service requests, and train a random forest classification model using the category labels obtained in Step 2.1; details are as follows: Step 2.2.1, construct the training dataset; use the cluster labels generated in the offline phase as the real labels for supervised learning, and use the resource consumption feature vector of each service request. Its assigned cluster label Related to each other, they form labeled training samples. All training samples constitute the supervised learning training dataset. ,in N is the total number of training samples; extract the resource request information field from real-time service requests and construct an online feature vector; Step 2.2.2, train the random forest model; set the number of decision trees in the random forest. The maximum number of features used during training of each tree Maximum depth of decision tree ,in , For the total number of features; for the th A decision tree, From the original training dataset The sample generated by sampling with replacement is of size Subdataset Starting from the root node, recursively perform node splitting until the maximum depth is reached, as follows: Step 2.2.2.1, randomly select candidate features; on the data subset of the current node, select from all... Randomly selected from the features These features serve as the candidate splitting feature set for the current node; Step 2.2.2.2: Find the optimal split point; for each feature in the candidate split feature set... and each of its potential split points , will the current node dataset Divided into two subsets and , Must meet , Must meet ; Calculate the weighted Gini impurity after partitioning : ; The Gini impurity of the dataset is defined as follows: ; in, Indicates that the data belongs to a category The sample proportion; Step 2.2.2.3: Select the feature and split point that maximizes the reduction in Gini impurity. The optimal splitting scheme for the node; the reduction in Gini impurity is: ; Nodes that no longer split are marked as leaf nodes, and the category with the most samples in that node is used as the prediction output for that leaf node; Step 2.2.3: Perform online prediction and dynamic decoupling; when a new service request arrives, extract its feature vector. The input is fed into a trained random forest model; each decision tree independently outputs a predicted class. Random forests integrate the predictions of all trees using a majority voting method: ; in, It is an indicator function; its value is 1 when the condition is true, and 0 otherwise. Indicates the number of decision trees; for each category c, calculate its predicted probability: The system allocates service requests to the corresponding workload types based on the final predicted category, thus completing the online dynamic decoupling of services.

8. The service dynamic decoupling and offloading method based on end-to-end collaboration according to claim 1, characterized in that, Step 3, the service dynamic offloading method based on the NSGA-II algorithm, specifically includes: Step 3.1: Encode a complete service allocation scheme into an integer sequence of length equal to the total number of sub-services in the current system. Each gene locus The value represents the terminal device number to which the sub-service is assigned. , This represents the total number of sub-services in the current system; if sub-services By terminal equipment The generation, and its corresponding gene locus This indicates that the sub-service is on the source terminal device. Execute locally; if sub-service By terminal equipment The generation, and its corresponding gene locus This indicates that the sub-service From source terminal equipment Uninstall to target terminal device The above execution, i.e., one end-to-end collaborative process; randomly initializes and generates a scale of parental population Find the optimal solution through iterative evolution, in each generation The specific execution steps are as follows: Step 3.1.1, the current parent population Its offspring population produced through crossover mutation Merge to form a size of Complex population ;right All individuals, with system average processing time Load balancing with terminal devices As an optimization objective, a fast non-dominated sort is performed; based on Pareto dominance, the entire population is divided into several mutually exclusive frontier tiers. ,in It is a non-dominated optimal frontier; Step 3.1.2, for the same non-dominated frontier For each individual within the area, calculate their crowding distance; for each individual Its crowded distance The calculation formula is as follows: ; in, and Individuals Two adjacent bodies in the same frontal line at the 1st The value of the objective function and These are the th species in the current composite population. The maximum and minimum values ​​of the objective function; Define the priority comparison relationship between individuals: when two individuals are in different non-dominance levels, the individual with the higher level is better; when they are in the same non-dominance level, the individual with a greater crowding distance is better. Step 3.1.3: Following the order of non-dominance levels from high to low, sequentially place the entire frontier into the new parent population. China; when joining the forefront This can lead to a population size exceeding [a certain threshold]. At that time, only The front of the most crowded area Individuals join to fill And maintain its size ; Step 3.1.4, based on the tournament selection mechanism, from Select parent individuals from the selected individuals; assign probability to the selected parent individuals. Perform a single-point crossover operation and use probability. Random substitution mutations are performed on gene loci in the offspring chromosomes to generate a new offspring population. ; Step 3.1.5: For all new individuals generated by the genetic operation, verify whether they meet all the constraints defined in the service offloading optimization function. For individuals that do not meet the constraints, redistribute the overloaded sub-services to terminal devices that meet the constraints to ensure the feasibility of all solutions in the population. The iterative process terminates after reaching the preset maximum number of generations, outputting the first non-dominated layer in the final population. As a Pareto optimal solution set for dynamic service unloading; Step 3.2 introduces a time window mechanism, dividing the system runtime into consecutive time windows, and executing the following dynamic optimization process within each time window: The system senses the current resource status and newly arrived service requests; based on the sensed status, it executes step 3.1 to generate a service unloading decision for the current window; and it passes unfinished service requests to the next time window.

9. A service dynamic decoupling and offloading system based on end-to-end collaboration, using the method described in any one of claims 1 to 8, characterized in that, The system includes: The first module is used to establish a distributed system architecture consisting of cloud servers and multiple terminal devices, and to establish service decoupling models, service deployment models, request latency models, and service offloading optimization functions including average processing time and load balancing. The second module is used to decompose complex services into a set of sub-services using a service dynamic decoupling method based on K-Means clustering and random forest classification. The third module is used to generate the Pareto optimal solution set for dynamic service unloading using the NSGA-II algorithm-based method.

10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Response time optimization method for fair deployment after centralized service decoupling

    CN112948058A