An enterprise electricity consumption self-adaptive prediction method based on cross-enterprise knowledge transfer

CN123014304APending Publication Date: 2026-10-30HUANENG JIANGSU COMPREHENSIVE ENERGY SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611187182.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-06
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0005]有鉴于此,本发明提供一种基于跨企业知识迁移的企业用电量自适应预测方法,以解决上述提及的问题

Benefits of technology

[0055]1、本发明通过构建企业用电画像进行聚类,识别具有相似源荷耦合特性的企业簇,并在簇内共享模型底层表征,实现跨企业的预测知识迁移,通过该方法,即便是在目标企业历史数据极少的情况下,也能通过借用相似企业的规律实现高精度用电量预测。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123014304A_ABST
    Figure CN123014304A_ABST
Patent Text Reader

Abstract

The application provides an enterprise electricity consumption self-adaptive prediction method based on cross-enterprise knowledge migration, relates to the technical field of artificial intelligence and industrial big data processing, and comprises the following steps: constructing a multi-layer progressive enterprise electricity consumption portrait; performing verification and correction processing on the multi-layer progressive enterprise electricity consumption portrait to obtain an enterprise comprehensive electricity consumption portrait; combining electricity consumption driving mechanism features extracted by pre-causal structure learning, and through cluster purity verification and adaptive secondary subdivision strategy, forming an enterprise cluster set with similar source-load coupling characteristics; learning general time sequence features through full-amount enterprise data, learning cluster industry characteristics through history data of enterprises in the same cluster to obtain a hierarchical pre-training prediction model; and through three-stage gradual unfreezing, combining smooth transition weight fusion prediction output, realizing electricity consumption self-adaptive prediction in the whole life cycle from cold start to mature period. The application can realize high-precision electricity consumption prediction by borrowing the rules of similar enterprises.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and industrial big data processing technology, and more specifically, to an adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer. Background Technology

[0002] With the deepening of low-carbon goals and the accelerated construction of new power systems, distributed photovoltaic (PV) power generation has been widely applied in industrial parks, commercial complexes, and industrial enterprises. The high proportion of renewable energy integration has fundamentally changed the electricity consumption characteristics of enterprise users. Enterprises are no longer merely pure electricity consumers, but rather integrated source-load units with both power generation and consumption attributes. Against this backdrop, enterprise electricity consumption forecasting no longer relies solely on trend extrapolation from historical load data; it must also fully consider the impact of multiple coupled factors such as PV output fluctuations, changes in weather conditions, time-of-use pricing responses, and the enterprise's own production rhythm. This significantly increases the difficulty of forecasting compared to traditional scenarios.

[0003] Existing forecasting technologies typically build independent models for each enterprise, leading to two core problems: first, data silos, where similar patterns between enterprises cannot be shared; and second, the cold start challenge, where newly connected enterprises or those recently upgrading their production lines suffer from sparse historical data and insufficient model training, resulting in extremely low forecasting accuracy. Extracting common electricity consumption characteristics among different enterprises and effectively transferring forecasting knowledge from established enterprises to newly connected ones is crucial for improving regional energy management efficiency.

[0004] There are currently no effective solutions to the problems in the relevant technologies. Summary of the Invention

[0005] In view of this, the present invention provides an adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer to solve the aforementioned problems.

[0006] To solve the above problems, the specific technical solution adopted by the present invention is as follows:

[0007] An adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer includes the following steps:

[0008] S1. Obtain enterprise power operation data and construct a multi-layer progressive enterprise power consumption profile; according to the inter-layer complementary verification mechanism, verify and correct the multi-layer progressive enterprise power consumption profile, and merge it through selective splicing to obtain a comprehensive enterprise power consumption profile.

[0009] S2. Based on the comprehensive electricity consumption profile of enterprises and combined with the electricity consumption driving mechanism features extracted by pre-causal structure learning, a statistical-causal comprehensive distance metric is constructed. An improved K-means++ algorithm is used for clustering and partitioning, and a set of enterprise clusters with similar source-load coupling characteristics is formed through cluster purity verification and adaptive secondary subdivision strategy. Among them, the improved K-means++ algorithm selects the initial centroid using the statistical-causal comprehensive distance metric.

[0010] S3. Construct a hierarchical transfer learning model, use enterprise clusters to perform hierarchical pre-training on the hierarchical transfer learning model, and learn general time-series features through full enterprise data and learn industry characteristics within the cluster through historical data of enterprises in the same cluster to obtain a hierarchical pre-trained prediction model.

[0011] S4. Based on the hierarchical pre-trained prediction model, and combined with domain adversarial feature decoupling and first-order Wasserstein distance metric, an adaptive mode switching mechanism based on distribution differences is constructed. Through three-stage progressive unfreezing, combined with smooth transition weight fusion prediction output, adaptive prediction of electricity consumption throughout the entire life cycle from cold start to maturity is achieved.

[0012] Preferably, step S1 includes the following steps:

[0013] S11. Obtain enterprise power operation data and construct a source-load power consumption profile by extracting the enterprise's static attributes and dynamic operation characteristics;

[0014] S12. Based on the enterprise's power operation data, determine the enterprise's net power sequence and total power load sequence, and use the depth of the duck curve, the evening ramp rate and the intraday reversal frequency as supply and demand fluctuation characteristics. Based on the supply and demand fluctuation characteristics, construct a supply and demand fluctuation profile.

[0015] S13. Based on the enterprise's power operation data, determine the enterprise's total active power sequence, and calculate the weekend deviation, daily cycle signal-to-noise ratio, and mode drift rate as steady-state rhythm characteristics. Based on the steady-state rhythm characteristics, construct a steady-state rhythm profile.

[0016] S14. Based on the inter-layer complementary verification mechanism, the source-load power consumption profile, supply-demand fluctuation profile, and steady-state rhythm profile are corrected and then merged by selective splicing to obtain the enterprise's comprehensive power consumption profile.

[0017] Preferably, step S14 includes the following steps:

[0018] S141. Extract the depth of the duck curve in the supply and demand fluctuation profile, and determine whether the depth of the duck curve exceeds the preset depth threshold. If so, adjust the daily average source-load power ratio upward; otherwise, keep the daily average source-load power ratio unchanged.

[0019] S142. Extract the daily cycle signal-to-noise ratio from the steady-state rhythm profile, and determine whether the daily cycle signal-to-noise ratio is higher than the preset signal-to-noise ratio threshold. If so, adjust the load volatility downward; otherwise, keep the load volatility unchanged.

[0020] S143. After verification and correction of the supply and demand fluctuation profile and steady-state rhythm profile, output the verified and corrected source load power consumption profile; the daily average source load power ratio and load fluctuation rate in the verified and corrected source load power consumption profile have been corrected for deviation by the upper-level profile.

[0021] S144. The verified and corrected source load power consumption profile, supply and demand fluctuation profile, and steady-state rhythm profile are merged by vector splicing to output the enterprise's comprehensive power consumption profile.

[0022] Preferably, step S2 includes the following steps:

[0023] S21. Using the feature variables of the enterprise's comprehensive electricity consumption profile as nodes, the weighted adjacency matrix is ​​solved through causal structure learning with sparse penalty and acyclic constraint. After threshold truncation and undirection processing, the causal skeleton and causal effect features are extracted to form the electricity consumption driving mechanism features.

[0024] S22. Standardize the comprehensive electricity consumption profile of enterprises to obtain a standardized enterprise profile vector, and construct a statistical-causal comprehensive distance metric by combining the characteristics of electricity consumption driving mechanism.

[0025] S23. The improved K-means++ algorithm is used to calculate the probability of initial centroid selection using a statistical-causal comprehensive distance metric, and the initial centroid is iteratively optimized using a spatial density correction method to complete the enterprise clustering.

[0026] S24. Perform cluster purity verification and adaptive secondary subdivision processing on the clustering results to obtain a set of enterprise clusters with similar source-load coupling characteristics.

[0027] Preferably, step S21 includes the following steps:

[0028] S211. By selecting the average daily source-load power ratio, load fluctuation rate, meteorological sensitivity coefficient, duck curve depth and evening climbing rate in the comprehensive electricity consumption profile of enterprises as causal analysis nodes, a five-dimensional characteristic variable set is constructed. The causal influence intensity between each causal analysis node is the variable to be solved, and a weighted adjacency matrix is ​​constructed.

[0029] S212. Construct a causal structure learning loss function that includes a data fitting term, a sparse penalty term, and an acyclic constraint term, and iteratively update the weighted adjacency matrix through gradient descent until convergence, thus obtaining the converged weighted adjacency matrix.

[0030] S213. Perform threshold truncation on the converged weighted adjacency matrix to obtain the causal effect matrix.

[0031] S214. Undirect the causal effect matrix to obtain the causal skeleton adjacency matrix.

[0032] S215. Extract the causal skeleton vector, critical path causal effect, and causal heterogeneity index from the causal effect matrix and the causal skeleton adjacency matrix to form the characteristics of the electric drive mechanism.

[0033] Preferably, step S23 includes the following steps:

[0034] S231. Based on the statistical-causal integrated distance metric, calculate the probability distribution of the centroid, and select several initial centroids according to the probability distribution of the centroid;

[0035] S232. For each initial centroid, calculate its local spatial density and calculate the density gradient direction based on the direction vector of each sample in the neighborhood relative to the centroid. Use the density gradient direction as the centroid offset direction and correct the position of the initial centroid with a preset correction step size to obtain the corrected centroid.

[0036] S233. Based on the corrected centroids, perform standard K-means iterations until convergence to obtain preliminary clustering results, thus completing the enterprise clustering.

[0037] Preferably, step S24 includes the following steps:

[0038] S241. Obtain the sample composition information of each enterprise cluster in the preliminary clustering results and the real industry label corresponding to each enterprise, and calculate the industry purity of each enterprise cluster respectively.

[0039] S242. Based on the causal skeleton adjacency matrix, calculate the average pairwise Jaccard similarity of the causal skeletons of enterprises within the enterprise cluster, and use the average pairwise Jaccard similarity of the causal skeletons of enterprises within the enterprise cluster as the causal purity of the enterprise cluster.

[0040] S243. If the industry purity of the current enterprise cluster is lower than the first preset threshold or the causal purity is lower than the second preset threshold, then the current cluster is determined to be a heterogeneous mixed cluster, triggering adaptive secondary subdivision; the adaptive secondary subdivision is to re-run the improved K-means++ algorithm within the samples of this cluster for secondary clustering until the industry purity of all enterprise clusters is greater than or equal to the first preset threshold and the causal purity is greater than or equal to the second preset threshold, or the maximum subdivision depth is reached.

[0041] S244. Output all enterprise clusters that meet the dual threshold requirements of industry purity and causal purity, forming a set of enterprise clusters with similar source-load coupling characteristics.

[0042] Preferably, step S3 includes the following steps:

[0043] S31. Construct a hierarchical transfer learning model with a three-layer parameter-sharing architecture;

[0044] S32. Using historical operational data within the enterprise cluster as the training set, perform hierarchical pre-training on the hierarchical transfer learning model to obtain the pre-trained model parameters.

[0045] S33. For the target enterprise, load the corresponding pre-trained model parameters according to its enterprise cluster, and perform stratified freeze training using the historical data of the target enterprise to obtain a stratified pre-trained prediction model adapted to the target enterprise.

[0046] Preferably, step S4 includes the following steps:

[0047] S41. Introduce a gradient reversal layer and a domain discriminator into the hierarchical pre-trained prediction model, construct an adversarial training objective function and perform joint optimization, force the extraction of domain-invariant features to achieve feature distribution alignment between the source domain and the target domain, and obtain the feature space after domain adversarial decoupling and alignment.

[0048] S42. In the feature space after decoupling and alignment of the adversarial features in the longitudinal domain, the residual difference between the feature distribution of the source domain and the feature distribution of the target domain is quantified by the first-order Wasserstein distance to obtain the distribution distance metric.

[0049] S43. Perform a three-stage adaptive mode switch based on the distribution distance metric and the cumulative data volume of the target enterprise, and achieve jitter-free fusion of the prediction output through smooth transition weights.

[0050] Preferably, step S43 includes the following steps:

[0051] S431. Compare the distribution distance metric and the cumulative data volume of the target enterprise with a preset comparison threshold, and determine the current stage based on the comparison result; the stage includes migration mode, transition mode and local mode;

[0052] S432. Execute the parameter unfreezing strategy of the corresponding level according to the determined stage;

[0053] S433. Repeat steps S431-S432, recalculate the distribution distance metric and re-determine the current stage in each training cycle, and execute the corresponding parameter update strategy according to the re-determined stage until a smooth transition from cold start knowledge transfer to fully personalized evolution is completed.

[0054] The beneficial effects of this invention are as follows:

[0055] 1. This invention constructs enterprise electricity consumption profiles for clustering, identifies enterprise clusters with similar source-load coupling characteristics, and shares the underlying representation of the model within the clusters to achieve cross-enterprise predictive knowledge transfer. Through this method, even when there is very little historical data for the target enterprise, high-precision electricity consumption prediction can be achieved by borrowing the patterns of similar enterprises.

[0056] 2. This invention is based on a dynamic mode switching mechanism using Wasserstein distance, enabling a smooth transition from cold start to maturity without the need for manual parameter tuning.

[0057] 3. This invention uses domain adversarial networks to eliminate industry distribution bias, providing a theoretical guarantee for cross-enterprise knowledge transfer and breaking down data silos.

[0058] 4. The framework of this invention supports federated learning extensions, enabling cross-park knowledge sharing while protecting enterprise data privacy, thereby improving the overall intelligence level of regional energy management. Attached Figure Description

[0059] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:

[0060] Figure 1 This is a flowchart of an adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer according to an embodiment of the present invention;

[0061] Figure 2 This is a principle block diagram of an enterprise electricity consumption adaptive prediction system based on cross-enterprise knowledge transfer according to an embodiment of the present invention;

[0062] Figure 3 This is a framework diagram of an adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer according to an embodiment of the present invention;

[0063] Figure 4 This is a flowchart illustrating the construction of a comprehensive enterprise electricity consumption profile in an adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer, according to an embodiment of the present invention.

[0064] Figure 5 This is a hardware structure block diagram of the host device according to an embodiment of the present invention. Detailed Implementation

[0065] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0066] The methods and embodiments provided in this application can be executed on a host device or a similar computing device. Taking running on a host device as an example, such as... Figure 5 As shown, the host device may include one or more ( Figure 5 Only one is shown in the diagram. The processor (which may include, but is not limited to, a microprocessor (MCU) or programmable logic device (FPGA), etc.) and storage for storing data are also shown. The host device may further include transmission devices for communication functions and input / output devices. Those skilled in the art will understand that... Figure 5 The structure shown is for illustrative purposes only and does not limit the structure of the host device described above. For example, the host device may also include components that are larger than... Figure 5 The more or fewer components shown, or having the same Figure 5 The different configurations shown.

[0067] The memory can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the exception handling method in this embodiment. The processor executes various functional applications and data processing by running the computer program stored in the memory, thus implementing the above-described method. The memory may include high-speed random access memory (RAM) and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the host device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks (LANs), mobile communication networks, and combinations thereof.

[0068] Transmission devices are used to receive or send data over a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the host device. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0069] According to an embodiment of the present invention, an adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer is provided.

[0070] Specifically, this invention proposes a power consumption prediction method. Its core innovation lies in an adaptive mode-switching mechanism based on Wasserstein distance metric and domain adversarial training. This mechanism is not a simple gradual parameter unfreezing, but rather a dynamic decision-making process that continuously quantifies the differences in feature distributions between the source domain (mature enterprises) and the target domain (new enterprises). It determines whether the model should be in a full transfer, transitional learning, or fully localized mode, and introduces smoothing weights to achieve a jitter-free fusion of prediction outputs. This effectively solves the negative transfer problem caused by distribution shifts in traditional transfer learning, as well as the catastrophic forgetting problem that may occur due to data accumulation, ensuring a steady improvement in prediction accuracy throughout the entire lifecycle of new enterprises, from cold start to maturity.

[0071] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments, such as... Figure 1 and Figure 3 As shown, according to a first embodiment of the present invention, an adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer is provided, comprising the following steps:

[0072] S1. Obtain enterprise power operation data and construct a multi-layer progressive enterprise power consumption profile; according to the inter-layer complementary verification mechanism, verify and correct the multi-layer progressive enterprise power consumption profile, and merge it through selective splicing to obtain a comprehensive enterprise power consumption profile.

[0073] like Figure 4 As shown, in a preferred embodiment, step S1 includes the following steps:

[0074] S11. Obtain enterprise power operation data and construct a source-load power consumption profile by extracting the enterprise's static attributes and dynamic operation characteristics;

[0075] It should be noted that when constructing a multi-source driven enterprise power consumption profile, the first step is to acquire enterprise power operation data, including enterprise industry category, transformer capacity, photovoltaic installed capacity, total load data, photovoltaic power generation data, ambient temperature data, and time-of-use electricity price data. Specifically, static attributes of the enterprise are extracted from industry category, transformer capacity, and photovoltaic installed capacity; dynamic operating characteristics are extracted from enterprise load, photovoltaic output, ambient temperature, and electricity price change data. These include:

[0076] Extract static attributes (industry category, transformer capacity, photovoltaic installation ratio) and dynamic characteristics (source-load power ratio, load fluctuation rate, weather sensitivity) of enterprises to form a source-load electricity consumption profile:

[0077] ;

[0078] In the formula, A vector representing the profile of a company; Code the industry category; This is the ratio of photovoltaic installed capacity to transformer capacity. This represents the daily average source-load power ratio; For load fluctuation rate; This is the meteorological sensitivity coefficient. This vector maps the static attributes and dynamic electricity consumption patterns of enterprises to the same feature space, providing a mathematical basis for subsequent similarity measurements.

[0079] Among them, source-load power ratio Defined as:

[0080] ;

[0081] In the formula, Let be the photovoltaic power generation at time t; This refers to the company's total electricity load. This indicator represents the net power drawn from the power grid and reflects the company's self-sufficiency rate in renewable energy. >1 indicates that surplus photovoltaic power can be fed back to the grid. <1 indicates that electricity needs to be purchased from the power grid.

[0082] Daily average source-load power ratio Calculation formula:

[0083] ;

[0084] In the formula, T represents the total number of sampling points within the statistical period, typically 24 hours (96 sampling points at 15-minute intervals). This statistic characterizes the average daily self-sufficiency rate of new energy for enterprises.

[0085] Load fluctuation Calculated using moving window standard deviation:

[0086] ;

[0087] In the formula, W is the length of the time window, i is the sampling time number within the time window, and t is the current time; The average load within the window is used to quantify the stability of enterprise production. The greater the volatility, the more irregular the electricity consumption behavior and the more difficult it is to predict.

[0088] Meteorological sensitivity coefficient Quantified using Pearson correlation coefficient:

[0089] ;

[0090] In the formula, The covariance between load and ambient temperature; and These represent the standard deviations of load and temperature, respectively. The coefficient ranges from -1 to 1. A larger absolute value indicates a more significant impact of meteorological factors on electricity consumption behavior, and the model should focus on meteorological forecast characteristics.

[0091] S12. Based on the enterprise's power operation data, determine the enterprise's net power sequence and total power load sequence, and use the depth of the duck curve, the evening ramp rate and the intraday reversal frequency as supply and demand fluctuation characteristics. Based on the supply and demand fluctuation characteristics, construct a supply and demand fluctuation profile.

[0092] It should be noted that when constructing a profile of supply and demand fluctuations, a 7-day net power sequence is obtained. With total electricity load sequence Calculate the following features:

[0093] (1) Duck curve depth:

[0094] ;

[0095] In the formula, This represents the minimum net power during the midday period (10:00-14:00). The daily average load is derived from the total electricity load sequence. The arithmetic mean is used to obtain this value. The larger the value, the deeper the backfeeding occurs at midday, and the greater the pressure on the power grid to absorb it.

[0096] (2) Evening climbing rate :

[0097] ;

[0098] In the formula, =15min. The larger the value, the steeper the power deficit in the evening, and the greater the pressure on the power grid frequency regulation.

[0099] (3) Intraday reversal frequency: ;

[0100] In the formula, This is an indicator function (it takes the value 1 if the condition is met, and 0 otherwise). The larger the value, the more unstable the supply and demand relationship within the day.

[0101] Supply and demand fluctuation profile vector: .

[0102] S13. Based on the enterprise's power operation data, determine the enterprise's total active power sequence, and calculate the weekend deviation, daily cycle signal-to-noise ratio, and mode drift rate as steady-state rhythm characteristics. Based on the steady-state rhythm characteristics, construct a steady-state rhythm profile.

[0103] It should be noted that when constructing a steady-state rhythm profile, the total active power sequence over 30 days is obtained. Calculate the following features:

[0104] (1) Weekend deviation :

[0105] ;

[0106] In the formula, This represents the average workload on weekdays. This represents the average workload on rest days. The higher the value, the stronger the constraints of the work calendar on the company's production.

[0107] (2) Daily periodic signal-to-noise ratio :

[0108] ;

[0109] In the formula, This refers to the daily (24-hour) energy in the FFT spectrum; For other frequency energy. The higher the value, the more regular the daily electricity consumption pattern.

[0110] (3) Mode drift rate : ;

[0111] In the formula, For Euclidean distance, For week i+1, For week i, The smaller the value, the more stable the enterprise's electricity consumption pattern, and the more suitable it is for establishing a long-term forecasting model.

[0112] Steady-state rhythm profiling vector: .

[0113] S14. Based on the inter-layer complementary verification mechanism, the source-load power consumption profile, supply-demand fluctuation profile, and steady-state rhythm profile are corrected and then merged by selective splicing to obtain the enterprise's comprehensive power consumption profile.

[0114] In a preferred embodiment, S14 includes the following steps:

[0115] S141. Extract the depth of the duck curve in the supply and demand fluctuation profile, and determine whether the depth of the duck curve exceeds the preset depth threshold. If so, adjust the daily average source-load power ratio upward; otherwise, keep the daily average source-load power ratio unchanged.

[0116] S142. Extract the daily cycle signal-to-noise ratio from the steady-state rhythm profile, and determine whether the daily cycle signal-to-noise ratio is higher than the preset signal-to-noise ratio threshold. If so, adjust the load volatility downward; if not, keep the load volatility unchanged. The preset signal-to-noise ratio threshold is 3.0.

[0117] S143. After verification and correction of the supply and demand fluctuation profile and steady-state rhythm profile, output the verified and corrected source load power consumption profile; the daily average source load power ratio and load fluctuation rate in the verified and corrected source load power consumption profile have been corrected for deviation by the upper-level profile.

[0118] Specifically, the average daily source-load power ratio is corrected by the duck curve depth verification in the supply-demand fluctuation profile (i.e., step S141), and the load fluctuation rate is corrected by the daily cycle signal-to-noise ratio verification in the steady-state rhythm profile (i.e., step S142). Substituting the corrected average daily source-load power ratio and load fluctuation rate into the source-load power consumption profile vector, the verified and corrected source-load power consumption profile is obtained.

[0119] S144. The verified and corrected source load power consumption profile, supply and demand fluctuation profile, and steady-state rhythm profile are merged by vector splicing to output the enterprise's comprehensive power consumption profile.

[0120] It should be noted that the inter-layer complementary verification and dynamic fusion are features proposed in this invention that differ from the simple and direct stitching of multi-layer images in existing technologies. They utilize an inter-layer complementary verification mechanism: using the upper-layer image to correct deviations in the lower-layer image, specifically including:

[0121] (1) Verification rule: When F (2) e Upon activation, adjust the average self-sufficiency rate in the base profile:

[0122] ;

[0123] In the formula, when the depth of the duck curve exceeds the threshold of 0.5, it indicates that the average self-sufficiency rate seriously underestimates the midday surplus capacity and needs to be corrected upward.

[0124] When F (3) e Upon activation, correct load volatility:

[0125] ;

[0126] In the formula, The daily signal-to-noise ratio (SNR) indicates that there are more predictable components in the volatility, and the true random volatility should be adjusted downwards.

[0127] (2) Dynamic fusion output: ;

[0128] In the formula, Indicates selective splicing, and In and It has been verified and corrected by the upper-level profile. This mechanism ensures that information from each layer is complementary rather than simply piled up, avoiding contradictory information from misleading subsequent clustering.

[0129] S2. Based on the comprehensive electricity consumption profile of enterprises and combined with the electricity consumption driving mechanism features extracted by pre-causal structure learning, a statistical-causal comprehensive distance metric is constructed. An improved K-means++ algorithm is used for clustering and partitioning, and a set of enterprise clusters with similar source-load coupling characteristics is formed through cluster purity verification and adaptive secondary subdivision strategy. Among them, the improved K-means++ algorithm selects the initial centroid using the statistical-causal comprehensive distance metric.

[0130] In a preferred embodiment, step S2 includes the following steps:

[0131] S21. Using the feature variables of the enterprise's comprehensive electricity consumption profile as nodes, the weighted adjacency matrix is ​​solved through causal structure learning with sparse penalty and acyclic constraint. After threshold truncation and undirection processing, the causal skeleton and causal effect features are extracted to form the electricity consumption driving mechanism features.

[0132] S22. Standardize the comprehensive electricity consumption profile of enterprises to obtain a standardized enterprise profile vector, and construct a statistical-causal comprehensive distance metric by combining the characteristics of electricity consumption driving mechanism.

[0133] S23. The improved K-means++ algorithm is used to calculate the probability of initial centroid selection using a statistical-causal comprehensive distance metric, and the initial centroid is iteratively optimized using a spatial density correction method to complete the enterprise clustering.

[0134] S24. Perform cluster purity verification and adaptive secondary subdivision processing on the clustering results to obtain a set of enterprise clusters with similar source-load coupling characteristics.

[0135] In a preferred embodiment, S21 includes the following steps:

[0136] S211. By selecting the average daily source-load power ratio, load fluctuation rate, meteorological sensitivity coefficient, duck curve depth and evening climbing rate in the comprehensive electricity consumption profile of enterprises as causal analysis nodes, a five-dimensional characteristic variable set is constructed. The causal influence intensity between each causal analysis node is the variable to be solved, and a weighted adjacency matrix is ​​constructed.

[0137] S212. Construct a causal structure learning loss function that includes a data fitting term, a sparse penalty term, and an acyclic constraint term, and iteratively update the weighted adjacency matrix through gradient descent until convergence, thus obtaining the converged weighted adjacency matrix.

[0138] S213. Perform threshold truncation on the converged weighted adjacency matrix to obtain the causal effect matrix.

[0139] S214. Undirect the causal effect matrix to obtain the causal skeleton adjacency matrix.

[0140] S215. Extract the causal skeleton vector, critical path causal effect, and causal heterogeneity index from the causal effect matrix and the causal skeleton adjacency matrix to form the characteristics of the electric drive mechanism.

[0141] In a preferred embodiment, S23 includes the following steps:

[0142] S231. Based on the statistical-causal integrated distance metric, calculate the probability distribution of the centroid, and select several initial centroids according to the probability distribution of the centroid;

[0143] S232. For each initial centroid, calculate its local spatial density and calculate the density gradient direction based on the direction vector of each sample in the neighborhood relative to the centroid. Use the density gradient direction as the centroid offset direction and correct the position of the initial centroid with a preset correction step size to obtain the corrected centroid.

[0144] S233. Based on the corrected centroids, perform standard K-means iterations until convergence to obtain preliminary clustering results, thus completing the enterprise clustering.

[0145] In a preferred embodiment, S24 includes the following steps:

[0146] S241. Obtain the sample composition information of each enterprise cluster in the preliminary clustering results and the real industry label corresponding to each enterprise, and calculate the industry purity of each enterprise cluster respectively.

[0147] S242. Based on the causal skeleton adjacency matrix, calculate the average pairwise Jaccard similarity of the causal skeletons of enterprises within the enterprise cluster, and use the average pairwise Jaccard similarity of the causal skeletons of enterprises within the enterprise cluster as the causal purity of the enterprise cluster.

[0148] S243. If the industry purity of the current enterprise cluster is lower than the first preset threshold or the causal purity is lower than the second preset threshold, then the current cluster is determined to be a heterogeneous mixed cluster, triggering adaptive secondary subdivision; the adaptive secondary subdivision is to re-run the improved K-means++ algorithm within the samples of this cluster for secondary clustering until the industry purity of all enterprise clusters is greater than or equal to the first preset threshold and the causal purity is greater than or equal to the second preset threshold, or the maximum subdivision depth is reached.

[0149] S244. Output all enterprise clusters that meet the dual threshold requirements of industry purity and causal purity, forming a set of enterprise clusters with similar source-load coupling characteristics.

[0150] Specifically, to avoid misclassification due to similar curves but different driving mechanisms caused by relying solely on statistical profiles, this step performs causal structure learning on the electricity consumption sequences of each enterprise before clustering, extracting features of the electricity consumption driving mechanism as parallel constraints for clustering. Using profile features as causal analysis variables, a 5-dimensional feature set V={ ,σ load ,η,D duck ,R ramp}, respectively, correspond to the daily average source-load power ratio, load fluctuation rate, meteorological sensitivity coefficient, duck curve depth, and evening climbing rate.

[0151] Learn a 5×5 weighted adjacency matrix W, W ij This represents the strength of the causal influence of feature j on feature i. It is solved by minimizing the following loss function:

[0152] ;

[0153] In the formula, The loss function is learned for the causal structure, which includes data fitting terms, sparse penalty terms, and acyclic constraint terms. Let R be the feature matrix for N companies, where R is the set of real numbers, indicating that the feature matrix has N rows (N companies) and 5 columns (5 features). It is the Frobenius norm; =0.01 is the sparsity penalty coefficient; =1.0 is the coefficient for acyclic constraints; The trace of the matrix increases significantly when W has a closed loop, and the optimization process automatically drives it toward a loop-free solution.

[0154] right Regarding the gradient of W, we iteratively update W←W-η·▽ using gradient descent. WL (η=0.001), where η is the learning rate (step size), which takes a value of 0.001 and controls the step size of each gradient descent update. ▽ WL Let L be the gradient of the loss function with respect to matrix W, until convergence. After convergence, threshold W is applied (|W|). ij (If |<0.3, set to zero), we obtain the causal effect matrix B. e .

[0155] B e Undirection yields the causal skeleton adjacency matrix S e ∈{0,1} (5×5) :

[0156] ;

[0157] In the formula, The element in the i-th row and j-th column of the causal skeleton adjacency matrix. is the element in the i-th row and j-th column of the causal effect matrix.

[0158] From S e and B e Extracting the causal feature vector C e :

[0159] (1) Causal skeleton vector: c1=vec(S e )∈{0,1} 10 , is the flattened vector of the causal skeleton, representing the structural type of the electric drive mechanism; where vec is a matrix vectorization operation, transforming the 5×5 matrix S e Flattened, it becomes a vector of length 10.

[0160] (2) Critical path causal effect: c2=[B e (σ load ,η)·B e (η, ),B e (D duck ,R ramp )]∈R 2 R represents the cumulative causal effect of the two key pathways. 2 It is a 2-dimensional real vector space;

[0161] (3) Causal heterogeneity index: ;

[0162] In the formula, B cluster Let F be the average causal effect matrix of firms in the current candidate cluster, where F is the Frobenius norm, i.e., the square root of the sum of the squares of all elements in the matrix.

[0163] final , with F e (norm) Parallel processing is used as clustering input.

[0164] Among them, the standardized enterprise profile vector F e (norm) :

[0165] ;

[0166] In the formula, μ is the mean vector of all features of all enterprises; σ is the standard deviation vector. Z-score standardization eliminates the differences in the dimensions of different features, ensuring the fairness of the clustering distance measurement.

[0167] Define inter-firm statistical-causal comprehensive distance:

[0168] ;

[0169] In the formula, α is the statistical-causal weighting coefficient, which is 0.8 for the cold start period and 0.5 for the data-sufficient period. Let be the statistical-causal combined distance between the i-th enterprise and the j-th enterprise. This is the standardized vector of the i-th enterprise profile. Let j be the standardized enterprise profile vector. Hamming distance is the number of distinct elements at corresponding positions between two vectors of equal length; here it is used to measure the causal skeleton vectors of two enterprises. and The structural differences between them, namely the number of inconsistencies in the existence of causal edges. Let i be the causal skeleton vector of the i-th enterprise. Let j be the causal skeleton vector of the j-th enterprise. Let be the critical path causal effect vector of the i-th enterprise. Let be the critical path causal effect vector of the j-th enterprise.

[0170] In the K-means++ initialization strategy, the probability of selecting the new centroid is:

[0171] ;

[0172] In the formula, Choose a probability for the new centroid. The newly selected cluster centroids (center points) are given, and x represents candidate sample points. For iteration variables (dummy variables). The comprehensive distance D(x) is the distance from sample x′ to the nearest existing centroid, defined above as the comprehensive distance D. total It replaces the traditional Euclidean distance; This is the set of unselected samples. This strategy keeps the initial centroids far apart, reducing the risk of K-means getting trapped in local optima and improving clustering stability.

[0173] This invention uses an improved K-means++ algorithm for clustering, and the specific process is as follows:

[0174] (1) Initialization: Execute the standard K-means++ algorithm to select K initial centroids according to the formula for calculating the probability of selecting new centroids.

[0175] (2) Local density calculation: For each selected centroid, calculate its local spatial density. :

[0176] ;

[0177] In the formula, X represents the set of all enterprise samples; This is the standardized profile vector for the i-th enterprise; is the Euclidean distance; r is the preset neighborhood radius. For c k The number of samples (integer) contained within a sphere with center r and radius r represents the local sample density at that centroid, i.e., the local spatial density.

[0178] (3) Spatial density correction: To avoid the centroid falling into an overly dense region and causing blurred cluster boundaries, a density-aware correction term is introduced. The density gradient direction is calculated as follows:

[0179] ;

[0180] In the formula, For c k The set of samples within a sphere centered at radius r; Let c be the density gradient vector, representing the sample in the neighborhood relative to the centroid c. k The average direction vector points in the direction of the fastest local density growth; the density gradient calculation is also based on D. total The centroid moves toward the statistical-causal double sparsity region.

[0181] The corrected centroid position is: ;

[0182] In the formula, This is the corrected k-th centroid; To correct the step size and control the centroid movement distance, δ = 0.05r is chosen; u is a random unit vector (satisfying ||u||² = 1), and a random perturbation is introduced to avoid the correction process getting stuck at a saddle point; β is the perturbation strength coefficient, β∈[0,1], and β = 0.3 is chosen to balance the gradient direction and the weight of the random perturbation; ||g k ||2 is the L2 norm of the gradient vector, used for normalization. This operation causes the centroid to move slightly in the opposite direction of the density gradient (i.e., towards a relatively sparse region of the feature space) to obtain an initial cluster structure with a more uniform distribution and clearer boundaries, laying the foundation for subsequent cluster-specific adaptation layers to learn more discriminative industry features.

[0183] (4) Iterative optimization: Based on the corrected initial centroid, perform standard K-means iteration until convergence.

[0184] (5) Cluster purity verification and adaptive secondary subdivision: After clustering, the industry purity of each cluster is calculated based on the enterprise industry label:

[0185] ;

[0186] In the formula, C k Let be the sample set of the k-th cluster; is the total number of samples within the cluster; j is the industry category index; This is the company's true industry label; To find the maximum value for all industry categories j; if a certain cluster C k If the industry purity is lower than the preset threshold θ (θ=0.7, i.e., 70%), the cluster is determined to contain heterogeneous power consumption patterns, triggering a secondary subdivision of the cluster: the improved K-means++ algorithm (K=2) is re-run only within the samples of this cluster, and purity verification is performed again. This iterative subdivision process continues until the purity of all clusters meets the threshold or the maximum subdivision depth L is reached. max (In this embodiment, L is taken as L) max =3) up to.

[0187] Causal structure purity: Calculate the average pairwise Jaccard similarity of the causal skeletons of firms within a cluster. :

[0188] ;

[0189] like If the value is less than 0.5, the cluster is considered statistically similar but causally heterogeneous, triggering a secondary subdivision. Let be the causal skeleton adjacency vector of the i-th enterprise. Let i be the causal skeleton adjacency vector of the j-th enterprise, where i is the enterprise index and j is the enterprise index.

[0190] Secondary subdivision strategy: If a certain cluster C k If the industry purity is <0.7 or the causal purity is <0.5, then the improved K-means++ algorithm (with K=2) is re-run only within that cluster sample. During re-clustering, α=0.3 is temporarily adjusted in the statistical-causal distance formula between firms to prioritize separating heterogeneous firms based on causal mechanisms. This iterative subdivision process continues until all clusters simultaneously satisfy industry purity ≥0.7 and causal purity ≥0.5, or the maximum subdivision depth L is reached. max (In this embodiment, L is taken as L) max =3) up to.

[0191] After clustering, K enterprise clusters are formed, C = {C1, C2, ..., C}. K Enterprises within the cluster share similar source-load coupling patterns and power consumption patterns.

[0192] The clustering results described above directly drive the parameter sharing range partitioning of the hierarchical transfer learning model in subsequent steps. Specifically:

[0193] (1) Parameter binding of L2 layer (cluster-specific adaptation layer): within the same cluster C k All enterprises within the same cluster adapter share the same set of parameters. The parameters between clusters are independent of each other. The clustering results determine which companies are included in the same parameter-sharing group.

[0194] (2) Cluster affiliation determination for cold-start enterprises: new enterprise e new Upon access, first calculate its image vector F. e (norm) The distance to the centroid of each cluster is used to assign it to the nearest cluster C. k Then directly load the pre-trained data of that cluster. As initial parameters for the L2 layer, it enables plug-and-play knowledge transfer.

[0195] (3) Source domain selection in domain adversarial training: When conducting domain adversarial training, the source domain enterprise is selected from the cluster C to which the target enterprise belongs. k Internal selection ensures that the source enterprise and the target enterprise have similar source-load coupling patterns, maximizing migration effectiveness.

[0196] Clustering quality directly determines the knowledge sharing boundary and transfer efficiency of subsequent transfer learning, and is a key link connecting enterprise profile feature extraction and hierarchical model training.

[0197] S3. Construct a hierarchical transfer learning model, use enterprise clusters to perform hierarchical pre-training on the hierarchical transfer learning model, and learn general time-series features through full enterprise data and learn industry characteristics within the cluster through historical data of enterprises in the same cluster to obtain a hierarchical pre-trained prediction model.

[0198] In a preferred embodiment, step S3 includes the following steps:

[0199] S31. Construct a hierarchical transfer learning model with a three-layer parameter-sharing architecture;

[0200] S32. Using historical operational data within the enterprise cluster as the training set, perform hierarchical pre-training on the hierarchical transfer learning model to obtain the pre-trained model parameters.

[0201] S33. For the target enterprise, load the corresponding pre-trained model parameters according to its enterprise cluster, and perform stratified freeze training using the historical data of the target enterprise to obtain a stratified pre-trained prediction model adapted to the target enterprise.

[0202] Specifically, the hierarchical transfer learning model with a three-layer parameter sharing architecture adopts a three-layer architecture, as shown in Table 1;

[0203] Table 1 Three-layer parameter sharing architecture

[0204] The L1 layer is a bidirectional LSTM encoder.

[0205] ;

[0206] ;

[0207] ;

[0208] In the formula, The input feature vector at time t is composed of two parts: the enterprise dynamic operation sequence and the external condition encoding. The enterprise dynamic operation sequence comes directly from the acquired time-series data, including historical net load sequences, photovoltaic output sequences, and ambient temperature sequences, with a sampling interval of 15 minutes and a sliding window width typically set to 96 points, i.e., 24 hours. This part does not require re-collection; only a window truncation of the original data is performed. The external condition encoding comes from the static and quasi-static attributes acquired above, including date type features (hour, day, week, whether it is a holiday) and future weather forecast features (temperature, irradiance). For d in 3D real vector space, This represents the hidden state of the forward LSTM at time t. This represents the hidden state of the forward LSTM at time t-1. This is the encoded output of layer L1 at time t; These represent the forward and backward LSTM hidden states, respectively; [;] indicates vector concatenation; These are encoder parameters shared across all enterprises. The bidirectional structure simultaneously captures the impact of past and future context on current power consumption.

[0209] The L2 layer is a cluster-specific residual adapter; for cluster C k The adaptation features are calculated as follows:

[0210] ;

[0211] ;

[0212] In the formula, For L1 layer output, Let be the adaptation features of the k-th cluster at time t. Let h be the multilayer perceptron of the k-th cluster, where h is the input variable of the MLP, representing the input to the MLP function. Here, the actual input is... , For the multilayer perceptron of the k-th cluster, the parameters are... Only in cluster C k Shared among internal enterprises This is the weight matrix of the first layer (hidden layer) of the MLP. This is the bias vector of the first layer (hidden layer) of the MLP. This is the weight matrix of the second layer (output layer) of the MLP. This is the bias vector for the second layer (output layer) of the MLP; the residual connection (+) preserves general feature information while injecting industry-specific knowledge. This design enables the model to learn industry commonalities while avoiding over-specialization.

[0213] The multilayer perceptron The generation and cluster binding mechanism is as follows:

[0214] (1) Source of pre-training data: After clustering is completed, each cluster C k It includes several established companies with ample historical data. (Cluster C) k The historical operational data of all mature enterprises within the company is used as the training set, which is then input into the L1 layer encoder to obtain the feature sequence. The actual net load P at the corresponding time. net Let (t) be the prediction objective. This is optimized through backpropagation by minimizing the mean squared error loss. parameters .

[0215] (2) Direct correlation with clustering results: cluster label k is The unique index. When assigning enterprise e to cluster C. k After that, the company was bound to Its L2 layer output is strictly calculated by the cluster-specific adapter. The adapter parameters for different clusters are independent of each other. and (i≠j) No sharing or interaction, ensuring that the source-load coupling logic between heterogeneous clusters will not cross-contaminate.

[0216] (3) Cold start inheritance mechanism: new enterprise e new Upon access, the distance from the image vector to the centroid of each cluster is first calculated, and the image is assigned to the nearest cluster. Then, the pre-trained images of that cluster are directly loaded. The parameters serve as initial values ​​for the L2 layer, eliminating the need for training from scratch. This inheritance process implements a complete technical chain encompassing clustering results, cluster labels, adapter selection, and knowledge transfer.

[0217] (4) Parameter update strategy: cold start period (migration mode). Keep frozen; after entering transition mode, The target enterprise data is gradually unfrozen and fine-tuned; after entering local mode, if the target enterprise data is sufficient and its distribution differs significantly from that of the source domain, the incremental update of the cluster adapter can be further triggered.

[0218] (5) Network structure details: The input dimension is the same as the output dimension of the L1 layer, both being 2d. h (Hidden state dimension after bidirectional LSTM concatenation); the hidden layer dimension is usually d. hThe activation function is ReLU; the output layer dimension is restored to 2d. h The weight matrix W1 matches the dimension of the residual connection. (k) W2 (k) Xavier uniform initialization (also known as Glorot initialization, proposed by Glorot and Bengio in 2010) is used, which starts from a uniform distribution. Random sampling in the middle, and These are the input and output dimensions of this layer, respectively; bias b1 (k) b2 (k) Initialize to a zero vector.

[0219] Layer L3 is a personalized prediction head used for calculating the prediction output:

[0220] ;

[0221] In the formula, To predict the output results, and These are parameters specific to the target company e; ReLU activation introduces nonlinearity, enhancing the fitting ability for extreme power consumption scenarios.

[0222] Among them, for new enterprise e new This approach employs a layered freezing fine-tuning strategy. While fully utilizing learned general knowledge (L1 layer) and industry knowledge (L2 layer), it rapidly adapts to individual characteristics using its limited own data. The core of this strategy is freezing shared layer parameters and optimizing only personalized layer parameters. The specific steps are as follows:

[0223] (1) Model initialization: Load the pre-trained model parameters for the new enterprise, including: globally shared encoder parameters θ enc (From L1 layer), its enterprise cluster C k Cluster-specific adapter parameters (From L2 layer), randomly initialize its own personalized prediction head parameters. and (L3 floor).

[0224] (2) Parameter freezing: During fine-tuning training, the loaded shared parameters θ are fixed (frozen). enc and This means that gradient updates for these parameters are prohibited.

[0225] (3) Defining the loss function and training: Training is performed using a small amount of historical data from the new enterprise. The goal of training is to minimize the following joint loss function:

[0226] ;

[0227] In the formula, This is the overall loss function, used to guide model optimization; the first term... Mean absolute error, which measures the deviation between the predicted value and the actual value; the second term For L2 regularization, λ is the regularization coefficient (usually between 0.01 and 0.1), used to control the weight of the second regularization loss term, balancing the relationship between fitting new data and maintaining consistency with pre-trained knowledge. This objective function forces the personalized parameters of the new enterprise to not deviate too far from the pre-trained knowledge, effectively preventing overfitting.

[0228] Only L3 layer parameters are updated during the optimization process:

[0229] ;

[0230] In the formula, For the updated L3 layer parameters, The L3 layer parameters before the update. For the parameter variable θ head Calculate the gradient, where η is the learning rate; the gradient only occurs at θ. head Backpropagation, θ enc and The gradient is artificially set to zero (parameter freezing). This selective fine-tuning mechanism allows new companies to inherit the general knowledge and industry experience of established companies, while quickly adapting to individual characteristics using limited data.

[0231] Specifically, after the above model construction, initialization, and cold start training, a hierarchical pre-trained prediction model that can run independently is obtained. The output of this model for cold start prediction of new enterprises is denoted as... However, this model employs a static parameter freezing strategy: the parameters of L1 and L2 layers are permanently fixed after cold start loading, with only L3 layer being fine-tuned based on the new enterprise's data. This means that no matter how much data the new enterprise subsequently accumulates or what unique electricity consumption patterns it develops, the model remains constrained within the framework of borrowing others' experience, unable to unleash the learning capabilities of L1 and L2 layers to achieve deep personalization. Step 4 is designed precisely to break through this static boundary.

[0232] S4. Based on the hierarchical pre-trained prediction model, and combined with domain adversarial feature decoupling and first-order Wasserstein distance metric, an adaptive mode switching mechanism based on distribution differences is constructed. Through three-stage progressive unfreezing, combined with smooth transition weight fusion prediction output, adaptive prediction of electricity consumption throughout the entire life cycle from cold start to maturity is achieved.

[0233] In a preferred embodiment, S4 includes the following steps:

[0234] S41. Introduce a gradient reversal layer and a domain discriminator into the hierarchical pre-trained prediction model, construct an adversarial training objective function and perform joint optimization, force the extraction of domain-invariant features to achieve feature distribution alignment between the source domain and the target domain, and obtain the feature space after domain adversarial decoupling and alignment.

[0235] S42. In the feature space after decoupling and alignment of the adversarial features in the longitudinal domain, the residual difference between the feature distribution of the source domain and the feature distribution of the target domain is quantified by the first-order Wasserstein distance to obtain the distribution distance metric.

[0236] S43. Perform a three-stage adaptive mode switch based on the distribution distance metric and the cumulative data volume of the target enterprise, and achieve jitter-free fusion of the prediction output through smooth transition weights.

[0237] In a preferred embodiment, S43 includes the following steps:

[0238] S431. Compare the distribution distance metric and the cumulative data volume of the target enterprise with a preset comparison threshold, and determine the current stage based on the comparison result; the stage includes migration mode, transition mode and local mode;

[0239] S432. Execute the parameter unfreezing strategy of the corresponding level according to the determined stage;

[0240] S433. Repeat steps S431-S432, recalculate the distribution distance metric and re-determine the current stage in each training cycle, and execute the corresponding parameter update strategy according to the re-determined stage until a smooth transition from cold start knowledge transfer to fully personalized evolution is completed.

[0241] It should be noted that a hierarchical pre-trained prediction model that can run independently has been built in step S3, and its cold start output is... However, this model has an inherent limitation: its parameter freezing strategy is static, and the L1 and L2 layers are permanently fixed after loading, making it unable to unleash deep learning capabilities as new enterprise data accumulates. When a new enterprise develops its own unique electricity consumption patterns after operating for several months, the model's prediction accuracy will reach a bottleneck.

[0242] Step S4 proposes a dynamic mode switching mechanism based on domain adversarial analysis as a post-processing optimization layer for the hierarchical pre-trained prediction model in Step S3. This mechanism does not modify the structure of the hierarchical pre-trained prediction model in Step S3. Instead, based on the output of Step S3, it dynamically decides whether and when to unfreeze the parameters of the L2 and even L1 layers in Step S3 by continuously quantifying the difference in feature distributions between the source and target domains, and introduces smoothing weights to achieve jitter-free fusion of the prediction outputs. The final output is the optimized prediction result, enabling the model to evolve from static borrowing to dynamic growth. Specifically, it includes the following steps:

[0243] Step 4.1 Decoupling of Domain Adversarial Features; Introducing a gradient reversal layer and a domain discriminator D to construct an adversarial training objective:

[0244] ;

[0245] In the formula, and These represent the sample size of the source company and the target company, respectively. For the domain label (0 represents the source domain, 1 represents the target domain); This represents the probability of belonging to the target domain, output by the domain discriminator. GRL multiplies the gradient by -λ during backpropagation. adv , here λ adv This is a hyperparameter used to control the strength of the influence of the gradient of the domain adversarial loss on the encoder parameter update direction. The larger the value, the stronger the incentive for the encoder to learn domain-invariant features, making the encoder generate features that the domain discriminator cannot distinguish from the source, i.e., domain-invariant features, thus eliminating the distribution bias caused by industry differences. For the parameters of the domain discriminator D, Let be the domain adversarial loss function.

[0246] In actual training, the adversarial objective function and the main prediction task are jointly optimized.

[0247] Step 4.2 Wasserstein distance metric; In the feature space after domain adversarial alignment in Step 4.1, the domain differences are quantified using Wasserstein-1 distance (i.e., first-order Wasserstein distance):

[0248] ;

[0249] In the formula, and These represent the feature distributions of the source and target domains, respectively. Let f be the joint distribution set of all marginal distributions; inf is the infimum, i.e., finding the optimal transmission scheme γ; in the equivalent dual form, f is a 1-Lipschitz function, and sup represents the supremum. In actual computation, the approximation method of Wasserstein GAN is used, and the optimal discriminant function f is learned through a neural network. For the expectation of the joint distribution γ, Let x be the Euclidean distance (L2 norm) between samples x and y. To provide the supremum of all functions f that satisfy the 1-Lipschitz constraints. For the source domain distribution P s Expectations To determine the output of the discriminant function f at sample x, For the distribution P of the target domain tExpectations This is the output of the discriminant function f at sample y.

[0250] This step is a quantitative evaluation of the training effect in step 4.1. It measures the residual difference between the feature distributions of the source firm and the target new firm after domain adversarial training. This calculable scalar distance is the core decision-making basis for the subsequent dynamic mode switching in step 4.3, thus linking feature learning, state evaluation, and control execution into a closed loop.

[0251] Step 4.3 Adaptive mode switching mechanism; establish a three-stage evolution strategy based on distribution distance, as shown in Table 2.

[0252] Table 2 Three-stage evolutionary strategy based on distribution distance

[0253] in, and This is the distance threshold (usually 0.5 or 0.2); N t The cumulative data volume for the target enterprise; N full This is the minimum number of samples required for full training. This mechanism ensures that the model fully utilizes transferred knowledge when data is scarce, and gradually releases model capacity as data accumulates, ultimately achieving complete personalization.

[0254] The core purpose of establishing a three-stage evolution strategy is to address the challenge of how prediction models dynamically adjust their knowledge dependency focus and model plasticity throughout the entire growth cycle of newly integrated enterprises, from data scarcity to data abundance. Traditional transfer learning methods are typically static (e.g., one-time pre-training followed by fine-tuning), unable to adapt to the dynamic process of the target object's data distribution changing over time. By introducing a quantitative metric (Wasserstein distance) and a clear stage division, this strategy achieves the following:

[0255] (1) Maximize the use of prior knowledge during the cold start period: When there is very little data on new enterprises (stage one), the model freezes the shared layer and relies strictly on the knowledge transferred from similar enterprises for prediction, avoiding overfitting due to its own data noise.

[0256] (2) Smooth transition and autonomous learning during the growth stage: As enterprise data accumulates, the differences between their electricity consumption patterns and those of the source enterprise gradually become apparent (stage two). The strategy allows the model to safely and gradually learn its own characteristics on the inherited industry knowledge framework by gradually unfreezing parameters and predictive fusion, thus achieving a smooth transition from imitation to learning.

[0257] (3) Achieve complete personalization in the mature stage: When the enterprise has sufficient data of its own and has formed a stable and unique pattern (stage three), the model fully releases its capacity, performs full parameter optimization, and finally transforms into a special model that is completely tailored to the enterprise in order to achieve the highest prediction accuracy.

[0258] The innovation of this strategy lies in transforming transfer learning from a static, single action into a dynamic adaptive process that spans the model's lifecycle. It achieves full automation by using quantifiable distributional distance (Wasserstein distance) as the sole basis for state awareness and decision switching, effectively avoiding the manual judgment of switching timing required in traditional methods, as well as the performance regression or prediction jitter that may result from hard switching. The specific steps are as follows:

[0259] (1) Input the collected source and target domain samples into the adversarial network in step 4.1 and perform a joint optimization (update the encoder and discriminator parameters) to further align the feature distributions; then, in the aligned feature space, calculate the Wasserstein distance W between the two according to the formula, and count the cumulative data N of the target enterprise. t ;

[0260] (2) The W and N obtained in real time t The system compares the current stage with a preset threshold and automatically determines the appropriate stage, as shown in Table 2 above.

[0261] (3) Under a defined stage, the system updates one column of the table parameters, only performs gradient updates on the thawed parameters, and the parameters of the frozen layer remain unchanged;

[0262] (4) After completing the training and prediction in this round, the process returns to step S1 to continue monitoring the data in the next cycle. As time goes by, the W value is expected to gradually decrease, and the system will automatically and smoothly drive the model from the transfer mode through the transition mode and finally into the local mode, without any manual intervention.

[0263] Smooth transition weight design:

[0264] ;

[0265] In the formula, σ is the Sigmoid function. The threshold value is the lower limit; τ is a temperature coefficient that controls the smoothness of the transition. and These are the fusion weights for transferred knowledge and local data, respectively. The smooth transition weights are used to achieve a jitter-free fusion of the predicted output in transition mode. Without a smooth transition, when the model switches from transfer mode (updating only the L3 layer) to transition mode (unfreezing the L2 layer), the model's trainable parameter space and optimization objective change abruptly, potentially causing a significant step in the predicted output, which is unacceptable in practical energy dispatching systems. The smooth transition weights are designed to eliminate this step. The hybrid predicted output is: In the formula, To ensure the transfer of prediction results, the previous static freezing strategy was adopted, keeping the parameters of the L1 layer encoder and L2 layer cluster adapter at their pre-trained initial values, with only the L3 layer prediction head fine-tuned. This prediction relies entirely on general patterns transferred from mature enterprises in the source domain; Based on the local prediction results and the migration prediction, the L2 layer cluster adapter parameter updates are enabled, allowing it to learn the source-load coupling logic specific to the target enterprise. This prediction begins to capture the unique production rhythms and temperature control response habits of each individual.

[0266] To better understand the above technical solutions, the following embodiments are used to illustrate them. Specifically:

[0267] Taking a high-tech industrial park's energy management system connecting 20 companies as an example, covering three industries: electronic information manufacturing (8 companies), precision machining (7 companies), and food processing (5 companies), with data spanning from January 2024 to June 2025 and a sampling interval of 15 minutes, a cold start prediction test was conducted on 3 newly connected companies (1 from each industry, with only 1 week of historical data for each) to verify the effectiveness of the method of this invention.

[0268] Based on enterprise profile vectors, the optimal number of clusters, K=3, was determined using a joint evaluation of the silhouette coefficient and Davies-Bouldin index. The clustering results highly matched the industry classification (92% purity), with only two machinery processing enterprises being classified into the electronics manufacturing cluster (due to the similar power consumption characteristics of their highly automated production lines). This verifies that source-load coupling characteristics can effectively characterize the similarity of enterprise power consumption, providing a reliable grouping basis for knowledge transfer.

[0269] The method of this invention reduces MAPE by 64% compared to independent LSTM and by 35% compared to full-parameter fine-tuning, while requiring only 40% of the parameters of an independent model, achieving a dual optimization of accuracy and efficiency. The prediction accuracy reaches or even exceeds the level of mature companies with more than one year of data (the benchmark MAPE for mature company LSTM is 10.5%). Details are shown in Table 3.

[0270] Table 3 Comparison of Predictive Performance

[0271] As data accumulated, the Wasserstein distance decreased from 0.87 to 0.08, and the model automatically triggered a transition mode in week 4, entering local mode in week 8. No manual intervention was required throughout the process, and the prediction accuracy smoothly improved from 9.2% to 5.4%, without any performance fluctuations or regressions, validating the effectiveness of the adaptive mechanism.

[0272] Table 4 Analysis of Cross-Industry Migration Effects

[0273] As shown in Table 4, knowledge transfer between companies within the same cluster is significantly better than that between different clusters (average difference of 55%), validating the necessity of clustering. Among companies in different clusters, electronics manufacturing and food processing show the greatest difference (MAPE 15.8%), due to their completely different source-load coupling modes (continuous production vs. intermittent production).

[0274] like Figure 2 As shown, according to a second embodiment of the present invention, an adaptive prediction system for enterprise electricity consumption based on cross-enterprise knowledge transfer is provided, comprising:

[0275] The profile building module is used to acquire enterprise power operation data and build a multi-layer progressive enterprise power consumption profile. According to the inter-layer complementary verification mechanism, the multi-layer progressive enterprise power consumption profile is verified and corrected, and then merged through selective splicing to obtain a comprehensive enterprise power consumption profile.

[0276] The enterprise clustering module is used to construct a statistical-causal comprehensive distance metric based on the comprehensive electricity consumption profile of enterprises and the electricity driving mechanism features extracted by pre-causal structure learning. An improved K-means++ algorithm is used for clustering, and a set of enterprise clusters with similar source-load coupling characteristics is formed through cluster purity verification and adaptive secondary subdivision strategy. Among them, the improved K-means++ algorithm selects the initial centroid using the statistical-causal comprehensive distance metric.

[0277] The model building module is used to build a hierarchical transfer learning model. It uses a set of enterprise clusters to perform hierarchical pre-training on the hierarchical transfer learning model, and learns general time-series features from the full set of enterprise data and industry characteristics within the cluster from historical data of enterprises in the same cluster, thus obtaining a hierarchical pre-trained prediction model.

[0278] The power consumption prediction module is used to construct an adaptive mode switching mechanism based on distribution differences by using a hierarchical pre-trained prediction model and combining domain adversarial feature decoupling with a first-order Wasserstein distance metric. Through a three-stage progressive unfreezing and combined with smooth transition weight fusion prediction output, it realizes adaptive power consumption prediction throughout the entire life cycle from cold start to maturity.

[0279] According to a third embodiment of the present invention, an electronic device is provided, the electronic device comprising: one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to perform the steps in any of the above method embodiments.

[0280] According to a fourth embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to perform the steps in any of the above method embodiments.

[0281] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0282] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, etc.) containing computer-usable program code.

[0283] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer, characterized in that, Includes the following steps: S1. Obtain enterprise power operation data and construct a multi-layer progressive enterprise power consumption profile; according to the inter-layer complementary verification mechanism, verify and correct the multi-layer progressive enterprise power consumption profile, and merge it through selective splicing to obtain a comprehensive enterprise power consumption profile. S2. Based on the comprehensive electricity consumption profile of enterprises, and combined with the electricity consumption driving mechanism features extracted by pre-causal structure learning, a statistical-causal comprehensive distance metric is constructed. An improved K-means++ algorithm is used for clustering, and a set of enterprise clusters with similar source-load coupling characteristics is formed through cluster purity verification and adaptive secondary subdivision strategy; wherein, the improved K-means++ algorithm selects the initial centroid using a statistical-causal comprehensive distance metric. S3. Construct a hierarchical transfer learning model, use enterprise clusters to perform hierarchical pre-training on the hierarchical transfer learning model, and learn general time-series features through full enterprise data and learn industry characteristics within the cluster through historical data of enterprises in the same cluster to obtain a hierarchical pre-trained prediction model. S4. Based on the hierarchical pre-trained prediction model, and combined with domain adversarial feature decoupling and first-order Wasserstein distance metric, an adaptive mode switching mechanism based on distribution differences is constructed. Through three-stage progressive unfreezing, combined with smooth transition weight fusion prediction output, adaptive prediction of electricity consumption throughout the entire life cycle from cold start to maturity is achieved.

2. The adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer according to claim 1, characterized in that, S1 includes the following steps: S11. Obtain enterprise power operation data and construct a source-load power consumption profile by extracting the enterprise's static attributes and dynamic operation characteristics; S12. Based on the enterprise's power operation data, determine the enterprise's net power sequence and total power load sequence, and use the depth of the duck curve, the evening ramp rate and the intraday reversal frequency as supply and demand fluctuation characteristics. Based on the supply and demand fluctuation characteristics, construct a supply and demand fluctuation profile. S13. Based on the enterprise's power operation data, determine the enterprise's total active power sequence, and calculate the weekend deviation, daily cycle signal-to-noise ratio, and mode drift rate as steady-state rhythm characteristics. Based on the steady-state rhythm characteristics, construct a steady-state rhythm profile. S14. Based on the inter-layer complementary verification mechanism, the source-load power consumption profile, supply-demand fluctuation profile, and steady-state rhythm profile are corrected and then merged by selective splicing to obtain the enterprise's comprehensive power consumption profile.

3. The adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer according to claim 2, characterized in that, S14 includes the following steps: S141. Extract the depth of the duck curve in the supply and demand fluctuation profile, and determine whether the depth of the duck curve exceeds the preset depth threshold. If so, adjust the daily average source-load power ratio upward; otherwise, keep the daily average source-load power ratio unchanged. S142. Extract the daily cycle signal-to-noise ratio from the steady-state rhythm profile, and determine whether the daily cycle signal-to-noise ratio is higher than the preset signal-to-noise ratio threshold. If so, adjust the load volatility downward; otherwise, keep the load volatility unchanged. S143. After verification and correction of the supply and demand fluctuation profile and steady-state rhythm profile, output the verified and corrected source load power consumption profile; the daily average source load power ratio and load fluctuation rate in the verified and corrected source load power consumption profile have been corrected for deviation by the upper-level profile. S144. The verified and corrected source load power consumption profile, supply and demand fluctuation profile, and steady-state rhythm profile are merged by vector splicing to output the enterprise's comprehensive power consumption profile.

4. The adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer according to claim 2, characterized in that, S2 includes the following steps: S21. Using the feature variables of the enterprise's comprehensive electricity consumption profile as nodes, the weighted adjacency matrix is ​​solved through causal structure learning with sparse penalty and acyclic constraint. After threshold truncation and undirection processing, the causal skeleton and causal effect features are extracted to form the electricity consumption driving mechanism features. S22. Standardize the comprehensive electricity consumption profile of enterprises to obtain a standardized enterprise profile vector, and construct a statistical-causal comprehensive distance metric by combining the characteristics of electricity consumption driving mechanism. S23. The improved K-means++ algorithm is used to calculate the probability of initial centroid selection using a statistical-causal comprehensive distance metric, and the initial centroid is iteratively optimized using a spatial density correction method to complete the enterprise clustering. S24. Perform cluster purity verification and adaptive secondary subdivision processing on the clustering results to obtain a set of enterprise clusters with similar source-load coupling characteristics.

5. The adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer according to claim 4, characterized in that, S21 includes the following steps: S211. By selecting the average daily source-load power ratio, load fluctuation rate, meteorological sensitivity coefficient, duck curve depth and evening climbing rate in the comprehensive electricity consumption profile of enterprises as causal analysis nodes, a five-dimensional characteristic variable set is constructed. The causal influence intensity between each causal analysis node is the variable to be solved, and a weighted adjacency matrix is ​​constructed. S212. Construct a causal structure learning loss function that includes a data fitting term, a sparse penalty term, and an acyclic constraint term, and iteratively update the weighted adjacency matrix through gradient descent until convergence, thus obtaining the converged weighted adjacency matrix. S213. Perform threshold truncation on the converged weighted adjacency matrix to obtain the causal effect matrix. S214. Undirect the causal effect matrix to obtain the causal skeleton adjacency matrix. S215. Extract the causal skeleton vector, critical path causal effect, and causal heterogeneity index from the causal effect matrix and the causal skeleton adjacency matrix to form the characteristics of the electric drive mechanism.

6. The adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer according to claim 4, characterized in that, S23 includes the following steps: S231. Based on the statistical-causal integrated distance metric, calculate the probability distribution of the centroid, and select several initial centroids according to the probability distribution of the centroid; S232. For each initial centroid, calculate its local spatial density and calculate the density gradient direction based on the direction vector of each sample in the neighborhood relative to the centroid. Use the density gradient direction as the centroid offset direction and correct the position of the initial centroid with a preset correction step size to obtain the corrected centroid. S233. Based on the corrected centroids, perform standard K-means iterations until convergence to obtain preliminary clustering results, thus completing the enterprise clustering.

7. The adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer according to claim 4, characterized in that, S24 includes the following steps: S241. Obtain the sample composition information of each enterprise cluster in the preliminary clustering results and the real industry label corresponding to each enterprise, and calculate the industry purity of each enterprise cluster respectively. S242. Based on the causal skeleton adjacency matrix, calculate the average pairwise Jaccard similarity of the causal skeletons of enterprises within the enterprise cluster, and use the average pairwise Jaccard similarity of the causal skeletons of enterprises within the enterprise cluster as the causal purity of the enterprise cluster. S243. If the industry purity of the current enterprise cluster is lower than the first preset threshold or the causal purity is lower than the second preset threshold, then the current cluster is determined to be a heterogeneous mixed cluster, triggering adaptive secondary subdivision; the adaptive secondary subdivision is to re-run the improved K-means++ algorithm within the samples of this cluster for secondary clustering until the industry purity of all enterprise clusters is greater than or equal to the first preset threshold and the causal purity is greater than or equal to the second preset threshold, or the maximum subdivision depth is reached. S244. Output all enterprise clusters that meet the dual threshold requirements of industry purity and causal purity, forming a set of enterprise clusters with similar source-load coupling characteristics.

8. The adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer according to claim 1, characterized in that, S3 includes the following steps: S31. Construct a hierarchical transfer learning model with a three-layer parameter-sharing architecture; S32. Using historical operational data within the enterprise cluster as the training set, perform hierarchical pre-training on the hierarchical transfer learning model to obtain the pre-trained model parameters. S33. For the target enterprise, load the corresponding pre-trained model parameters according to its enterprise cluster, and perform stratified freeze training using the historical data of the target enterprise to obtain a stratified pre-trained prediction model adapted to the target enterprise.

9. The adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer according to claim 1, characterized in that, S4 includes the following steps: S41. Introduce a gradient reversal layer and a domain discriminator into the hierarchical pre-trained prediction model, construct an adversarial training objective function and perform joint optimization, force the extraction of domain-invariant features to achieve feature distribution alignment between the source domain and the target domain, and obtain the feature space after domain adversarial decoupling and alignment. S42. In the feature space after decoupling and alignment of the adversarial features in the longitudinal domain, the residual difference between the feature distribution of the source domain and the feature distribution of the target domain is quantified by the first-order Wasserstein distance to obtain the distribution distance metric. S43. Perform a three-stage adaptive mode switch based on the distribution distance metric and the cumulative data volume of the target enterprise, and achieve jitter-free fusion of the prediction output through smooth transition weights.

10. The adaptive prediction method for enterprise electricity consumption based on cross-enterprise knowledge transfer according to claim 9, characterized in that, S43 includes the following steps: S431. Compare the distribution distance metric and the cumulative data volume of the target enterprise with a preset comparison threshold, and determine the current stage based on the comparison result; the stage includes migration mode, transition mode and local mode; S432. Execute the parameter unfreezing strategy of the corresponding level according to the determined stage; S433. Repeat steps S431-S432, recalculate the distribution distance metric and re-determine the current stage in each training cycle, and execute the corresponding parameter update strategy according to the re-determined stage until a smooth transition from cold start knowledge transfer to fully personalized evolution is completed.