A personalized federated continual learning method and system based on dynamic clustering and multi-scale prototypes

By employing dynamic clustering and a multi-scale prototype library, the spatiotemporal forgetting problem of models in federated learning is addressed, achieving efficient training and stability under changing data distributions, and enhancing the model's adaptability and ability to retain old knowledge.

CN122154978APending Publication Date: 2026-06-05TIANJIN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610325842.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-17
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing federated learning methods struggle to guarantee model stability and performance during long-term training when faced with dynamic semantic transfer and concept drift. They also suffer from spatial and temporal forgetting issues, making them unsuitable for the needs of personalized federated continuous learning.

Method used

We employ a method based on dynamic clustering and multi-scale prototyping. We use routing histograms to achieve drift detection and online re-clustering, build a multi-scale prototype library including short-term, long-term, and drift prototypes, dynamically adjust the memory update rate, and combine it with local time consistency regularization training on the client side to achieve rapid model adaptation and retention of old knowledge.

Benefits of technology

It significantly reduces communication and computational overhead, ensures the stability and adaptability of the model when the data distribution changes, enables efficient federated training in an environment where the data distribution is constantly evolving, and improves the model's adaptability and ability to retain historical knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122154978A_ABST
    Figure CN122154978A_ABST
Patent Text Reader

Abstract

The application discloses a kind of personalized federated continuous learning method and system based on dynamic clustering and multi-scale prototype, to solve the problem of spatiotemporal catastrophic forgetting in personalized federated continuous learning.The server initializes global model containing prompt parameters and cluster-level multi-scale prototype library, and the client generates routing histogram representing local data distribution and incremental prototype through a gated routing network and uploads it.The server calculates JS divergence based on routing histogram to detect drift, triggers K-Means online re-clustering, and dynamically updates the multi-scale prototype library containing short-term, long-term and drift prototypes in combination with the drift signal.The client uses long-term prototype to construct a joint loss optimization model.The application balances new knowledge learning and old knowledge retention while protecting data privacy and reducing overhead, and adapts to scenarios where data distribution continues to evolve.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of personalized federated continuous learning, and in particular to a personalized federated continuous learning method and system based on dynamic clustering and multi-scale prototyping. Background Technology

[0002] With the widespread adoption of smart terminal devices and the continuous expansion of data scale, data from different users, devices, and environments exhibits characteristics of high dispersion, strong privacy, and continuous change over time. In many real-world application scenarios, the sensitive privacy information contained in devices makes it difficult to centralize data on a server for unified storage and analysis, thus hindering the application of traditional centralized training methods. While the currently widely used federated learning technology allows clients to collaboratively train without uploading data to a server, it struggles to guarantee the stability and performance of models during long-term training when faced with the constantly evolving task sequences, dynamic semantic shifts in data distribution, and temporal characteristics such as concept drift in real-world environments. Specifically, in practical applications, the tasks of different clients continuously change dynamically over time, the distribution differences between clients widen, and various semantic preferences exhibit significant temporal drift characteristics, making traditional federated learning methods ill-suited to these long-term dynamic learning needs.

[0003] From the perspective of model structure and spatial forgetting, clustering clients with similar data distributions into a single cluster can reduce the need for overriding updates of learned parameters when switching between different data distributions, thus effectively mitigating spatial forgetting. However, existing techniques typically rely on one-time clustering or low-frequency static model grouping in the initial stage, lacking a mechanism for online dynamic reorganization based on changes in client semantic preferences during training. This can lead to clients being locked into outdated clusters, receiving incorrect knowledge sharing, and severely impacting their models. Furthermore, existing drift detection methods often rely on the statistical distribution of the uploaded raw data or intermediate features for judgment, which not only violates the data privacy minimization principle of federated learning but also incurs high communication and computational overhead.

[0004] From the perspective of memory mechanisms and temporal forgetting, existing methods cannot adaptively adjust the memory update rate according to the drift intensity. This causes the model to either over-update and overwrite historical knowledge when facing the transition between old and new tasks, leading to catastrophic forgetting, or fail to adapt quickly to new distributions due to forcibly maintaining historical consistency, resulting in an inability to learn new tasks. Especially in long-term multi-task sequences, existing methods gradually lose their discriminative ability due to continuous averaging operations and lack hierarchical (such as short-term and long-term) memory structures to cope with complex non-stationary environments.

[0005] In summary, existing technologies lack a mechanism that can simultaneously address spatiotemporal catastrophic forgetting in personalized federated continuous learning. In real-world scenarios involving diverse tasks and continuous semantic drift on the client side, existing systems cannot provide a stable, reliable, and effective federated continuous learning solution that balances resistance to forgetting with rapid adaptation capabilities. Ultimately, model performance will significantly degrade over time. Summary of the Invention

[0006] The purpose of this invention is to solve the spatiotemporal catastrophic forgetting problem in existing personalized federated continuous learning, and to provide a personalized federated continuous learning method and system based on dynamic clustering and multi-scale prototyping.

[0007] To achieve the objectives of this invention, the technical solution provided by this invention is as follows: First aspect This invention provides a personalized federated continuous learning method based on dynamic clustering and multi-scale prototypes. It achieves drift detection and online re-clustering through routing histograms, and uses a multi-scale prototype library modulated by drift signals to balance new knowledge learning and old knowledge retention, thus realizing efficient federated training in an environment where data distribution is constantly evolving.

[0008] Furthermore, it includes the following steps: Step S1: The server initializes a global model containing prompt parameters and builds an initial cluster-level multi-scale prototype library. That is, the server independently maintains a prototype library containing short-term, long-term, and drift three-layer structures for each cluster, and the prototype libraries of different clusters do not interfere with each other. The server first divides all clients participating in training into one cluster according to a single global method and distributes the corresponding model parameters. The client receives the initial model parameters and loads local data to prepare for the first round of training. Step S2: When the client is training locally, it uses a gated routing network as a cue selector to perform dynamic route matching based on feature similarity on the input samples, generates a routing histogram that reflects the distribution of local data, and calculates incremental prototypes for each category that include intra-class feature statistics. Step S3: Server-side drift detection and dynamic re-clustering: The server receives the routing histograms uploaded by all clients and calculates the global average distribution drift intensity; if the drift intensity exceeds the preset threshold, the server performs K-Means online re-clustering on the clients based on the routing histogram features and updates the cluster allocation relationship. Step S4: Model parameter aggregation and update: Based on the cluster allocation results, the server updates the global hints and cluster-level hints using a hierarchical aggregation strategy to achieve knowledge fusion of model parameters; Step S5: Updating the Multi-Scale Prototype Library: The server updates the multi-scale prototype library for each cluster based on the cluster allocation results and drift signals. This prototype library is divided into three levels according to different time granularities, as defined below: (1) Short-term prototype: Represents the data distribution characteristics at the current moment; it is entirely aggregated from the incremental prototypes uploaded by the client in this round, has extremely high plasticity, can quickly respond to changes in new tasks, but is easily affected by noise. (2) Long-term prototype: represents the steady-state knowledge accumulated in history; it is obtained by weighting and fusing the historical long-term prototype and the current short-term prototype through time inertia weight, and has high time consistency, which is used to constrain the model to prevent forgetting; among them, time consistency means that it can maintain the continuous and smooth evolution of feature semantics in the time dimension and avoid drastic changes in the prototype due to short-term data fluctuations. (3) Drift prototype: represents the characteristic state when the task switching boundary or environment changes suddenly; it is a snapshot backup of the short-term prototype when the system detects a violent drift, used to record key distribution jump point information; The server dynamically calculates the time inertia weight using the drift intensity signal, merges short-term and long-term prototypes, updates the multi-scale prototype library, and generates drift prototype snapshots when the drift intensity is high. Step S6: Client-side consistency regularization training based on long-term prototype: The server distributes the updated long-term prototype to the client; in the next round of local training, the client uses this prototype to calculate the temporal consistency regularization loss and optimizes the local model in conjunction with the cross-entropy loss until all training rounds are completed.

[0009] Further, in step S2, for the input sample Model extracts features Simultaneously, the gated routing network (i.e., a learnable linear projection layer) computes features. In the hint pool The matching weights of each prompt are determined, and dynamic routing matching is performed: that is, the k prompts with the highest weights are selected and weighted together to obtain an aggregated prompt vector for auxiliary classification.

[0010] Furthermore, in step S2, the client maintains a length of Routing histogram This histogram is essentially a statistical vector recording the activation frequency of each cue in the cue pool, used to characterize the semantic distribution preferences of the client's local data without revealing the original data. During training, the frequency of each cue being selected is counted, and the histogram is smoothly updated using an exponential moving average (EMA) strategy, as shown in the formula: in, For smoothing coefficients, For the routing statistics of the current batch, This is the histogram updated at the current moment. This is the historical histogram before the update; this histogram is uploaded to the server as a privacy-de-identified semantic fingerprint and does not contain the original data.

[0011] Furthermore, in step S2, the client calculates the incremental prototype for each category, specifically the sum of the feature vectors of all samples in that category. and sample size These two statistics allow the server to reconstruct the accurate average prototype through addition without accessing the original data.

[0012] Furthermore, in step S3, the specific implementation method of drift detection and dynamic re-clustering is as follows: Step S31: The server normalizes the collected routing histograms from each client. Step S32: Calculate the Jensen-Shannon (JS) divergence between the histogram distribution of each client in the current round and the historical distribution of the previous round, and take the average value as the global drift intensity. ; Step S33: Determine Is it greater than the preset drift threshold? : like If concept drift is detected, the server performs a K-Means clustering algorithm based on the routing histogram features of all current clients to re-segment the clients to... In each cluster; if The distribution is determined to be stable, and the cluster allocation structure of the previous round remains unchanged. At the same time, a residence time constraint is introduced, and a client is only allowed to migrate out if its residence time in the current cluster exceeds the minimum round, so as to enhance the temporal robustness of the cluster allocation structure.

[0013] Furthermore, in step S5, the multi-scale prototype library comprises a three-layer structure of short-term prototypes, long-term prototypes, and drift prototypes, and its update is specifically implemented as follows: Step S51: The server aggregates incremental prototypes uploaded by clients belonging to the same cluster and calculates the short-term prototypes for each category of that cluster. ; Step S52: Utilize the global drift intensity calculated in step 3 The time inertia weight is calculated using an exponential decay function. :

[0014] in This is the sensitivity coefficient; the larger the drift, the higher the sensitivity coefficient. The smaller the value, the faster the memory bank is updated; the smaller the drift, The larger the size, the more conservative the memory bank; Step S53: Update the cluster-level long-term prototype according to the following formula. Achieve time-consistency fusion:

[0015] Step S54: When When a certain recording threshold is exceeded, the current short-term prototype is stored as a drift prototype in the drift prototype list to record the characteristic state of the distribution switching boundary.

[0016] Furthermore, in step S5, the loss function for local training on the client side is designed as follows: The client receives the cluster-level long-term prototype from the server. Calculate the total loss during local training. :

[0017] in: Cross-entropy loss for classification tasks; For time consistency regularization loss, cosine embedding loss is used to constrain the features of the current sample. Its long-term prototype Maintain consistent direction; The system assigns a higher weighting coefficient to categories belonging to older tasks in order to enhance the retention of old knowledge.

[0018] Second aspect This invention provides a personalized federated continuous learning system based on dynamic clustering and multi-scale prototypes. The system is used to execute the personalized federated continuous learning method based on dynamic clustering and multi-scale prototypes. It realizes drift detection and online re-clustering through routing histograms, and uses a multi-scale prototype library modulated by drift signals to balance new knowledge learning and old knowledge retention, thus achieving efficient federated training in an environment where data distribution is constantly evolving.

[0019] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention proposes a dynamic clustering mechanism based on routing histograms and applies it to federated continuous learning scenarios. Unlike traditional methods that rely on uploading statistical summaries of raw data or high-dimensional features for drift detection, this invention utilizes the routing activation frequency of the client's local gated network to generate low-dimensional semantic fingerprints. Without disclosing any local raw data or model parameters, it accurately perceives conceptual drift in data distribution by calculating Jensen-Shannon (JS) divergence. This not only strictly adheres to the data privacy minimization principle of federated learning and significantly reduces communication and computational overhead, but also enables the system to perform online dynamic topology reorganization based on changes in client semantic preferences, effectively solving the spatial forgetting problem caused by static cluster structures.

[0020] Furthermore, this invention constructs a multi-scale prototype library (including short-term, long-term, and drifting prototypes) and its adaptive evolution mechanism, effectively solving the temporal catastrophic forgetting problem prevalent in federated continuous learning. Existing technologies typically employ static prototypes or simple moving average updates, while this invention dynamically adjusts the temporal inertia weights of memory updates through a global drift intensity signal: strengthening the preservation of historical long-term prototypes when the distribution is stable, accelerating the absorption of short-term new knowledge when the distribution changes abruptly, and recording key drifting prototype snapshots. Combined with client-side local training based on long-term prototypes with temporal consistency regularization, this invention significantly improves the model's ability to retain historical knowledge while ensuring rapid adaptation to new task sequences, achieving an optimal balance between model plasticity and stability. Attached Figure Description

[0021] Figure 1 A flowchart of a personalized federated continuous learning method based on dynamic clustering and multi-scale prototyping provided in an embodiment of the present invention; Figure 2 This is a flowchart illustrating the drift detection and dynamic re-clustering logic in an embodiment of the present invention. Figure 3 This is a schematic diagram of the multi-scale prototype library update mechanism in an embodiment of the present invention; Figure 4 This is a comparison chart of the average accuracy changes of the present invention and existing technologies in a continuous multi-task scenario; Figure 5 This is a comparison chart of the forgetting levels of the present invention and existing technologies in a continuous multitasking scenario. Detailed Implementation

[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0023] This embodiment provides a federated continuous learning method based on dynamic cue clustering and multi-scale prototyping. The specific workflow is as follows: Figure 1 As shown, it includes the following steps: Step S1: The server establishes a global model, which includes a pre-trained model with frozen parameters and a learnable cue pool. The cue pool contains M learnable vectors of dimension D. The server initializes a multi-scale prototype library structure, including short-term prototype lists, long-term prototype lists, and drift prototype lists. In the initial stage, the server adopts a single global initialization strategy, dividing all clients participating in training into the same initial cluster and distributing the cue parameters corresponding to that cluster to all clients.

[0024] Step S2: After receiving the model parameters from the server, the client loads local private data for training. For a single local input sample data... Perform the following procedure: Step S21: Transfer the data Input a frozen model, output feature vectors .

[0025] Step S22: Feature Vector Input a gated routing network. The routing network calculates the matching scores between the M prompts in the prompt pool and the current feature, and generates a routing weight vector using the Softmax function. The Softmax function is expressed as:

[0026] in, Represents the route weight vector The corresponding number in the middle The normalized weight values ​​of each prompt; Representing the eigenvector With the The original match score of the prompt; This represents the total number of prompts in the prompt pool. Step S23: Select The largest value Only this index is activated. Tips and features Weighted fusion is performed for subsequent classification tasks.

[0027] Step S3: During local training, the client maintains a routing histogram vector H of length M. This step is used to generate a privacy-friendly "semantic fingerprint." The specific steps and mathematical model are as follows: Step S31: Count the number of prompts in the current batch of data. The frequency of selection by the mechanism, after normalization, yields the distribution of the current batch. .

[0028] Step S32: Update the local historical histogram H using an exponential moving average strategy, with the following formula:

[0029] in, This is the histogram updated at the current moment. This is the historical histogram before the update. This is a smoothing coefficient (ranging from 0.9 to 0.99), used to smooth out random noise between batches, so that the histogram stably reflects the client's long-term semantic preferences.

[0030] Step S33: After training, the client only displays the histogram. Incremental prototypes of various categories are uploaded to the server, but the original data is not uploaded. Specifically, for categories... The incremental prototype contains two physical quantities: the sum of the feature vectors of samples in that category. and sample size The server can use these two quantities to calculate the global or cluster-level average prototype without accessing the original data.

[0031] Step S4: The server receives the routing histograms uploaded by all clients. ( (For client number), execute as follows Figure 2 The drift detection process is shown below: Step S41: Normalize the histogram so that the sum of its elements is 1; Step S42: Calculate the global average drift intensity First, calculate the histogram for the current round for each client. Compared with the previous round of historical histograms Jensen-Shannon (JS) divergence between:

[0032] in , Let KL divergence be a metric. Step S43: Take the average of the JS divergence of all clients to obtain... The variable The physical meaning refers to the overall degree of deviation of the current data distribution within the system relative to its historical state.

[0033] Step S5: Dynamic re-clustering and cluster allocation, the server determines the clusters based on the drift intensity. Decide whether to adjust the cluster structure: Step S51: Determine Whether it is valid, among which The preset drift threshold; Step S52: If true, determine that a concept drift has occurred in the system. The server uses the routing histogram of all clients. Using the feature vector, the K-Means clustering algorithm is executed to re-segment the clients into... In each cluster; Step S53: Introduce dwell time logic judgment: If the number of times a client stays in the current cluster is less than the minimum dwell threshold, then even if the clustering result changes, it will be forced to stay in the original cluster to enhance the temporal robustness of the cluster allocation structure. Step S54: Hierarchical Aggregation Update of Cluster-Level Hints: The server performs model parameter updates, first calculating the global average hints for all clients. Then for each cluster Aggregate the prompts from clients within this cluster to obtain And using interpolation coefficients Update:

[0034] This hierarchical aggregation strategy preserves the individual characteristics within a cluster while preventing the cluster-level model from deviating from the overall semantic space through global prompts.

[0035] Step S6: The server updates the multi-scale prototype library for each cluster based on the cluster allocation results and drift signals, such as... Figure 3 As shown: Step S61: Short-term prototype aggregation: For incremental prototypes uploaded by clients belonging to the same cluster, calculate the weighted average based on the number of samples to obtain the short-term prototypes for each category of that cluster. ; Step S62: Calculate the time inertia weight: using the drift intensity obtained in step 4 The weights are calculated using an exponential decay model. :

[0036] in The sensitivity coefficient, in physical terms, is the coefficient of sensitivity when the drift... When it increases, A rapid decrease prompts the memory to be updated quickly to adapt to the new distribution; when the drift is small, Maintaining a level close to 1 helps stabilize memory. Step S63: Long-term prototype update: weight-based Update cluster-level long-term prototype :

[0037] Step S64: Drift Prototype Update: If Exceeding a certain high threshold will change the current Storing these drift prototypes in the drift prototype list helps record the characteristic states of task switching boundaries. Drift prototype snapshots will be sent to the client as optional regularization constraints or used for experience replay analysis in subsequent rounds.

[0038] Step S7: The server updates the cluster assignment ID, cluster-level hint parameters, and cluster-level long-term prototype. The data is then sent to the client. In the next round of training, the client uses the following loss function to optimize the model:

[0039] in: Cross-entropy is used for classification loss. For time-consistency regularization loss, cosine embedding loss is used:

[0040] The physical meaning of this formula is: constraining the features of the current sample. The direction vector is made as close as possible to the prototype direction of the category in the long-term memory, thereby preventing the model from forgetting old knowledge when learning new tasks. To balance the coefficients, a larger coefficient is assigned to category labels belonging to older tasks. Values ​​are used to enhance memory retention.

[0041] To verify the effectiveness of the federated continuous learning method based on dynamic cue clustering and multi-scale prototyping proposed in this invention, comparative experiments were conducted on the CIFAR-100 continuous task dataset. The experimental setup included five sequentially arriving tasks, and the comparison methods included: dynamic clustering only, traditional federated averaging, federated proximal optimization, global single model, and the complete method proposed in this invention. Figure 4 and Figure 5 As shown, the experimental results demonstrate that the present invention ensures improved accuracy while minimizing forgetting.

[0042] In addition, this invention provides a personalized federated continuous learning system based on dynamic clustering and multi-scale prototypes. The system is used to execute the personalized federated continuous learning method based on dynamic clustering and multi-scale prototypes. It realizes drift detection and online re-clustering through routing histograms, and uses a multi-scale prototype library modulated by drift signals to balance new knowledge learning and old knowledge retention, thus achieving efficient federated training in an environment where data distribution is constantly evolving.

[0043] Finally, it should be noted that the above embodiments are merely illustrative and explanatory of the present invention, and are not intended to limit the present invention to the scope of the described embodiments. Furthermore, those skilled in the art will understand that the present invention is not limited to the above embodiments, and many more variations and modifications can be made based on the teachings of the present invention, all of which fall within the scope of protection claimed by the present invention.

Claims

1. A personalized federated continuous learning method based on dynamic clustering and multi-scale prototyping, characterized in that, Drift detection and online re-clustering are achieved by using routing histograms, and a multi-scale prototype library modulated by drift signals is used to balance new knowledge learning and old knowledge retention, thus realizing efficient federated training in an environment where data distribution is constantly evolving.

2. The personalized federated continuous learning method based on dynamic clustering and multi-scale prototyping according to claim 1, characterized in that, Includes the following steps: Step S1: The server initializes a global model containing prompt parameters and builds an initial cluster-level multi-scale prototype library. That is, the server independently maintains a prototype library containing short-term, long-term, and drift three-layer structures for each cluster, and the prototype libraries of different clusters do not interfere with each other. The server first divides all clients participating in training into one cluster according to a single global method and distributes the corresponding model parameters. The client receives the initial model parameters and loads local data to prepare for the first round of training. Step S2: When the client is training locally, it uses a gated routing network as a cue selector to perform dynamic route matching based on feature similarity on the input samples, generates a routing histogram that reflects the distribution of local data, and calculates incremental prototypes for each category that include intra-class feature statistics. Step S3: Server-side drift detection and dynamic re-clustering: The server receives the routing histograms uploaded by all clients and calculates the global average distribution drift intensity; If the drift intensity exceeds the preset threshold, the client is re-clustered online using K-Means based on the routing histogram features, and the cluster assignment relationship is updated. Step S4: Model parameter aggregation and update: Based on the cluster allocation results, the server updates the global hints and cluster-level hints using a hierarchical aggregation strategy to achieve knowledge fusion of model parameters; Step S5: Updating the Multi-Scale Prototype Library: The server updates the multi-scale prototype library for each cluster based on the cluster allocation results and drift signals. This prototype library is divided into three levels according to different time granularities, as defined below: (1) Short-term prototype: represents the data distribution characteristics at the current moment; it is entirely aggregated from the incremental prototypes uploaded by the client in this round; (2) Long-term prototype: Represents the steady-state knowledge accumulated in history; it is obtained by weighting and fusing the historical long-term prototype and the current short-term prototype through time inertia weight, and has high time consistency, which is used to constrain the model to prevent forgetting; among them, time consistency means that it can maintain the continuous and smooth evolution of feature semantics in the time dimension. (3) Drift prototype: represents the characteristic state when the task switching boundary or environment changes suddenly; it is a snapshot backup of the short-term prototype when the system detects a violent drift, used to record key distribution jump point information; The server dynamically calculates the time inertia weight using the drift intensity signal, merges short-term and long-term prototypes, updates the multi-scale prototype library, and generates drift prototype snapshots when the drift intensity is high. Step S6: Client-side consistency regularization training based on long-term prototype: The server distributes the updated long-term prototype to the client; in the next round of local training, the client uses this prototype to calculate the temporal consistency regularization loss and optimizes the local model in conjunction with the cross-entropy loss until all training rounds are completed.

3. The personalized federated continuous learning method based on dynamic clustering and multi-scale prototyping according to claim 2, characterized in that, In step S2, for the input sample Model extracts features Simultaneously, the computational characteristics of gated routing networks In the hint pool The matching weights of each prompt are determined, and dynamic routing matching is performed: that is, the k prompts with the highest weights are selected and weighted together to obtain an aggregated prompt vector for auxiliary classification.

4. The personalized federated continuous learning method based on dynamic clustering and multi-scale prototyping according to claim 3, characterized in that, In step S2, the client maintains a length of Routing histogram This histogram is essentially a statistical vector recording the activation frequency of each cue in the cue pool, used to characterize the semantic distribution preferences of the client's local data without revealing the original data. During training, the frequency of each cue being selected is counted, and the histogram is smoothly updated using an exponential moving average (EMA) strategy, as shown in the formula: ; in, For smoothing coefficients, For the routing statistics of the current batch, This is the histogram updated at the current moment. This is the historical histogram before the update; this histogram is uploaded to the server as a privacy-de-identified semantic fingerprint and does not contain the original data.

5. The personalized federated continuous learning method based on dynamic clustering and multi-scale prototyping according to claim 4, characterized in that, In step S2, the client calculates the incremental prototype for each category, specifically the sum of the feature vectors of all samples in that category. and sample size These two statistics allow the server to reconstruct the accurate average prototype through addition without accessing the original data.

6. The personalized federated continuous learning method based on dynamic clustering and multi-scale prototyping according to claim 5, characterized in that, In step S3, the specific implementation method of drift detection and dynamic re-clustering is as follows: Step S31: The server normalizes the collected routing histograms from each client. Step S32: Calculate the Jensen-Shannon divergence between the histogram distribution of each client in the current round and the historical distribution of the previous round, and take the average value as the global drift intensity. ; Step S33: Determine Is it greater than the preset drift threshold? : like If concept drift is detected, the server performs a K-Means clustering algorithm based on the routing histogram features of all current clients to re-segment the clients to... In each cluster; if If the distribution is stable, the cluster allocation structure from the previous round remains unchanged. Meanwhile, a residence time constraint is introduced, allowing a client to migrate out only if its residence time in the current cluster exceeds the minimum round, in order to enhance the temporal robustness of the cluster allocation structure.

7. The personalized federated continuous learning method based on dynamic clustering and multi-scale prototyping according to claim 6, characterized in that, In step S5, the multi-scale prototype library contains a three-layer structure: short-term prototype, long-term prototype, and drift prototype. The specific implementation method for its update is as follows: Step S51: The server aggregates incremental prototypes uploaded by clients belonging to the same cluster and calculates the short-term prototypes for each category of that cluster. ; Step S52: Utilize the global drift intensity calculated in step 3 The time inertia weight is calculated using an exponential decay function. : ; in This is the sensitivity coefficient; the larger the drift, the higher the sensitivity coefficient. The smaller the value, the faster the memory bank is updated; the smaller the drift, The larger the size, the more conservative the memory bank; Step S53: Update the cluster-level long-term prototype according to the following formula. Achieve time-consistency fusion: ; Step S54: When When a certain recording threshold is exceeded, the current short-term prototype is stored as a drift prototype in the drift prototype list to record the characteristic state of the distribution switching boundary.

8. The personalized federated continuous learning method based on dynamic clustering and multi-scale prototyping according to claim 7, characterized in that, In step S5, the loss function for local training on the client side is designed as follows: The client receives the cluster-level long-term prototype from the server. Calculate the total loss during local training. : ; in: Cross-entropy loss for classification tasks; For time consistency regularization loss, cosine embedding loss is used to constrain the features of the current sample. Its long-term prototype Maintain consistent direction; The system assigns a higher weighting coefficient to categories belonging to older tasks in order to enhance the retention of old knowledge.

9. A personalized federated continuous learning system based on dynamic clustering and multi-scale prototyping, characterized in that, The system is used to execute the personalized federated continuous learning method based on dynamic clustering and multi-scale prototypes as described in any one of claims 1-8. It achieves drift detection and online re-clustering through routing histograms and uses a multi-scale prototype library modulated by drift signals to balance new knowledge learning and old knowledge retention, thus realizing efficient federated training in an environment where data distribution is constantly evolving.