A federated learning recommendation method based on spatiotemporal consistency in mobile environment

By adopting a federated learning recommendation method based on spatiotemporal consistency in the mobile recommendation system, the problem of degradation in the performance of recommendation models and slow convergence speed under federated learning is solved, and higher recommendation accuracy and faster model convergence are achieved.

CN116821527BActive Publication Date: 2025-04-15WEI SHENG JIAYE INT TRADE (BEIJING) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310559909.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-18
Publication Date
2025-04-15
Estimated Expiration
2043-05-18

AI Technical Summary

Technical Problem

在确保隐私安全的同时,如何提高移动推荐系统中的兴趣点推荐准确性,尤其是在联邦学习下面临的模型性能下降、收敛减慢和模型漂移等问题。

Method used

The federated learning recommendation method based on spatiotemporal consistency is adopted to improve the performance and convergence speed of the recommended model through trajectory completion, construction and training of the SCFL framework, weighted aggregation on the client and edge, and global model aggregation on the server.

Benefits of technology

While protecting user privacy and security, it significantly improves the performance of the recommendation model and optimizes model convergence, thereby achieving faster customer update response speed and improving the real-time performance of the recommendation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116821527B_ABST
    Figure CN116821527B_ABST
Patent Text Reader

Abstract

The present invention relates to a federated learning recommendation method based on spatiotemporal consistency in a mobile environment. The method mainly utilizes the spatiotemporal consistency of trajectories to optimize the federated learning process, including trajectory completion, client clustering and weighted aggregation. Trajectory completion can effectively improve the training performance of local models under data constraints, clustering strategies can effectively promote information sharing between similar customers, and weighted aggregation can reduce the problem of model drift. Experimental verification shows that the method of the present invention achieves higher model performance and better convergence effect than all baselines while ensuring user privacy and security. Compared with the best baseline, SCFL performance is improved by up to 84.26%, which greatly improves the convergence speed of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of interest point recommendation, and in particular to a method for recommending interest points based on spatiotemporal consistency federated learning. Background Art

[0002] With the development of artificial intelligence technology, mobile recommendation systems have become an important tool for people's daily consumption, commuting and travel behaviors. However, traditional mobile recommendation systems collect user privacy data on central servers, which poses a risk of threatening user privacy and security. The risk of privacy leakage may reduce the trust and enthusiasm of users and service providers for recommendation services, so better privacy protection measures are needed to solve this problem. Since the data in the field of mobile recommendation is widely distributed and has high spatial and temporal complexity, general privacy protection methods are not suitable for protecting data security in this field. For example, data protection schemes based on encryption or masking can protect user privacy by encrypting user data. However, when decrypting the data, the data still needs to be centralized in one location for decryption processing, which may lead to privacy leakage.

[0003] Federated learning is a distributed data protection method that is becoming increasingly popular due to its ability to avoid privacy leakage by not uploading data to the server. In this method, the local device is responsible for local training and only transmits local model parameters to the server after encryption. Federated learning reduces the risk of privacy leakage and promotes the development of privacy protection technology in the recommendation field.

[0004] However, the research on using federated learning to protect the privacy and security of mobile recommendation services is still in its early stages. Some researchers only use simple recommendation models to verify the effectiveness of federated learning in protecting privacy without considering the new problems brought by federated learning. Directly applying general federated learning to mobile recommendation systems may lead to problems such as degraded model performance, slowed convergence, and model drift. Therefore, considering recommendation performance and convergence speed while ensuring privacy and security can truly promote the development of mobile recommendation systems under federated learning. Summary of the invention

[0005] In view of the above problems existing in the prior art, the technical problem to be solved by the present invention is: how to improve the accuracy of recommending points of interest while ensuring privacy security.

[0006] In order to solve the above technical problems, the present invention adopts the following technical solution: a federated learning recommendation method based on spatiotemporal consistency in a mobile environment, comprising the following steps:

[0007] S1: trajectory completion, the trajectory completion is to complete the user's trajectory using the spatiotemporal distribution of the trajectory.

[0008] S2: Build and train the SCFL framework, which includes a client, an edge, and a server. The recommendation model used by the SCFL framework is a sequential recommendation model.

[0009] S21: Use the method in S1 to complete the customer trajectory to obtain enhanced customer trajectory data.

[0010] S22: Use the enhanced customer trajectory data to train the client's recommendation model to obtain local model parameters At the same time, the time and space consistency value of the client is obtained

[0011] S23: All Encrypted and uploaded to the server, the server receives all The clients are clustered, and the server broadcasts the clustering results to all clients and edge terminals. A cluster after clustering corresponds to one edge terminal.

[0012] S24: All clients set their local model parameters and Upload to the corresponding edge end.

[0013] S25: Each edge end receives and Perform weighted aggregation to obtain the edge model parameters of the edge end and the edge spatiotemporal consistency value at the edge

[0014] S26: Obtain a public data set, use the method in S1 to complete the trajectories in the public data set to obtain an enhanced public data set, and use the enhanced public data set to train the edge recommendation model to obtain new edge model parameters

[0015] S27: and Upload to the server, the server receives Perform global model aggregation to obtain the server's global model parameter θ G , and the server will θ G After broadcasting to all edge terminals and all clients, it returns to S21 to start the next iteration.

[0016] When the iteration reaches the maximum number of iterations, the training is stopped and the optimal SCFL framework is obtained.

[0017] S3: For a user on a client, obtain the user's trajectory, and use the method in S1 to complete the trajectory, and then input the user's trajectory after trajectory completion into the corresponding client sequential recommendation model, and the output is the predicted next point of interest of the user.

[0018] As an improvement, the specific steps of trajectory completion in S1 are as follows:

[0019] The temporal consistency of the trajectory is calculated using formulas (2) and (3):

[0020]

[0021]

[0022] in, Indicates the c i The temporal consistency value of the h-th trajectory of a customer. Indicates the c i The time consistency value of a customer. H represents c i -th number of trajectories in the client. t j represents the time label of the jth trajectory point, Represents the average value of all track point time labels. h Represents the number of trajectory points in the hth trajectory.

[0023] The c i Time consistency value for each customer Sort in descending order and select the time consistency value that ranks in the last 1 / 4-1 / 2 place The corresponding trajectory point is used as the trajectory point to be completed, and one of the first Q trajectory points of the trajectory point to be completed is randomly selected to replace the trajectory point.

[0024] The spatial distribution of the trajectory is calculated using formulas (4) and (5):

[0025]

[0026]

[0027] in, Indicates the c i The spatial consistency value of the h-th trajectory of a customer. Indicates the c i The spatial consistency value of each client. (x j ,y j ) and (x j+1 ,y j+1 ) represent the coordinates of adjacent points.

[0028] The ci Spatial consistency value for each client Sort in descending order and select the spatial consistency value in the last 1 / 4-1 / 2 position The corresponding trajectory point is used as the trajectory point to be completed, and one of the first Q trajectory points of the trajectory point to be completed is randomly selected to replace the trajectory point.

[0029] As an improvement, the local model parameters obtained by S22 are and The specific steps are as follows:

[0030] Initialize c i The recommendation model in the client where the cth customer is located is then input into the customer trajectory in the enhanced customer trajectory dataset i Recommended models in the client of customers:

[0031]

[0032] in, It is c i The local model parameters on the client side of the client, x i and i are the input and label of sample i, L is the loss function, is The model output function below. express is the gradient of , η is the learning rate, and λ is the regularization factor.

[0033] Calculate the sample entropy to measure the spatiotemporal consistency of its data and obtain

[0034]

[0035] Among them, U i represents the ith subsequence, and r represents the threshold parameter. Γ(x) is a step function that takes the value 1 when x ≥ 0 and takes the value 0 otherwise. ||U i -U i+1 ||is U i and U i+1 The Euclidean distance between h It is an intermediate variable and has no practical meaning.

[0036]

[0037] in, It is c i The spatiotemporal consistency of each client.

[0038] As an improvement, in S23, the server receives all The specific steps for clustering clients are as follows:

[0039]

[0040]

[0041]

[0042] The k-dimensional data refers to the k-th feature of the client data. yes and The difference between k is the variance of the k-th dimension data. Indicates the c i Client c i and c j The similarity of the client of each customer on the k-th dimension data. STS(c i ,c j ) is the c i Client c i and c j The spatiotemporal similarity of the client where each client is located. k is the parameter of the k-th dimension data, ||c j -μ i || 2 Indicates the c j The client where the customer is located and the cluster center μ i (c i ) is the square of the Euclidean distance between them.

[0043] As an improvement, the S25 calculates the edge model parameters and edge spatiotemporal consistency value The specific steps are as follows:

[0044]

[0045]

[0046] Where b represents the number of clients included in the edge, w j is the weight of the j-th client.

[0047] As an improvement, the global model parameter θ is obtained in S27 G The specific steps are:

[0048] When all and When uploaded to the server, the server will perform weighted global aggregation according to formula (10) to obtain the global model parameters θG .

[0049] Compared with the prior art, the present invention has at least the following advantages:

[0050] The method of the present invention can significantly improve the performance of the recommendation model and optimize model convergence while protecting user privacy and security, thereby achieving faster client update response speed under federated learning. The present invention is verified by experiments: trajectory completion can make the trajectory more complete and continuous, which is conducive to model convergence and performance improvement. Weighted aggregation can effectively reduce the negative impact of poor client parameter quality, which is beneficial to performance and speed. Client clustering can aggregate and update clients by cluster, which is helpful to mine common information between similar clients and improve model performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 A simplified logic diagram of the method of the present invention.

[0052] Figure 2 A simplified diagram of the trajectory completion steps.

[0053] Figure 3 The abbreviations in the figure include: spatiotemporal consistency (STC), local model parameters (LMP), edge model parameters (EMP), and server model parameters (GMP).

[0054] Figure 4 The abbreviations in the figure include spatiotemporal consistency (STC), spatiotemporal similarity (STS), clustering result (CR), local model parameter (LMP), edge model parameter (EMP) and global model parameter (GMP).

[0055] Figure 5 The main tasks of the server are as follows. The abbreviations in the figure include, spatiotemporal consistency (STC), spatiotemporal similarity (STS), clustering result (CR), edge model parameter (EMP) and global model parameter (GMP).

[0056] Figure 6 The performance improvement speed of SASREC and SSEPT under different federation settings is shown in the figure. Figure 6 (a)- Figure 6 (c) shows the performance changes of SASREC on the NYC, TKY and GOWALLA datasets respectively. Figure 6 (d)- Figure 6 (f) shows the performance changes of SSEPT on the NYC, TKY and GOWALLA datasets respectively. DETAILED DESCRIPTION

[0057] The present invention is described in further detail below.

[0058] Define the privacy protection of mobile trajectory data and represent the trajectory dataset as D = D1, D2, ..., D n , where D i =(u i , p i , t i , l i ) represents the trajectory data of the i-th user, u i is the user ID, p i is the point of interest (POI), t i is the timestamp, l i is the geographic location of the trajectory point. Since the user's historical trajectory is highly coupled in time and space, exploring the spatiotemporal consistency of the trajectory can help the model better understand the user's interests and improve the accuracy and efficiency of recommendation. Spatiotemporal consistency STC←f(d(t i , t i+1 ), d(l i , l i+1 )) is a metric calculated based on the time and space labels in the trajectory dataset, which is used to measure the consistency of the temporal and spatial distribution of trajectory data.

[0059] Based on the trajectory dataset D, the multi-objective optimization function F(D) simultaneously considers the objectives of privacy protection, recommendation performance, and convergence speed. In order to achieve multi-objective optimization, a function is used to represent F(D), as shown in (1).

[0060] F(D)=F(f prv (D), f pfm (D), f spd (D)) (1)

[0061] f prv The goal of (D) is to protect user privacy and reduce the risk of privacy leakage by measuring privacy risks and protecting user privacy when processing user data. pfm (D)←max(Recalli(D)),f pfm The goal of (D) is to improve the recommendation accuracy by measuring the recall rate of each user i based on the dataset D. spd (D)←min(loss(D,t i , l i )),f spd The goal of (D) is to calculate the recommendation result and user u i The error between the actual behavior of the model can be reduced to accelerate convergence. By reducing the error, the convergence speed of the model can be increased, thereby improving the real-time performance of the recommendation system.

[0062] Therefore, the main purpose of the present invention is to optimize the multi-objective function F(D) to protect user privacy, improve recommendation performance and increase the model convergence speed of the joint mobile recommendation system.

[0063] A federated learning recommendation method based on spatiotemporal consistency in a mobile environment includes the following steps:

[0064] S1: Trajectory completion: Trajectory completion is to complete the user's trajectory using the spatiotemporal distribution of the trajectory, so as to help the model capture more useful information with less data.

[0065] S2: Build and train the SCFL framework, which includes clients, edge devices, and servers. The main work of the client is to calculate the spatiotemporal consistency of the trajectory, use local data for training, and upload the trained local model parameters. The main work of the edge device includes clustering clients, using public data for training, and serving as a parameter cache to respond to client update requests. The server performs global aggregation and updates all clients and edges.

[0066] The recommendation model used by the SCFL framework is a sequential recommendation model, such as SASREC or SSEPT.

[0067] S21: Use the method in S1 to complete the customer trajectory to obtain enhanced customer trajectory data;

[0068] S22: Use the enhanced customer trajectory data to train the client's recommendation model to obtain local model parameters At the same time, the time and space consistency value of the client is obtained When calculated When the client encrypts it using homomorphic encryption, it then The two outputs from the client include the spatiotemporal consistency value and the model parameters that have been trained locally STCci will first be transmitted to the server to guide the client clustering, and then according to the clustering results Transmitted to the corresponding edge node.

[0069] S23: All Encrypted and uploaded to the server, the server receives all The clients are clustered, and the server broadcasts the clustering results to all clients and edge terminals. A cluster after clustering corresponds to one edge terminal.

[0070] S24: All clients set their local model parameters and Upload to the corresponding edge end;

[0071] S25: Each edge end receives and Perform weighted aggregation to obtain the edge model parameters of the edge end and the edge spatiotemporal consistency value at the edge

[0072] S26: Obtain a public data set, use the method in S1 to complete the trajectories in the public data set to obtain an enhanced public data set, and use the enhanced public data set to train the edge recommendation model to obtain new edge model parameters The training process is the same as that of the recommended model in S22.

[0073] S27: and Upload to the server, the server receives Perform global model aggregation to obtain the server's global model parameter θ G , and the server will θ G After broadcasting to all edge terminals and all clients, it returns to S21 to start the next iteration.

[0074] When the iteration reaches the maximum number of iterations, the training is stopped and the optimal SCFL framework is obtained.

[0075] S3: For a user on a client, obtain the user's trajectory, and use the method in S1 to complete the trajectory, and then input the user's trajectory after trajectory completion into the corresponding client sequential recommendation model (at this time, the sequential recommendation model is already the optimal sequential recommendation model), and the output is the predicted next point of interest of the user.

[0076] Specifically, the specific steps of trajectory completion in S1 are as follows:

[0077] In order to improve the ability of the local model to capture user preferences with less data, the present invention uses the spatiotemporal consistency of the trajectory to complete the trajectory so that the local model has a chance to obtain more user information. Figure 2 Schematic diagram showing the trajectory completion method. We sequentially compute the temporal and spatial distributions by interpolating trajectory points to fill in the missing positions to obtain a more spatiotemporally consistent trajectory.

[0078] The temporal consistency of the trajectory is calculated using formulas (2) and (3):

[0079]

[0080]

[0081] in, Indicates the c iThe temporal consistency value of the h-th trajectory of a customer. Indicates the c i The time consistency value of each client. i -th number of trajectories in the client. t j represents the time label of the jth trajectory point, Represents the average value of all track point time labels. h Represents the number of trajectory points in the hth trajectory.

[0082] The c i Time consistency value for each customer Sort in descending order and select the time consistency value that ranks in the last 1 / 4-1 / 2 place The corresponding trajectory point is used as the trajectory point to be completed, and one of the first Q trajectory points of the trajectory point to be completed is randomly selected to replace the trajectory point.

[0083] The spatial distribution of the trajectory is calculated using formulas (4) and (5):

[0084]

[0085]

[0086] in, Indicates the c i The spatial consistency value of the h-th trajectory of a customer. Indicates the c i The spatial consistency value of each client. (x j ,y j ) and (x j +1,y j +1) represent the coordinates of adjacent points.

[0087] The c i Spatial consistency value for each client Sort in descending order and select the spatial consistency value in the last 1 / 4-1 / 2 position The corresponding trajectory point is used as the trajectory point to be completed, and one of the first Q trajectory points of the trajectory point to be completed is randomly selected to replace the trajectory point.

[0088] Specifically, the main tasks of the client include trajectory completion, spatiotemporal consistency calculation, local model training, and uploading and updating local model parameters. Figure 3 .

[0089] The S22 obtains the local model parameters and The specific steps are as follows:

[0090] Initialize c iThe recommendation model in the client where the cth customer is located is then input into the customer trajectory in the enhanced customer trajectory dataset i Recommended models in the client of customers:

[0091]

[0092] in, It is c i The local model parameters on the client side of the client, x i and i are the input and label of sample i, L is the loss function, is The model output function below. express is the gradient of , η is the learning rate, and λ is the regularization factor, which aims to prevent overfitting.

[0093] Calculate the sample entropy to measure the spatiotemporal consistency of its data and obtain

[0094]

[0095] Among them, u i represents the ith subsequence, and r represents the threshold parameter. T(x) is a step function that takes the value 1 when x ≥ 0 and takes the value 0 otherwise. ||U i -U i+1 ||is U i and U i+1 The Euclidean distance between h It is an intermediate variable with no practical meaning. However, other distance metrics can also be used. If the distribution between trajectory points is more consistent, then C h The value of will be smaller.

[0096]

[0097] in, It is c i The spatiotemporal consistency of each client.

[0098] Specifically, the main tasks of the server include client similarity calculation, client clustering, global parameter aggregation, and updating clients and edge nodes. Please refer to Figure 5 Specifically, the server will first calculate the similarity of all clients based on their spatiotemporal consistency values ​​to guide client clustering. When all edge models are uploaded, the server will perform global aggregation. After obtaining the updated global model parameters, the server will return them to all clients and edges and start the next global iteration.

[0099] The server will decrypt all The spatiotemporal similarity of all clients is calculated using formulas (11) and (12). After calculating STS, the server clusters all clients using formula (13) to obtain clustering results. The clustering results are then sent back to all clients and edge devices.

[0100] In S23, the server receives all The specific steps for clustering clients are as follows:

[0101]

[0102]

[0103]

[0104] The k-dimensional data refers to the k-th feature of the client data. yes and The difference between k is the variance of the k-th dimension data. Indicates the c i Client c i and c j The similarity of the client of each customer on the k-th dimension data. The closer it is to 1, the higher the spatiotemporal consistency of the two clients on the k-th dimension data. i , c j ) is the c i Client c i and c j The spatiotemporal similarity of the client where each client is located. k is the parameter of the k-th dimension data, reflecting its impact on client similarity. ||c j -μ i || 2 Indicates the c j The client where the customer is located and the cluster center μ i (c i The goal of clustering is to find a set of cluster centers so that the distance between clients assigned to each cluster center is minimized.

[0105] Specifically, the main tasks of edge computing include weighted aggregation of local model parameters, edge model training, and transmission of edge model parameters to clients and servers, see Figure 4 The edge will be based on Aggregate client parameters to obtain edge models. Then, train the edge model with a public dataset to obtain updated edge model parameters. The edge model parameters will be updated in a timely manner to meet the client's response time requirements. At the same time, the edge will wait for other edges to complete training and upload their edge model parameters to the server for global aggregation, and assist in updating the global model parameters on the client.

[0106] The S25 calculates the edge model parameters and edge spatiotemporal consistency value The specific steps are as follows:

[0107]

[0108]

[0109] Where b represents the number of clients included in the edge, and their spatiotemporal consistency values ​​are w j is the weight of the j-th client.

[0110] Specifically, the global model parameter θ is obtained in S27 G The specific steps are:

[0111] When all and STCe i When uploaded to the server, the server will perform weighted global aggregation according to formula (10) to obtain the global model parameters θ G .

[0112] The more consistent the spatiotemporal distribution of edge model parameters is, the greater their weight in global aggregation, which can alleviate the drift problem of the global model. The server will then update θ G .

[0113] Experimental Evaluation

[0114] The benchmarks used in the experiments include five federated learning frameworks: FedSGD, FedAVG, FedAVGM, FedMA, and FedPROX.

[0115] FedSGD uses a stochastic gradient descent algorithm to train each client, and then the server aggregates the updated gradients of all clients to obtain the gradient of the server model. FedAVG adds data volume weights when aggregating the model parameters of the clients, giving a higher proportion to clients with larger data. FedAVGM aims to solve the problem of performance degradation caused by significant harmful differences in distributed data. FedMA is a federated learning framework for convolutional neural networks that builds a shared global model by matching and averaging hidden elements. FedPROX adds a proximal term penalty on the basis of FedAVG to improve the robustness of the model and reduce communication delays and losses between different devices.

[0116] 1. Model and Dataset

[0117] To comprehensively evaluate the proposed SCFL and benchmarks, we use the self-attention based sequential recommendation model (SASREC) and the random shared embedding model (SSEPT) for training and testing. The datasets used for training and testing in the present invention are NYC, TKY and GOWALLA, which are public datasets commonly used in the field of mobile recommendation. NYC and TKY are two datasets based on Foursquare, containing check-in records of users in New York and Tokyo. The NYC dataset has 1,083 users, 38,333 POIs, and 227,428 check-ins. The TKY dataset has 2,296 users, 57,339 POIs, and 573,703 check-ins. GOWALLA contains check-in records of users worldwide, with 4,807 users, 5,937,917 POIs, and 1,048,577 check-ins.

[0118] 2. Indicators

[0119] We use evaluation metrics including NDCG@k and HR@k, where the values ​​of k include 5, 10, and 20. In the field of mobile recommendation, NDCG@k and HR@k are commonly used evaluation metrics to evaluate the performance of recommendation systems. NDCG, short for Normalized Discounted Cumulative Gain, is a metric used to evaluate ranking results and measure the difference between the ranking list and the user's true interests. HR, short for Hit Rate, is a metric used to evaluate whether the recommendation results contain items that users actually interact with.

[0120] 3. Parameter settings

[0121] The specific hyperparameters of the experiment are shown in Table I. STD represents the centralized training process, and SCFL represents the training process under spatiotemporal consistency federated learning.

[0122] Table 1 Hyperparameters used in the experiments

[0123]

[0124] 4. Global model performance test

[0125] To verify the performance superiority of the global model under SCFL and the baseline, we use the NYC, TKY and GOWALLA datasets to train SASREC and SSEPT models under different federated learning frameworks for experiments. The performance of the global model is shown in Table 2. It can be seen that STD has the best performance, while the performance of the recommendation model under federated learning is slightly reduced. The "improvement" in the table refers to the performance improvement of the SCFL model compared with the best baseline.

[0126] In all three datasets, SCFL significantly improves model performance, especially in the GOWALLA dataset, where the server model performance under the SCFL framework is improved by an astonishing 80%. This is because the unenhanced GOWALLA data has the worst spatiotemporal consistency, highlighting the necessity of optimizing spatiotemporal consistency. In addition to the significant improvement in the GOWALLA dataset, the SCFL framework also has a huge impact on model optimization in the NYC and TKY datasets. In the NYC and TKY datasets, the optimization of spatiotemporal consistency brings the server model performance close to the STD model, indicating that SCFL effectively alleviates the problem of performance degradation of recommendation models in federated learning.

[0127] 5. Performance improvement speed

[0128] The faster the model performance improves, the less user waiting time. Therefore, reducing the model training time of the mobile recommendation system can further improve the efficiency of federated learning and user experience. We use NDCG@20 as the evaluation metric and record the performance changes of SASREC and SSEPT on the NYC, TKY, and GOWALLA datasets.

[0129] All experimental results show that SCFL's model performance improves much faster than Baselines and has higher final performance. Figure 6 (a)- Figure 6 (d) It can be seen that at the second global iteration (200 epochs), the performance of SCFL is much higher than that of the eighth global iteration (800 epochs) of Baselines. The experimental results fully prove that SCFL is very helpful in improving model performance, which can be reflected in both the speed of model performance improvement and the absolute value. Faster performance improvement means that the recommendation model under federated learning can achieve better performance in less training time.

[0130] 6. Analysis

[0131] According to the experimental results shown in Table 2, we can observe that in all scenarios, the SCFL method based on spatiotemporal consistency outperforms the baseline method, with the maximum improvement of 25.57% in the New York dataset, 11.63% in the Tokyo dataset, and 84.26% in the GOWALLA dataset. Figure 6 In the 2018 dataset, SCFL’s performance improved significantly faster than the baseline method. For example, in all six scenarios, SCFL’s performance in the second global iteration was better than that of the baseline method in the eighth global iteration.

[0132] Table 2 Performance test results of SASREC and SSEPT under different federation settings

[0133]

[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.

Claims

1. A federated learning recommendation method based on spatiotemporal consistency in a mobile environment, characterized in that: The steps include: S1: trajectory completion, which is to complete the user's trajectory using the spatiotemporal distribution of the trajectory; S2: Build and train the SCFL framework, which includes a client, an edge, and a server. The recommendation model used by the SCFL framework is a sequential recommendation model. S21: Use the method in S1 to complete the customer trajectory to obtain enhanced customer trajectory data; S22: Use the enhanced customer trajectory data to train the client's recommendation model to obtain local model parameters At the same time, the time and space consistency value of the client is obtained S23: All Encrypted and uploaded to the server, the server receives all The clients are clustered, and the server broadcasts the clustering results to all clients and edge terminals. A cluster after clustering corresponds to one edge terminal. S24: All clients set their local model parameters and Upload to the corresponding edge end; S25: Each edge end receives and Perform weighted aggregation to obtain the edge model parameters of the edge end and the edge spatiotemporal consistency value at the edge S26: Obtain a public data set, use the method in S1 to complete the trajectories in the public data set to obtain an enhanced public data set, and use the enhanced public data set to train the edge recommendation model to obtain new edge model parameters S27: and Upload to the server, the server receives Perform global model aggregation to obtain the server's global model parameter θ G , and the server will θ G After broadcasting to all edge terminals and all clients, return to S21 to start the next iteration; When the iteration reaches the maximum number of iterations, the training is stopped and the optimal SCFL framework is obtained; S3: For a user on a client, obtain the user's trajectory, and use the method in S1 to complete the trajectory, and then input the user's trajectory after trajectory completion into the corresponding client sequential recommendation model, and the output is the predicted next point of interest of the user.

2. The method for recommending federated learning based on spatiotemporal consistency in a mobile environment according to claim 1, characterized in that: The specific steps of trajectory completion in S1 are as follows: The temporal consistency of the trajectory is calculated using formulas (2) and (3): in, Indicates the c i The time consistency value of the h-th trajectory of a customer, Indicates the c i The time consistency value of a customer, H represents c i - the number of trajectories in the th client, t j represents the time label of the jth trajectory point, represents the average value of all trajectory point time labels, n h represents the number of trajectory points in the h-th trajectory; The c i Time consistency value for each customer Sort in descending order and select the time consistency value that ranks in the last 1 / 4-1 / 2 place The corresponding trajectory point is used as the trajectory point to be completed, and one of the first Q trajectory points of the trajectory point to be completed is randomly selected to replace the trajectory point; The spatial distribution of the trajectory is calculated using formulas (4) and (5): in, Indicates the c i The spatial consistency value of the h-th trajectory of a customer, Indicates the c i The spatial consistency value of each client, (x j ,y j ) and (x j+1 ,y j+1 ) represent the coordinates of adjacent points respectively; The c i Spatial consistency value for each client Sort in descending order and select the spatial consistency value in the last 1 / 4-1 / 2 position The corresponding trajectory point is used as the trajectory point to be completed, and one of the first Q trajectory points of the trajectory point to be completed is randomly selected to replace the trajectory point.

3. The method for recommending federated learning based on spatiotemporal consistency in a mobile environment according to claim 2, characterized in that: The S22 obtains the local model parameters and The specific steps are as follows: Initialize c i Then, the customer trajectory in the enhanced customer trajectory dataset is input into the cth customer’s client. i Recommended models in the client of customers: in, It is c i The local model parameters on the client side where the client is located, x i and i are the input and label of sample i, L is the loss function, is The model output function is: express The gradient of , η is the learning rate, and λ is the regularization factor; Calculate the sample entropy to measure the spatiotemporal consistency of its data and obtain Among them, U i represents the ith subsequence, r represents the threshold parameter, Γ(x) is a step function, which takes the value 1 when x ≥ 0 and takes the value 0 otherwise, ||U i -U i+1 ||is U i and U i+1 The Euclidean distance between h It is an intermediate variable with no practical meaning; in, It is c i The spatiotemporal consistency of each client.

4. The method for recommending federated learning based on spatiotemporal consistency in a mobile environment according to claim 3, characterized in that: In S23, the server receives all The specific steps for clustering clients are as follows: Among them, k-dimensional data refers to the k-th feature of the client data. yes and The difference between k is the variance of the k-th dimension data, Indicates the c i Client c i and c j The similarity of the client of each customer on the k-th dimension data, STS(c i ,c j ) is the c i Client c i and c j The spatiotemporal similarity of the client where each customer is located, ξ k is the parameter of the k-th dimension data, ||c j -μ i || 2 Indicates the c j The client where the customer is located and the cluster center μ i (c i ) is the square of the Euclidean distance between them.

5. The method for recommending federated learning based on spatiotemporal consistency in a mobile environment according to claim 4, characterized in that: The S25 calculates the edge model parameters and edge spatiotemporal consistency value The specific steps are as follows: Where b represents the number of clients included in the edge, w j is the weight of the j-th client.

6. The method for recommending federated learning based on spatiotemporal consistency in a mobile environment according to claim 5, characterized in that: The global model parameter θ is obtained in S27 G The specific steps are: When all and STCe i When uploaded to the server, the server will perform weighted global aggregation according to formula (10) to obtain the global model parameters θ G .

Citation Information

Patent Citations

  • Federal learning method oriented to mobile recommendation and based on semantics

    CN117648995A