A two-stage heterogeneous energy storage user identification method and system for weakly labeled scenarios
Patent Information
- Application Number
- CN202610959328.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-10-16
AI Technical Summary
[0005]为了解决现有技术存在的漏检、计算成本高、稳定性不足的问题,本发明提出了一种面向弱标注场景的两级异构储能用户识别方法及系统
本发明提供了一种面向弱标注场景的两级异构储能用户识别方法及系统,通过基于输入的用户多日负荷曲线数据按照用户维度构建用户样本包,并基于用户样本包中各日负荷曲线构建表征用户常规用电行为的第一实例集合以及表征用户全时段用电行为的第二实例集合,使得具有明显储能充放电行为特征的关键日负荷曲线能够与常规稳定负荷行为进行区分,从而避免关键储能行为特征在多日平均或整体统计过程中被大量普通负荷行为稀释,降低储能用户漏检和误判风险,提高储能用户识别准确性。
Smart Images

Figure CN122928381A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of energy storage user identification technology, specifically to a two-level heterogeneous energy storage user identification method and system for weakly labeled scenarios. Background Technology
[0002] Guided by the "dual carbon" goals, the construction of new power systems continues to advance, and distributed energy storage has been deployed on a large scale on the industrial and commercial user side. It plays a crucial role in core power grid operations such as demand-side management, electricity consumption auditing, load forecasting, and flexible resource dispatching. Against this backdrop, power grid companies have an increasingly urgent need for rapid and accurate identification of energy storage users within their distribution areas. However, under current engineering conditions, the core data available to the power grid side is mainly the daily load curves of users at 15-minute intervals. How to achieve efficient and accurate identification of energy storage users based on this type of data has become a pressing technical challenge that needs to be addressed.
[0003] Existing methods for energy storage user identification mainly include those based on traditional machine learning and those based on deep learning. Traditional machine learning methods typically extract statistical features from users' multi-day load curves for user identification, offering high computational efficiency. However, due to the intermittent and strategic nature of energy storage charging and discharging behavior, relying solely on statistical features can dilute key behavioral characteristics, thus affecting identification accuracy. Deep learning-based methods can uncover more complex load features and improve identification capabilities, but they incur significant computational overhead in large-scale user scenarios and are sensitive to the quality of labeled data, easily exhibiting insufficient identification stability in weakly labeled or noisy environments.
[0004] Therefore, existing technologies still have problems such as key energy storage behaviors being easily overlooked, high computational costs for full-scale deep inference, and insufficient identification stability in weakly labeled scenarios. It is necessary to propose a new method for identifying energy storage users to solve these problems. Summary of the Invention
[0005] To address the issues of missed detections, high computational costs, and insufficient stability in existing technologies, this invention proposes a two-level heterogeneous energy storage user identification method and system for weakly labeled scenarios.
[0006] Firstly, a two-level heterogeneous energy storage user identification method for weakly labeled scenarios is provided, including: Based on the input user multi-day load curve data, a user sample package is constructed according to the user dimension. Based on the load curves of each day in the user sample package, a first instance set representing the user's regular electricity consumption behavior and a second instance set representing the user's all-time electricity consumption behavior are constructed. Based on the user-level input feature vector extracted from the first instance set, the user is screened for energy storage users using a pre-trained one-stage user-level screening model to obtain a candidate energy storage user set. The second instance set corresponding to the candidate energy storage user set is input into the pre-trained two-stage user fine identification model, and the energy storage user identification result is output.
[0007] Preferably, the user sample package is constructed based on the input multi-day load curve data of users according to the user dimension, and a first instance set representing the user's regular electricity consumption behavior and a second instance set representing the user's all-time electricity consumption behavior are constructed based on the load curves of each day in the user sample package, including: The input multi-day load curve data of users is parsed by date, and missing data, abnormal data and load curve data with all zeros are removed to obtain the processed multi-day load curve data of users. The processed multi-day load curve data of users are aggregated according to the user dimension, and the aggregated multi-day load curve data is determined as the user sample package of the corresponding user. Based on the date attribute in the user sample package, the daily load curves corresponding to weekdays are filtered to construct a first instance set representing the user's regular electricity consumption behavior, and based on all the daily load curves in the user sample package, a second instance set representing the user's electricity consumption behavior throughout the day is constructed.
[0008] Preferably, the step of using a pre-trained one-stage user-level preliminary screening model to perform preliminary screening of energy storage users based on the user-level input feature vector extracted from the first instance set, to obtain a candidate energy storage user set, includes: Based on the first instance set, user statistical features and average load curve features are extracted and normalized to obtain user-level input feature vectors. The user-level input feature vector is input into a pre-trained one-stage user-level initial screening model, and the one-stage energy storage user probability corresponding to each user is output. Users whose probability of being a first-stage energy storage user is greater than a preset first-stage prediction threshold are identified as candidate energy storage users, and a candidate energy storage user set is constructed based on the identified candidate energy storage users.
[0009] Preferably, the step of inputting the second instance set corresponding to the candidate energy storage user set into a pre-trained two-stage user fine identification model and outputting the energy storage user identification result includes: By using a pre-trained two-stage user fine identification model, the daily load curves in the second instance set corresponding to the input candidate energy storage user set are encoded using a time-series encoder to obtain instance feature vectors. The attention score corresponding to the feature vector of each instance is calculated using the attention mechanism, and the attention weight of each instance is calculated based on the attention score using the normalized exponential function. Based on the attention weight of each instance, the Top-K aggregation mechanism is used to select the K daily load curve instances with the highest attention weight for each user, thus obtaining the key instance set for the corresponding user. Based on the instance feature vectors and attention weights corresponding to each instance in the key instance set, a weighted aggregation is performed to obtain the user-level representation vector corresponding to each user. The user-level representation vector is concatenated with the user statistical features corresponding to the first instance set and passed through the user-level classifier in the two-stage user fine identification model to obtain the two-stage user output probability that the corresponding user belongs to the energy storage user. Users whose second-stage user output probability is greater than or equal to the preset second-stage prediction threshold are identified as energy storage users, and the energy storage user identification result is output. Where K is an integer greater than 1.
[0010] Preferably, the training process of the first-stage user-level initial screening model includes: The development set is obtained by partitioning the preprocessed full user training set, and the development set is further divided into the first-stage training set and the first-stage validation set. The first-stage input feature vector is constructed based on the first instance set corresponding to each user in the first-stage training set. The first-stage input feature vector is used as input, and the first-stage user-level initial screening model based on the user label corresponding to the first-stage input feature vector is subjected to supervised training to obtain the trained first-stage user-level initial screening model.
[0011] Preferably, the training process of the two-stage user fine-grained identification model includes: The first-stage verification feature vector is constructed based on the first instance set corresponding to each user in the first-stage verification set. The first-stage verification feature vector is input into the trained first-stage user-level preliminary screening model to obtain the first-stage energy storage user prediction probability of each user belonging to the energy storage user, and a preset first-stage prediction threshold is determined based on the first-stage energy storage user prediction probability. Users whose predicted probability of first-stage energy storage is greater than or equal to the preset first-stage prediction threshold are integrated to obtain a candidate user set, and users whose predicted probability of first-stage energy storage is less than the preset first-stage prediction threshold are integrated to obtain a non-energy storage user set. A second-stage training set and a second-stage validation set are constructed based on the candidate user set and the non-energy storage user set. A multi-instance learning package is constructed based on the second instance set corresponding to each user in the second-stage training set. Based on the user-level weakly labeled tags in the multi-instance learning package, the two-stage user fine identification model is trained under supervision so that the two-stage user fine identification model can learn the contribution of each daily load curve to the energy storage user identification result without labeling the daily load curve instance, thus obtaining the trained two-stage user fine identification model. Based on the second-stage validation set, different candidate thresholds are traversed within a preset threshold range, and the F1 score corresponding to each candidate threshold is calculated. The candidate threshold that makes the F1 index reach its maximum value is selected as the second-stage prediction threshold, which is used to classify and decide the output probability of the second-stage users in the subsequent energy storage user identification stage. The user-level weak label represents whether the corresponding user belongs to the energy storage user, and the daily load curves in the multi-instance learning package share the user-level weak label of the corresponding user. The two-stage user fine identification model outputs the two-stage user output probability that the corresponding user belongs to the energy storage user. The preset one-stage prediction threshold is determined by satisfying the energy storage user recall rate constraint and maximizing the preset evaluation index.
[0012] Secondly, a two-level heterogeneous energy storage user identification system for weakly labeled scenarios is provided, characterized by comprising: The construction module is used to construct a user sample package according to the user dimension based on the input multi-day load curve data of users, and to construct a first instance set representing the user's regular electricity consumption behavior and a second instance set representing the user's all-time electricity consumption behavior based on the load curves of each day in the user sample package. The initial screening module is used to perform initial screening of energy storage users based on the user-level input feature vector extracted from the first instance set and using a pre-trained one-stage user-level initial screening model to obtain a candidate energy storage user set. The output module is used to input the second instance set corresponding to the candidate energy storage user set into the pre-trained two-stage user fine identification model and output the energy storage user identification result.
[0013] Preferably, the building module is specifically used for: The input multi-day load curve data of users is parsed by date, and missing data, abnormal data and load curve data with all zeros are removed to obtain the processed multi-day load curve data of users. The processed multi-day load curve data of users are aggregated according to the user dimension, and the aggregated multi-day load curve data is determined as the user sample package of the corresponding user. Based on the date attribute in the user sample package, the daily load curves corresponding to weekdays are filtered to construct a first instance set representing the user's regular electricity consumption behavior, and based on all the daily load curves in the user sample package, a second instance set representing the user's electricity consumption behavior throughout the day is constructed.
[0014] Preferably, the primary screening module is specifically used for: Based on the first instance set, user statistical features and average load curve features are extracted and normalized to obtain user-level input feature vectors. The user-level input feature vector is input into a pre-trained one-stage user-level initial screening model, and the one-stage energy storage user probability corresponding to each user is output. Users whose probability of being a first-stage energy storage user is greater than a preset first-stage prediction threshold are identified as candidate energy storage users, and a candidate energy storage user set is constructed based on the identified candidate energy storage users.
[0015] Preferably, the output module is specifically used for: By using a pre-trained two-stage user fine identification model, the daily load curves in the second instance set corresponding to the input candidate energy storage user set are encoded using a time-series encoder to obtain instance feature vectors. The attention score corresponding to the feature vector of each instance is calculated using the attention mechanism, and the attention weight of each instance is calculated based on the attention score using the normalized exponential function. Based on the attention weight of each instance, the Top-K aggregation mechanism is used to select the K daily load curve instances with the highest attention weight for each user, thus obtaining the key instance set for the corresponding user. Based on the instance feature vectors and attention weights corresponding to each instance in the key instance set, a weighted aggregation is performed to obtain the user-level representation vector corresponding to each user. The user-level representation vector is concatenated with the user statistical features corresponding to the first instance set and passed through the user-level classifier in the two-stage user fine identification model to obtain the two-stage user output probability that the corresponding user belongs to the energy storage user. Users whose second-stage user output probability is greater than or equal to the preset second-stage prediction threshold are identified as energy storage users, and the energy storage user identification result is output. Where K is an integer greater than 1.
[0016] Preferably, the training process of the user-level initial screening model in the initial screening module includes: The development set is obtained by partitioning the preprocessed full user training set, and the development set is further divided into the first-stage training set and the first-stage validation set. The first-stage input feature vector is constructed based on the first instance set corresponding to each user in the first-stage training set. The first-stage input feature vector is used as input, and the first-stage user-level initial screening model based on the user label corresponding to the first-stage input feature vector is trained under supervision to obtain the trained first-stage user-level initial screening model. Based on the first-stage validation set, a preset first-stage prediction threshold is determined, and users are screened as candidates based on the preset first-stage prediction threshold to construct training samples for the second-stage user fine identification model. The preset first-stage prediction threshold is determined by satisfying the energy storage user recall rate constraint and maximizing the preset evaluation index.
[0017] Preferably, the training process of the two-stage user fine-grained identification model in the output module includes: The first-stage verification feature vector is constructed based on the first instance set corresponding to each user in the first-stage verification set. The first-stage verification feature vector is input into the trained first-stage user-level preliminary screening model to obtain the first-stage energy storage user prediction probability of each user belonging to the energy storage user, and a preset first-stage prediction threshold is determined based on the first-stage energy storage user prediction probability. Users whose predicted probability of first-stage energy storage is greater than or equal to the preset first-stage prediction threshold are integrated to obtain a candidate user set, and users whose predicted probability of first-stage energy storage is less than the preset first-stage prediction threshold are integrated to obtain a non-energy storage user set. A second-stage training set and a second-stage validation set are constructed based on the candidate user set and the non-energy storage user set. A multi-instance learning package is constructed based on the second instance set corresponding to each user in the second-stage training set. Based on the user-level weakly labeled tags in the multi-instance learning package, the two-stage user fine identification model is trained under supervision so that the two-stage user fine identification model can learn the contribution of each daily load curve to the energy storage user identification result without labeling the daily load curve instance, thus obtaining the trained two-stage user fine identification model. Based on the second-stage validation set, different candidate thresholds are traversed within a preset threshold range and the F1 score corresponding to each candidate threshold is calculated. The candidate threshold that makes the F1 index reach its maximum value is selected as the second-stage prediction threshold, which is used to classify and decide the output probability of the second-stage users in the subsequent energy storage user identification stage. The user-level weak label represents whether the corresponding user belongs to the energy storage user, and the daily load curves in the multi-instance learning package share the user-level weak label of the corresponding user. The two-stage user fine identification model outputs the two-stage user output probability that the corresponding user belongs to the energy storage user. The preset one-stage prediction threshold is determined by satisfying the energy storage user recall rate constraint and maximizing the preset evaluation index.
[0018] In another aspect, this application also provides an electronic device, comprising: at least one processor and a memory; the memory and the processor are connected via a bus; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, a two-level heterogeneous energy storage user identification method for weakly labeled scenarios is implemented as described above.
[0019] Furthermore, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the two-level heterogeneous energy storage user identification method for weakly labeled scenarios as described above.
[0020] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention provides a two-level heterogeneous energy storage user identification method and system for weakly labeled scenarios. It constructs a user sample package based on input multi-day load curve data of users according to the user dimension. Then, based on the daily load curves in the user sample package, it constructs a first set of instances representing the user's regular electricity consumption behavior and a second set of instances representing the user's electricity consumption behavior throughout the entire time period. This allows key daily load curves with obvious energy storage charging and discharging behavior characteristics to be distinguished from regular stable load behavior, thereby avoiding the dilution of key energy storage behavior characteristics by a large amount of ordinary load behavior during multi-day averaging or overall statistical processes. This reduces the risk of missed detection and misjudgment of energy storage users and improves the accuracy of energy storage user identification.
[0021] By extracting user-level input feature vectors based on the first instance set, and using a pre-trained one-stage user-level screening model to quickly screen all users for energy storage users, a candidate energy storage user set is obtained. This allows for subsequent high-complexity fine identification to be performed only on a small number of suspected energy storage users, thereby reducing the processing scale of deep models, lowering the overall computational overhead and inference latency, and improving the efficiency of the method in engineering applications in large-scale transformer substations, parks, and batch user scenarios.
[0022] By inputting the second instance set corresponding to the candidate energy storage user set into the pre-trained two-stage user fine identification model, and supervising the training of weakly labeled user-level tags based on the multi-instance learning mechanism, the model can automatically learn key behavioral instances that contribute significantly to energy storage user identification even in the absence of daily instance-level precise labels. This reduces the reliance on high-quality manually labeled data, improves the model's adaptability to label noise and complex working conditions, and enhances the model's stability and cross-scenario generalization ability.
[0023] In summary, this invention solves the problems in existing technologies such as the dilution of key energy storage behaviors, high computational cost of full-scale deep inference, and insufficient model stability in weakly labeled scenarios. It achieves efficient, accurate, and reliable identification of energy storage users and can provide technical support for demand-side management, energy storage operation monitoring, electricity auditing, and flexible resource assessment. Attached Figure Description
[0024] Figure 1 This is a flowchart illustrating the user identification method for two-level heterogeneous energy storage in weakly labeled scenarios according to the present invention. Figure 2 The flowchart below shows the user identification method for two-level heterogeneous energy storage in weakly labeled scenarios according to the present invention. Figure 3 This is a schematic diagram of the fine identification process of energy storage users based on multi-instance learning in the two-level heterogeneous energy storage user identification method for weakly labeled scenarios of the present invention. Figure 4 This is a schematic diagram of the two-level heterogeneous energy storage user identification system for weakly labeled scenarios according to the present invention; Figure 5 This is a schematic diagram of an electronic device structure according to the present invention. Detailed Implementation
[0025] Currently, common energy storage user identification methods can be broadly categorized into two types, both with significant limitations: one type is a single-stage identification method based on traditional machine learning. This method summarizes the multi-day load curves of a user within a certain time window, constructs statistical features such as load peak-to-valley difference and load volatility, and combines them with models such as XGBoost and Random Forest to complete energy storage user identification. Its advantages lie in its simplicity, high inference efficiency, and ability to quickly process full user data. However, due to the significant intermittency and strategic nature of energy storage charging and discharging behavior, the energy storage characteristics of the same user are often prominent only on a few days or during a few periods. Directly averaging or performing coarse-grained statistics on multi-day curves can easily "dilute" key energy storage behaviors, leading to a high false negative rate and making it difficult to meet the requirements for accurate identification.
[0026] Another type is the single-stage identification method based on deep learning. This method uses deep learning sequence models such as CNN, RNN, and Transformer to directly model the multi-day load sequences of users, which can uncover more complex load pattern features and improve the recognition accuracy to some extent. However, this type of method has obvious shortcomings. When the user scale is large and the time window is long, the computational cost of performing deep inference for all users is extremely high, making it difficult to adapt to the actual application scenarios of large-scale transformer areas. At the same time, the model training is highly sensitive to the quality of labeled data. In engineering scenarios with weak labels or high label noise, the recognition stability is insufficient and the generalization ability is limited.
[0027] To address the problems existing in the prior art, this invention proposes a two-level heterogeneous energy storage user identification method for weakly labeled scenarios. It combines an XGBoost (eXtreme Gradient Boosting) user-level initial screening model with a Multiple Instance Learning (MIL) fine-grained identification model. This method improves the ability to identify key behaviors of energy storage users while maintaining efficiency in large-scale user screening. This effectively solves the problems of easily missed key behaviors, high overall computational cost, and insufficient model stability in weakly labeled scenarios in existing energy storage user identification technologies, thus adapting to the large-scale and refined energy storage user identification needs of power grid enterprises.
[0028] like Figure 1 As shown, the overall process of this invention includes three stages: data input and preprocessing, two-level heterogeneous identification, and model inference output.
[0029] First, data input and preprocessing are performed. The daily load curve data is cleaned by date parsing and removing missing / abnormal / all-zero data. Multi-day curves are aggregated by user to construct multi-day sample packages. Addressing the intermittent and strategic nature of energy storage user charging and discharging behavior, where key charging and discharging characteristics are prominent only on a few days and during a few time periods, existing identification technologies tend to dilute key behaviors, leading to high false negative rates and difficulty in meeting accurate identification requirements. This invention constructs a refined identification mechanism based on multi-instance learning, representing users as sample packages composed of multi-day curve instances. Under package-level label supervision, key energy storage behavior days are automatically mined, preventing key features from being masked by redundant data, effectively reducing false negative rates and improving the accuracy of energy storage user identification. Furthermore, the user sample packages are normalized by user; simultaneously, user-level statistical features are extracted and standardized to complete the construction of the input features required by the model.
[0030] Subsequently, a two-level heterogeneous model for energy storage identification is constructed. In response to the problem that existing identification technologies have extremely high computational costs due to the large number of users in large-scale transformer areas and long time windows, making them difficult to adapt to actual engineering application scenarios, this invention designs a two-level heterogeneous architecture. The first level adopts the XGBoost user-level preliminary screening model, which outputs the energy storage probability of all users through the user-level lightweight model and filters to form a candidate set of suspected energy storage users, which greatly compresses the range of users for fine identification and significantly reduces the overall computational cost. Furthermore, addressing the issue that key behaviors of energy storage users only appear on certain fluctuating dates and are easily diluted by overall average features, this invention utilizes a deep learning model for refined identification. The second level employs a multi-instance precision detection model to perform time-series encoding on the daily instance curves of candidate users and calculate instance-level attention weights. To address the problems of weak annotations and label noise in engineering scenarios, which lead to unstable training and insufficient generalization ability in existing methods, this invention leverages the packet-level supervision characteristics of MIL to aggregate weak and noisy daily signals into user-level supervision. Through attention and Top-K mechanisms, it achieves adaptive selection and robust aggregation of key instances, enabling the model to complete user-level identification without relying on precise daily annotations. This results in outputting precision detection probabilities and discrimination results, improving identification accuracy, enhancing tolerance to label noise, and increasing cross-condition generalization ability, thus adapting to the practical application needs of large-scale distribution areas.
[0031] Finally, model reasoning and output are performed: by combining the screening and fine-tuning results of each stage of the two-level model, the final predicted set of energy storage users and non-energy storage users are output, which realizes efficient, accurate and reliable identification of energy storage users and provides practical technical support for demand-side management and electricity inspection.
[0032] To better understand the present invention, the following description, in conjunction with the accompanying drawings and embodiments, will further illustrate the content of the present invention.
[0033] Example 1: A two-level heterogeneous energy storage user identification method for weakly labeled scenarios, such as Figure 2 As shown, it includes: Step 1: Based on the input multi-day load curve data of users, construct a user sample package according to the user dimension, and construct a first instance set representing the user's regular electricity consumption behavior and a second instance set representing the user's all-time electricity consumption behavior based on the load curves of each day in the user sample package. Step 2: Based on the user-level input feature vector extracted from the first instance set, use a pre-trained one-stage user-level preliminary screening model to perform preliminary screening of energy storage users, and obtain a candidate energy storage user set. Step 3: Input the second instance set corresponding to the candidate energy storage user set into the pre-trained two-stage user fine identification model, and output the energy storage user identification result.
[0034] In this embodiment, during step 1, since the raw load data typically contains missing values, outliers, and invalid load data, and the load behavior fluctuations vary significantly across different dates, it is necessary to preprocess the raw load data and classify the daily load curves based on load fluctuation characteristics to effectively distinguish user behavior patterns. This improves the data targeting and identification accuracy of the subsequent initial screening and refined identification phases. Specifically, this includes: The input multi-day load curve data of users is parsed by date, and missing data, abnormal data and load curve data with all zeros are removed to obtain the processed multi-day load curve data of users. The processed multi-day load curve data of users are aggregated according to the user dimension, and the aggregated multi-day load curve data is determined as the user sample package of the corresponding user. Based on the date attribute in the user sample package, the daily load curves corresponding to weekdays are filtered to construct a first instance set representing the user's regular electricity consumption behavior, and based on all the daily load curves in the user sample package, a second instance set representing the user's electricity consumption behavior throughout the day is constructed.
[0035] Specifically, the acquired multi-day load curve data of users is parsed to identify the date information corresponding to each load curve, and the quality of the original load data is verified. Daily load curves with missing samples, abnormal abrupt changes, or zero load for the entire day are removed to avoid abnormal data interfering with model training and recognition results. Subsequently, the multi-day load curves corresponding to the same user are aggregated according to the user dimension to construct the user sample package for that user.
[0036] Furthermore, based on the date attribute in the user sample package, the daily load curves corresponding to weekdays are filtered to construct a first instance set representing the user's regular electricity consumption behavior, and based on all the daily load curves in the user sample package, a second instance set representing the user's electricity consumption behavior throughout the day is constructed.
[0037] In one specific embodiment, the input data of the present invention includes daily load curve data of multiple users on multiple dates. For any user u's load curve on day d, it is denoted as:
[0038] in, Number of sampling points (preferred embodiment) (Corresponding to a 15-minute interval per day).
[0039] Define user-level tags as:
[0040] in, Indicates user For energy storage users, Indicates user For non-energy storage users, it is unknown on which dates they actually performed energy storage activities; that is, the daily instance tag is unknown. To ensure data quality, the raw data is preferably preprocessed as follows: (1) Perform date parsing and time window filtering; (2) Remove daily samples with missing values, infinite values, all-zero curves, or abnormally low-energy curves; (3) Count the number of valid days for each user, and select users whose number of valid days is not less than the preset threshold; Subsequently, this invention applies to each user The multi-day curves of a user are aggregated by date to form a multi-instance set for that user. To simultaneously ensure the stability of user-level tag generation and the sufficiency of multi-instance learning representation, this invention constructs two types of date sets for the same user: a weekday instance set and a weekday instance set. (i.e., the aforementioned first instance set) and the full-time instance set (i.e., the aforementioned second set of instances), based on which two packages are defined:
[0041]
[0042] Among them, weekday packages Used to generate user tags and construct initial screening features, with the aim of reducing the interference of weekend behavioral differences on tag counting; all-day package Used for multi-instance learning and fine-tuning, preserving as complete a behavioral pattern as possible within the window.
[0043] Because different users have significantly different load sizes, directly using the original values would cause the model to rely excessively on scale rather than form. Therefore, this invention performs per-user normalization for each user package. Take the largest absolute value in its package:
[0044] in, For users A complete set of dates, For time step indexing.
[0045] Normalize the curve for any day:
[0046] in To prevent extremely small constants from being divided by zero, both weekday packages and all-day packages can be normalized in this way, denoted as follows: , .
[0047] In this embodiment, during step 2, since energy storage users still exhibit certain overall load statistics under normal stable operating conditions, it is necessary to extract user-level input feature vectors based on the first instance set to achieve rapid preliminary screening of a large number of users, thereby reducing the processing scale and computational complexity of the subsequent second-stage user fine identification model. Specifically, this includes: Based on the first instance set, user statistical features and average load curve features are extracted and normalized to obtain user-level input feature vectors. The user-level input feature vector is input into a pre-trained one-stage user-level initial screening model, and the one-stage energy storage user probability corresponding to each user is output. Users whose probability of being a first-stage energy storage user is greater than a preset first-stage prediction threshold are identified as candidate energy storage users, and a candidate energy storage user set is constructed based on the identified candidate energy storage users.
[0048] Specifically, for each user's corresponding first instance set, user statistical features and average load curve features are extracted. Among them, user statistical features may include statistical quantities that can reflect the user's overall electricity consumption patterns, such as average load, peak-to-valley difference, load fluctuation rate, and load change rate; average load curve features are used to characterize the typical load change trend of the user under normal operating conditions.
[0049] Furthermore, to reduce the impact of differences in measurement units among different users on model training, the extracted user statistical features and average load curve features are normalized, and the normalized features are concatenated to form a user-level input feature vector. Subsequently, the user-level input feature vector is input into a pre-trained one-stage user-level screening model, which outputs the one-stage energy storage user probability corresponding to each user.
[0050] Finally, the probability of a first-stage energy storage user is compared with a preset first-stage prediction threshold. When the probability of a corresponding user being a first-stage energy storage user is greater than the preset first-stage prediction threshold, the user is identified as a candidate energy storage user and included in the candidate energy storage user set for further analysis by the subsequent second-stage user fine identification model.
[0051] In one specific embodiment, the purpose of the first stage is to use a machine learning model with low computational cost to quickly filter out a set of potential energy storage users from all users.
[0052] Specifically, user-level aggregated features are constructed for each user's multi-day daily curve. Preferably, these features may include at least one or more of the following: (1) Characteristics of multi-day average daily load curve; (2) Statistical characteristics such as maximum load, minimum load, peak-to-valley difference, and load fluctuation rate; (3) Steady-state characteristics such as low quantile baseline load and high quantile peak load; (4) Morphological characteristics of suspected charging and discharging periods; (5) Differences between working days and non-working days.
[0053] Furthermore, the average daily curve can be concatenated with statistical features to form the first-stage input feature vector. :
[0054] in, Indicates user The characteristics of the multi-day average daily curve. This indicates its statistical characteristics.
[0055] Then, using the first-stage training subset, a binary classification model is trained to output the probability that a user is an energy storage user. :
[0056] in, For the initial screening model at the user level, XGBoost is preferred. XGBoost is an efficient implementation of gradient boosting decision trees. Its basic idea is to progressively stack multiple regression trees in an additive model, fitting the residuals of the previous round in each iteration, thereby continuously improving the overall discrimination ability. The reason for choosing XGBoost in the first stage of this invention is that the first stage input... Composed of the average curve of working days and statistical features of a small number of users, it belongs to the typical tabular continuous features and has obvious non-linear threshold and feature interaction relationship. XGBoost can automatically learn this type of non-linear boundary through tree splitting. At the same time, energy storage users are usually a minority class, and XGBoost supports the mitigation of class imbalance through class weights, which is more in line with the goal of high recall initial screening. In addition, its inference overhead is low, making it suitable for quickly outputting probabilities on the full number of users and using thresholds to filter the candidate set, which significantly compresses the calculation range for the second stage of multi-instance learning fine detection.
[0057] Then, the initial screening threshold is determined based on the first-stage validation subset. This threshold is preferably achieved by satisfying the high recall constraint and maximizing... The metrics or methods for controlling the proportion of candidate users are determined. For any user, when If the condition is met, the user is included in the candidate set; otherwise, the user is directly identified as a non-energy storage user.
[0058] Using the methods described above, the first phase of rapid pre-screening of all users is completed.
[0059] In this embodiment, during step 3, since the charging and discharging behavior of energy storage users is usually only evident on certain days, traditional identification methods based on overall average features are difficult to effectively capture key behavioral patterns. Therefore, it is necessary to conduct detailed analysis of behaviorally fluctuating instances through multi-instance learning to focus on key load behavior instances, thereby improving the accuracy of energy storage user identification. Specifically, this includes: By using a pre-trained two-stage user fine identification model, the daily load curves in the second instance set corresponding to the input candidate energy storage user set are encoded using a time-series encoder to obtain instance feature vectors. The attention score corresponding to the feature vector of each instance is calculated using the attention mechanism, and the attention weight of each instance is calculated based on the attention score using the normalized exponential function. Based on the attention weight of each instance, the Top-K aggregation mechanism is used to select the K daily load curve instances with the highest attention weight for each user, thus obtaining the key instance set for the corresponding user. Based on the instance feature vectors and attention weights corresponding to each instance in the key instance set, a weighted aggregation is performed to obtain the user-level representation vector corresponding to each user. The user-level representation vector is concatenated with the user statistical features corresponding to the first instance set and passed through the user-level classifier in the two-stage user fine identification model to obtain the two-stage user output probability that the corresponding user belongs to the energy storage user. Users whose second-stage user output probability is greater than or equal to the preset second-stage prediction threshold are identified as energy storage users, and the energy storage user identification result is output. Where K is an integer greater than 1.
[0060] Specifically, the second instance set corresponding to the candidate energy storage user set is input into the pre-trained two-stage user fine identification model, and the time encoder is used to encode the features of each daily load curve to extract the corresponding instance feature vector. The time encoder can adopt structures such as convolutional neural network, recurrent neural network or Transformer network to learn the time-series change features in the daily load curve.
[0061] Subsequently, the importance of each instance feature vector is evaluated using an attention mechanism, the attention score corresponding to each instance is calculated, and the attention score is converted into the corresponding attention weight through a normalized exponential function to characterize the contribution of different daily load curves to the energy storage user identification results.
[0062] Furthermore, for each user, the K daily load curve instances with the highest attention weights are selected using the Top-K aggregation mechanism based on the attention weights corresponding to each instance to construct a key instance set for the corresponding user. Then, the instance feature vectors corresponding to each instance in the key instance set are weighted and aggregated according to their corresponding attention weights to obtain the user-level representation vector of the corresponding user.
[0063] Finally, the user-level representation vector is concatenated with the user statistical features and input into the user-level classifier in the two-stage user fine identification model. The output probability of the corresponding user belonging to the energy storage user is then output. When the two-stage user output probability is greater than or equal to the preset two-stage prediction threshold, the corresponding user is identified as an energy storage user, and the energy storage user identification result is output.
[0064] In one specific embodiment, for the candidate users obtained through the first-stage user-level initial screening model based on XGBoost, the input for the second stage is constructed. Let the candidate users be... have The daily load curve represents the user as a sample package consisting of multiple daily instances:
[0065] Among them, package-level tags are still user-level tags. However, it is unknown whether each daily instance within the package represents an energy storage activity day.
[0066] The second-stage energy storage user fine-grained identification model mainly consists of an instance encoder, an attention module, a Top-K convergence module, and a user-level classifier. Its process is as follows: Figure 3 As shown: Specifically as follows: (1) Instance encoder The daily load curve at point T for each day in the sample package A timing encoder is used. Encoding is performed to obtain a single-day feature vector. In a preferred embodiment, Using a TCN network, we can obtain:
[0067] in, This represents a temporal convolutional encoder. This encoder can consist of one or more layers of one-dimensional convolution, dilated convolution, residual connections, nonlinear activation, and pooling operations, used to extract local temporal patterns and cross-period dependencies from daily load curves.
[0068] (2) Attention module Since energy storage users may only exhibit typical energy storage behavior on a limited number of days, this invention introduces an attention mechanism to adaptively model the importance of instances on each day. The Calculate the attention score for each example. :
[0069] in, For learnable weight matrix transpose, For users On the date The hidden state vector, This is the bias vector.
[0070] Then, the attention weights are obtained using softmax:
[0071] in, Indicates the first The importance of the day for user-level discrimination: the higher the weight of the day, the more the model considers it to be an energy storage day; For users On the date Attention score For users The number of valid dates.
[0072] (3) Top-K convergence To further highlight key behavior days and suppress interference from irrelevant dates, this invention introduces a Top-K convergence mechanism based on attention weighting. That is, for each user, the date with the highest attention weight is selected. Let the 100 instances be denoted by their index set. Only instances within this set are weighted and aggregated:
[0073] in, The weights are the renormalized weights within the Top-K instance set. For user-level representation vectors, For users On the date The hidden state vector.
[0074] In this way, the model does not need to know the specific day when energy storage activity occurs, and can automatically learn the key dates that are most helpful in distinguishing energy storage users from non-energy storage users during the training process.
[0075] (4) User-level classifier User-level representation vector User statistical characteristics splicing:
[0076] Input the user-level classifier to obtain the second-stage output probability:
[0077] in, This represents the second-stage user-level classifier. In a preferred embodiment, the user-level classifier is implemented using an MLP network. If the condition is met, the candidate user is determined to be an energy storage user; otherwise, it is determined to be a non-energy storage user. This is the threshold for the second-stage model.
[0078] In this embodiment, to enable the first-stage user-level initial screening model to quickly screen energy storage users, it is necessary to perform supervised training on the model based on historical user samples and determine the first-stage prediction threshold suitable for candidate user screening by combining validation data. This improves the recall capability of energy storage users and ensures the training effect of the subsequent second-stage fine identification model. Specifically, this includes: The development set is obtained by partitioning the preprocessed full user training set, and the development set is further divided into the first-stage training set and the first-stage validation set. The first-stage input feature vector is constructed based on the first instance set corresponding to each user in the first-stage training set. The first-stage input feature vector is used as input, and the first-stage user-level initial screening model based on the user label corresponding to the first-stage input feature vector is trained under supervision to obtain the trained first-stage user-level initial screening model. Based on the first-stage validation set, a preset first-stage prediction threshold is determined, and users are screened as candidates based on the preset first-stage prediction threshold to construct training samples for the second-stage user fine identification model. The preset first-stage prediction threshold is determined by satisfying the energy storage user recall rate constraint and maximizing the preset evaluation indicators.
[0079] Specifically, a development set is obtained based on the preprocessed full user training set, and the development set is further divided into a first-stage training set and a first-stage validation set. The first-stage training set is used to train the first-stage user-level initial screening model, and the first-stage validation set is used to verify the model performance and determine the preset first-stage prediction threshold. Subsequently, the first-stage input feature vector is constructed based on the first instance set corresponding to each user in the first-stage training set, and the corresponding user labels are used as supervision signals to supervise the training of the first-stage user-level initial screening model based on XGBoost, so as to learn the user-level statistical difference features between energy storage users and non-energy storage users, and obtain the trained first-stage user-level initial screening model.
[0080] Furthermore, a preset first-stage prediction threshold is determined based on the first-stage energy storage user probability output from the first-stage validation set. The preset first-stage prediction threshold can be determined by satisfying the energy storage user recall rate constraint and maximizing the preset evaluation index to minimize the missed detection of energy storage users. Finally, users are screened as candidates based on the preset first-stage prediction threshold, and training samples for the second-stage user fine identification model are constructed based on the screening results.
[0081] In this embodiment, since real-world scenarios typically only have user-level energy storage labels and lack instance-level labels corresponding to daily load curves, it is necessary to conduct supervised training on the second instance set based on a multi-instance learning approach. This enables the model to automatically learn key energy storage behavior instances under weak labeling conditions, thereby improving the ability to finely identify energy storage users in complex scenarios. Specifically, this includes: The first-stage verification feature vector is constructed based on the first instance set corresponding to each user in the first-stage verification set. The first-stage feature vector is input into the trained first-stage user-level preliminary screening model to obtain the first-stage energy storage user prediction probability of each user belonging to the energy storage user, and a preset first-stage prediction threshold is determined based on the first-stage energy storage user prediction probability. Users whose predicted probability of first-stage energy storage is greater than or equal to the preset first-stage prediction threshold are integrated to obtain a candidate user set, and users whose predicted probability of first-stage energy storage is less than the preset first-stage prediction threshold are integrated to obtain a non-energy storage user set. A second-stage training set and a second-stage validation set are constructed based on the candidate user set and the non-energy storage user set. A multi-instance learning package is constructed based on the second instance set corresponding to each user in the second-stage training set. Based on the user-level weakly labeled tags in the multi-instance learning package, the two-stage user fine identification model is trained under supervision so that the two-stage user fine identification model can learn the contribution of each daily load curve to the energy storage user identification result without labeling the daily load curve instance, thus obtaining the trained two-stage user fine identification model. Based on the second-stage validation set, different candidate thresholds are traversed within a preset threshold range, and the F1 score corresponding to each candidate threshold is calculated. The candidate threshold that makes the F1 index reach its maximum value is selected as the second-stage prediction threshold, which is used to classify and decide the output probability of the second-stage users in the subsequent energy storage user identification stage. The user-level weak label represents whether the corresponding user belongs to the energy storage user, and the daily load curves in the multi-instance learning package share the user-level weak label of the corresponding user. The two-stage user fine identification model outputs the two-stage user output probability that the corresponding user belongs to the energy storage user. The preset one-stage prediction threshold is determined by satisfying the energy storage user recall rate constraint and maximizing the preset evaluation index.
[0082] Specifically, a first-stage verification feature vector is constructed based on the first instance set corresponding to each user in the first-stage verification set. The first-stage verification feature vector is then input into the trained first-stage user-level preliminary screening model to obtain the first-stage energy storage user prediction probability corresponding to each user. Subsequently, users whose first-stage energy storage user prediction probability is greater than or equal to the preset first-stage prediction threshold are integrated to obtain a candidate user set, and users whose first-stage energy storage user prediction probability is less than the preset first-stage prediction threshold are integrated to obtain a non-energy storage user set.
[0083] Furthermore, a second-stage training set and a second-stage validation set are constructed based on the candidate user set and the non-energy storage user set. A multi-instance learning package is then constructed based on the second instance set corresponding to each user in the second-stage training set. Each multi-instance learning package corresponds to one user and includes multiple daily load curve instances corresponding to that user. Subsequently, the second-stage user fine-grained identification model is trained under supervision based on the user-level weakly labeled tags corresponding to the multi-instance learning packages. The user-level weakly labeled tags characterize whether the corresponding user belongs to the energy storage user category, and each daily load curve in the multi-instance learning package shares the corresponding user's user-level weakly labeled tags. During training, the model can automatically learn key daily load curve instances that contribute significantly to energy storage user identification without explicit instance-level labels, thereby achieving the learning and identification of complex energy storage behavior patterns.
[0084] Finally, different candidate thresholds are traversed within the preset threshold range, and the precision, recall, and F1 score are calculated. The candidate threshold that makes the F1 score reach its maximum value is then selected as the second-stage prediction threshold, which is used to classify and decide the output probability of the second-stage user in the subsequent energy storage user identification stage.
[0085] In one specific embodiment, all sample data is divided into datasets using users as the smallest unit. Since the identification objective of this invention is to determine whether a user belongs to the energy storage user category, during the partitioning process, all multi-day data for the same user can only appear in the same subset of data, and cannot be simultaneously distributed across the training, validation, and test sets. This avoids information leakage caused by the cross-use of data from different dates for the same user. Furthermore, stratified sampling or a partitioning method based on category proportion constraints can be used when partitioning the dataset to ensure that the proportion of energy storage users and non-energy storage users in each subset remains as consistent as possible, thereby improving the stability of model training and evaluation results.
[0086] The specific steps for model training are as follows: First, the preprocessed full user set is divided into a development set. With test set Among them, the test set It is used only for the final performance evaluation after the model training is completed, and does not participate in the model parameter learning, threshold adjustment and candidate sample construction process, so as to ensure the objectivity of the test results.
[0087] Then, the development set Further divided into the first phase training set and the first phase of validation set Used for training and validation of user-level initial screening models based on XGBoost. Specifically, based on each user's normalized workday package. Constructing the first-stage input feature vector And combined with the corresponding user-level tags The model training is completed, and the first-stage user-level initial screening model is obtained. After training is complete, the first-stage validation set will be used. The feature vectors of the users are input into the initial screening model to obtain the predicted probability that each user belongs to the energy storage user category. Since the goal of the first phase is to retain as many real energy storage users as possible with lower computational costs, the initial screening threshold is... The selection criteria prioritize high recall. When the first-stage threshold... Once determined, for any user If its predicted probability satisfies If the condition is met, the user is included in the candidate user set; otherwise, the user is directly identified as a non-energy storage user.
[0088] Then, the initial screening model from the first stage was used to screen... and Users are selected from the pool to construct the second-stage training set. Second-stage verification set This method is used for training and validating a multi-instance learning-based model for fine-grained identification of energy storage users. Specifically, user-level labels are used as supervision signals to optimize model parameters, enabling the model to learn to extract key information contributing to energy storage user identification from multi-day daily load curves even without known daily instance labels. After training, the second-stage validation set will be used. The refined identification model is trained by inputting each user sample packet into it, and the predicted probability that each user belongs to an energy storage user is obtained. The second-stage threshold is determined by iterating through different candidate values within a preset threshold range and combining precision, recall, and F1 scores. Preferably, the candidate value that optimizes the F1 score is selected as the threshold for the second stage. If necessary, further adjustments can be made while ensuring that the accuracy rate is not lower than the preset requirements. Adjustments will be made. When the second-stage threshold... Once determined, for any user If its predicted probability satisfies If the condition is met, the user is identified as an energy storage user; otherwise, the user is identified as a non-energy storage user.
[0089] Finally, save the first-stage model parameters, the second-stage model parameters, and the determined thresholds. and This is used for two-level cascaded reasoning in the subsequent testing phase. During the testing phase, After undergoing the same data preprocessing and user-specific normalization as in the training phase, the data is used to construct the first-stage input feature vector, which is then input into the trained first-stage user-level initial screening model to obtain a candidate energy storage user set. This set is then fed into the second-stage refined identification model. Finally, the direct judgment results from the first stage are integrated with the refined identification results from the second stage to obtain the final energy storage user identification results in the test set.
[0090] The model is trained using cross-entropy loss, as detailed below:
[0091] in, This is the training set for the second phase.
[0092] The energy storage user identification method proposed in this invention for weakly labeled scenarios can achieve good comprehensive application results in user-side energy storage identification tasks, as detailed below: Firstly, regarding accuracy, this invention addresses the problem that energy storage behavior only occurs significantly on a few days, and that traditional methods easily weaken key features due to multi-day averaging or coarse-grained statistics. It enables the model to more effectively distinguish between "users who genuinely engage in energy storage behavior" and "non-energy storage users who only exhibit ordinary fluctuations." Especially in scenarios where energy storage behavior is intermittent and highly strategic, this invention better preserves information meaningful for the judgment and reduces the interference of irrelevant information on the results, thereby helping to reduce the risk of missed detections and false positives, and improving the relevance of energy storage user identification results.
[0093] Secondly, regarding engineering application efficiency, this invention does not uniformly perform high-complexity modeling on all users. Instead, it first performs a rapid screening of all users, and then further analyzes a smaller range of suspected users. This approach reduces the scope of high-complexity model calls while ensuring identification requirements are met, thereby lowering overall computational overhead and inference latency, and improving the applicability of the method in large-scale distribution areas, campuses, or batch user data scenarios. For business scenarios requiring periodic user screening, this method is easier to deploy and implement.
[0094] Finally, regarding adaptability under limited data conditions, this invention does not rely on high-precision manual annotation on a daily or time-period basis. Instead, it can complete user-level identification tasks even with only weak daily annotations and a certain degree of omissions and errors. This makes the invention less dependent on high-quality labeled data, better aligning with the actual data conditions of power grid companies. Even in real engineering environments where annotations are incomplete and sample noise is high, this method still exhibits good stability and usability, which is beneficial for improving the model's generalization ability across different transformer areas, user groups, and time windows.
[0095] In summary, this invention balances recognition effectiveness, computational efficiency, and adaptability to weak annotation in energy storage user identification tasks. It effectively improves upon existing technologies that suffer from issues such as the dilution of key behaviors, high costs of full-scale deep inference, and insufficient annotation conditions for real engineering data. It can provide technical support for power grid companies to conduct energy storage user screening, demand-side management, electricity auditing, and flexibility resource assessment.
[0096] Example 2: The two-level heterogeneous energy storage user identification method proposed in this invention, targeting scenarios with weak labeling, is applicable to the application needs of power grid companies in screening and identifying energy storage users in distribution areas, industrial parks, and industrial and commercial user scenarios. It is particularly suitable for actual engineering environments with only daily load curve data, lacking precise daily labeling information, and with a large user base. In such scenarios, the power grid side can usually obtain the daily load curves of user-level smart meters and some auxiliary tag information, but it is difficult to obtain complete daily operating information of energy storage devices. Therefore, this invention can better adapt to the data conditions and deployment requirements in real business.
[0097] To make the technical solution of the present invention clearer, the following preferred embodiments are provided to further illustrate the present invention: (1) Data parameters: The input data consists of 7496 users, each user has 28 valid days, and the number of sampling points per day is T=96 (15 minutes / point); after preprocessing, users with ≥7 valid days are retained, totaling 7468 users, of which 528 are energy storage users and 6940 are non-energy storage users.
[0098] (2) Data set division ratio: The full data is divided into development set (5974 users) and test set (1494 users) in an 8:2 ratio; the development set is divided into first-stage training set (4779 users) and first-stage validation set (1195 users) in an 8:2 ratio; the second-stage training set and validation set are selected from the initial screening of candidate users.
[0099] (3) Model hyperparameters: The XGBoost classification model is used in the user-level initial screening stage. Its main parameters are set as follows: the number of base learners is 400, the learning rate is 0.05, the tree depth is 4, the subsampling ratio is 0.8, the feature column sampling ratio is 0.8, the L2 regularization coefficient is 1.0, and the class imbalance weight is adaptively set according to the number of positive and negative samples in the training set. The TCN (Temporal Convolutional Network) instance encoder in the fine detection stage contains 3 layers of temporal convolutional blocks with a kernel size of 5 and dilation coefficients of 1, 2 and 4 respectively. Each layer adopts residual connection and dropout mechanism with a dropout rate of 0.2. The attention convergence module adopts a 4-head scaled dot product attention mechanism with a Top-K convergence parameter of 3. The user-level classifier adopts a two-layer fully connected network with one hidden layer, uses the ReLU activation function in the middle, and combines dropout to improve generalization ability.
[0100] (4) Threshold determination: the initial screening threshold τ_1=0.5, and the fine identification threshold τ_2=0.62.
[0101] (5) Performance results: On the test set, the model precision was 64.52%, recall was 75.47%, F1 score was 69.75%, and accuracy was 95.31%. Compared with the single model, precision, recall and F1 score were significantly improved, which can effectively solve the problem of energy storage user identification in weak label scenarios.
[0102] In practical applications, this invention can be deployed in the data analysis platform, marketing audit platform, demand-side management platform, or integrated energy service platform of power grid companies. For business scenarios that require periodic screening of energy storage users, user data can be processed in batches on a monthly, quarterly, or specified time window basis. The first stage quickly narrows down the range of suspected users, and the second stage performs a detailed analysis of candidate users, thereby reducing the overall computing cost while ensuring the identification effect.
[0103] This embodiment is considered a preferred embodiment because it neither relies on high-cost energy storage devices for full metering nor requires precise labeling of each instance. Instead, it fully utilizes readily available daily load curves and weakly labeled information from the grid side to complete user-level identification. This approach effectively balances data availability, model operating efficiency, and business usage requirements in practical engineering. Therefore, this embodiment has good feasibility for engineering implementation and significant potential for widespread application.
[0104] Example 3: Based on the same inventive concept, this invention also provides a two-level heterogeneous energy storage user identification system for weakly labeled scenarios, such as... Figure 4 As shown, it includes: The construction module is used to construct a user sample package according to the user dimension based on the input multi-day load curve data of users, and to construct a first instance set representing the user's regular electricity consumption behavior and a second instance set representing the user's all-time electricity consumption behavior based on the load curves of each day in the user sample package. The initial screening module is used to perform initial screening of energy storage users based on the user-level input feature vector extracted from the first instance set and using a pre-trained one-stage user-level initial screening model to obtain a candidate energy storage user set. The output module is used to input the second instance set corresponding to the candidate energy storage user set into the pre-trained two-stage user fine identification model and output the energy storage user identification result.
[0105] Preferably, the building module is specifically used for: The input multi-day load curve data of users is parsed by date, and missing data, abnormal data and load curve data with all zeros are removed to obtain the processed multi-day load curve data of users. The processed multi-day load curve data of users are aggregated according to the user dimension, and the aggregated multi-day load curve data is determined as the user sample package of the corresponding user. Based on the date attribute in the user sample package, the daily load curves corresponding to weekdays are filtered to construct a first instance set representing the user's regular electricity consumption behavior, and based on all the daily load curves in the user sample package, a second instance set representing the user's electricity consumption behavior throughout the day is constructed.
[0106] Preferably, the primary screening module is specifically used for: Based on the first instance set, user statistical features and average load curve features are extracted and normalized to obtain user-level input feature vectors. The user-level input feature vector is input into a pre-trained one-stage user-level initial screening model, and the one-stage energy storage user probability corresponding to each user is output. Users whose probability of being a first-stage energy storage user is greater than a preset first-stage prediction threshold are identified as candidate energy storage users, and a candidate energy storage user set is constructed based on the identified candidate energy storage users.
[0107] Preferably, the output module is specifically used for: By using a pre-trained two-stage user fine identification model, the daily load curves in the second instance set corresponding to the input candidate energy storage user set are encoded using a time-series encoder to obtain instance feature vectors. The attention score corresponding to the feature vector of each instance is calculated using the attention mechanism, and the attention weight of each instance is calculated based on the attention score using the normalized exponential function. Based on the attention weight of each instance, the Top-K aggregation mechanism is used to select the K daily load curve instances with the highest attention weight for each user, thus obtaining the key instance set for the corresponding user. Based on the instance feature vectors and attention weights corresponding to each instance in the key instance set, a weighted aggregation is performed to obtain the user-level representation vector corresponding to each user. The user-level representation vector is concatenated with the user statistical features corresponding to the first instance set and passed through the user-level classifier in the two-stage user fine identification model to obtain the two-stage user output probability that the corresponding user belongs to the energy storage user. Users whose second-stage user output probability is greater than or equal to the preset second-stage prediction threshold are identified as energy storage users, and the energy storage user identification result is output. Where K is an integer greater than 1.
[0108] Preferably, the training process of the user-level initial screening model in the initial screening module includes: The development set is obtained by partitioning the preprocessed full user training set, and the development set is further divided into the first-stage training set and the first-stage validation set. The first-stage input feature vector is constructed based on the first instance set corresponding to each user in the first-stage training set. The first-stage input feature vector is used as input, and the first-stage user-level initial screening model based on the user label corresponding to the first-stage input feature vector is trained under supervision to obtain the trained first-stage user-level initial screening model. Based on the first-stage validation set, a preset first-stage prediction threshold is determined, and users are screened as candidates based on the preset first-stage prediction threshold to construct training samples for the second-stage user fine identification model. The preset first-stage prediction threshold is determined by satisfying the energy storage user recall rate constraint and maximizing the preset evaluation index.
[0109] Preferably, the training process of the two-stage user fine-grained identification model in the output module includes: The first-stage verification feature vector is constructed based on the first instance set corresponding to each user in the first-stage verification set. The first-stage verification feature vector is input into the trained first-stage user-level preliminary screening model to obtain the first-stage energy storage user prediction probability of each user belonging to the energy storage user, and a preset first-stage prediction threshold is determined based on the first-stage energy storage user prediction probability. Users whose predicted probability of first-stage energy storage is greater than or equal to the preset first-stage prediction threshold are integrated to obtain a candidate user set, and users whose predicted probability of first-stage energy storage is less than the preset first-stage prediction threshold are integrated to obtain a non-energy storage user set. A second-stage training set and a second-stage validation set are constructed based on the candidate user set and the non-energy storage user set. A multi-instance learning package is constructed based on the second instance set corresponding to each user in the second-stage training set. Based on the user-level weakly labeled tags in the multi-instance learning package, the two-stage user fine identification model is trained under supervision so that the two-stage user fine identification model can learn the contribution of each daily load curve to the energy storage user identification result without labeling the daily load curve instance, thus obtaining the trained two-stage user fine identification model. Based on the second-stage validation set, different candidate thresholds are traversed within a preset threshold range, and the F1 score corresponding to each candidate threshold is calculated. The candidate threshold that makes the F1 index reach its maximum value is selected as the second-stage prediction threshold, which is used to classify and decide the output probability of the second-stage users in the subsequent energy storage user identification stage. The user-level weak label represents whether the corresponding user belongs to the energy storage user, and the daily load curves in the multi-instance learning package share the user-level weak label of the corresponding user. The two-stage user fine identification model outputs the two-stage user output probability that the corresponding user belongs to the energy storage user. The preset one-stage prediction threshold is determined by satisfying the energy storage user recall rate constraint and maximizing the preset evaluation index.
[0110] Example 4 like Figure 5 As shown, the present invention also provides an electronic device, which may be a computer device, a microcontroller device, a smart mobile device, etc. The electronic device in this embodiment may include a processor, a memory, a transceiver component, etc. The memory, processor, and transceiver component are connected via a bus; the memory can be used to store executable programs, and an exemplary executable program may include instructions; the processor is used to execute the instructions stored in the memory. The memory can also be used to store data, which can be accessed and / or modified when instructions are executed.
[0111] The processor may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, and it is suitable for implementing one or more instructions. Specifically, it is suitable for loading and executing one or more instructions in the storage medium to realize the corresponding method flow or corresponding function, so as to realize the steps of a two-level heterogeneous energy storage user identification method for weak labeling scenarios in the above embodiments.
[0112] Example 5 Based on the same inventive concept, this invention also provides a readable storage medium, specifically an electronic device readable storage medium (Memory). This readable storage medium is a memory device within an electronic device used to store programs and data. It is understood that the storage medium here can include both built-in storage media within the electronic device and extended storage media supported by the electronic device. The storage medium provides storage space, which stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more executable programs (including program code). It should be noted that the storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. Loading and executing one or more instructions stored in the storage medium by the processor can implement the steps of a two-level heterogeneous energy storage user identification method for weakly labeled scenarios described in the above embodiments.
[0113] 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, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0114] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0115] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.
[0116] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0117] The above are merely embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of the claims of the present invention pending approval.
Claims
1. A method for user identification in a two-level heterogeneous energy storage system for weakly labeled scenarios, characterized in that, include: Based on the input user multi-day load curve data, a user sample package is constructed according to the user dimension. Based on the load curves of each day in the user sample package, a first instance set representing the user's regular electricity consumption behavior and a second instance set representing the user's all-time electricity consumption behavior are constructed. Based on the user-level input feature vector extracted from the first instance set, the user is screened for energy storage users using a pre-trained one-stage user-level screening model to obtain a candidate energy storage user set. The second instance set corresponding to the candidate energy storage user set is input into the pre-trained two-stage user fine identification model, and the energy storage user identification result is output.
2. The method according to claim 1, characterized in that, The input user multi-day load curve data is used to construct a user sample package according to the user dimension. Based on the load curves of each day in the user sample package, a first instance set representing the user's regular electricity consumption behavior and a second instance set representing the user's all-time electricity consumption behavior are constructed, including: The input multi-day load curve data of users is parsed by date, and missing data, abnormal data and load curve data with all zeros are removed to obtain the processed multi-day load curve data of users. The processed multi-day load curve data of users are aggregated according to the user dimension, and the aggregated multi-day load curve data is determined as the user sample package of the corresponding user. Based on the date attribute in the user sample package, the daily load curves corresponding to weekdays are filtered to construct a first instance set representing the user's regular electricity consumption behavior, and based on all the daily load curves in the user sample package, a second instance set representing the user's electricity consumption behavior throughout the day is constructed.
3. The method according to claim 1, characterized in that, The step involves using a pre-trained one-stage user-level initial screening model to perform initial screening of energy storage users based on the user-level input feature vector extracted from the first instance set, resulting in a candidate energy storage user set, including: Based on the first instance set, user statistical features and average load curve features are extracted and normalized to obtain user-level input feature vectors. The user-level input feature vector is input into a pre-trained one-stage user-level initial screening model, and the one-stage energy storage user probability corresponding to each user is output. Users whose probability of being a first-stage energy storage user is greater than a preset first-stage prediction threshold are identified as candidate energy storage users, and a candidate energy storage user set is constructed based on the identified candidate energy storage users.
4. The method according to claim 1, characterized in that, The step of inputting the second instance set corresponding to the candidate energy storage user set into the pre-trained two-stage user fine identification model and outputting the energy storage user identification result includes: By using a pre-trained two-stage user fine identification model, the daily load curves in the second instance set corresponding to the input candidate energy storage user set are encoded using a time-series encoder to obtain instance feature vectors. The attention score corresponding to the feature vector of each instance is calculated using the attention mechanism, and the attention weight of each instance is calculated based on the attention score using the normalized exponential function. Based on the attention weight of each instance, the Top-K aggregation mechanism is used to select the K daily load curve instances with the highest attention weight for each user, thus obtaining the key instance set for the corresponding user. Based on the instance feature vectors and attention weights corresponding to each instance in the key instance set, a weighted aggregation is performed to obtain the user-level representation vector corresponding to each user. The user-level representation vector is concatenated with the user statistical features corresponding to the first instance set and passed through the user-level classifier in the two-stage user fine identification model to obtain the two-stage user output probability that the corresponding user belongs to the energy storage user. Users whose second-stage user output probability is greater than or equal to the preset second-stage prediction threshold are identified as energy storage users, and the energy storage user identification result is output. Where K is an integer greater than 1.
5. The method according to claim 1, characterized in that, The training process of the first-stage user-level initial screening model includes: The development set is obtained by partitioning the preprocessed full user training set, and the development set is further divided into the first-stage training set and the first-stage validation set. The first-stage input feature vector is constructed based on the first instance set corresponding to each user in the first-stage training set. The first-stage input feature vector is used as input, and the first-stage user-level initial screening model based on the user label corresponding to the first-stage input feature vector is subjected to supervised training to obtain the trained first-stage user-level initial screening model.
6. The method according to claim 5, characterized in that, The training process of the two-stage user fine-grained identification model includes: The first-stage verification feature vector is constructed based on the first instance set corresponding to each user in the first-stage verification set. The first-stage verification feature vector is input into the trained first-stage user-level preliminary screening model to obtain the first-stage energy storage user prediction probability of each user belonging to the energy storage user, and a preset first-stage prediction threshold is determined based on the first-stage energy storage user prediction probability. Users whose predicted probability of first-stage energy storage is greater than or equal to the preset first-stage prediction threshold are integrated to obtain a candidate user set, and users whose predicted probability of first-stage energy storage is less than the preset first-stage prediction threshold are integrated to obtain a non-energy storage user set. A second-stage training set and a second-stage validation set are constructed based on the candidate user set and the non-energy storage user set. A multi-instance learning package is constructed based on the second instance set corresponding to each user in the second-stage training set. Based on the user-level weakly labeled tags in the multi-instance learning package, the two-stage user fine identification model is trained under supervision so that the two-stage user fine identification model can learn the contribution of each daily load curve to the energy storage user identification result without labeling the daily load curve instance, thus obtaining the trained two-stage user fine identification model. Based on the second-stage validation set, different candidate thresholds are traversed within a preset threshold range, and the F1 score corresponding to each candidate threshold is calculated. The candidate threshold that makes the F1 index reach its maximum value is selected as the second-stage prediction threshold, which is used to classify and decide the output probability of the second-stage users in the subsequent energy storage user identification stage. The user-level weak label represents whether the corresponding user belongs to the energy storage user, and the daily load curves in the multi-instance learning package share the user-level weak label of the corresponding user. The two-stage user fine identification model outputs the two-stage user output probability that the corresponding user belongs to the energy storage user. The preset one-stage prediction threshold is determined by satisfying the energy storage user recall rate constraint and maximizing the preset evaluation index.
7. A two-stage heterogeneous energy storage user identification system for weakly labeled scenarios, characterized in that, include: The construction module is used to construct a user sample package according to the user dimension based on the input multi-day load curve data of users, and to construct a first instance set representing the user's regular electricity consumption behavior and a second instance set representing the user's all-time electricity consumption behavior based on the load curves of each day in the user sample package. The initial screening module is used to perform initial screening of energy storage users based on the user-level input feature vector extracted from the first instance set and using a pre-trained one-stage user-level initial screening model to obtain a candidate energy storage user set. The output module is used to input the second instance set corresponding to the candidate energy storage user set into the pre-trained two-stage user fine identification model and output the energy storage user identification result.
8. The system according to claim 7, characterized in that, The building module is specifically used for: The input multi-day load curve data of users is parsed by date, and missing data, abnormal data and load curve data with all zeros are removed to obtain the processed multi-day load curve data of users. The processed multi-day load curve data of users are aggregated according to the user dimension, and the aggregated multi-day load curve data is determined as the user sample package of the corresponding user. Based on the date attribute in the user sample package, the daily load curves corresponding to weekdays are filtered to construct a first instance set representing the user's regular electricity consumption behavior, and based on all the daily load curves in the user sample package, a second instance set representing the user's electricity consumption behavior throughout the day is constructed.
9. The system according to claim 7, characterized in that, The primary screening module is specifically used for: Based on the first instance set, user statistical features and average load curve features are extracted and normalized to obtain user-level input feature vectors. The user-level input feature vector is input into a pre-trained one-stage user-level initial screening model, and the one-stage energy storage user probability corresponding to each user is output. Users whose probability of being a first-stage energy storage user is greater than a preset first-stage prediction threshold are identified as candidate energy storage users, and a candidate energy storage user set is constructed based on the identified candidate energy storage users.
10. The system according to claim 7, characterized in that, The output module is specifically used for: By using a pre-trained two-stage user fine identification model, the daily load curves in the second instance set corresponding to the input candidate energy storage user set are encoded using a time-series encoder to obtain instance feature vectors. The attention score corresponding to the feature vector of each instance is calculated using the attention mechanism, and the attention weight of each instance is calculated based on the attention score using the normalized exponential function. Based on the attention weight of each instance, the Top-K aggregation mechanism is used to select the K daily load curve instances with the highest attention weight for each user, thus obtaining the key instance set for the corresponding user. Based on the instance feature vectors and attention weights corresponding to each instance in the key instance set, a weighted aggregation is performed to obtain the user-level representation vector corresponding to each user. The user-level representation vector is concatenated with the user statistical features corresponding to the first instance set and passed through the user-level classifier in the two-stage user fine identification model to obtain the two-stage user output probability that the corresponding user belongs to the energy storage user. Users whose second-stage user output probability is greater than or equal to the preset second-stage prediction threshold are identified as energy storage users, and the energy storage user identification result is output. Where K is an integer greater than 1.
11. The system according to claim 7, characterized in that, The training process of the user-level initial screening model in the initial screening module includes: The development set is obtained by partitioning the preprocessed full user training set, and the development set is further divided into the first-stage training set and the first-stage validation set. The first-stage input feature vector is constructed based on the first instance set corresponding to each user in the first-stage training set. The first-stage input feature vector is used as input, and the first-stage user-level initial screening model based on the user label corresponding to the first-stage input feature vector is trained under supervision to obtain the trained first-stage user-level initial screening model. Based on the first-stage validation set, a preset first-stage prediction threshold is determined, and users are screened as candidates based on the preset first-stage prediction threshold to construct training samples for the second-stage user fine identification model. The preset first-stage prediction threshold is determined by satisfying the energy storage user recall rate constraint and maximizing the preset evaluation index.
12. The system according to claim 11, characterized in that, The training process of the two-stage user fine-grained identification model in the output module includes: The first-stage verification feature vector is constructed based on the first instance set corresponding to each user in the first-stage verification set. The first-stage verification feature vector is input into the trained first-stage user-level preliminary screening model to obtain the first-stage energy storage user prediction probability of each user belonging to the energy storage user, and a preset first-stage prediction threshold is determined based on the first-stage energy storage user prediction probability. Users whose predicted probability of first-stage energy storage is greater than or equal to the preset first-stage prediction threshold are integrated to obtain a candidate user set, and users whose predicted probability of first-stage energy storage is less than the preset first-stage prediction threshold are integrated to obtain a non-energy storage user set. A second-stage training set and a second-stage validation set are constructed based on the candidate user set and the non-energy storage user set. A multi-instance learning package is constructed based on the second instance set corresponding to each user in the second-stage training set. Based on the user-level weakly labeled tags in the multi-instance learning package, the two-stage user fine identification model is trained under supervision so that the two-stage user fine identification model can learn the contribution of each daily load curve to the energy storage user identification result without labeling the daily load curve instance, thus obtaining the trained two-stage user fine identification model. Based on the second-stage validation set, different candidate thresholds are traversed within the preset threshold range and the F1 index corresponding to each candidate threshold is calculated. The candidate threshold that makes the F1 index reach its maximum value is selected as the second-stage prediction threshold, which is used to classify and decide the output probability of the second-stage users in the subsequent energy storage user identification stage. The user-level weak label represents whether the corresponding user belongs to the energy storage user, and the daily load curves in the multi-instance learning package share the user-level weak label of the corresponding user. The two-stage user fine identification model outputs the two-stage user output probability that the corresponding user belongs to the energy storage user. The preset one-stage prediction threshold is determined by satisfying the energy storage user recall rate constraint and maximizing the preset evaluation index.
13. An electronic device, characterized in that, include: At least one processor and memory; The memory and processor are connected via a bus; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, the two-level heterogeneous energy storage user identification method for weakly labeled scenarios as described in any one of claims 1 to 6 is implemented.
14. A readable storage medium, characterized in that, It contains an execution program, which, when executed, implements the two-level heterogeneous energy storage user identification method for weakly labeled scenarios as described in any one of claims 1 to 6.