Cross-domain line loss prediction method and system based on privacy protection
By employing federated learning and differential privacy techniques, the problem of line loss prediction under data silos in power companies is solved, achieving high-precision, highly generalizable cross-domain line loss prediction that meets privacy protection requirements and adapts to the differences in data distribution among power companies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-03-13
AI Technical Summary
Data silos formed between different power companies due to privacy regulations and trade secret restrictions result in poor generalization ability of line loss prediction models. Centralized training violates privacy protection requirements, and traditional federated learning carries the risk of privacy leaks during model updates.
A cross-domain line loss prediction method based on federated learning is adopted. The method is trained collaboratively by a central server and clients, uses a random forest regressor as the global prediction model, and implements differential privacy processing, including gradient pruning and noise addition, to optimize communication efficiency and achieve high accuracy and strong generalization ability.
It breaks down data silos, enables collaborative training across power companies, provides mathematically provable privacy protection, achieves prediction accuracy close to that of centralized models, adapts to the differences in data distribution among actual power companies, and meets regulatory requirements.
Smart Images

Figure CN121659280A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system line loss prediction and privacy-preserving machine learning technology, and in particular to a privacy-preserving cross-domain line loss prediction method and system. Background Technology
[0002] Line loss is a crucial economic indicator in distribution network operation, and accurate prediction of line loss is essential for improving grid efficiency. With the widespread adoption of smart meters and advanced metering systems, data-driven line loss prediction methods (such as random forests and long short-term memory networks) are gradually replacing traditional physical models. However, privacy regulations and trade secret restrictions among different power companies create data silos, leading to poor model generalization capabilities. Existing centralized training methods require sharing raw data, violating privacy protection requirements. While traditional federated learning can avoid data sharing, it still carries the risk of privacy leaks during model updates.
[0003] The statements herein provide only background information in relation to this invention and do not necessarily constitute prior art. Summary of the Invention
[0004] The purpose of this invention is to provide a privacy-preserving cross-domain line loss prediction method and system, which aims to solve the line loss prediction problem under data silos across power companies, and to achieve high-precision and strong generalization ability line loss prediction model training while protecting user privacy.
[0005] To achieve the above objectives, this invention provides a privacy-preserving cross-domain line loss prediction method, comprising: Step S1: Construct a federated learning system, which includes a central server and multiple clients. The central server maintains a global prediction model, and each client has a local private dataset containing multiple samples, each sample corresponding to a line loss data point. Step S2: The central server distributes the global prediction model to each client; Step S3: Each client uses the global prediction model to train the line loss data and calculates the local model update of the global prediction model. Step S4: Each client performs differential privacy processing on local model updates; Step S5: The client uploads the updated model after differential privacy processing to the central server; Step S6: The central server aggregates the model updates from each client and generates a new generation of global prediction model; Step S7: Repeat the communication iteration process from steps S2 to S6 until the iteration conditions are met and then terminate the training.
[0006] The global prediction model is a random forest regressor.
[0007] Each client k Holding local private datasets D k , Each private dataset D k Include One sample, each sample For a single line loss data point, the feature vector Includes current I ,resistance R Input energy A in Output energy A out Target variable For statistical line loss value A stat , ; Calculating the local model update for the global prediction model includes: In the formula, the global prediction model parameters w It refers to the set of all trainable parameters that constitute the global prediction model. Update the local model. These are the parameters trained locally. These are the initial parameters. ,parameter It uses samples Trained.
[0008] The differential privacy processing includes gradient pruning and noise addition; The gradient clipping includes: Perform gradient for each sample L 2 Norm clipping: In the formula, C To preset the cropping threshold, g(x i ) as a sample x i The gradient; The noise addition includes: Add Gaussian noise to the model update: In the formula, s Noise multiplier I The identity matrix and noise multiplier are given. s Through formula calculate, The probability of failure. Budget for privacy.
[0009] Privacy Budget The value ranges from 1.0 to 5.0.
[0010] The gradient clipping threshold C Determined through the following steps: Step 1: Calculate the gradient norm distribution on the local private dataset; Step 2, select the first p Percentiles are used as the pruning threshold, where, ; Step 3: Adjust through cross-validation to obtain the optimal utility-privacy trade-off.
[0011] The central server aggregates model updates from various clients to generate a new generation of global prediction models, including: The central server uses a federated averaging algorithm to aggregate updates from all clients. In the formula, For the first t The set of clients participating in training via round-robin communication. t It is a natural number.
[0012] The iteration conditions include: an upper limit condition for the number of communication rounds and / or a convergence condition; The upper limit condition for the number of communication rounds includes: when the number of communication rounds... t Reaching the preset maximum value T_ max Training is terminated at that time, among which, t For natural numbers, T_ max The range is 30 to 100; The convergence criteria include: the central server maintains a global prediction model validation set, or the average performance is taken on the local validation sets of each client. Let the first t The root mean square error of the global prediction model after round-robin communication on the global prediction model validation set is: RMSE_ value(t) If continuous N=10 If formula (1) is satisfied within a round, then training is terminated; Wherein, the local validation set is a subset of the local private dataset; global objective function F(w) This is used to define the convergence state of the global prediction model. The global objective function is: In the formula, For the client k The number of samples, For the client k The local objective function; The local objective function Defined as: In the formula, D k For the client k Local private dataset, For regression loss function; The regression loss function is calculated using the mean squared error: In the formula, For the model to sample The predicted value.
[0013] Optimize the communication efficiency of the federated learning system, including: A periodic aggregation strategy is adopted to reduce the number of communication rounds; Use model compression technology to reduce the amount of data in each communication; Dynamically adjust the client selection strategy, prioritizing clients with high data quality.
[0014] This invention also provides a privacy-preserving cross-domain line loss prediction system, comprising: The central server is used for model initialization, distribution, and aggregation. Multiple clients are used for local model training and differential privacy processing. Each client includes a privacy protection module for performing differential privacy processing. The communication module is used to enable secure data exchange between the central server and the client.
[0015] The present invention has the following beneficial effects: 1. Break down data silos: Enable collaborative training across power companies through federated learning, significantly improving the model's generalization ability.
[0016] 2. Strict privacy protection: Provides mathematically provable privacy protection through differential privacy mechanisms, meeting regulatory requirements.
[0017] 3. High practicality: Experiments on real datasets show that the prediction accuracy (RMSE=1.75kWh) of the method of this invention under strong privacy protection (ε=2.0) is close to that of the centralized ideal model (RMSE=1.62kWh), and significantly better than local independent training (RMSE=2.07kWh).
[0018] 4. Flexible and adjustable: The privacy budget ε is adjustable to adapt to the privacy protection needs of different scenarios.
[0019] 5. System robustness: It has good adaptability to non-independent and identically distributed data and is suitable for the data distribution differences of actual power companies. Attached Figure Description
[0020] Figure 1 The flowchart illustrates a privacy-preserving cross-domain line loss prediction method provided by this invention.
[0021] Figure 2 This is a diagram showing the comparison between the actual line loss value and the predicted value.
[0022] Figure 3 A graph showing the relationship between privacy budget and prediction error. Detailed Implementation
[0023] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The advantages and features of the present invention will become clearer from the following description. It should be noted that the drawings are in a very simplified form and use non-precise proportions, used only to facilitate and clearly illustrate the embodiments of the present invention. Please refer to the drawings to make the objectives, features, and advantages of the present invention more apparent and understandable. It should be understood that the structures, proportions, sizes, etc., depicted in the accompanying drawings are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed in the specification, and are not intended to limit the implementation conditions of the present invention. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in proportions, or adjustments to the size, without affecting the effects and objectives achieved by the present invention, should still fall within the scope of the technical content disclosed in the present invention.
[0024] like Figure 1 The present invention provides a privacy-preserving cross-domain line loss prediction method, comprising the following steps: Step S1: Construct a federated learning system, which includes a central server and multiple clients (power companies), each client holding a local private dataset; Local private dataset: denoted as D K This refers to the original line loss data set held by each client (power company) and not shared externally, containing several samples for local model training.
[0025] Step S2: The central server initializes the global prediction model parameters. w And distribute the global prediction model parameters to each client; Global prediction model: In a federated learning system, this refers to a unified prediction model (in this invention, a random forest regressor) maintained by a central server and distributed to all clients. It is a complete, executable machine learning model capable of predicting line loss values based on input features (such as current, voltage, power, etc.).
[0026] Global prediction model parameters (denoted as w): This refers to the set of all trainable parameters that constitute the global prediction model, such as the node splitting features, splitting threshold, and leaf node values of each tree in a random forest. Mathematically, w is a vector or matrix that represents the specific structure and behavior of the model, and this vector contains all the trainable parameters in the model.
[0027] Step S3: Each client trains the line loss data locally using a random forest regressor and calculates the local model update of the global prediction model. Step S4: Each client performs differential privacy processing on the local model update, including gradient clipping and noise addition; Step S5: The client uploads the updated, privacy-protected model to the central server; Step S6: The central server aggregates the model updates from each client and generates a new generation of global prediction model; Step S7: Repeat the iterative process from steps S2 to S6 until training terminates when any of the following conditions are met: Convergence criteria: The central server maintains a global validation set for the prediction model, or the average performance is taken on the local validation sets of each client. Let the... t The root mean square error of the global prediction model after round 10 on the validation set is: RMSE_val(t) If continuous N=10 The following conditions must be met within the wheel: (1) Local validation set: This is a subset of the client's local private dataset. It is not used for model training and is only used to evaluate model performance (such as calculating the root mean square error RMSE).
[0028] The local validation set is a part of the local private dataset, usually obtained by random partitioning (e.g., 80% training set / 20% validation set). During federated learning, each client can evaluate the performance of the current global prediction model on the local validation set and report the evaluation results (e.g., RMSE) to the central server to determine whether the model has converged (as shown in formula (1)). This protects the privacy of the original data while enabling cross-domain model performance monitoring and convergence judgment.
[0029] Maximum number of rounds: When the number of communication rounds... t (Natural number) reaches the preset maximum valueT_ max When training is forcibly terminated (usually set to 30 to 100 rounds), it saves computing and communication resources.
[0030] It should be noted that during the iteration process, step S2 "distribute the model" refers to distributing the global prediction model for the current round, and the model initialization is executed only once.
[0031] In one embodiment, the privacy-preserving cross-domain line loss prediction method includes: First, build a federated learning system, including a central server and K Each client (power company) k Holding local private datasets D k Each private dataset D k Include Each client's private dataset contains [number] samples. Each sample This corresponds to a single line loss record. Feature vector. Includes the measured electrical quantities (such as current, voltage, power, etc.) at that moment, and the target value. The corresponding statistical line loss value Then initialize the global prediction model parameters of the central server. w Set privacy parameters ,in For privacy budget, The failure probability is typically set to... , .
[0032] In each round of communication t Perform the following steps: 1. The central server randomly selects a portion of the client set. Distribute the current global prediction model w t ; In this invention, "the central server randomly selects a portion of the client set" S t The design of "" is intentional and crucial, and its number of clients is typically less than k This design is based on the following four considerations, aiming to make the system more efficient, robust, and practical: Improving efficiency: Power companies are widely distributed with varying network conditions. Communicating only with a subset of clients per round significantly reduces synchronization wait time, accelerates overall training speed, and prevents clients with insufficient network or computing resources from becoming bottlenecks.
[0033] Enhanced robustness: In real-world industrial environments, clients may experience temporary failures. This design allows the system to flexibly bypass unavailable nodes, aggregating updates only from available nodes to ensure uninterrupted training.
[0034] Enhanced privacy: The random selection mechanism adds a layer of dynamic uncertainty to differential privacy protection, making it more difficult for attackers to track the contribution patterns of specific clients and improving the overall level of privacy and security.
[0035] Balanced performance: Both theory and experiments have shown that by randomly selecting a representative subset of clients and iterating for a sufficient number of rounds, the performance of the model can approach the ideal upper limit of full participation in each round, achieving the optimal balance between efficiency and accuracy.
[0036] Therefore, "selecting a subset of clients" is an optimized technique for distributed, cross-domain collaborative scenarios, rather than an exclusion of the "all clients" scenario. This makes the method described in this invention more adaptable to the complex operating environment of real power systems.
[0037] 2. Each selected client uses a random forest regressor to train the model locally and calculates model updates. ; (2) In the formula, These are the parameters trained locally. These are the initial parameters; This represents the set of internal parameters of the global random forest prediction model obtained after federated learning training. It defines the specific structure of the model (such as the splitting rules of each tree and the values of leaf nodes) and serves as the basis for the model's mathematical calculations. Line loss data is the training material for the model. The relationship between the two is that of "learning rules" and "learning materials," expressed by the formula: Model parameters It is to utilize The trained prediction patterns are abstracted and distilled from line loss data, with the aim of making the predicted values closer to the true values. (Formula) It's for the purpose of continuously updating based on training. w This allows the training results (predicted values) to be closer to the actual line loss values.
[0038] The relationship between model updates and private dataset samples is one of source and flow, cause and effect. Model updates are the core result calculated by the client algorithm based on all its local samples, encoding the patterns in that client data. For this reason, it becomes the direct target of privacy-preserving techniques (differential privacy) to ensure that sample-level privacy is not leaked during collaborative training.
[0039] 3. Update the model Perform differential privacy processing: Gradient clipping: Perform gradient clipping on each sample. L 2 Norm clipping: (3) In the formula, C To preset the cropping threshold, g(x i ) as a sample x i The gradient; The gradient clipping threshold C Determined through the following steps: Step 1. Calculate the gradient norm distribution on the local private dataset; Step 2. Select the first p Percentiles are used as the pruning threshold, where, ; Step 3. Adjust through cross-validation to obtain the optimal utility-privacy trade-off; Noise addition: Add Gaussian noise during model updates. (4) In the formula, s Noise multiplier I The identity matrix and noise multiplier are given. s Through formula calculate, The probability of failure. Budget for privacy; 4. The client updates the privacy-protected model. Uploaded to the central server; 5. The central server uses a federated averaging algorithm to aggregate updates from all clients: (5) In the formula, For the first t The set of clients participating in the training rounds of communication; the number of clients selected in each round of communication can usually remain the same, but the method described in this invention supports its variation. In each round of communication, the initial selection of clients is based on a random mechanism.
[0040] Repeat steps 1-5 of the above iterative training until the model converges, and then deploy the final global prediction model to each client for line loss prediction.
[0041] global objective function F(w) It is primarily used to define the convergence state of the global prediction model and guide the aggregation strategy of the central server. The global objective function is: (6) In the formula, For the client k The number of samples, For the client k The local objective function.
[0042] The local objective function Defined as: (7) In the formula, D k For the client k Local private dataset, This is the regression loss function.
[0043] The regression loss function uses mean squared error, which is calculated using the following formula: (8) In the formula, For the model to sample The predicted value.
[0044] global objective function F(w) This is the core optimization problem that federated learning systems aim to solve. Mathematically, it defines the "optimal model" as minimizing the weighted loss of all client data. It guides the design of the central server's aggregation strategy. Formula (1) is an operable convergence criterion designed for the above optimization problem in a real-world cross-domain privacy protection scenario. Since client data cannot leave the country, the global objective function... F(w) The true value cannot be directly calculated. Therefore, the average performance metric (RMSE) evaluated on the local validation set of each client is used as its proxy. When this proxy metric remains stable over multiple iterations, it can be inferred from an engineering perspective that the global prediction model has approached the optimum, and training can be terminated.
[0045] The communication efficiency of the federated learning system is optimized in the following ways: Step 1. Employ a periodic aggregation strategy to reduce the number of communication rounds; Step 2. Use model compression technology to reduce the amount of data in each communication; Step 3. Dynamically adjust the client selection strategy, prioritizing clients with high data quality.
[0046] The client's local machine learning model is a random forest regressor with 50 trees per tree. This model is robust to overfitting and can effectively model complex nonlinear relationships.
[0047] The client data is divided into non-independent identically distributed segments, and the load characteristics and consumption patterns of different power companies' service areas are simulated based on the statistical characteristics (mean and variance) of the line loss data.
[0048] privacy budget Adjustable within the range of 1.0 to 5.0, the ε value is adjusted to balance the strength of privacy protection with prediction accuracy.
[0049] In one specific embodiment of the present invention, the federated learning system includes four clients, simulating four different power companies. System parameter settings are shown in Table 1: Table 1 The participation rate is an adjustable parameter that affects the working characteristics of a federated learning system. Table 1 uses 100% for experimental purposes to verify the core performance of the algorithm. The value of the technical solution claimed in this invention lies precisely in its ability to adapt to different operating modes with varying participation rates, from low to high, providing a flexible and reliable solution for achieving efficient, robust, and privacy-secure cross-domain line loss prediction in complex real-world power system environments.
[0050] Line loss data includes current ( I ),resistance( R ), input energy ( A in ), output energy ( A out Features such as statistical line loss (SCR) are used to determine the target variable. A stat The calculation formula is: (9) Line loss serves as training samples for the client's local model. The model learns prediction patterns by fitting these data, thereby generating model updates. Simultaneously, it is also an objective standard for evaluating whether the global prediction model has converged and its final prediction accuracy.
[0051] Data preprocessing includes: (1) Missing value handling: Fill with the mean; (2) Outlier handling: For each numerical feature, calculate its mean. m and population standard deviation s data 。 Remove any feature value that exceeds the limit from all features. ± 3p data Data samples within the range; (3) Data standardization: Z-score normalization is adopted.
[0052] To simulate real-world non-independent and identically distributed scenarios, the dataset was divided into four client-side data based on the statistical characteristics (mean and variance) of the line loss data, simulating the differences in load characteristics across the service areas of different power companies.
[0053] Differential privacy processing involves two core steps: First, gradient clipping is performed, which applies L2 norm constraints to the gradient of each sample to prevent a single sample from having too much impact on the model update.
[0054] Clipping threshold C Determined through the following steps: (1) Calculate the gradient norm distribution on the local dataset; (2) Select the 95th percentile as the initial threshold; (3) Fine-tune to the optimal value through cross-validation.
[0055] Secondly, noise is added. Based on the Gaussian mechanism, calibrated noise is added during model updates. Noise multiplier. s Calculated using the following formula: (10) in e =2.0, d =10 -5 Calculated s ≈2.0.
[0056] Model training and evaluation: The federated learning process performs 50 rounds of communication, with all clients participating in training in each round. Root mean square error (RMSE) was used as the primary evaluation metric, and the results are shown in Table 2. Table 2 Figure 2 This paper demonstrates the performance of the method of this invention in a practical line loss prediction task. The prediction accuracy of each method is intuitively reflected by comparing the "actual line loss value" and the "predicted line loss value". In the figure, the horizontal axis represents the actual statistical line loss value, in kWh, with a value range of 0 to 10 kWh and a scale interval of 1 kWh; the vertical axis represents the line loss value predicted by the model, also in kWh, with the same value range as the horizontal axis.
[0057] The graph contains four key contrast curves: 1. Ideal reference line (y = x line): labeled as "ideal prediction line", representing the theoretical optimal situation where the predicted value is completely consistent with the actual value.
[0058] 2. Locally trained independent model: The scatter distribution is relatively scattered, especially in the area with higher line loss values (>5kWh), where it deviates significantly from the diagonal, indicating the inadequacy of a single power company with limited data.
[0059] 3. Centralized training model (ideal upper bound): The scatter points are closely distributed around the diagonal, representing the highest prediction accuracy that can be achieved under the ideal condition of complete data sharing.
[0060] 4. The method of the present invention (PFL) 2 The scatter distribution is very close to that of the centralized model, especially in the low to medium line loss range (2–6 kWh), which almost overlaps with the centralized model, indicating that it can still maintain excellent prediction consistency under strong privacy protection.
[0061] By comparison, we can conclude that: 1. The root mean square error (RMSE) of the local model is 2.07 kWh; 2. The RMSE of the centralized model is 1.62 kWh; 3. The RMSE of the method of the present invention is 1.75 kWh, which is 15.5% higher than that of the local model, and the performance gap with the centralized model is only 8%.
[0062] 4. This figure visually verifies that the present invention significantly improves the accuracy of cross-domain line loss prediction while protecting data privacy.
[0063] Experimental results show that the method of the present invention provides strong privacy protection while significantly improving prediction accuracy compared to local independent training, and is close to that of a centralized ideal model.
[0064] Privacy-Utility Trade-off Analysis: As shown in Table 3, by adjusting the privacy budget e Analyze the trade-off between the strength of privacy protection and prediction accuracy: Table 3 The results show that even under strong privacy protection settings (ε=1.0), the method of the present invention still maintains a 12% performance improvement, proving its effectiveness in practical applications.
[0065] Figure 3 This diagram reveals the trade-off between privacy protection strength and prediction accuracy in the method of this invention, and is a key illustration for evaluating the practicality of differential privacy mechanisms. The horizontal axis represents the privacy budget ε, ranging from 0.5 to 5.0 with a scale interval of 0.5; the vertical axis represents the average RMSE of the global prediction model, in kWh, ranging from 1.6 to 2.2 kWh with a scale interval of 0.1 kWh.
[0066] The diagram mainly contains the following elements: 1. Privacy-Utility Trade-off Curve (Main Curve): The curve shows a downward trend, indicating that as the ε value increases (privacy protection weakens), the prediction error gradually decreases. The curve decreases rapidly in the range of ε=1.0 to 2.0, and then tends to flatten out, indicating that most of the performance gains can be obtained under a moderate privacy budget.
[0067] 2. Key data point annotation: (1) When ε=1.0 (strong privacy protection), RMSE≈1.82 kWh; (2) When ε=2.0 (default setting), RMSE≈1.75 kWh; (3) When ε=3.0 (weaker privacy), RMSE≈1.71 kWh.
[0068] 3. Reference horizontal line: (1) The dashed line above represents the local baseline performance (RMSE=2.07 kWh); (2) The dashed line below represents the non-privacy federated learning performance (RMSE=1.69 kWh).
[0069] 4. Privacy Strength Labels: The left side of the horizontal axis is labeled "Strong Privacy Protection" and the right side is labeled "Weak Privacy Protection," visually demonstrating the negative correlation between ε and privacy strength.
[0070] The following conclusions can be drawn from the figure: (1) Even under the strongest privacy settings (ε=1.0), the RMSE of the method of the present invention is still about 12% better than the local baseline; (2) When ε≥2.0, the performance is close to that of non-privacy federated learning (gap <5%). (3) The plateau effect of the curve indicates that excessively increasing ε has limited effect on performance improvement. It is recommended to choose ε=1.5–2.5 in practical applications to balance privacy and utility.
[0071] This diagram provides important guidance for system deployment, allowing users to flexibly adjust the ε value based on actual privacy compliance requirements.
[0072] This invention also provides a privacy-preserving cross-domain line loss prediction system, comprising: The central server is used for model initialization, distribution, and aggregation. Multiple clients are used for local model training and differential privacy processing; each client also includes a privacy protection module for performing gradient clipping and noise addition operations. The communication module is used to enable secure data exchange between the central server and the client.
[0073] This invention is applicable to the following application scenarios in smart grids: 1. Cross-regional line loss analysis and comparison; 2. Detection of abnormal electricity consumption behavior; 3. Evaluation of distribution network operation efficiency; 4. Support for electricity market transactions.
[0074] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0075] In the description of this invention, it should be understood that the terms "center," "height," "thickness," "upper," "lower," "vertical," "horizontal," "top," "bottom," "inner," "outer," "axial," "radial," and "circumferential," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.
[0076] In the description of this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0077] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.
[0078] Although the present invention has been described in detail through the preferred embodiments above, it should be understood that the above description should not be considered as a limitation of the present invention. Various modifications and substitutions to the present invention will be apparent to those skilled in the art after reading the above description. Therefore, the scope of protection of the present invention should be defined by the appended claims.
Claims
1. A privacy-preserving cross-domain line loss prediction method, characterized in that, The process includes: Step S1, constructing a federated learning system, which comprises a central server and multiple clients. The central server maintains a global prediction model, and each client has a local private dataset containing multiple samples, each corresponding to a line loss data point; Step S2, the central server distributes the global prediction model to each client; Step S3, each client trains the global prediction model on the line loss data and calculates the local model update; Step S4, each client performs differential privacy processing on its local model update; Step S5, the client uploads the differential privacy-processed model update to the central server; Step S6, the central server aggregates the model updates from each client to generate a new generation of global prediction model; Step S7, repeating the communication iteration process from Step S2 to Step S6 until the iteration conditions are met, at which point training terminates.
2. The privacy-preserving cross-domain line loss prediction method as described in claim 1, characterized in that, The global prediction model is a random forest regressor.
3. The privacy-preserving cross-domain line loss prediction method as described in claim 2, characterized in that, Each client k Holding local private datasets D k , Each private dataset D k Include One sample, each sample For a single line loss data point, the feature vector Includes current I ,resistance R Input energy A in Output energy A out Target variable For statistical line loss value A stat , ; Calculating local model updates for the global prediction model includes: In the formula, the global prediction model parameters w It refers to the set of all trainable parameters that constitute the global prediction model. Update the local model. These are the parameters trained locally. These are the initial parameters. ,parameter It uses samples Trained.
4. The privacy-preserving cross-domain line loss prediction method as described in claim 3, characterized in that, The differential privacy processing includes gradient pruning and noise addition; The gradient clipping includes: Perform gradient for each sample L 2 Norm clipping: In the formula, C To preset the cropping threshold, g(x i ) as a sample x i The gradient; The noise addition includes: Add Gaussian noise to the model update: In the formula, σ For noise multiplier, I The identity matrix and noise multiplier are given. σ Through formula calculate, The probability of failure. Budget for privacy.
5. The privacy-preserving cross-domain line loss prediction method as described in claim 4, characterized in that, Privacy Budget The value ranges from 1.0 to 5.
0.
6. The privacy-preserving cross-domain line loss prediction method as described in claim 4, characterized in that, The gradient clipping threshold C Determined through the following steps: Step 1: Calculate the gradient norm distribution on the local private dataset; Step 2, select the first p Percentiles are used as the pruning threshold, where, ; Step 3: Adjust through cross-validation to obtain the optimal utility-privacy trade-off.
7. The privacy-preserving cross-domain line loss prediction method as described in claim 4, characterized in that, The central server aggregates model updates from various clients to generate a new generation of global prediction models, including: The central server uses a federated averaging algorithm to aggregate updates from all clients. In the formula, For the first t The set of clients participating in training via round-robin communication. t It is a natural number.
8. The privacy-preserving cross-domain line loss prediction method as described in claim 1, characterized in that, The iteration conditions include: an upper limit condition for the number of communication rounds and / or a convergence condition; The upper limit condition for the number of communication rounds includes: when the number of communication rounds... t Reaching the preset maximum value T_ max Training will be terminated at that time, during which... t For natural numbers, T_ max The range is 30 to 100; The convergence criteria include: the central server maintains a global prediction model validation set, or the average performance is taken on the local validation sets of each client. Let the first t The root mean square error of the global prediction model after round-robin communication on the global prediction model validation set is: RMSE_val (t) If continuous N=10 If formula (1) is satisfied within a round, then training is terminated; Wherein, the local validation set is a subset of the local private dataset; global objective function F(w) This is used to define the convergence state of the global prediction model. The global objective function is: In the formula, For the client k The number of samples, For the client k The local objective function; The local objective function Defined as: In the formula, D k For the client k Local private dataset, For regression loss function; The regression loss function is calculated using the mean squared error: In the formula, For the model to sample The predicted value.
9. The privacy-preserving cross-domain line loss prediction method as described in claim 1, characterized in that, Optimize the communication efficiency of the federated learning system, including: A periodic aggregation strategy is adopted to reduce the number of communication rounds; Use model compression technology to reduce the amount of data in each communication; Dynamically adjust the client selection strategy, prioritizing clients with high data quality.
10. A privacy-preserving cross-domain line loss prediction system for implementing the privacy-preserving cross-domain line loss prediction method as described in any one of claims 1 to 9, characterized in that, Include: The central server is used for model initialization, distribution, and aggregation. Multiple clients are used for local model training and differential privacy processing. Each client includes a privacy protection module for performing differential privacy processing. The communication module is used to enable secure data exchange between the central server and the client.