Federal learning-based service deployment method and system
Through the federated learning service deployment method, clustering and resource allocation is combined with user information and service interaction data, and edge server selection is optimized, the problem of limited resources of edge servers is solved, and system performance and data security is improved.
Patent Information
- Application Number
- CN202511013726.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-07-23
AI Technical Summary
In mobile edge computing, edge server resources are limited and cannot meet the growing diverse needs of users, and traditional methods may ignore actual situations and increase the risk of data breaches.
Through a service deployment method based on federated learning, edge servers are used to obtain user information and service interaction data, cluster and resource allocation, and optimize edge server selection with non-dominant sorting genetic algorithm, and obtain a global prediction model through federated learning, predict the number of service requests and deploy popular incremental services.
Optimize the distribution and deployment efficiency of services, reduce redundant computing and resource waste, improve system performance and adaptability to different environments, and ensure the security of data privacy.
Smart Images

Figure CN120528784A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of edge computing service deployment, and in particular to a service deployment method and system based on federated learning. Background Art
[0002] With the rapid development of 5G communication technology and the widespread adoption of smart devices, diverse real-time application demands are emerging, such as video surveillance, smart homes, and online gaming. However, traditional cloud computing models, which require uploading data and tasks to remote data centers, face network congestion and service delays, impacting user experience. Furthermore, data privacy and security issues are becoming increasingly prominent, with frequent data leaks and abuse incidents posing serious risks to users. Against this backdrop, Mobile Edge Computing (MEC) has emerged by deploying virtualized computing nodes down to base stations, creating a novel architecture where "data stays within the domain, while computing power is close to the device." This architecture successfully achieves the coordinated optimization of network load offload and data security protection. However, due to limited edge resources, they are unable to meet the growing and diverse needs of users, especially for personalized services and intelligent applications, where the processing power of edge nodes remains insufficient. Efficiently configuring and managing these edge resources has become a critical issue that needs to be addressed.
[0003] Publication number CN 113296909A, titled "Optimized Service Deployment Method in Mobile Edge Computing," describes a patent application titled "Method for Optimizing Service Deployment in Mobile Edge Computing." This method estimates the number of service application failures based on historical data, models the service deployment problem as an optimization problem involving the maximization of service deployment variables and service request scheduling variables, then simplifies the optimization problem into a single-variable optimization problem involving only the service deployment variables. This single-variable optimization problem is then converted into a set function optimization problem involving the service deployment variables. Finally, a robust algorithm is used to derive a service deployment strategy, thereby achieving optimized deployment. This method maximizes the total utility of deployed services. However, by simplifying the complex optimization problem into a single-variable problem, it may overlook actual conditions, thus affecting the optimization effect. Furthermore, in terms of privacy protection, this method requires the transmission of user data for failure prediction, increasing the risk of data leakage. Summary of the Invention
[0004] The Summary of the Invention introduces a series of simplified concepts that will be further described in the Detailed Description of the Invention. The Summary of the Invention is not intended to define the key features and essential features of the claimed technical solution, nor is it intended to determine the scope of protection of the claimed technical solution.
[0005] To address the technical issues of limited edge server computing resources, large differences in user needs, dynamic changes in service requests, and privacy leaks in distributed environments, the present invention provides a service deployment method and system based on federated learning, which achieves efficient resource allocation and service deployment by combining user personal information and service interaction data.
[0006] First, a service deployment method based on federated learning is provided, including: Obtain user personal information and service interaction data based on edge servers; Clustering users based on the personal information to obtain a cluster set; Based on the obtained cluster set, available edge servers in each cluster are obtained, multiple objective functions are designed according to the constraints of the edge servers, and the optimal solutions of the multiple objective functions are solved using a non-dominated sorting genetic algorithm to find edge cloud servers in each cluster; Deploy local prediction models based on the available edge servers and the edge cloud servers in each cluster, and obtain a global federated prediction model through federated learning; Based on the available edge servers in each cluster, the global federated prediction model is used to predict the service request volume of each cluster at a future time, and services with popular increments are deployed to the available edge servers.
[0007] Furthermore, clustering the users to obtain a cluster set includes: Based on the personal information, the characteristic value of the personal information is mapped to On the dimensional coordinate axis, the user standard coordinate is obtained; Based on the user standard coordinates, calculating the similarity between different users to construct a user similarity matrix; Initializing a responsibility matrix and an availability matrix based on the user similarity matrix, and iteratively updating the responsibility matrix and the availability matrix until an iteration threshold is reached to obtain a final responsibility matrix and a final availability matrix; Select all cluster centers according to the final responsibility matrix and the final availability matrix, and assign the remaining data points that are not cluster centers to the clusters to which the nearest cluster center belongs, to obtain a cluster set; The personal information includes: age, gender, occupation, geographic location, device type, interest preferences, and access time.
[0008] Furthermore, the initializing the responsibility matrix and the availability matrix refers to initializing the responsibility matrix and the availability matrix to zero matrices of the same dimension as the user similarity matrix; The user similarity matrix is expressed as: ; ; in, is the user similarity matrix, For users and users The similarities between For users The user standard coordinates after normalization processing, For users The user standard coordinates after normalization, is the distance threshold, is the total number of users, is the median of the user similarity matrix, expressed as: ; The responsibility matrix and the availability matrix are iteratively updated, and the iterative calculation formula is: ; ; in, is the responsibility matrix, representing the user For users The degree of suitability as a cluster center, For users For users The degree of support for becoming the center of the cluster, is the availability matrix, which represents the user For users The degree of support as the center of the cluster; When the user With users Not the same person, indicating that the user For users The support level of becoming the cluster center is When the user With users For the same person, self-attribution is used to only consider other users' The degree of support for becoming the center of a cluster; The selection of all cluster centers refers to judging Is it greater than the iteration threshold? If so, select the user As the cluster center, otherwise try other users until all cluster centers are found; The cluster set is expressed as: ,in, For the A cluster contains all users belonging to the cluster.
[0009] Furthermore, the characteristic value of the personal information is mapped to On the dimensional coordinate axis, the user standard coordinates are obtained, including: The personal features in the personal information are converted into digital feature values through feature coding, and then the feature values are mapped to dimensional coordinate axis, and perform standardization to obtain user standard coordinates; The user standard coordinates are expressed as: ; in, For users The user standard coordinates of For users No. The eigenvalues on the dimensional coordinate axis are the eigenvalues after normalization; The standardization process refers to deviation standardization, which scales the eigenvalues on each coordinate axis to the interval [0, 1]. The calculation formula is: ; in, For users No. The eigenvalues on the dimensional coordinate axis are the eigenvalues after normalization. For the The maximum eigenvalue on the dimensional coordinate axis, For the The minimum eigenvalue on the dimensional coordinate axis, For users No. The eigenvalues on the dimensional coordinate axis.
[0010] Furthermore, the calculation of the similarity between different users refers to the user similarity obtained by calculating the Euclidean distance between the standard coordinates of different users. The calculation formula of user similarity is: ; ; in, Represents a user With users The similarity of Indicates the user based on the user's standard coordinates With users The Euclidean distance between For users No. The eigenvalues on the dimensional coordinate axis are the eigenvalues after normalization. For users No. The eigenvalues on the dimensional coordinate axis are the eigenvalues after normalization.
[0011] Furthermore, the constraints include: bandwidth constraints, power constraints, load balancing constraints, and signal-to-noise ratio constraints; The bandwidth constraint means that data transmission does not exceed the bandwidth limit of the edge server, which is expressed as: ,in, is the data transmission objective function, used to calculate the edge server Data transfer rate, For edge servers bandwidth; The power constraint means that the transmission power of the edge server cannot exceed the maximum power of the edge server, which is expressed as: ,in, For edge servers The transmission power, For edge servers Maximum power; The load balancing constraint means that the load of the edge server should be within the maximum load range to avoid overloading the edge server, which is expressed as: ,in, For edge servers The load, For edge servers Maximum load; The signal-to-noise ratio constraint means that the signal-to-noise ratio of the edge server must not be lower than the minimum signal-to-noise ratio to ensure that the signal quality meets the data transmission requirements. It is expressed as: ; in, For edge servers The transmission power, is the channel gain connecting the terminal device and the edge server, is the signal-to-noise power generated during data transmission, The lowest signal-to-noise ratio.
[0012] Furthermore, the multiple objective functions include: a data transmission objective function, a computing power objective function, and a load balancing objective function; The data transmission objective function is calculated as follows: ; in, is the data transmission objective function, For edge servers The transmission power, is the channel gain connecting the terminal device and the edge server, For edge servers bandwidth, is the signal-to-noise power generated during data transmission; The computing capability objective function is calculated as follows: ; in, is the computing capability objective function, For edge servers The number of CPU cores you have, The main frequency of each CPU core, For edge servers computing power, For edge servers The memory size, They are the relevant parameters of CPU, GPU and memory respectively; The load balancing objective function is calculated as follows: ; ; in, is the load balancing objective function, is the average load of the edge server, For edge servers The load, For the Clusters, Cluster The number of edge servers in the network.
[0013] Furthermore, the method of using a non-dominated sorting genetic algorithm to solve the optimal solutions of the multiple objective functions and finding edge cloud servers within each cluster includes: Based on the designed multiple objective functions, the performance data of the edge servers in each cluster are brought into the multiple objective functions. Based on the constraints, the non-dominated sorting genetic algorithm is used to obtain the Pareto optimal solution in each cluster. The edge server corresponding to the Pareto optimal solution is used as the edge cloud server of the cluster.
[0014] Furthermore, the method of using the non-dominated sorting genetic algorithm to obtain the Pareto optimal solution in each cluster includes: S11: Calculate a comprehensive score for each available edge server based on the performance data of the available edge servers in each cluster; S12: Based on the calculated comprehensive score, select the top 20% of available edge servers as the current population; S13: Calculating the function values of the multiple objective functions of each individual in the current population, performing non-dominated sorting to divide the individual levels, and assigning a fitness value to each individual; S14: sorting the individuals according to the superiority of the fitness values; S15: Dynamically adjust the crossover rate and mutation rate, perform crossover and mutation operations on each individual in the current population, generate new candidate individuals, and introduce a local search strategy to fine-tune some individuals to obtain a newly generated offspring population; S16: merging the individuals in the current population and the newly generated offspring population, and retaining the top N individuals as the next generation population based on non-dominated sorting and crowding distance selection; S17: Repeat S13-S16 until the maximum number of iterations is reached, and select the individual with the highest fitness as the Pareto optimal solution.
[0015] Furthermore, the calculation of the comprehensive score of each available edge server in step S11 refers to a comprehensive score calculated based on the performance data of the edge server, including computing power, energy consumption, latency, bandwidth, and storage capacity, and the calculation formula is: ; in, Edge servers computing power, energy consumption, latency, bandwidth, and storage capacity, is the maximum computing capacity of the edge server in the cluster, is the maximum bandwidth of the communication link, is the storage capacity of the edge server in the cluster, are the weight parameters of computing power, energy consumption, latency, bandwidth, and storage capacity respectively; The dynamic adjustment of the crossover rate and the mutation rate in step S15 means that if the fitness converges slowly, the mutation rate is increased, and if the fitness converges quickly, the mutation rate is reduced.
[0016] Furthermore, the deploying of the local prediction model includes: Converting the service interaction data obtained from the available edge servers and the edge cloud servers in each cluster into time series data as training data; The Autoformer model is trained based on the training data, a mean square error function is used as a loss function, and an Adam optimizer is used to update parameters to obtain a local prediction model; The service interaction data refers to all data items containing the interactive services between each user and the edge server, wherein the data items include: service ID, service name, service access time, service request volume, service response time, service quality, data transmission volume, user identity information and user behavior data.
[0017] Furthermore, obtaining a global federated prediction model through federated learning includes: S21: uploading the parameters of the deployed local prediction model to the cloud server based on the available edge servers in each cluster in the cluster set; S22: The edge cloud server aggregates the parameters of the local prediction models uploaded by each available edge server through a federated averaging algorithm to update the deployed local prediction models to obtain a global model; S23: The edge cloud server sends the parameters of the global model to each available edge server in the same cluster. Each available edge server aggregates and updates the local prediction model. Based on the interaction data obtained by the available edge servers, the local prediction model is trained and fine-tuned in a cross-validation manner. The parameters of the trained and updated local prediction model are uploaded to the edge cloud server. S24: Repeat steps S22-S23 until the loss value of the global model changes less than the convergence threshold, thereby obtaining a global federated prediction model.
[0018] Furthermore, the cross-validation method described in step S23 refers to converting the local service interaction data obtained by the available edge servers in each cluster into time series data and using it as training data, and selecting a portion of samples in the training data to test the local prediction model.
[0019] Furthermore, the federated averaging algorithm refers to aggregating the parameters of the local prediction models of each participant by weighted averaging, so as to achieve collaborative training of the global model while protecting data privacy. The calculation formula for updating the global model by weighted average is: ; in, for The parameters of the global model of the edge cloud server in the round training, for Participants in the training round Parameters of the local prediction model, For participants The weight of For participants The number of local data samples, is the total number of data samples from all participants, is the number of training rounds, is the total number of training rounds.
[0020] Furthermore, the method of using the global federated prediction model to predict the future service request volume of each cluster based on the available edge servers in each cluster, and deploying services with popular increments to the available edge servers, includes: Each available edge server in the same cluster downloads the parameters of the global federated prediction model from the edge cloud server and loads them into the deployed local prediction model to update the model parameters; Based on the local service interaction data obtained by the available edge server, fine-tune the local prediction model after parameter update, and then predict the service request volume of each service in each cluster at a future time; Calculate the service popularity according to the predicted service request volume, and sort the service popularity in descending order to obtain the future service popularity. The service popularity queue at the moment; Finding services with popular trends based on the service popularity queue and service heat range; Subdivide the services with popular trends and find services with increasing popularity; Deploy the services with popular increments in each cluster to available edge servers.
[0021] Furthermore, the service popularity is calculated as follows: ; ; in, For the future Always Service popularity, For the current Always Service popularity, For the current Always Service The number of service requests, For service collection, For the future Always Service The number of service requests, For the current Time to the future Always Service The service request increment, For the current Always Service The ratio of the ranking in the service popularity queue to the total number of service requests, They are the current service request ratio factor, trend intensity factor, and ranking decay factor respectively; The service popularity queue refers to a service queue in which services are arranged in descending order based on service popularity at the same time; The service heat interval is expressed as: ,in, is the lower threshold of popular services, is the upper threshold of unpopular services, and ; The services mentioned above include: Get the future Always Service The ratio of the ranking in the service popularity queue to the total number of service requests ; The Compare with the upper and lower thresholds of the service heat range, if , then the service The popularity of the service is too low, it is a cold service, there is no trend, the service Remove and upload logs to the cloud server; if , then the service This service is too popular. Backup to cope with sudden traffic; if , then the service With popular trends; The subdividing of the services with popular trends and finding services with popular increments include: Compare and The size of , then the service For a service with popular increments, if , then the service For services that do not have popular increments, and will serve Migrate to adjacent available edge servers to reduce load and resource consumption, where For the current Always Service The ratio of the ranking in the service popularity queue to the total number of service requests.
[0022] Furthermore, deploying the services with popular increments in each cluster to available edge servers includes: The available edge servers of each cluster check whether the service with the popular increment has been deployed. If so, it continues to be maintained. If not, it downloads and deploys the service with the popular increment from the cloud server. The deployment process includes: loading the service image, distributing the configuration file, and initializing the operating environment.
[0023] Secondly, a service deployment system based on federated learning is provided, including: a data acquisition module, a clustering module, an edge cloud server selection module, a global federated prediction model construction module, and a service deployment module; The data acquisition module is used to obtain the user personal information and service interaction data based on the edge server; The clustering module is used to cluster users based on the personal information to obtain a cluster set; The edge cloud server selection module is used to obtain available edge servers in each cluster based on the obtained cluster set, design multiple objective functions based on the constraints of the edge servers, and use a non-dominated sorting genetic algorithm to solve the optimal solutions of the multiple objective functions to find edge cloud servers in each cluster; The global federated prediction model construction module is used to deploy local prediction models based on the available edge servers and the edge cloud servers in each cluster, and obtain a global federated prediction model through federated learning; The service deployment module is used to predict the future service request volume of each cluster based on the available edge servers in each cluster using the global federated prediction model, and deploy services with popular increments to the available edge servers.
[0024] The beneficial effects of the invention are:
[0025] The present invention provides a service deployment method based on federated learning. By clustering users based on affinity, groups of users with similar needs are assigned to the same cluster, reducing redundant computing and resource waste, and optimizing service distribution and deployment efficiency.
[0026] The present invention provides a service deployment method based on federated learning, which adopts multiple objective optimization methods and combines the computing power, data transmission efficiency and load balancing of edge servers to reasonably allocate service resources, avoid over-concentration or resource waste, and improve the overall performance of the system.
[0027] The present invention provides a service deployment method based on federated learning. Through the dynamic crossover and mutation strategy of the non-dominated sorting genetic algorithm, it continuously optimizes the edge server selection process, enhances the system's adaptability to different environments and loads, and ensures the system's robustness in complex network environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is a flow chart of a service deployment method based on federated learning provided by an embodiment of the present invention.
[0029] Figure 2 This is a schematic diagram of a service deployment system based on federated learning provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The preferred embodiments of the present invention are described in detail below with reference to the accompanying drawings so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more precise definition of the protection scope of the present invention.
[0031] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present invention, rather than all the embodiments.
[0032] The specific implementation of the technical solution of the present invention includes the following contents:
[0033] Example 1
[0034] A service deployment method based on federated learning according to embodiment 1 of the present invention includes: Based on the edge server, user personal information and service interaction data are obtained; based on the personal information, users are clustered to obtain a cluster set; based on the obtained cluster set, available edge servers in each cluster are obtained, and multiple objective functions are designed through the constraints of the edge server. The optimal solution of the multiple objective functions is solved using a non-dominated sorting genetic algorithm to find the edge cloud server in each cluster; local prediction models are deployed based on the available edge servers in each cluster and the edge cloud servers, and a global federated prediction model is obtained through federated learning; based on the available edge servers in each cluster, the global federated prediction model is used to predict the service request volume of each cluster at a future time, and services with popular increments are deployed to the available edge servers.
[0035] Specifically, Figure 1 A flow chart of a service deployment method based on federated learning in application embodiment 1 is shown, including: S1. Obtain user personal information and service interaction data based on the edge server.
[0036] The personal information described in step S1 includes: age, gender, occupation, geographic location, device type, interest preferences, and access time.
[0037] The service interaction data in step S1 refers to all data items containing the interactive services between each user and the edge server, wherein the data items include: service ID, service name, service access time, service request volume, service response time, service quality, data transmission volume, user identity information and user behavior data.
[0038] Exemplarily, an edge server obtains personal information and service interaction data for all users in a region through the network. This includes: first, accessing the application programming interface (API) of the user's device to extract each user's basic personal information, including user ID, age, gender, occupation, geographic location, device type, interests, and access time. Simultaneously, service interaction data between the user and each edge server is recorded. This data includes, but is not limited to, service ID (e.g., "Service A"), service name (e.g., "Video Streaming Service"), service access time (e.g., "2024-10-20 10:30:00"), service access frequency (e.g., "5 times / day"), service response time (e.g., "200ms"), service quality (e.g., "4.5 / 5"), data transfer volume (e.g., "100MB"), as well as user identity information and user behavior data (e.g., "click-through rate"). All collected data is stored in a backend database for subsequent analysis and processing.
[0039] S2. Clustering users based on the personal information to obtain a cluster set.
[0040] In step S2, clustering the users to obtain a cluster set includes: Based on the personal information, the characteristic value of the personal information is mapped to On the dimensional coordinate axis, the user standard coordinate is obtained; Based on the user standard coordinates, calculating the similarity between different users to construct a user similarity matrix; Initializing a responsibility matrix and an availability matrix based on the user similarity matrix, and iteratively updating the responsibility matrix and the availability matrix until an iteration threshold is reached to obtain a final responsibility matrix and a final availability matrix; Select all cluster centers according to the final responsibility matrix and the final availability matrix, and assign the remaining data points that are not cluster centers to the clusters to which the nearest cluster center belongs, to obtain a cluster set; The personal information refers to information containing the user's personal characteristics, including: age, gender, occupation, geographic location, device type, interest preferences, and access time.
[0041] Specifically, the initializing the responsibility matrix and the availability matrix refers to initializing the responsibility matrix and the availability matrix to zero matrices of the same dimension as the user similarity matrix; The user similarity matrix is expressed as: ; ; in, is the user similarity matrix, For users and users The similarities between For users The user standard coordinates after normalization, For users The user standard coordinates after normalization, is the distance threshold, is the total number of users, is the median of the user similarity matrix, expressed as: ; The responsibility matrix and the availability matrix are iteratively updated, and the iterative calculation formula is: ; ; in, is the responsibility matrix, representing the user For users The degree of suitability as a cluster center, For users For users The degree of support for becoming the center of the cluster, is the availability matrix, which represents the user For users The degree of support as the center of the cluster; When the user With users Not the same person, indicating that the user For users The support level of becoming the cluster center is When the user With users For the same person, self-attribution is used to only consider other users' The degree of support for becoming the center of a cluster; The selection of all cluster centers refers to judging Is it greater than the iteration threshold? If so, select the user As the cluster center, otherwise try other users until all cluster centers are found; Expressed as: ,in, For the A cluster contains all users belonging to the cluster.
[0042] Specifically, the characteristic value of personal information is mapped to On the dimensional coordinate axis, the user standard coordinates are obtained, including: The personal features in the personal information are converted into digital feature values through feature coding, and then the feature values are mapped to dimensional coordinate axis, and perform standardization to obtain user standard coordinates; The user standard coordinates are expressed as: ; in, For users The user standard coordinates of For users No. The eigenvalues on the dimensional coordinate axis are the eigenvalues after normalization; The standardization process refers to deviation standardization, which scales the eigenvalues on each coordinate axis to the interval [0, 1]. The calculation formula is: ; in, For users No. The eigenvalues on the dimensional coordinate axis are the eigenvalues after normalization. For the The maximum eigenvalue on the dimensional coordinate axis, For the The minimum eigenvalue on the dimensional coordinate axis, For users No. The eigenvalues on the dimensional coordinate axis.
[0043] Specifically, the calculation of the similarity between different users refers to the user similarity obtained by calculating the Euclidean distance between the standard coordinates of different users. The calculation formula of user similarity is: ; ; in, Represents a user With users The similarity of Indicates the user based on the user's standard coordinates With users The Euclidean distance between For users No. The eigenvalues on the dimensional coordinate axis are the eigenvalues after normalization. For users No. The eigenvalues on the dimensional coordinate axis are the eigenvalues after normalization.
[0044] S3. Based on the obtained cluster set, obtain the available edge servers in each cluster, design multiple objective functions through the constraints of the edge servers, use the non-dominated sorting genetic algorithm to solve the optimal solutions of the multiple objective functions, and find the edge cloud servers in each cluster.
[0045] The constraints in step S3 include: bandwidth constraints, power constraints, load balancing constraints, and signal-to-noise ratio constraints; The bandwidth constraint means that data transmission does not exceed the bandwidth limit of the edge server, which is expressed as: ,in, is the data transmission objective function, used to calculate the edge server Data transfer rate, For edge servers bandwidth; The power constraint means that the transmission power of the edge server cannot exceed the maximum power of the edge server, which is expressed as: ,in, For edge servers The transmission power, For edge servers Maximum power; The load balancing constraint means that the load of the edge server should be within the maximum load range to avoid overloading the edge server, which is expressed as: ,in, For edge servers The load, For edge servers Maximum load; The signal-to-noise ratio constraint means that the signal-to-noise ratio of the edge server must not be lower than the minimum signal-to-noise ratio to ensure that the signal quality meets the data transmission requirements. It is expressed as: ; in, For edge servers The transmission power, is the channel gain connecting the terminal device and the edge server, is the signal-to-noise power generated during data transmission, The lowest signal-to-noise ratio.
[0046] The multiple objective functions in step S3 include: a data transmission objective function, a computing capacity objective function, and a load balancing objective function; The data transmission objective function is calculated as follows: ; in, is the data transmission objective function, For edge servers The transmission power, is the channel gain connecting the terminal device and the edge server, For edge servers bandwidth, is the signal-to-noise power generated during data transmission; The computing capability objective function is calculated as follows: ; in, is the computing capability objective function, For edge servers The number of CPU cores you have, The main frequency of each CPU core, For edge servers computing power, For edge servers The memory size, They are the relevant parameters of CPU, GPU and memory respectively; The load balancing objective function is calculated as follows: ; ; in, is the load balancing objective function, is the average load of the edge server, For edge servers The load, For the Clusters, Cluster The number of edge servers in the network.
[0047] In step S3, the non-dominated sorting genetic algorithm is used to solve the optimal solutions of the multiple objective functions to find the edge cloud servers in each cluster, including: Based on the designed multiple objective functions, the performance data of the edge servers in each cluster are brought into the multiple objective functions. Based on the constraints, the non-dominated sorting genetic algorithm is used to obtain the Pareto optimal solution in each cluster. The edge server corresponding to the Pareto optimal solution is used as the edge cloud server of the cluster.
[0048] Specifically, the non-dominated sorting genetic algorithm is used to obtain the Pareto optimal solution in each cluster, including: S11: Calculate a comprehensive score for each available edge server based on the performance data of the available edge servers in each cluster; S12: Based on the calculated comprehensive score, select the top 20% of available edge servers as the current population; S13: Calculating the function values of the multiple objective functions of each individual in the current population, performing non-dominated sorting to divide the individual levels, and assigning a fitness value to each individual; S14: sorting the individuals according to the superiority of the fitness values; S15: Dynamically adjust the crossover rate and mutation rate, perform crossover and mutation operations on each individual in the current population, generate new candidate individuals, and introduce a local search strategy to fine-tune some individuals to obtain a newly generated offspring population; S16: merging the individuals in the current population and the newly generated offspring population, and retaining the top N individuals as the next generation population based on non-dominated sorting and crowding distance selection; S17: Repeat S13-S16 until the maximum number of iterations is reached, and select the individual with the highest fitness as the Pareto optimal solution.
[0049] Furthermore, the calculation of the comprehensive score of each available edge server in step S11 refers to a comprehensive score calculated based on the performance data of the edge server, including computing power, energy consumption, latency, bandwidth, and storage capacity, and the calculation formula is: ; in, Edge servers computing power, energy consumption, latency, bandwidth, and storage capacity, is the maximum computing capacity of the edge server in the cluster, is the maximum bandwidth of the communication link, is the storage capacity of the edge server in the cluster, are the weight parameters of computing power, energy consumption, latency, bandwidth, and storage capacity respectively; The dynamic adjustment of the crossover rate and the mutation rate in step S15 means that if the fitness converges slowly, the mutation rate is increased, and if the fitness converges quickly, the mutation rate is reduced.
[0050] S4. Deploy local prediction models based on the available edge servers in each cluster and the edge cloud server, and obtain a global federated prediction model through federated learning.
[0051] In step S4, deploying the local prediction model includes: Converting the service interaction data obtained from the available edge servers and the edge cloud servers in each cluster into time series data as training data; The Autoformer model is trained based on the training data, a mean square error function is used as a loss function, and an Adam optimizer is used to update parameters to obtain a local prediction model; The service interaction data refers to all data items containing the interactive services between each user and the edge server, wherein the data items include: service ID, service name, service access time, service request volume, service response time, service quality, data transmission volume, user identity information and user behavior data.
[0052] In step S4, obtaining a global federated prediction model through federated learning includes: S21: uploading the parameters of the deployed local prediction model to the cloud server based on the available edge servers in each cluster in the cluster set; S22: The edge cloud server aggregates the parameters of the local prediction models uploaded by each available edge server through a federated averaging algorithm to update the deployed local prediction models to obtain a global model; S23: The edge cloud server sends the parameters of the global model to each available edge server in the same cluster. Each available edge server aggregates and updates the local prediction model, trains the updated local prediction model based on the interaction data obtained by the available edge services in a cross-validation manner, and uploads the parameters of the trained and updated local prediction model to the edge cloud server. S24: Repeat steps S22-S23 until the loss value of the global model changes less than the convergence threshold, thereby obtaining a global federated prediction model.
[0053] Specifically, the cross-validation method described in step S23 refers to converting the local service interaction data obtained by the available edge servers in each cluster into time series data and using it as training data. A portion of samples in the training data are selected to test the local prediction model.
[0054] Specifically, the federated averaging algorithm aggregates the parameters of the local prediction models of each participant by weighted averaging, thereby achieving collaborative training of the global model while protecting data privacy. The calculation formula for updating the global model by weighted average is: ; in, for The parameters of the global model of the edge cloud server in the round training, for Participants in the training round Parameters of the local prediction model, For participants The weight of For participants The number of local data samples, is the total number of data samples from all participants, is the number of training rounds, is the total number of training rounds.
[0055] S5. Based on the available edge servers in each cluster, the global federated prediction model is used to predict the service request volume of each cluster at a future time, and services with popular increments are deployed to the available edge servers.
[0056] Specifically, in step S5, based on the available edge servers in each cluster, the global federated prediction model is used to predict the future service request volume of each cluster, and services with popular increments are deployed to the available edge servers, including: Each available edge server in the same cluster downloads the parameters of the global federated prediction model from the edge cloud server and loads them into the deployed local prediction model to update the model parameters; Based on the local service interaction data obtained by the available edge server, fine-tune the local prediction model after parameter update, and then predict the service request volume of each service in each cluster at a future time; Calculate the service popularity according to the predicted service request volume, and sort the service popularity in descending order to obtain the future service popularity. The service popularity queue at the moment; Finding services with popular trends based on the service popularity queue and service heat range; Further subdivide the services with popular trends and find services with popular increments; Deploy the services with popular increments in each cluster to available edge servers.
[0057] Specifically, the service popularity is calculated as follows: ; ; in, For the future Always Service popularity, For the current Always Service popularity, For the current Always Service The number of service requests, For service collection, For the future Always Service The number of service requests, For the current Time to the future Always Service The service request increment, For the current Always Service The ratio of the ranking in the service popularity queue to the total number of service requests, They are the current request ratio factor, trend strength factor, and ranking decay factor respectively; The service popularity queue refers to a service queue in which services are arranged in descending order based on service popularity at the same time; The service heat interval is expressed as: ,in, is the lower threshold of popular services, is the upper threshold of unpopular services, and ; The services mentioned above include: Get the future Always Service The ratio of the ranking in the service popularity queue to the total number of service requests ; The Compare with the upper and lower thresholds of the service heat range, if , then the service The popularity of the service is too low, it is a cold service, there is no trend, the service Remove and upload logs to the cloud server; if , then the service This service is too popular. Backup to cope with sudden traffic; if , then the service With popular trends; The subdividing of the services with popular trends and finding services with popular increments include: Compare and The size of , then the service For a service with popular increments, if , then the service For services that do not have popular increments, and will serve Migrate to adjacent available edge servers to reduce load and resource consumption, where For the current Always Service The ratio of the ranking in the service popularity queue to the total number of service requests.
[0058] Specifically, deploying the services with popular increments in each cluster to available edge servers includes: The available edge servers of each cluster check whether the service with the popular increment has been deployed. If so, it continues to be maintained. If not, it downloads and deploys the service with the popular increment from the cloud server. The deployment process includes: loading the service image, distributing the configuration file, and initializing the operating environment.
[0059] Example 2
[0060] like Figure 2 As shown, a service deployment system based on federated learning involved in Example 2 of the present application includes: a data acquisition module, a clustering module, an edge cloud server selection module, a global federated prediction model construction module, and a service deployment module; Specifically, the data collection module is used to obtain user personal information and service interaction data based on the edge server; The clustering module is used to cluster users based on the personal information to obtain a cluster set; The edge cloud server selection module is used to obtain available edge servers in each cluster based on the obtained cluster set, design multiple objective functions based on the constraints of the edge servers, and use a non-dominated sorting genetic algorithm to solve the optimal solutions of the multiple objective functions to find edge cloud servers in each cluster; The global federated prediction model construction module is used to deploy local prediction models based on the available edge servers and the edge cloud servers in each cluster, and obtain a global federated prediction model through federated learning; The service deployment module is used to predict the future service request volume of each cluster based on the available edge servers in each cluster using the global federated prediction model, and deploy services with popular increments to the available edge servers.
[0061] The specific implementation method of this embodiment is the same as that of Example 1, which will not be repeated here. Please refer to the description of Example 1 for details.
[0062] Those skilled in the art will appreciate that although some embodiments herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is intended to be within the scope of the present invention and to form different embodiments.
[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A service deployment method based on federated learning, characterized in that: include: Obtain user personal information and service interaction data based on edge servers; Clustering users based on the personal information to obtain a cluster set; Based on the obtained cluster set, available edge servers in each cluster are obtained, multiple objective functions are designed according to the constraints of the edge servers, and the optimal solutions of the multiple objective functions are solved using a non-dominated sorting genetic algorithm to find edge cloud servers in each cluster; Deploy local prediction models based on the available edge servers and the edge cloud servers in each cluster, and obtain a global federated prediction model through federated learning; Based on the available edge servers in each cluster, the global federated prediction model is used to predict the service request volume of each cluster at a future time, and services with popular increments are deployed to the available edge servers.
2. A method for service deployment based on federated learning according to claim 1, characterized in that: Clustering users to obtain a cluster set includes: Based on the personal information, the characteristic value of the personal information is mapped to On the dimensional coordinate axis, the user standard coordinate is obtained; Based on the user standard coordinates, calculating the similarity between different users to construct a user similarity matrix; Initializing a responsibility matrix and an availability matrix based on the user similarity matrix, and iteratively updating the responsibility matrix and the availability matrix until an iteration threshold is reached to obtain a final responsibility matrix and a final availability matrix; Select all cluster centers according to the final responsibility matrix and the final availability matrix, and assign the remaining data points that are not cluster centers to the clusters to which the nearest cluster center belongs, to obtain a cluster set; The personal information includes: age, gender, occupation, geographic location, device type, interest preferences, and access time.
3. A service deployment method based on federated learning according to claim 2, characterized in that: The characteristic value of the personal information is mapped to On the dimensional coordinate axis, the user standard coordinates are obtained, including: The personal information is converted from non-digital features into digital feature values through feature coding, and then the feature values are mapped to dimensional coordinate axis, and perform standardization to obtain user standard coordinates; The user standard coordinates are expressed as: ; in, For users The user standard coordinates of For users No. The eigenvalues on the dimensional coordinate axis are the eigenvalues after normalization; The standardization process refers to deviation standardization, which scales the eigenvalues on each coordinate axis to the interval [0, 1]. The calculation formula is: ; in, For users No. The eigenvalues on the dimensional coordinate axis are the eigenvalues after normalization. For the The maximum eigenvalue on the dimensional coordinate axis, For the The minimum eigenvalue on the dimensional coordinate axis, For users No. The eigenvalues on the dimensional coordinate axis.
4. A method for service deployment based on federated learning according to claim 2, characterized in that: The calculation of the similarity between different users refers to the user similarity obtained by calculating the Euclidean distance between the standard coordinates of different users. The calculation formula of user similarity is: ; ; in, Represents a user With users The similarity of Indicates the user based on the user's standard coordinates With users The Euclidean distance between For users No. The eigenvalues on the dimensional coordinate axis are the eigenvalues after normalization. For users No. The eigenvalues on the dimensional coordinate axis are the eigenvalues after normalization.
5. A method for service deployment based on federated learning according to claim 1, characterized in that: The constraints include: bandwidth constraints, power constraints, load balancing constraints, and signal-to-noise ratio constraints; The bandwidth constraint means that data transmission does not exceed the bandwidth limit of the edge server, which is expressed as: ,in, is the data transmission objective function, used to calculate the edge server Data transfer rate, For edge servers bandwidth; The power constraint means that the transmission power of the edge server cannot exceed the maximum power of the edge server, which is expressed as: ,in, For edge servers The transmission power, For edge servers Maximum power; The load balancing constraint means that the load of the edge server should be within the maximum load range to avoid overloading the edge server, which is expressed as: ,in, For edge servers The load, For edge servers Maximum load; The signal-to-noise ratio constraint means that the signal-to-noise ratio of the edge server must not be lower than the minimum signal-to-noise ratio to ensure that the signal quality meets the data transmission requirements. It is expressed as: ;in, For edge servers The transmission power, is the channel gain connecting the terminal device and the edge server, is the signal-to-noise power generated during data transmission, The lowest signal-to-noise ratio.
6. A method for service deployment based on federated learning according to claim 1, characterized in that: The multiple objective functions include: a data transmission objective function, a computing power objective function, and a load balancing objective function; The data transmission objective function is calculated as follows: ; in, is the data transmission objective function, For edge servers The transmission power, To connect terminal devices and edge servers The channel gain, For edge servers bandwidth, is the signal-to-noise power generated during data transmission; The computing capability objective function is calculated as follows: ; in, is the computing capability objective function, For edge servers The number of CPU cores you have, The main frequency of each CPU core, For edge servers computing power, For edge servers The memory size, They are the relevant parameters of CPU, GPU and memory respectively; The load balancing objective function is calculated as follows: ; ; in, is the load balancing objective function, is the average load of the edge server, For edge servers The load, For the Clusters, Cluster The number of edge servers in the network.
7. A method for service deployment based on federated learning according to claim 1, characterized in that: The method of using a non-dominated sorting genetic algorithm to solve the optimal solutions of the multiple objective functions and finding edge cloud servers within each cluster includes: Based on the designed multiple objective functions, the performance data of the edge servers in each cluster are brought into the multiple objective functions. Based on the constraints, the non-dominated sorting genetic algorithm is used to obtain the Pareto optimal solution in each cluster. The edge server corresponding to the Pareto optimal solution is used as the edge cloud server of the cluster.
8. A method for service deployment based on federated learning according to claim 7, characterized in that: The method of using a non-dominated sorting genetic algorithm to obtain the Pareto optimal solution in each cluster includes: S11: Calculate a comprehensive score for each available edge server based on the performance data of the available edge servers in each cluster; S12: Based on the calculated comprehensive score, select the top 20% of available edge servers as the current population; S13: Calculating the function values of the multiple objective functions of each individual in the current population, performing non-dominated sorting to divide the individual levels, and assigning a fitness value to each individual; S14: sorting the individuals according to the superiority of the fitness values; S15: Dynamically adjust the crossover rate and mutation rate, perform crossover and mutation operations on each individual in the current population, generate new candidate individuals, and introduce a local search strategy to fine-tune some individuals to obtain a newly generated offspring population; S16: Merge the individuals in the current population and the newly generated offspring population, select based on non-dominated sorting and crowding distance, and retain the previous Individuals serve as the next generation population; S17: Repeat S13-S16 until the maximum number of iterations is reached, and select the individual with the highest fitness as the Pareto optimal solution.
9. The method for service deployment based on federated learning according to claim 1, characterized in that: The deploying of the local prediction model includes: Converting the service interaction data obtained from the available edge servers and the edge cloud servers in each cluster into time series data as training data; The Autoformer model is trained based on the training data, a mean square error function is used as a loss function, and an Adam optimizer is used to update parameters to obtain a local prediction model; The service interaction data refers to all data items containing the interactive services between each user and the edge server, wherein the data items include: service ID, service name, service access time, service request volume, service response time, service quality, data transmission volume, user identity information and user behavior data.
10. A method for service deployment based on federated learning according to claim 1, characterized in that: The obtaining of a global federated prediction model through federated learning includes: S21: uploading the parameters of the deployed local prediction model to the edge cloud server based on the available edge servers in each cluster in the cluster set; S22: The edge cloud server aggregates the parameters of the local prediction models uploaded by each available edge server through a federated averaging algorithm to update the deployed local prediction models to obtain a global model; S23: The edge cloud server sends the parameters of the global model to each available edge server in the same cluster. Each available edge server aggregates and updates the local prediction model. Based on the interaction data obtained by the available edge servers, the updated local prediction model is trained in a cross-validation manner, and the parameters of the trained and updated local prediction model are uploaded to the edge cloud server. S24: Repeat steps S22-S23 until the loss value of the global model changes less than the convergence threshold, thereby obtaining a global federated prediction model.
11. A method for service deployment based on federated learning according to claim 10, characterized in that: The federated averaging algorithm aggregates the parameters of the local prediction models of each participant by weighted averaging, thereby achieving collaborative training of the global model while protecting data privacy. The calculation formula for updating the global model by weighted average is: ; in, for The parameters of the global model of the edge cloud server in the round training, for Participants in the training round Parameters of the local prediction model, For participants The weight of For participants The number of local data samples, is the total number of data samples from all participants, is the number of training rounds, is the total number of training rounds.
12. A method for service deployment based on federated learning according to claim 1, characterized in that: The method of using the global federated prediction model to predict the future service request volume of each cluster based on the available edge servers in each cluster, and deploying services with popular increments to the available edge servers, includes: Each available edge server in the same cluster downloads the parameters of the global federated prediction model from the edge cloud server and loads them into the deployed local prediction model to update the model parameters; Based on the local service interaction data obtained by the available edge server, fine-tune the local prediction model after parameter update, and then predict the service request volume of each service in each cluster at a future time; Calculate the service popularity according to the predicted service request volume, and sort the service popularity in descending order to obtain the future service popularity. The service popularity queue at the moment; Finding services with popular trends based on the service popularity queue and service heat range; Subdivide the services with popular trends and find services with increasing popularity; Deploy the services with popular increments in each cluster to available edge servers.
13. A service deployment method based on federated learning according to claim 12, characterized in that: The service popularity is calculated as follows: ; ; in, For the future Always Service popularity, For the current Always Service popularity, For the current Always Service The number of service requests, For service collection, For the future Always Service The number of service requests, For the current Time to the future Always Service The service request increment, For the current Always Service The ratio of the ranking in the service popularity queue to the total number of service requests, They are the current service request ratio factor, trend intensity factor, and ranking decay factor respectively; The service popularity queue refers to a service queue in which services are arranged in descending order based on service popularity at the same time; The service heat interval is expressed as: ,in, is the lower threshold of popular services, is the upper threshold of unpopular services, and ; The services mentioned above include: Get the future Always Service The ratio of the ranking in the service popularity queue to the total number of service requests ; The Compare with the upper and lower thresholds of the service heat range, if , then the service The popularity of the service is too low, it is a cold service, there is no trend, the service Remove and upload logs to the cloud server; if , then the service This service is too popular. Backup to cope with sudden traffic; if , then the service With popular trends; The subdividing of the services with popular trends and finding services with popular increments include: Compare and The size of , then the service For a service with popular increments, if , then the service For services that do not have popular increments, and will serve Migrate to adjacent available edge servers to reduce load and resource consumption, where For the current Always Service The ratio of the ranking in the service popularity queue to the total number of service requests.
14. The method for service deployment based on federated learning according to claim 12, characterized in that: The step of deploying the services with popular increments in each cluster to available edge servers includes: The available edge servers of each cluster check whether the service with the popular increment has been deployed. If so, it continues to be maintained. If not, it downloads and deploys the service with the popular increment from the cloud server. The deployment process includes: loading the service image, distributing the configuration file, and initializing the operating environment.
15. A service deployment system based on federated learning, characterized in that: Implementing a service deployment method based on federated learning according to any one of claims 1 to 14, specifically comprising: Data collection module, used to obtain user personal information and service interaction data based on the edge server; A clustering module, configured to cluster users based on the personal information to obtain a cluster set; An edge cloud server selection module is configured to obtain available edge servers within each cluster based on the obtained cluster set, design multiple objective functions based on the constraints of the edge servers, and use a non-dominated sorting genetic algorithm to find the optimal solutions of the multiple objective functions to find edge cloud servers within each cluster; A global federated prediction model construction module is used to deploy local prediction models based on the available edge servers and the edge cloud servers in each cluster, and obtain a global federated prediction model through federated learning; The service deployment module is used to predict the future service request volume of each cluster based on the available edge servers in each cluster using the global federated prediction model, and deploy services with popular increments to the available edge servers.
Citation Information
Patent Citations
Optimized service deployment method in mobile edge computing
CN113296909A
Mobile edge cache optimization method based on federated learning
CN114595632A
Cloud edge-end collaborative personalized federal learning method, system, device and medium
CN115688913A
Multi-service pre-deployment method based on edge computing
CN116483585A
Federal learning-based privacy protection active caching method in mobile edge computing
CN117041939A
Cited By
Adaptive asynchronous federated learning intrusion detection method and device
CN120750675A