A trajectory data preparation method based on federated learning
By introducing a trajectory knowledge enhancer and a privacy autoencoder into the federated learning framework, combined with a small language model and a parallel optimization module, the problems of privacy protection and training efficiency in trajectory data preparation are solved, and efficient trajectory data preparation is achieved.
Patent Information
- Application Number
- CN202511544914.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2045-10-28
AI Technical Summary
In the framework of trajectory data preparation for federated learning, how to protect trajectory data privacy, develop large language models for trajectory data preparation, and improve training efficiency, especially when client computing resources are limited?
We design a trajectory data preparation method based on federated learning, which protects data privacy by using a trajectory knowledge enhancer and a trajectory privacy autoencoder, performs local data preparation through a small language model, and improves training efficiency by employing a secret-sharing distributed aggregation method and a federated parallel optimization module.
It enables the protection of trajectory data privacy in a federated environment, improves the training efficiency of trajectory data preparation and the learning ability of models, and reduces the burden of data transmission and computing resources.
Smart Images

Figure CN121009585B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of trajectory data preparation, and particularly relates to a trajectory data preparation method based on federated learning. BACKGROUND
[0002] Trajectory data is usually represented as a sequence of spatio-temporal points describing the motion of objects (e.g., people and vehicles), and GPS (Global Positioning System) and location-based services have led to the generation of a large amount of trajectory data, thus enabling various analysis applications, including route planning, crowd clustering, and traffic prediction.
[0003] However, due to sensor failures, limited device precision, and transmission interruptions, trajectory data is often plagued by serious quality problems, resulting in inconsistent data, noise, and missing values, which weakens the reliability of trajectory analysis and limits its practical application. In order to solve these problems, trajectory data preparation, including preprocessing and data mining operations such as data imputation, map matching, trajectory-user linking, anomaly detection, and trajectory recovery, has become a key to improving data quality before analysis and application.
[0004] Federated learning is a privacy-preserving distributed learning paradigm that has been widely applied in urban computing and traffic management to address privacy issues. Federated learning enables multiple clients (i.e., regions) to collaboratively train models on a server while keeping data decentralized, thus protecting the privacy of each client. This approach helps to address privacy protection and data security issues while also enabling the full utilization of region-specific information to improve trajectory data quality.
[0005] In summary, there is an urgent need in the academic and industrial communities for a trajectory data preparation method and device based on federated learning. During the design and implementation of the technical solution of the present application, we have found at least the following problems and deficiencies in the prior art:
[0006] First, how to protect the privacy of trajectory data in the framework of federated learning trajectory data preparation. Trajectory data preparation tasks usually need to consider the context of data, which involves the exchange and sharing of data and requires collaborative processing across clients (i.e., cross-client trajectory data preparation), thus raising privacy concerns.
[0007] Secondly, how to develop a large language model for trajectory data preparation in the federated learning trajectory data preparation framework. Existing large language models are mainly designed for text data. However, trajectory data exhibits unique spatio-temporal characteristics, such as temporal regularity and spatial dependence, which are quite different from text data and are essentially not of concern to large language models. In addition, the pre-training of existing large language models relies heavily on public unsupervised corpora, which only capture general text knowledge. In contrast, the trajectory data preparation task involves complex spatio-temporal relationships and patterns, which are not fully reflected in these corpora, so the performance of large language models on trajectory data preparation tasks is usually poor.
[0008] Finally, how to improve the training efficiency of the federated learning trajectory data preparation framework. Due to the limited computing resources and storage capacity of clients, it is not feasible to directly deploy and train a large language model locally on the client. Therefore, the large language model is usually hosted on a server, and the client needs to transfer its local data to the server for trajectory data preparation processing, which will burden the server with storage and waste the client's computing resources. In addition, large language models usually contain a large number of parameters, and even with techniques such as parameter-efficient fine-tuning, training a large language model for trajectory data preparation is still very time-consuming and resource-intensive. SUMMARY
[0009] In view of the above, the present application provides a trajectory data preparation method based on federated learning, which utilizes the functions of a large language model to achieve trajectory data preparation in a federated environment, protects trajectory data privacy, and improves the training efficiency of federated learning.
[0010] A trajectory data preparation method based on federated learning, comprising the following steps:
[0011] (1) The client obtains trajectory data of a mobile device, each trajectory data being composed of a series of spatio-temporal points, each spatio-temporal point containing a timestamp and latitude and longitude position coordinates;
[0012] (2) For local trajectory data preparation of the client, a trajectory knowledge enhancer is used to generate trajectory data preparation prompts as input for a small language model;
[0013] (3) The trajectory knowledge enhancer uses the output results of each client small language model to enhance trajectory data preparation knowledge to obtain a final result;
[0014] (4) For cross-client trajectory data preparation, a trajectory privacy autoencoder is used to encode trajectory data and transmit the encoded data to the server;
[0015] (5) Freeze the data coming from the client, use the trajectory knowledge enhancer to generate trajectory data preparation prompts as the input of the large language model;
[0016] (6) Decode the results output by the large language model (deployed on the server), freeze the data coming from the server using the federated parallel optimization module, and use the decoding results to enhance the trajectory data preparation knowledge of the trajectory knowledge enhancer to obtain the final results.
[0017] In order to realize the distributed computing of the framework, the trajectory knowledge enhancer in step (2) introduces a small language model, which is a small version of the server large language model, deployed on each client for local trajectory data preparation, to fully utilize the computing resources of the client and reduce the workload of the server; if the data context of the trajectory data preparation of a certain trajectory in the client does not involve the joint processing of data of other clients, the small language model deployed locally is used for trajectory data preparation.
[0018] In order to enhance the learning ability of the small language model, the trajectory knowledge enhancer in step (3) uses the large language model to assist its learning of trajectory knowledge through the trajectory off-site tuning strategy, which is not to directly transfer the trained large language model adapter to the small language model, but to use and train the large language model to enhance the learning ability of the small language model during training.
[0019] Further, the trajectory privacy autoencoder in step (4) encodes the trajectory data using an encoder to obtain corresponding embedding vectors; the client transmits the embedding vectors to the server for aggregation while preserving the spatiotemporal dependencies within and between clients; the server splits and distributes the output results of the large language model to the clients, and the clients reconstruct the estimated trajectory through the decoder. The trajectory privacy autoencoder encodes the trajectory data into spatiotemporal embeddings for transmission instead of sending raw data, which ensures data privacy while preserving the spatiotemporal dependencies required for trajectory data preparation tasks.
[0020] Further, the trajectory privacy autoencoder is implemented using a three-layer NLP (multilayer perceptron) with a GELU (Gaussian Error Linear Unit) activation function.
[0021] Further, a decentralized aggregation method based on secret sharing is used in step (4), which is implemented as follows: first, each client generates a shared key and stores it locally, then divides the parameters of the trajectory privacy autoencoder into multiple parameter blocks; for any client , it uses the key determined with other clients to mask the local parameter block, if , add ; if , subtract ; wherein and are two clients in a client pair, is a shared key of the client pair, i and j are clients and are numbers of the clients holds a raw parameter block aggregated by other clients, and the aggregation result of the mask parameter blocks of all clients is equal to the aggregation result of the raw parameter blocks of all clients;
[0022] Finally, the client obtains the aggregation result of the raw parameter block by aggregating the mask parameter blocks sent by other clients, and broadcasts it to other clients for model updating of the trajectory privacy autoencoder.
[0023] Further, the trajectory knowledge enhancer in step (5) first designs a trajectory instruction paradigm to generate a trajectory data preparation prompt, which includes tasks, data, information, and format; then uses a large language model to assist it in learning trajectory knowledge through a trajectory off-site tuning strategy; further adopts a LoRA (Low Rank Adaptation) sparse tuning strategy to only select the top-ranked layers in the LoRA parameter change rate of the small language model for training; in addition, the trajectory knowledge enhancer develops a bidirectional knowledge learning capability to enhance the trajectory data preparation knowledge of the large language model and the small language model, that is, the output of the small language model is aligned with the high-frequency output of the large language model using reverse KL divergence, so that the small language model learns useful trajectory data preparation knowledge in the complex output space of the large language model, and the output of the large language model is aligned with the overall output of the small language model using forward KL divergence, so that the large language model can learn all the knowledge of the small language model in the original trajectory data. The trajectory knowledge enhancer can help the small language model and the large language model understand the trajectory data and learn the specific knowledge required for the trajectory data preparation task, which enhances the model's ability to learn trajectory data preparation related patterns, while reducing the number of parameters.
[0024] Further, the federated parallel optimization module in step (6) decomposes the federated training between the learning decomposition server and the client by splitting, adopts alternating optimization to minimize data transmission, and accelerates training by parallel execution, the specific implementation manner is as follows:
[0025] S61: Adopting split learning to decompose the federated training process into client and server training, realizing the simultaneous training of the client and the server, the client is responsible for the training of the trajectory privacy autoencoder and the small language model, and the server is responsible for the training of the large language model;
[0026] S62: Freeze the data required by the client and the server respectively using alternating optimization to reduce data transmission; during training, the server freezes the embedding vector uploaded by the client for the training of the large language model, and the client freezes the result output by the large language model in the server for the training of the trajectory privacy autoencoder model and the small language model;
[0027] S63: Use parallel training to optimize multiple objectives in parallel, enhance the parallelism of training; wherein the client focuses on optimizing three objectives: ① minimize the reconstruction loss of the trajectory privacy autoencoder; ② reduce the reverse KL loss between the outputs of the small language model and the large language model; ③ minimize the loss between the output of the small language model and the label; the server focuses on optimizing two objectives: ① minimize the forward KL loss between the outputs of the large language model and the small language model; ② reduce the loss between the output of the large language model and the label.
[0028] A computer device comprising a memory and a processor, the memory having a computer program stored therein, and the processor being configured to execute the computer program to implement the trajectory data preparation method based on federated learning described above.
[0029] A computer-readable storage medium storing a computer program, the computer program being executed by a processor to implement the trajectory data preparation method based on federated learning described above.
[0030] The present application provides a trajectory data preparation method and device based on federated learning. The present application first designs a unified privacy protection framework using federated learning, uses the function of the large language model to realize trajectory data preparation in the federated environment; designs a trajectory privacy autoencoder to ensure data transmission security and protect privacy; introduces a trajectory knowledge enhancer to improve the model learning of the knowledge related to trajectory data preparation, thereby realizing the development of the large language model for trajectory data preparation; proposes federated parallel optimization to improve training efficiency by reducing data transmission and realizing parallel model training. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 The present application is a trajectory data preparation method based on federated learning.
[0032] Figure 2 The present application is a trajectory data preparation method based on federated learning. DETAILED DESCRIPTION
[0033] In order to more specifically describe the present application, the technical solutions of the present application will be described in detail below in conjunction with the drawings and specific embodiments.
[0034] As Figure 1As shown, the trajectory data preparation method based on federated learning of the present application comprises the following steps, and the method is applied in a terminal.
[0035] Step S11: The client obtains trajectory data of a mobile device, wherein each piece of trajectory data is composed of a series of spatiotemporal points, and each spatiotemporal point contains a timestamp, longitude and latitude position coordinates.
[0036] In a transportation system, trajectory data is usually represented as a sequence of spatiotemporal points describing the motion of objects (such as people and vehicles), and the generation of a large amount of trajectory data is caused by GPS and location-based services. By aggregating the trajectory data generated by GPS and location-based services, a series of spatiotemporal points constituting the trajectory data can be obtained, each spatiotemporal point containing a timestamp, longitude and latitude position coordinates.
[0037] Step S12: For local client trajectory data preparation, the trajectory knowledge enhancer generates trajectory data preparation prompts as inputs to the small language model.
[0038] The present application designs a trajectory knowledge enhancer, in order to realize distributed computing of the framework, a small language model is introduced, which is a small version of the server large language model, deployed on each client for local trajectory data preparation, to fully utilize the computing resources of the client and reduce the workload of the server. If the trajectory data preparation data context on the client sub-trajectory does not involve the joint processing of data of other clients, then the local trajectory data preparation is performed using the locally deployed small language model.
[0039] Step S13: The trajectory knowledge enhancer enhances the trajectory data preparation knowledge using the output results of the client small language model to obtain the final results.
[0040] In order to enhance the learning ability of the small language model, the trajectory knowledge enhancer uses the large language model to assist its learning of trajectory knowledge through trajectory off-site tuning, which is not directly transferring the trained large language model adapter to the small language model, but using and training it to enhance the learning ability of the small language model during training.
[0041] Step S14: For cross-client trajectory data preparation, the trajectory privacy autoencoder first encodes the trajectory data and transmits the encoded data to the server, specifically:
[0042] S41: The trajectory privacy autoencoder adopts an encoder-decoder architecture to respectively encode the trajectory data and embed the vector , wherein each spatiotemporal point is independently encoded as .
[0043] S42: The embedding of the client is transmitted to the server for aggregation while preserving the spatio-temporal dependencies within and across clients, which helps large language models capture the spatio-temporal relationships in trajectory data.
[0044] S43: The server splits and distributes the output results of the large language model to the clients, where the estimated trajectories are reconstructed by the client decoders wherein .
[0045] Here, the trajectory privacy autoencoder is implemented as a three-layer NLP with GELU (Gaussian Error Linear Unit) activation function, with embedding and hidden layer dimensions set to 32 and 256, respectively.
[0046] However, using only the embedding for transmission does not completely protect the data privacy in federated learning, because an attacker can recover the original data by performing embedding and gradient inversion attacks during the trajectory privacy autoencoder model aggregation. In contrast, the present application proposes a secret sharing-based decentralized aggregation method to achieve secure trajectory privacy autoencoder aggregation without affecting efficiency or accuracy, with the specific process as follows:
[0047] First, each client generates a shared key and stores it locally, respectively. Next, the trajectory privacy autoencoder parameters are divided into parameter blocks . For aggregation, the client uses the key determined with other clients to mask its parameter block. If , then is added, and if , then is subtracted:
[0048]
[0049] wherein: the client holds the parameter block aggregated by the client , and is the masked parameter block.
[0050] Given the masked parameter blocks from all clients, their aggregated results are equal to the aggregated results of all clients' original parameter blocks , which are represented as follows:
[0051]
[0052] Accordingly, the client The parameter block can be obtained by aggregating each mask parameter block sent by the client :
[0053]
[0054] Finally, the aggregated parameter block is broadcast to the client for trajectory privacy autoencoder model update.
[0055] Step S15: The federated parallel optimization module freezes the data sent from the client, and the trajectory knowledge enhancer generates a trajectory data preparation prompt as input for the large language model, specifically:
[0056] S51: In order to help the small language model and the large language model understand the trajectory data and learn the trajectory data preparation knowledge, the trajectory knowledge enhancer designs a trajectory instruction paradigm to generate the trajectory data preparation prompt. Specifically, the generated trajectory data preparation prompt is defined as task, data, information, format:
[0057] The task represents a text instruction composed of a task name and a task description.
[0058] The data represents the input trajectory data, which can be the trajectory data for the small language model for local trajectory data preparation , or the embedding for the large language model for cross-client trajectory data preparation .
[0059] The information represents optional trajectory context (such as road network, weather) from public sources such as OpenStreetMap (OpenStreetMap) and weather services, to enhance the model's ability to perform trajectory data preparation tasks.
[0060] The format represents the output format specific to the task, such as the classification results of the trajectory data preparation task (including anomaly detection, trajectory-user linkage, and travel mode identification), the trajectories of the trajectory data preparation task (including trajectory induction, noise filtering, trajectory simplification, trajectory segmentation, map matching, and trajectory recovery), and the spatiotemporal points of the stay point detection task.
[0061] S52: In order to enhance the learning ability of the small language model, the trajectory knowledge enhancer uses the large language model to assist its learning of trajectory knowledge through trajectory fine-tuning. Specifically, the large language model is divided into two parts, represented as where is the last few layers of the large language model, used to optimize the general features of a specific task, thereby realizing feature mapping and decision-making for the specific task, and the base is the part of the large language model other than The remaining layers, except for the last few layers, are used to extract and encode general data patterns, converting the raw input into a meaningful representation.
[0062] Initially, the adapter of the server is scheduled to the client as the last few layers to be integrated into the client small language model, whereby the small language model consists of two components, denoted as , where is the base of the small language model. Subsequently, the small language model reduces the number of parameters in the adapter using LoRA, and then transmits the fine-tuned adapter to the server for aggregation and updating, which is not directly transferring the adapter of the trained large language model to the small language model, but utilizing and training it to enhance the learning ability of the small language model during training.
[0063] S53: In order to reduce the training parameters, the trajectory knowledge enhancer proposes LoRA sparse tuning, according to the research on sparsity, the larger the parameter change, the greater the contribution to the convergence of the model. Therefore, only the layers with the top m percent of LoRA parameter change rate in the small language model are selected for training, specifically, the client calculates the ratio of the LoRA parameter change rate of each layer to all global LoRA parameter change rates:
[0064]
[0065] where: N is the number of layers, is the LoRA parameter change rate of the r th layer in the th round of training:
[0066]
[0067] Next, randomly select layers to participate in the next round of training, where .
[0068] Given the ratio r of the th layer in the th round of training and the number of layers to be trained , the probability of the next round of training layers is , as follows:
[0069]
[0070] Accordingly, the training layers are selected according to the probability of each round of training; finally, the client uploads the LoRA parameters of the training layers to the server for aggregation, and the server assigns different weights to the parameters according to the number of clients involved in the training of these layers, as follows:
[0071]
[0072] wherein: is the client j number of layers in the training round r sent LoRA parameters of the layer, is the LoRA parameter aggregated in the first r layer of the training round , number of clients training r the layer in the training round , is the number of data used for training in the client .
[0073] S54: In order to improve the learning ability of the small language model and the large language model, the trajectory knowledge enhancer develops a bidirectional knowledge learning ability to enhance their trajectory data preparation knowledge.
[0074] Specifically, in order to let the small language model learn useful trajectory data preparation knowledge in the complex output space of the large language model, it uses the reverse KL divergence to align the output of the small language model with the high-frequency output of the large language model, as follows:
[0075]
[0076] wherein: and are the output distributions of the small language model and the large language model, respectively.
[0077] In addition, since the small language model can access the original trajectory data, it uses the forward KL divergence to align the output of the large language model with the overall output of the small language model, which enables the large language model to learn the full knowledge of the small language model in the original trajectory data, as follows:
[0078]
[0079] Step S16: The trajectory data preparation decoding server outputs the results of the large language model, the federal parallel optimization module freezes the data transmitted from the server, and the trajectory knowledge enhancer enhances the trajectory data preparation knowledge through the decoding results to obtain the final results.
[0080] S61: Adopting split learning to decompose the federal training process into client and server training, realizing the simultaneous training of client and server, the client is responsible for the training of the trajectory privacy automatic encoder model (i.e. encoder and decoder) and the small language model, while the server is responsible for the management of the training of the large language model.
[0081] S62: Freeze the data required by the client and server respectively using alternating optimization to reduce data transmission. During training, the server freezes the embeddings uploaded by the client for the training of the large language model, while the client freezes the results output by the server's large language model for the training of the trajectory privacy autoencoder model and the small language model.
[0082] S63: Use parallel training to optimize multiple objectives in parallel, enhance the parallelism of training, and the client focuses on optimizing three objectives: ① Minimize the reconstruction loss of the trajectory privacy autoencoder model; ② Reduce the reverse KL loss between the outputs of the small language model and the large language model; ③ Minimize the loss between the output of the small language model and the label. The server has two optimization objectives: ① Minimize the forward KL loss between the outputs of the large language model and the small language model; ② Reduce the loss between the output of the large language model and the label.
[0083] Since there are various trajectory data preparation tasks to be solved, the present application proposes a multi-task training strategy to enhance the learning and generalization ability of the model. Specifically, a trajectory data set suitable for most trajectory data preparation tasks is prepared, and labels are constructed for each task; in the training phase, multiple trajectory data preparation tasks are performed on the same trajectory data input, the loss of each task is calculated, and the model is jointly optimized, which is represented as follows:
[0084]
[0085] Wherein: is the loss of the trajectory data preparation task .
[0086] In the training of the server, the input is the training round, and for each training round r , it starts to obtain the frozen state f , if f is not frozen, the server obtains the trajectory embeddings E from the client and concatenates them, or freezes the local trajectory r in the last training round E -1; then, the server uses the trajectory knowledge enhancer to construct the trajectory data preparation prompt for the large language model and obtains the output o ; finally, if f is not frozen, the server splits it into several parts and sends them to the corresponding client.
[0087] In the training of the client, the input is the training round and the server, and for each training round r , it starts to obtain the trajectory data D and the frozen state f , if f is not frozen, the client willD Encode into an embedding vector and send to the server; then, the client uses the trajectory knowledge enhancer to build a prompt for the small language model and get the output ; if f is not frozen, the client gets the output of the large language model from the server o and decodes it, or it freezes the local r at the last round o -1; finally, the client calculates the final result between and o using the trajectory data enhancer.
[0088] The embodiment also provides an electronic device including a processor, a memory, a network interface, an internal bus, etc., and the memory stores corresponding programs. When the programs are executed by the processor, the processor implements the trajectory data preparation method based on federated learning described above. As Figure 2 shown is a hardware structure of any data processing capable device on which a trajectory data preparation method based on federated learning provided by the embodiment is located. In addition to the processor, the memory, and the network interface shown in Figure 2 , any data processing capable device on which the device in the embodiment is usually located according to the actual function of the data processing capable device, and can also include other hardware. This will not be described again.
[0089] Correspondingly, the embodiment also provides a computer readable storage medium having computer instructions stored thereon. When the instructions are executed by the processor, the trajectory data preparation method based on federated learning described above is implemented. The computer readable storage medium can be an internal storage unit of any data processing capable device, such as a hard disk or a memory. The computer readable storage medium can also be an external storage device, such as a plug-in hard disk, a smart memory card, an SD card, a flash memory card, etc. Further, the computer readable storage medium can include both the internal storage unit of any data processing capable device and the external storage device. The computer readable storage medium is used to store computer programs and other programs and data required by any data processing capable device, and can also be used to temporarily store data that has been output or will be output.
[0090] The above description of the embodiments is to facilitate those of ordinary skill in the art to understand and apply the present application. Those skilled in the art can easily make various modifications to the above embodiments, and apply the general principles described herein to other embodiments without inventive labor. Therefore, the present application is not limited to the above embodiments, and any improvements and modifications of the present application made by those skilled in the art according to the disclosure of the present application shall be within the scope of protection of the present application.
Claims
1. A trajectory data preparation method based on federated learning, characterized in that, Comprise the following steps: (1) The client obtains the trajectory data of the mobile device, each trajectory data is composed of a series of spatiotemporal points, each spatiotemporal point contains a timestamp and latitude and longitude position coordinates; (2) For local trajectory data preparation of the client, the trajectory knowledge enhancer generates trajectory data preparation prompts as the input of the small language model; (3) The trajectory knowledge enhancer enhances the trajectory data preparation knowledge by using the output results of each client small language model to obtain the final results; (4) For cross-client trajectory data preparation, the trajectory privacy autoencoder encodes the trajectory data and transmits the encoded data to the server; (5) Freeze the data from the client, use the trajectory knowledge enhancer to generate trajectory data preparation prompts as the input of the large language model; (6) Decode the output results of the large language model, use the federated parallel optimization module to freeze the data from the server, and the trajectory knowledge enhancer enhances the trajectory data preparation knowledge to obtain the final results. 2.The trajectory data preparation method based on federated learning according to claim 1, characterized in that: In order to realize the distributed computing of the framework, the trajectory knowledge enhancer in step (2) introduces a small language model, which is a small version of the server large language model, deployed on each client for local trajectory data preparation, to fully utilize the computing resources of the client and reduce the workload of the server; If the data context of the trajectory data preparation of a certain trajectory in the client does not involve the joint processing of the data of other clients, the small language model deployed locally is used for trajectory data preparation. 3.The trajectory data preparation method based on federated learning according to claim 1, wherein: In order to enhance the learning ability of the small language model, the trajectory knowledge enhancer in step (3) uses the large language model to assist its learning of trajectory knowledge through the trajectory off-site tuning strategy, which is not directly transferring the trained large language model adapter to the small language model, but using and training the large language model to enhance the learning ability of the small language model during training. 4.The trajectory data preparation method based on federated learning according to claim 1, characterized in that: The trajectory privacy autoencoder in step (4) encodes the trajectory data using an encoder to obtain the corresponding embedding vector; the client transmits the embedding vector to the server for aggregation while preserving the spatiotemporal dependence within and between clients; the server splits and distributes the output results of the large language model to the client, and the client reconstructs the estimated trajectory through the decoder. 5.The trajectory data preparation method based on federated learning according to claim 1, characterized in that: The trajectory privacy autoencoder uses a three-layer NLP with GELU activation function. 6.The trajectory data preparation method based on federated learning according to claim 1, wherein: The step (4) adopts a secret sharing based distributed aggregation method, and the specific implementation manner is as follows: first, each client generates a shared key and stores it locally, then divides the parameters of the trajectory privacy automatic encoder into multiple parameter blocks; for any client , uses the key determined with other clients to shield the local parameter block, if , adds ; if , subtracts ; wherein and are two clients in a client pair, is a shared key of the client pair, i and j are the numbers of the clients and , the client holds the original parameter block aggregated by other clients, and the aggregation result of the mask parameter block of all clients is equal to the aggregation result of the original parameter block of all clients; Finally, the client The aggregation result of the original parameter block is obtained by aggregating the respective mask parameter blocks sent by other clients, and is broadcast to other clients for model updating of the trajectory privacy autoencoder. 7.The trajectory data preparation method based on federated learning according to claim 1, wherein: The trajectory knowledge enhancer in the step (5) first designs a trajectory instruction paradigm to generate trajectory data preparation prompts, which include tasks, data, information, and formats; then uses a large language model to assist it in learning trajectory knowledge through trajectory off-site tuning strategies; further adopts LoRA sparse tuning strategies to only select the top-ranked layers of LoRA parameter change rates in the small language model for training; in addition, the trajectory knowledge enhancer develops bidirectional knowledge learning capabilities to enhance the trajectory data preparation knowledge of the large language model and the small language model, that is, the output of the small language model is aligned with the high-frequency output of the large language model using reverse KL divergence, enabling the small language model to learn useful trajectory data preparation knowledge in the complex output space of the large language model, and the output of the large language model is aligned with the overall output of the small language model using forward KL divergence, enabling the large language model to learn all the knowledge of the small language model in the original trajectory data. 8.The trajectory data preparation method based on federated learning according to claim 1, wherein: The federated parallel optimization module in the step (6) decomposes the federated training between the learning decomposition server and the client by splitting, adopts alternating optimization to minimize data transmission, and accelerates training by parallel execution, with the specific implementation as follows: S61: Adopting split learning to decompose the federated training process into client and server training, realizing simultaneous training of the client and the server, with the client responsible for the training of the trajectory privacy autoencoder and the small language model, and the server responsible for the training of the large language model; S62: Using alternating optimization to freeze the data required by the client and the server, respectively, to reduce data transmission; during training, the server freezes the embedding vectors uploaded by the client for the training of the large language model, while the client freezes the results output by the large language model in the server for the training of the trajectory privacy autoencoder model and the small language model; S63: Using parallel training to optimize multiple objectives in parallel, enhancing the parallelism of training; Wherein the client focuses on optimizing three objectives: ① minimizing the reconstruction loss of the trajectory privacy autoencoder; ② reducing the reverse KL loss between the outputs of the small language model and the large language model; ③ minimizing the loss between the output of the small language model and the label; the server focuses on optimizing two objectives: ① minimizing the forward KL loss between the outputs of the large language model and the small language model; ② reducing the loss between the output of the large language model and the label.
9. A computer device comprising a memory and a processor, said memory having stored therein a computer program, characterized in that: The processor is configured to execute the computer program to implement the trajectory data preparation method based on federated learning according to any one of claims 1-8.
10. A computer readable storage medium storing a computer program, characterized in that: The computer program is executed by the processor to implement the trajectory data preparation method based on federated learning according to any one of claims 1-8.
Citation Information
Patent Citations
Multi-point robot navigation system of fine-tuning adaptive small language model
CN118862954A
Resident trajectory activity semantic inference method, system, equipment and medium
CN119808950A