Power user electricity consumption behavior-based electricity sales scheme generation method and system
By collecting and analyzing electricity consumption data from power users, and using LSTM networks and gradient boosting tree models to generate differentiated electricity sales plans, the problem of balancing power grid and user demand in existing technologies has been solved, achieving synergistic optimization of power grid efficiency and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING LUOHE TECH CO LTD
- Filing Date
- 2025-10-30
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies cannot accurately match the needs of users with different electricity consumption habits, making it difficult to balance the cost of peak and off-peak load differentiation with user satisfaction. Existing electricity sales solutions lack refined design and cannot balance grid efficiency and user experience.
By collecting historical electricity load data, responsiveness data after electricity price adjustments, and preference data for daily peak and off-peak electricity consumption periods, time series analysis is performed using an LSTM network to generate user electricity consumption feature vectors. These vectors are then grouped using a clustering algorithm. Combining the peak and off-peak power supply costs of the power grid with user electricity satisfaction requirements, a gradient boosting tree model is used to optimize the electricity sales plan and generate differentiated electricity sales plans.
It enables accurate prediction and grouping of electricity users' electricity consumption behavior, generates differentiated electricity sales plans adapted to each user group, improves the synergistic optimization of power grid operation efficiency and user experience, and avoids the problem of insufficient adaptability caused by data loss and rough classification in traditional solutions.
Smart Images

Figure CN121329495B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of generating electricity sales plans for electricity users, and in particular to a method and system for generating electricity sales plans based on the clustering of electricity user behavior. Background Technology
[0002] With the advancement of electricity retail marketization, users' electricity consumption habits vary significantly. Some users mainly consume electricity during peak hours, while others mainly consume it during off-peak hours. The power grid needs to optimize load and reduce costs, and users have an urgent need for personalized electricity sales solutions. Therefore, there is a need for a solution generation method based on electricity consumption behavior clustering to achieve a dual improvement in power grid efficiency and user experience.
[0003] Currently, existing technologies rely on basic user electricity consumption data, such as total monthly electricity consumption and average daily electricity usage time, to perform simple statistics, such as calculating the average monthly electricity consumption and dividing users into high, medium, and low electricity consumption groups based on peak hour percentages. Then, combined with the average cost of the power grid and the benchmark electricity price, fixed-tier packages are developed, such as high-electricity packages offering fixed discounts to the corresponding groups.
[0004] However, existing technologies have drawbacks: relying solely on historical data to segment groups fails to capture future electricity consumption trends, leading to a disconnect between the segmentation results and reality; the solutions depend on average costs and fixed discounts, failing to consider the differentiated costs of peak and off-peak power grids and user satisfaction, lacking fine-grained optimization, making it difficult to match core user needs, and unable to balance peak and off-peak loads with personalized user demands. Summary of the Invention
[0005] The purpose of this application is to provide a method and system for generating electricity sales plans based on the clustering of electricity users' electricity consumption behavior, so as to solve the problem in the prior art that it is difficult to accurately match the needs of users with different electricity consumption habits.
[0006] To address the aforementioned technical problems, in a first aspect, this application provides a method for generating electricity sales plans based on clustering of electricity user behavior, comprising:
[0007] Collect historical electricity load data, responsiveness data after electricity price adjustments, and preference data for daily peak and off-peak electricity consumption periods for each electricity user;
[0008] The historical electricity load data is processed by time series analysis using an LSTM network to obtain the electricity consumption behavior trend characteristics of each electricity user in the future time period.
[0009] The electricity consumption behavior trend characteristics, the responsiveness data, and the preference data are vector-encoded to obtain the user electricity consumption feature vector.
[0010] A clustering algorithm is used to group the user electricity consumption feature vectors to obtain user clustering results. The user clustering results include peak electricity consumption-dominant user groups, off-peak electricity consumption-dominant user groups, and neutral electricity consumption-dominant user groups.
[0011] Based on the user clustering results, and combined with the peak and valley power supply costs of the power grid and the user's electricity satisfaction requirements, a gradient boosting tree model is used to optimize the parameters of the electricity sales plan and generate differentiated electricity sales plans that are suitable for each electricity user group.
[0012] Optionally, based on the user clustering results, and combined with the peak-valley power supply cost of the power grid and user electricity satisfaction requirements, a gradient boosting tree model is used to optimize the parameters of the electricity sales scheme, generating differentiated electricity sales schemes suitable for various electricity user groups, including:
[0013] Based on the user clustering results, the optimization objectives for electricity price parameters are set to obtain the optimization objective combinations corresponding to peak-consumption-dominant user groups, off-peak-consumption-dominant user groups, and flat-peak-consumption-dominant user groups, respectively.
[0014] Based on the peak and valley power supply costs of the power grid, power supply cost constraints are constructed to obtain cost constraints for each time period.
[0015] Based on the user electricity satisfaction requirements, user satisfaction constraints are constructed to obtain satisfaction constraints for each user group.
[0016] A gradient boosting tree model is used to optimize the combination of optimization objectives, the cost constraints, and the satisfaction constraints to obtain the final combination of electricity price parameters. Based on the final combination of electricity price parameters, a differentiated electricity sales plan is generated to form a differentiated electricity sales plan that is suitable for each electricity user group.
[0017] Optionally, the step of using a gradient boosting tree model to optimize the combination of optimization objectives, the cost constraints, and the satisfaction constraints to obtain the final combination of electricity price parameters includes:
[0018] Based on the optimized objective combination, the gradient boosting tree model is used to evaluate the current electricity price parameter combination to obtain a comprehensive evaluation result that includes the power supply cost evaluation value and the user satisfaction evaluation value.
[0019] Based on the comprehensive evaluation results, identify the parameter conflict items in the current electricity price parameter combination that do not meet the cost constraint and the satisfaction constraint, and obtain the parameter items to be optimized;
[0020] The parameters to be optimized in the current electricity price parameter combination are adjusted to generate the final electricity price parameter combination, wherein the final electricity price parameter combination satisfies the cost constraint and the satisfaction constraint.
[0021] Optionally, the step of using an LSTM network to perform time series analysis on the historical electricity load data to obtain the electricity consumption behavior trend characteristics of each electricity user in the future time period includes:
[0022] The historical electricity load data is arranged in chronological order as a load time series with equal intervals.
[0023] The memory unit of the LSTM network is used to extract time features from the load time series to obtain time dimension features. Then, multi-scale feature extraction is performed on the time dimension features to obtain multi-scale time series features.
[0024] Based on the multi-scale time series features, sequence transformation processing is performed to obtain serialized trend features. The serialized trend features are then subjected to feature aggregation processing to form the electricity consumption behavior trend features of each electricity user in the future time period.
[0025] Optionally, the step of performing vector encoding processing on the electricity consumption behavior trend features, the responsiveness data, and the preference data to obtain a user electricity consumption feature vector includes:
[0026] Based on the aforementioned electricity consumption behavior trend characteristics, the load fluctuation range and rate of change in the future time period are calculated to obtain trend quantification indicators;
[0027] Based on the responsiveness data, the sensitivity coefficient of users to changes in peak and off-peak electricity prices is determined, and a quantitative response index is obtained.
[0028] Based on the aforementioned preference data, the proportion of electricity consumption by users during peak and off-peak hours is statistically analyzed to obtain a quantitative indicator of preference.
[0029] The trend quantification index, the response quantification index, and the preference quantification index are concatenated to form a standardized feature combination. The standardized feature combination is then subjected to dimensional standardization to obtain the user's electricity consumption feature vector.
[0030] Optionally, the step of concatenating the trend quantification index, the response quantification index, and the preference quantification index to form a standardized feature combination, and then performing dimensional standardization on the standardized feature combination to obtain the user's electricity consumption feature vector, includes:
[0031] According to the preset feature arrangement order, the trend quantification index, the response quantification index, and the preference quantification index are connected to form an initial feature combination;
[0032] Based on the numerical distribution characteristics of each indicator in the initial feature combination, the numerical adjustment parameters corresponding to each indicator are obtained, wherein the numerical adjustment parameters include the baseline value and adjustment coefficient of each indicator.
[0033] Based on the numerical adjustment parameters, the initial feature combination is adjusted to obtain a standardized feature combination;
[0034] Based on the feature expression form of the preset dimension, the standardized feature combination is standardized to form the user electricity consumption feature vector.
[0035] Optionally, the user electricity consumption feature vector is grouped using a clustering algorithm to obtain user clustering results. These results include peak-consumption-dominated user groups, off-peak-consumption-dominated user groups, and flat-consumption-dominated user groups, including:
[0036] Based on the user electricity consumption feature vector, a clustering algorithm is used to perform cluster center localization processing to obtain multiple initial cluster centers;
[0037] Calculate the degree of difference between each user's electricity consumption feature vector and each of the initial cluster centers, and based on the degree of difference, assign each user to the corresponding user group to form the user grouping result;
[0038] Based on the user grouping results, the average value of the electricity consumption feature vectors of all users in each user group is calculated to obtain the final cluster center;
[0039] Based on the final cluster centers, user groups are classified to generate user clustering results that include peak-consumption-dominant user groups, off-peak-consumption-dominant user groups, and neutral-consumption-dominant user groups.
[0040] Secondly, this application provides a power sales scheme generation system based on power user electricity consumption behavior clustering, including:
[0041] The data acquisition module is used to collect historical electricity load data, response data after electricity price adjustments, and preference data for daily peak and off-peak electricity consumption periods for each electricity user.
[0042] The analysis module is used to perform time series analysis on the historical electricity load data using an LSTM network to obtain the electricity consumption behavior trend characteristics of each electricity user in the future time period.
[0043] The processing module is used to perform vector encoding processing on the electricity consumption behavior trend characteristics, the responsiveness data, and the preference data to obtain the user electricity consumption feature vector;
[0044] The grouping module is used to process the user electricity consumption feature vectors into groups using a clustering algorithm to obtain user clustering results. The user clustering results include peak electricity consumption-dominant user groups, off-peak electricity consumption-dominant user groups, and neutral electricity consumption-dominant user groups.
[0045] The optimization module is used to optimize the parameters of the electricity sales plan based on the user clustering results, combined with the peak and valley power supply cost of the power grid and the user's electricity satisfaction requirements, using a gradient boosting tree model to generate differentiated electricity sales plans that are suitable for each electricity user group.
[0046] Thirdly, this application provides an electronic device, comprising:
[0047] Memory, used to store computer programs;
[0048] A processor is configured to execute the computer program to implement the steps of the electricity sales scheme generation method based on electricity user behavior clustering as described in the first aspect above.
[0049] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps of the electricity sales scheme generation method based on electricity user behavior clustering as described in the first aspect above.
[0050] The electricity sales scheme generation method based on electricity user behavior clustering provided in this application collects historical electricity load data, response data after electricity price adjustments, and preference data for peak and off-peak hours of each electricity user. It uses an LSTM network to perform time series analysis on the historical electricity load data to obtain the electricity consumption behavior trend characteristics of each electricity user in the future time period. The electricity consumption trend characteristics, response data, and preference data are then vector-encoded to obtain user electricity consumption feature vectors. A clustering algorithm is used to group the user electricity consumption feature vectors to obtain user clustering results, which include peak-consumption-dominant user groups, off-peak-consumption-dominant user groups, and neutral-consumption-dominant user groups. Based on the user clustering results, combined with the peak and off-peak power supply costs of the power grid and user electricity satisfaction requirements, a gradient boosting tree model is used to optimize the parameters of the electricity sales scheme, generating differentiated electricity sales schemes adapted to each electricity user group.
[0051] The technical solution of this application has the following beneficial effects:
[0052] This application first collects historical electricity load data, electricity price responsiveness data, and peak-valley time preference data from various electricity users, comprehensively covering users' historical electricity consumption characteristics, electricity price sensitivity, and time selection habits. This provides a complete and multi-dimensional foundation for subsequent analysis, effectively avoiding biases in analysis results due to missing data. Next, an LSTM network is used to perform time series analysis on the historical electricity load data. Leveraging the LSTM network's ability to capture long-term dependencies in time series data, this approach overcomes the limitations of traditional methods that rely solely on historical data statistics. It deeply mines the temporal evolution patterns of users' electricity load, accurately obtaining the future electricity consumption behavior trends of each user, providing crucial forward-looking evidence for subsequent clustering and scheme development. Finally, the electricity consumption behavior trend characteristics, responsiveness data, and preference data are vector-encoded. This approach transforms multi-dimensional and heterogeneous electricity consumption data into user electricity consumption feature vectors in a unified format. This eliminates the interference of data format differences on clustering analysis and achieves multi-feature fusion, ensuring that the clustering algorithm can accurately group users based on complete feature dimensions. Next, the clustering algorithm groups the feature vectors to obtain clustering results for peak, off-peak, and flat-peak electricity consumption-dominant groups. Dispersed users are categorized according to their core electricity consumption characteristics, clarifying the differences in electricity consumption among different groups and providing a clear basis for differentiated solution development. Finally, combining the peak-valley power supply cost of the power grid with user satisfaction requirements, the parameters of the electricity sales plan are optimized through a gradient boosting tree model. This balances power grid operating costs and user demands, generating differentiated solutions suitable for each group, achieving synergistic optimization of power grid operating efficiency and user experience.
[0053] Furthermore, this application first sets the optimization objectives for electricity price parameters to obtain optimization objective combinations corresponding to peak-consumption-dominated, off-peak-consumption-dominated, and flat-peak-consumption-dominated user groups, respectively. Then, it constructs cost constraints for each time period by combining the peak and off-peak power supply costs of the power grid, and constructs satisfaction constraints for each user group by combining user electricity satisfaction requirements. Finally, it uses a gradient boosting tree model to optimize the above optimization objective combinations, cost constraints, and satisfaction constraints to obtain the final electricity price parameter combination. Based on this final electricity price parameter combination, it generates differentiated electricity sales schemes to form differentiated electricity sales schemes adapted to each electricity user group.
[0054] This application avoids the inadequacy of a "one-size-fits-all" approach by setting specific optimization target combinations for different electricity-consuming groups. Simultaneously, it constructs peak-valley time period cost constraints and satisfaction constraints for each group, ensuring that the parameter optimization process simultaneously considers grid operation cost control and user needs. Furthermore, it employs a gradient boosting tree model to precisely optimize multiple objectives and constraints, resulting in a final electricity price parameter combination that better suits the characteristics of each group and the actual situation of the grid. The resulting differentiated electricity sales plan further improves in its targeting, rationality, and accuracy, effectively addressing the issues of a macro-level parameter optimization process and insufficiently detailed constraints. Attached Figure Description
[0055] To more clearly illustrate the technical solutions of the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0056] Figure 1 A flowchart illustrating a method for generating electricity sales plans based on clustering of electricity user behavior, provided in an embodiment of this application;
[0057] Figure 2 A schematic diagram illustrating a specific implementation of a method for generating electricity sales schemes based on clustering of electricity user behavior, provided in this application embodiment;
[0058] Figure 3 A schematic diagram of the structure of a power sales scheme generation system based on power user electricity consumption behavior clustering provided in this application embodiment;
[0059] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0060] Current electricity retail market solutions largely rely on simple statistics of users' historical electricity consumption data, failing to predict future changes in user electricity demand and struggling to ensure user satisfaction. They are often based solely on fixed grid supply costs, lacking sophisticated design. This results in solutions that are disconnected from users' electricity consumption characteristics, hindering grid optimization of peak-valley loads and failing to meet personalized user needs, making it difficult to balance grid efficiency with user experience.
[0061] To address the aforementioned issues, this application proposes a method for generating electricity sales plans based on clustering of electricity user behavior. First, historical electricity load, price responsiveness, and peak-valley preference data are collected from users, and time-series analysis is used to determine future electricity consumption trends. Then, multi-dimensional data is integrated and encoded into electricity consumption characteristics, and users are clustered into three dominant electricity-consuming groups. Finally, combining the peak-valley power supply cost of the power grid with user satisfaction, multi-factor optimization techniques are used to generate differentiated plans. This method compensates for the shortcomings of future prediction, and through precise grouping and optimization, ensures that the plans align with the needs of the power grid and users, solving the problems of insufficient adaptability and versatility in existing plans.
[0062] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0063] The core of this application is to provide a method for generating electricity sales plans based on clustering of electricity user behavior. A flowchart of one specific implementation is shown below. Figure 1 As shown, the method includes:
[0064] S101. Collect historical electricity load data, responsiveness data after electricity price adjustment, and preference data for daily peak and off-peak electricity consumption periods for each electricity user.
[0065] In the above scheme, historical electricity load data refers to the actual power or electricity consumption data of electricity users over a period of time, such as the past 3 months or the past 6 months, for each time unit, such as every 15 minutes or every hour, which can reflect the user's past electricity intensity and time distribution patterns; responsiveness data after electricity price adjustment refers to the relevant data on changes in user electricity consumption when electricity prices are adjusted, which is used to reflect the user's sensitivity to electricity price changes; preference data refers to the data on the proportion of user electricity consumption during peak and off-peak periods as defined by the power grid, which can reflect which period users prefer to concentrate their electricity consumption during.
[0066] In this application example, firstly, historical electricity load data is collected: a smart meter cluster is used as the data collection device, and an independent smart meter is configured for each electricity user. The smart meter collects the user's actual electricity consumption data in real time at a frequency of once every 15 minutes. At the same time, the collected electricity consumption data is associated with the corresponding user ID and transmitted to the back-end data storage system through the power communication network for structured storage, forming a historical electricity load data table containing "user ID-collection time-electricity consumption". This data table provides basic electricity data support for the subsequent collection of the two types of data.
[0067] Secondly, responsiveness data is collected after the electricity price adjustment: The electricity sales management system records the time and magnitude of each electricity price adjustment. Based on the time, the electricity consumption data of the corresponding users within 30 days before and after the adjustment is retrieved from the historical electricity load data table. The changes in the average daily electricity consumption of each user before and after the electricity price adjustment are calculated. The associated data of "user ID - electricity price adjustment magnitude - average daily electricity consumption before adjustment - average daily electricity consumption after adjustment" is integrated into responsiveness data after the electricity price adjustment. The generation of this data directly depends on the collected historical electricity load data.
[0068] Finally, daily peak and off-peak electricity consumption preference data is collected: First, the daily peak and off-peak periods are determined based on power grid operation standards. Then, the total electricity consumption during peak and off-peak periods for each user over 30 consecutive days is extracted from the historical electricity load data table. The proportion of peak-hour electricity consumption to total daily electricity consumption and the proportion of off-peak electricity consumption to total daily electricity consumption are calculated. The average of these two proportions over 30 days is taken as the user's peak-off-peak period preference data, forming a preference data table containing "User ID - Average peak-hour electricity consumption proportion - Average off-peak electricity consumption proportion". The historical electricity load data table, response data, and preference data table are then aggregated into the same data management module, providing complete basic data for subsequent LSTM time series analysis in S102, vector encoding processing in S103, and clustering grouping in S104.
[0069] In practical applications, a certain area includes 100 residential users (numbered A001 to A100) and 50 micro and small enterprise users (numbered B001 to B050). S101 data collection work is carried out for users in this area.
[0070] First, compatible smart meters are configured for all users. These smart meters collect users' actual electricity consumption every 15 minutes. The collected data is transmitted to the regional power data storage system via the regional power communication network and stored in a structured format of "User ID - Collection Time - Electricity Consumption (unit: kWh)," forming a historical electricity load data table. For example, residential user A001's electricity consumption on February 1st of a certain year was 1.2 kWh from 8:00-8:15, 1.1 kWh from 8:15-8:30, and 1.0 kWh from 8:30-8:45. Small and micro-enterprise B001's electricity consumption during the same period was 5.3 kWh, 5.5 kWh, and 5.4 kWh, respectively. This data is recorded continuously for three months in chronological order and will subsequently serve as the core input for time series analysis in the LSTM network of S102, used to uncover future electricity consumption trends for users such as A001 and B001.
[0071] Then, on March 1st of a certain year, the region implemented an electricity price adjustment, increasing the peak-hour price by 0.08 yuan / kWh and decreasing the off-peak price by 0.05 yuan / kWh. The electricity sales management system recorded the time of this adjustment, i.e., T0 = March 1st of the certain year + the adjustment amount. =0.08 yuan / kWh, = -0.05 yuan / kWh; then, the total electricity consumption of all users in the 30 days before T0 was retrieved from the historical electricity load data table, which was 450kWh, and the total electricity consumption of B001 in the same period was 6000kWh, and the average daily electricity consumption of users was calculated according to the following formula: Where E is the average daily electricity consumption (unit: kWh / day). This represents the sum of daily electricity consumption (in kWh) for each user within the statistical period, where n is the number of days in the statistical period (n=30 days here). This yields the average daily electricity consumption of A001 before adjustment. =450kWh ÷ 30 = 15kWh / day, average daily electricity consumption before adjustment (B001) =6000kWh ÷ 30 = 200kWh / day. The total electricity consumption of A001 in the 30 days after T0 is 390kWh, and the total electricity consumption of B001 during the same period is 5400kWh. Similarly, the adjusted average daily electricity consumption of A001 is calculated. =390kWh ÷ 30 = 13kWh / day, B001 Adjusted Daily Average Electricity Consumption =5400kWh ÷ 30 = 180kWh / day, then use the formula Calculate the change in average daily electricity consumption, where, This represents the daily average change in electricity consumption, in kWh / day, yielding A001. =13kWh / day - 15kWh / day = -2kWh / day, B001 =180kWh / day - 200kWh / day = -20kWh / day, and form a data structure containing "User ID - ID- - - - - This is a response rate dataset. This dataset will be used for vector encoding processing of S103, as an important component of the user's electricity consumption feature vector.
[0072] Then, based on the regional power grid operation standards, the daily peak period was determined to be 8:00-22:00, lasting 14 hours, and the off-peak period was 22:00-8:00 the next day, lasting 10 hours. Electricity consumption data for A001 on February 1st was extracted from the historical electricity load data table: the total electricity consumption collected in 56 peak periods was 11.2 kWh, the total electricity consumption collected in 40 off-peak periods was 3.8 kWh, and the total electricity consumption collected in 96 periods throughout the day was 15 kWh. Then, according to the formula... ,in, This represents the percentage of electricity consumption during peak hours on a single day. This represents the total electricity consumption during peak hours on a single day. Given the total daily electricity consumption, m=56, p=96, substituting the data, we obtain the electricity consumption of A001 on February 1st. =11.2kWh ÷ 15kWh ≈ 0.747, then according to the formula ,in, This represents the percentage of electricity consumption in a single day's valley section. To calculate the total electricity consumption during a single day's off-peak period, q=40, substitute the data to obtain the electricity consumption for A001 on February 1st. =3.8kWh ÷ 15kWh ≈ 0.253. Similarly, extract the daily peak and off-peak electricity consumption data of A001 from January 30th to February 28th, and calculate the daily peak and off-peak electricity consumption. and Then follow the formula , Calculate the 30-day average: A001 = (0.747 + 0.752 + ... + 0.751) ÷ 30 ≈ 0.75, = (0.253 + 0.248 + ... + 0.249) ÷ 30 ≈ 0.25; B001 30 days of the same period ≈0.6, ≈0.4. The final result will contain "User ID- - The preference dataset for "A001" , With B001 , Subsequently, it will be combined with ΔE from the response data and the future electricity consumption trend characteristics output by S102 to participate in the vector encoding processing of S103, providing key data in the "time period preference" dimension for user clustering in S104.
[0073] The aforementioned S101 overall solution comprehensively collects historical electricity load data, responsiveness data after electricity price adjustments, and peak-valley time period preference data from electricity users. This covers three core dimensions: historical patterns of user electricity consumption, electricity price sensitivity, and time period selection habits. It avoids the problem of incomplete information caused by collecting only single electricity consumption data in existing technologies. During the collection process, the three types of data are associated and integrated through user IDs to ensure that subsequent steps can analyze the multi-dimensional characteristics of the same user.
[0074] S102. Using an LSTM network, perform time series analysis on the historical electricity load data to obtain the electricity consumption behavior trend characteristics of each electricity user in the future time period.
[0075] Optionally, in step S102, an LSTM network is used to perform time series analysis on the historical electricity load data to obtain the electricity consumption behavior trend characteristics of each electricity user in the future time period, including:
[0076] Step 1021: Arrange the historical electricity load data into an equally spaced load time series according to the time sequence.
[0077] Step 1022: Using the memory unit of the LSTM network, extract the time features of the load time series to obtain the time dimension features, and extract the multi-scale features of the time dimension features to obtain the multi-scale time series features.
[0078] The time dimension features are the electricity load time variation patterns extracted by the LSTM network from the load time series. These include the load rise and fall rates at different times, the time intervals of daily load peaks and valleys, and the correlation of load changes within adjacent 15-minute intervals. For example, whether the load increase in the previous 15 minutes continues or changes direction in the next period, corresponding to users' actual electricity consumption habits, such as concentrated electricity consumption at specific times, stable load, or sudden changes. This provides basic time correlation information for subsequent multi-scale time series feature extraction. The multi-scale time series features are based on the time dimension features, mined at the hourly and daily levels to further refine electricity consumption patterns, covering short-term fluctuations and long-term habit stability, avoiding omissions in single-span analysis. The hourly level uses four 15-minute load data points as windows to reflect the average load trend within one hour, such as rises, falls, or stability. The daily level uses 96 15-minute load data points as windows to reflect the load distribution throughout the 24 hours, such as peak and valley periods and peak-valley differences, comprehensively depicting the time attributes of electricity consumption behavior and providing multi-dimensional support for converting future electricity consumption trend characteristics.
[0079] Step 1023: Based on the multi-scale time series features, perform sequence transformation processing to obtain serialized trend features, and perform feature aggregation processing on the serialized trend features to form the electricity consumption behavior trend features of each electricity user in the future time period.
[0080] Among them, serialized trend features refer to the electricity load data sequence corresponding to future time periods formed by sequence transformation based on multi-scale time series features. Its physical meaning is to transform the hourly load change trend and daily peak and valley distribution pattern extracted from the multi-scale time series features into the specific state of the user's expected electricity load in each 15-minute interval in the future, according to the same 15-minute time interval as historical electricity data. It can intuitively reflect the size of the user's electricity load in each short time interval in the future time period, the direction of load change in adjacent intervals, and the continuity of the peak and valley load changes in the future. It provides a fine-grained and continuous future electricity behavior data foundation for subsequent feature aggregation, ensuring that the aggregated trend features can accurately correspond to the user's actual future electricity consumption scenario.
[0081] In the above scheme, the equal-interval load time series refers to arranging historical electricity load data in chronological order of collection time to form a continuous data sequence with fixed time intervals, which is used to adapt to the input requirements of the LSTM network for time series data; the LSTM network memory unit is the core component of the Long Short-Term Memory network, which has the ability to selectively store and forget key information in the time series data, and can capture long-term time dependencies of data, used to extract the time correlation features of electricity load data; the time dimension features refer to the basic features extracted from the load time series through the LSTM memory unit, reflecting the changes in electricity load over time; the multi-scale time series features refer to the features further extracted from the time dimension features according to different time scales, which can cover short-term and long-term electricity consumption patterns; the serialized trend features refer to the conversion of multi-scale time series features into serialized data that conforms to the data format of future time periods, reflecting the trend of electricity consumption changes; the future electricity consumption behavior trend features refer to the feature set formed after aggregating the serialized trend features, which can comprehensively reflect the size and time distribution patterns of users' electricity load in the future.
[0082] In this application example, firstly, an equally spaced load time series is constructed through step 1021: all electricity consumption data of a single power user are extracted from the historical electricity load data table formed in step S101 and sorted according to the order of collection time. Since the collection interval of the smart meter in step S101 is fixed at 15 minutes, the sorted data naturally forms a load time series with a uniform time interval of 15 minutes, ensuring that the time difference between adjacent data points in the series is consistent and there is no missing data.
[0083] Secondly, step 1022 extracts time-dimensional features and multi-scale time-series features: the obtained equally spaced load time series is input into an LSTM network, and the memory unit of the LSTM network processes the sequence data point by point. The memory unit filters and retains key time correlation information in the sequence through a forget gate, updates the features of the current data point through an input gate, and integrates them through an output gate to form time-dimensional features reflecting the change law of electricity load over time. The obtained time-dimensional features will be further used for the extraction of multi-scale time-series features. A multi-scale sliding window technique is used to set two window scales: hourly and daily. The hourly window is used to extract the average change trend of load within an hour, and the daily window is used to extract the peak occurrence time pattern of load each day, ultimately forming multi-scale time-series features covering short-term and long-term electricity consumption patterns.
[0084] Finally, step 1023 transforms and aggregates the serialized trend features: based on the obtained multi-scale time-series features, a time-series prediction mapping method is used to convert them into serialized trend features corresponding to future time periods. During the conversion process, a 15-minute time interval consistent with historical data is maintained to ensure that the format of the serialized trend features matches the needs of subsequent analysis. Subsequently, a feature aggregation algorithm is used to aggregate the serialized trend features according to three dimensions: future daily peak-hour average load, future daily valley-hour average load, and the peak load fluctuation range within the future time period, forming future electricity consumption behavior trend features that comprehensively reflect users' future electricity consumption patterns. The formed future electricity consumption behavior trend features will be transmitted to the data processing module, providing forward-looking data support for the vector encoding processing in step S103, while ensuring multi-dimensional feature complementarity with the response data and preference data from step S101.
[0085] In practical applications, for residential user A001 and micro-enterprise user B001 in a certain area, the S102 step is carried out based on the historical electricity load data collected in step S101.
[0086] First, extract the electricity consumption data for A001 from January 30th to February 28th from the historical electricity load data table in step S101, sorting them chronologically by collection time. This period lasts 30 days, with data collected every 15 minutes for 24 hours a day, resulting in 24 × 4 = 96 collections per day and a total of 30 × 96 = 2880 collections over 30 days. Therefore, the equal-interval load time series for A001 contains 2880 data points, each corresponding to 15 minutes of electricity consumption. Similarly, extract the data for B001 during the same period to construct an equal-interval load time series containing 2880 data points. These two series will serve as input data for subsequent LSTM network analysis of A001 and B001, respectively.
[0087] Next, the equally spaced load time series of A001 is input into a pre-trained LSTM network, which contains three hidden layers, each with 64 memory units. After processing by the LSTM memory units, the temporal features of A001 are obtained. Subsequently, a multi-scale sliding window technique is used to extract multi-scale temporal features: the hourly window size is set to 4, and the load change rate of adjacent data points within the window is calculated and averaged. The load change rate is calculated according to the formula... Calculate, where r is the load change rate. The power consumption of the (i+1)th data point within the window. Let i be the electricity consumption of the i-th data point within the window. The data point interval is 15 minutes. For example, if the electricity consumption of four data points for A001 within a certain hour is 1.1 kWh, 1.2 kWh, 1.3 kWh, and 1.4 kWh, the adjacent change rates are calculated as (1.2-1.1) / 15 = 0.0067 kWh / minute, (1.3-1.2) / 15 = 0.0067 kWh / minute, and (1.4-1.3) / 15 = 0.0067 kWh / minute, respectively. The average value is 0.0067 kWh / minute, which is the hourly feature for that hour. The daily window size is set to 96. The maximum electricity consumption and its occurrence time among the 96 data points each day are calculated. The average occurrence time of the maximum electricity consumption over 30 days is taken as the daily feature. For example, if the average peak load of A001 over 30 days occurs at 8:45, this is the daily feature. B001 is processed using the same method to obtain its hourly and daily features.
[0088] Then, the multi-scale time-series features of A001 are converted into serialized trend features for the next 7 days using a time-series prediction mapping method. There are a total of 7 × 96 = 672 data points for the next 7 days, with each data point corresponding to the expected electricity consumption for the next 15 minutes. Subsequently, the aggregated features are calculated using the following formula: The formula for calculating the average peak load for the next day is... ,in, This represents the average peak load for the next 7 days. This represents the total electricity consumption of all data points during the peak period over the next 7 days. This represents the total number of data points during the peak period over the next 7 days. The peak period is from 8:00 AM to 10:00 PM daily, with 14 × 4 = 56 data collections per day during this peak period. =7 × 56 = 392 times. Assuming the total peak electricity consumption of A001 over the next 7 days is 470.4 kWh, then... =470.4kWh ÷ 392 = 1.2kWh / 15 minutes. The formula for calculating the average daily load during off-peak hours is: ,in, This represents the average load during the trough period over the next 7 days. This represents the total electricity consumption of all data points during the valley period over the next 7 days. This represents the total number of data points for the valley segment over the next 7 days. The valley segment is from 22:00 to 8:00 the next day, and the number of valley segment data collections per day is 10 × 4 = 40. (The last part, "over the next 7 days," appears to be an unrelated fragment and is omitted from the translation.) =7 × 40 = 280 times. Assuming the total electricity consumption of A001 during the off-peak period over the next 7 days is 224 kWh, then... =224kWh ÷ 280 = 0.8kWh / 15 minutes. The formula for calculating the future peak load fluctuation range is: ,in, This represents the range of peak load fluctuations for the next 7 days. This represents the maximum electricity consumption among all data points during the peak period over the next 7 days. This represents the minimum electricity consumption among all data points during the peak period over the next 7 days. Assuming the maximum peak electricity consumption for A001 over the next 7 days is 1.8 kWh and the minimum is 1.5 kWh, then... =1.8kWh - 1.5kWh = 0.3kWh. Based on the above calculations, the future electricity consumption trend of A001 is as follows: average peak load 1.2kWh / 15 minutes, average valley load 0.8kWh / 15 minutes, and peak load fluctuation range 0.3kWh for the next 7 days. Using the same method, B001 is calculated to have an average peak load of 5.8kWh / 15 minutes, an average valley load of 4.2kWh / 15 minutes, and a peak load fluctuation range of 0.3kWh for the next 7 days.
[0089] Finally, the future electricity consumption trend characteristics of A001 and B001 are transmitted to the data processing module. In step S103, the average daily electricity consumption change in the response data of A001, the average peak electricity consumption ratio in the preference data, and the response data and preference data of B001 are all processed together with vector encoding to form a user electricity consumption feature vector containing multiple dimensions such as history, future, electricity price sensitivity, and time period preference, which provides complete feature support for user clustering and grouping in step S104.
[0090] The S102 overall solution described above uses an LSTM network to perform time-series analysis on the collected historical electricity load data, overcoming the limitations of existing technologies that rely solely on historical data statistics and cannot predict future electricity consumption trends. The construction of equally spaced load time series ensures the standardization of data input, providing a high-quality analysis foundation for the LSTM network. The LSTM memory unit can accurately capture the long-term time dependence of electricity load, avoiding interference from irregular fluctuations in feature extraction. The extraction of multi-scale time-series features covers both short-term and long-term electricity consumption patterns, making the features more comprehensive. The conversion and aggregation of serialized trend features transform multi-scale features into trend features that can directly reflect future electricity consumption patterns.
[0091] S103. Perform vector encoding processing on the electricity consumption behavior trend characteristics, the responsiveness data, and the preference data to obtain the user electricity consumption feature vector.
[0092] Optionally, step S103 involves performing vector encoding processing on the electricity consumption behavior trend characteristics, the responsiveness data, and the preference data to obtain a user electricity consumption feature vector, including:
[0093] Step 1031: Based on the electricity consumption behavior trend characteristics, calculate the load fluctuation range and change rate in the future period to obtain trend quantification indicators.
[0094] Step 1032: Based on the responsiveness data, determine the user's sensitivity coefficient to changes in peak and off-peak electricity prices to obtain a quantitative response index.
[0095] Step 1033: Based on the preference data, calculate the proportion of electricity consumption by users during peak and off-peak hours to obtain a quantitative preference index.
[0096] Step 1034: The trend quantification index, the response quantification index and the preference quantification index are concatenated to form a standardized feature combination. The standardized feature combination is then subjected to dimensional standardization processing to obtain the user electricity consumption feature vector.
[0097] Step 1034 may specifically include the following steps: connecting the trend quantification index, the response quantification index, and the preference quantification index according to a preset feature arrangement order to form an initial feature combination; obtaining the numerical adjustment parameters corresponding to each index based on the numerical distribution characteristics of each index in the initial feature combination, wherein the numerical adjustment parameters include the baseline value and adjustment coefficient of each index; adjusting the initial feature combination based on the numerical adjustment parameters to obtain a standardized feature combination; and standardizing the standardized feature combination based on a preset dimension feature expression form to form a user electricity consumption feature vector.
[0098] The standardization feature combination process is as follows: First, the baseline value and adjustment coefficient of each indicator in the initial feature combination are determined; then, the baseline value is subtracted from each indicator value to eliminate the influence of absolute numerical differences; next, the result is multiplied by the adjustment coefficient to unify the range of numerical fluctuations and avoid interference from differences in magnitude caused by different units; finally, standardized data in similar intervals that can be compared horizontally are obtained, forming a standardized feature combination; the "preset dimension feature expression form" needs to be combined with the quantity and attribute fixed vector dimension and meaning of the quantified indicators in step S103. In this scheme, the trend quantification indicator contains 2 indicators, the response quantification indicator contains 1 indicator, and the preference quantification indicator contains 2 indicators, so it is preset as a 5-dimensional fixed structure vector. The dimensions are defined as follows: Dimension 1 corresponds to "future load fluctuation range", a floating-point number with a value of [-2, 2], reflecting the stability of future electricity load; Dimension 2 corresponds to "future load change rate", a floating-point number with a value of [-2, 2], reflecting the speed of load change during different time periods; Dimension 3 corresponds to "electricity price sensitivity coefficient", a floating-point number with a value of [-5, 5], reflecting the degree of responsiveness to electricity price adjustments; Dimension 4 corresponds to "peak electricity consumption ratio", a floating-point number with a value of [-3, 3], reflecting the preference for peak electricity consumption; Dimension 5 corresponds to "valley electricity consumption ratio", a floating-point number with a value of [-3, 3], reflecting the preference for off-peak electricity consumption.
[0099] In the above scheme, the trend quantification index refers to the future load fluctuation range and rate of change calculated based on the trend characteristics of electricity consumption behavior, used to quantify the stability and speed of change of users' future electricity consumption; the response quantification index refers to the sensitivity coefficient of users to peak and valley electricity price changes determined based on response data, used to quantify the degree of user response to electricity price changes; the preference quantification index refers to the proportion of user peak and valley electricity consumption based on preference data statistics, used to quantify users' electricity consumption tendency during different time periods; the initial feature combination refers to the original feature set formed by splicing the three types of quantification indices in a preset order; the numerical adjustment parameter refers to the benchmark value and adjustment coefficient determined based on the numerical distribution of the initial feature combination, used to eliminate the dimensional differences of different indicators; the standardized feature combination refers to the feature set after being processed by the numerical adjustment parameter, which has a unified numerical range; the user electricity consumption feature vector refers to the vector form converted from the standardized feature combination, used for the cluster analysis in the subsequent S104 step, providing structured feature input for accurate grouping.
[0100] In this application example, firstly, a trend quantification index is calculated in step 1031: using the electricity consumption behavior trend characteristics output in step S102 as input, the load peak fluctuation range is extracted as the first trend quantification index; then, by calculating the difference between the average load during the future peak period and the average load during the valley period, and dividing it by the difference between the peak period duration and the valley period duration, the load change rate within the future time period is obtained as the second trend quantification index. The trend quantification index will serve as one of the basic data for subsequent feature concatenation, providing quantitative information on the stability and rate of change of users' future electricity consumption for vector encoding.
[0101] Secondly, the response quantification index is determined through step 1032: using the response data collected in step S101 as input, the daily average electricity consumption change, peak-segment electricity price adjustment range, and off-peak electricity price adjustment range are extracted; the product of the peak-segment electricity price adjustment range and the peak-segment duration is calculated, and then the product of the off-peak electricity price adjustment range and the off-peak duration is added to obtain the total electricity price adjustment impact value; then, the daily average electricity consumption change is divided by the total electricity price adjustment impact value to obtain the user's sensitivity coefficient to peak-valley electricity price changes, i.e., the response quantification index. The response quantification index will participate in subsequent feature stitching together with the trend quantification index to provide quantitative information on the user's electricity price sensitivity.
[0102] Next, step 1033 involves calculating the preference quantification index: using the preference data collected in step S101 as input, the average peak-hour electricity consumption ratio and the average valley-hour electricity consumption ratio are directly extracted as preference quantification indicators. These preference quantification indicators are then combined with the previous two types of indicators to provide quantitative information on users' electricity consumption tendencies during different time periods for feature splicing.
[0103] Finally, step 1034 generates a user electricity consumption feature vector: First, following a preset order of "trend quantification indicators, response quantification indicators, and preference quantification indicators," the three types of indicators obtained in steps 1031, 1032, and 1033 are connected to form an initial feature combination. Second, the numerical distribution of each indicator in the initial feature combination is analyzed, the mean of each indicator is calculated as a baseline value, and the standard deviation of each indicator is calculated and its reciprocal is used as an adjustment coefficient. The baseline value and the adjustment coefficient together constitute the numerical adjustment parameters. Third, the value of each indicator in the initial feature combination is subtracted from the corresponding baseline value, and then multiplied by the corresponding adjustment coefficient to obtain a standardized feature combination. Fourth, based on a preset fixed-dimensional feature expression format, the standardized feature combination is converted into a vector format to form a user electricity consumption feature vector. This vector will be transmitted to step S104 as input data for a clustering algorithm, supporting accurate grouping of user electricity consumption behavior.
[0104] In practical applications, for residential user A001 and micro-enterprise user B001 in a certain area, the S103 step is carried out based on the response data and preference data of step S101 and the electricity consumption behavior trend characteristics of step S102.
[0105] First, the electricity consumption trend of A001 is as follows: average peak load of 1.2 kWh / 15 minutes, average valley load of 0.8 kWh / 15 minutes, and peak load fluctuation range of 0.3 kWh over the next 7 days. The regional power grid stipulates a peak duration of 14 hours and a valley duration of 10 hours. According to the formula... Calculate the load change rate, where V is the load change rate in kWh / 15 minutes / hour. This represents the average load during future peak periods. This represents the average load during future valley periods. For peak duration, Let V be the duration of the off-peak period. Substituting the data, we get V=(1.2-0.8) / (14-10)=0.1kWh / 15 minutes / hour for A001. Therefore, the trend quantification indicators for A001 are 0.3kWh and 0.1kWh / 15 minutes / hour. The electricity consumption trend characteristics of B001 are: average peak load of 5.8kWh / 15 minutes, average off-peak load of 4.2kWh / 15 minutes, and peak load fluctuation range of 0.3kWh over the next 7 days. Similarly, we calculate V=(5.8-4.2) / (14-10)=0.4kWh / 15 minutes / hour, and the trend quantification indicators are 0.3kWh and 0.4kWh / 15 minutes / hour.
[0106] Next, since the responsiveness data for A001 is the daily average change in electricity consumption... =-2kWh / day, peak electricity price adjustment range =0.08 yuan / kWh, off-peak electricity price adjustment range = -0.05 yuan / kWh. According to the formula Calculate the sensitivity coefficient, where S is the sensitivity coefficient. This represents the change in average daily electricity consumption. This refers to the adjustment range for peak electricity prices. The adjustment range for off-peak electricity prices. For peak duration, Let S be the duration of the trough. Substituting the data, the denominator is 0.08 × 14 + (-0.05) × 10 = 1.12 - 0.5 = 0.62, S = -2 / 0.62 ≈ -3.23. Therefore, the response quantification index for A001 is -3.23. The response rate data for B001 is... =-20kWh / day, similarly calculate the denominator=0.62, S=-20 / 0.62≈-32.26, the response quantification index is -32.26.
[0107] Then, the preference quantification index is calculated, since the preference data for A001 is the average peak-hour electricity consumption ratio. =0.75, average proportion of electricity consumption during off-peak hours =0.25, directly extract these two data points as preference quantification indicators, namely 0.75 and 0.25. The preference data for B001 are R-peak average = 0.6 and R-trough average = 0.4, and the preference quantification indicators are 0.6 and 0.4.
[0108] Then, following the preset order of "trend quantitative indicators, response quantitative indicators, and preference quantitative indicators", the initial feature combinations of A001 are 0.3, 0.1, -3.23, 0.75, and 0.25, respectively; and the initial feature combinations of B001 are 0.3, 0.4, -32.26, 0.6, and 0.4. Subsequently, the numerical distribution of the initial feature combination was analyzed to determine the mean μ, standard deviation σ, and adjustment coefficient k for each indicator. The adjustment coefficient k is the reciprocal of the standard deviation σ. Since the two users have the same trend fluctuation range, the mean of the trend fluctuation range μ1 = 0.3, the standard deviation σ1 = 0, and the adjustment coefficient k1 = 0; the mean of the trend change rate μ2 = 0.25, the standard deviation σ2 = 0.212, and the adjustment coefficient k2 ≈ 4.72; the mean of the response sensitivity coefficient μ3 = -17.745, the standard deviation σ3 = 20.58, and the adjustment coefficient k3 ≈ 0.0486; the mean of the preference peak proportion μ4 = 0.675, the standard deviation σ4 = 0.106, and the adjustment coefficient k4 ≈ 9.43; and the mean of the preference trough proportion μ5 = 0.325, the standard deviation σ5 = 0.106, and the adjustment coefficient k5 ≈ 9.43. According to the formula... Standardization is carried out, among which, Represents the standardized eigenvalues. Let μ represent the initial feature value, k represent the index mean, and k represent the adjustment coefficient. After standardization, A001 yields 0, (0.1-0.25)×4.72≈-0.71, (-3.23+17.745)×0.0486≈0.71, (0.75-0.675)×9.43≈0.71, and (0.25-0.325)×9.43≈-0.71, which are then converted into a 5-dimensional user electricity consumption feature vector of 0, -0.71, 0.71, 0.71, and -0.71. After standardization, B001 yields 0, (0.4-0.25)×4.72≈0.71, (-32.26+17.745)×0.0486≈-0.71, (0.6-0.675)×9.43≈-0.71, and (0.4-0.325)×9.43≈0.71, which are converted into vectors 0, 0.71, -0.71, -0.71, and 0.71.
[0109] Finally, the electricity consumption feature vectors of users A001 and B001 are transmitted to step S104 as input data for the clustering algorithm. In step S104, the clustering algorithm will group these vectors based on their numerical differences. For example, the vector of A001, due to its higher peak-period correlation feature value, may be classified as a peak-consumption-dominant user group; the vector of B001, due to its higher valley-period correlation feature value, may be classified as an off-peak-consumption-dominant user group. This group segmentation provides the basis for generating differentiated electricity sales plans in step S105.
[0110] The aforementioned S103 overall solution quantifies three types of heterogeneous data—future electricity consumption trends, electricity price sensitivity, and time-of-use preferences—into trend, response, and preference quantitative indicators, respectively, eliminating format differences between different data types and laying the foundation for subsequent integrated analysis. The splicing of initial feature combinations achieves preliminary aggregation of multi-dimensional information, ensuring that no core user electricity consumption characteristics are omitted. The determination and standardization of numerical adjustment parameters unify the dimensions of each indicator, avoiding excessive emphasis on a certain type of indicator by the clustering algorithm due to differences in numerical ranges. The final user electricity consumption feature vector has the characteristics of being structured and standardized.
[0111] S104. Using a clustering algorithm, the user electricity consumption feature vectors are grouped to obtain user clustering results. The user clustering results include peak electricity consumption-dominant user groups, off-peak electricity consumption-dominant user groups, and neutral electricity consumption-dominant user groups.
[0112] Optionally, in step S104, a clustering algorithm is used to group the user electricity consumption feature vectors to obtain user clustering results. These results include peak-consumption-dominant user groups, off-peak-consumption-dominant user groups, and flat-consumption-dominant user groups, including:
[0113] Step 1041: Based on the user electricity consumption feature vector, a clustering algorithm is used to perform cluster center location processing to obtain multiple initial cluster centers.
[0114] Step 1042: Calculate the degree of difference between each user's electricity consumption feature vector and each of the initial cluster centers. Based on the degree of difference, assign each user to the corresponding user group to form the user grouping result.
[0115] Step 1043: Based on the user grouping results, calculate the average value of the electricity consumption feature vectors of all users in each user group to obtain the final cluster center.
[0116] Step 1044: Based on the final cluster center, perform user group classification processing to generate user clustering results that include peak electricity consumption-dominant user groups, off-peak electricity consumption-dominant user groups, and flat-peak electricity consumption-dominant user groups.
[0117] In the above scheme, the initial cluster center refers to the initial vector selected from all user electricity consumption feature vectors at the beginning of clustering, representing the potential user group, and providing a reference benchmark for subsequent grouping; the degree of difference is measured by Euclidean distance, which refers to the numerical similarity between the electricity consumption feature vector of a single user and the cluster center, and the smaller the distance, the more similar the features are; the user grouping result refers to the preliminary group set formed after all users are assigned to the group to which the corresponding initial cluster center belongs based on the degree of difference; the final cluster center refers to the vector obtained by calculating the average of each dimension of all feature vectors in each user group, which can more accurately represent the group characteristics than the initial cluster center; the user clustering result refers to the three groups formed by classifying the time-period preference characteristics based on the final cluster center, namely peak electricity consumption-dominated type, off-peak electricity consumption-dominated type, and flat-period electricity consumption-dominated type user groups.
[0118] In this application example, firstly, initial cluster centers are determined through step 1041: Based on all user electricity consumption feature vectors obtained in step S103, the K-means clustering algorithm is used for processing. Since it is necessary to divide the electricity consumption into three dominant groups—peak, off-peak, and flat-peak—the preset number of clusters K=3 is used. Three non-repeating vectors are randomly selected from all user electricity consumption feature vectors as initial cluster centers. These initial cluster centers will serve as the reference benchmark for calculating the degree of difference in step 1042, providing an initial reference for subsequent user grouping.
[0119] Secondly, user grouping results are generated through step 1042: For each user's electricity consumption feature vector, the degree of difference between it and the three initial cluster centers is calculated using the Euclidean distance formula. The Euclidean distance formula is... Where d is the Euclidean distance, i.e., the degree of difference, and n is the vector dimension; in this scheme, n=5. Let i be the value of the i-th dimension of the user's electricity consumption feature vector. The i-th dimension value is used as the initial cluster center, and each user's electricity consumption feature vector is assigned to the group to which the initial cluster center with the smallest distance belongs. After all vector assignments are completed, the user grouping result is formed, which will be used in step 1043 to calculate the final cluster center.
[0120] Next, the final cluster centers are calculated in step 1043: For each user group formed in step 1042, the values of each dimension of the electricity consumption feature vector of all users in the group are extracted, and the average value of each dimension is calculated, such as the average value of the 4th dimension "standardized value of peak electricity consumption ratio", the average value of the 5th dimension "standardized value of valley electricity consumption ratio", etc. These dimensional average values are combined in the original dimension order of the vector to obtain the final cluster center of each group.
[0121] Finally, step 1044 generates user clustering results: analyzing the fourth and fifth dimensions of the three final cluster centers. If the fourth dimension value of a final cluster center is significantly higher than the other two centers and the fifth dimension value is significantly lower than the other two centers, then the group to which this center belongs is classified as a peak-consumption-dominant user group; if the fifth dimension value is significantly higher than the other two centers and the fourth dimension value is significantly lower than the other two centers, then it is classified as an off-peak-consumption-dominant user group; if both the fourth and fifth dimension values are at an intermediate level and conform to the characteristics of flat-peak-consumption, then it is classified as a flat-peak-consumption-dominant user group. The resulting user clustering results will be transmitted to step S105 to provide a basis for group division for parameter optimization and generation of differentiated electricity sales schemes.
[0122] In practical applications, for 100 residential users (numbered A001 to A100) and 50 micro and small enterprise users (numbered B001 to B050) in a certain area, step S104 is carried out based on the 150 user electricity consumption feature vectors obtained in step S103.
[0123] First, with a preset cluster size K=3, three initial cluster centers are randomly selected from the 150 user electricity consumption feature vectors: C1 (vector of A002 [0.1, -0.6, 0.8, 0.8, -0.7]), C2 (vector of B002 [-0.1, 0.5, -0.6, -0.7, 0.6]), and C3 (vector of A003 [0, 0.1, -0.1, 0.2, -0.2]). These three initial cluster centers will be used to calculate the degree of difference between each user's vector and the centers in subsequent calculations.
[0124] Next, the Euclidean distance formula is used. Calculate the degree of difference between each user's electricity consumption feature vector and the three initial cluster centers, where d is the Euclidean distance and i is the vector dimension (1 to 5). Let i be the value of the i-th dimension of the user vector. Let be the initial cluster center's i-th dimension value. Taking the vector [0, -0.71, 0.71, 0.71, -0.71] of resident user A001 as an example, calculate its distance to C1: First, calculate the squares of the differences in each dimension: (0-0.1)²=0.01, (-0.71+0.6)²=0.0121, (0.71-0.8)²=0.0081, (0.71-0.8)²=0.0081, (-0.71+0.7)²=0.0001; Second, calculate the sum of squares: 0.01+0.0121+0.0081+0.0081+0.0001=0.0384; Third, calculate the square root: Similarly, the distance between vector A001 and C2 is approximately 2.1, and the distance to C3 is approximately 1.5. Since the distance to C1 is the smallest, A001 is assigned to the group to which C1 belongs. Taking the vector [0, 0.71, -0.71, -0.71, 0.71] of micro-enterprise user B001 as an example, calculate its distance to C2: Squares of the differences in each dimension: (0+0.1)²=0.01, (0.71-0.5)²=0.0441, (-0.71+0.6)²=0.0081, (-0.71+0.7)²=0.0001, (0.71-0.6)²=0.0121; Sum of squares: 0.01+0.0441+0.0081+0.0001+0.0121=0.0744; Square root: 6. The distance between vector B001 and C1 is approximately 2.3, and the distance to C3 is approximately 1.6. Since the distance to C2 is the smallest, B001 is assigned to the group to which C2 belongs. Following this logic, all 150 user vectors are processed, ultimately forming three user groups: group C1 contains 52 users, group C2 contains 48 users, and group C3 contains 50 users.
[0125] Then, for the 52 user vectors belonging to C1, the values of each vector in 5 dimensions are extracted, and the average value of each dimension is calculated: First dimension (standardized value of future load fluctuation range): The sum of the values of the first dimension of the 52 vectors is approximately 4.16, and the average value = 4.16 ÷ 52 = 0.08; Second dimension (standardized value of future load change rate): The sum of the values is approximately -28.6, and the average value = -28.6 ÷ 52 ≈ -0.55; Third dimension (standardized value of electricity price sensitivity coefficient): The sum of the values is approximately 3... 9. Average value = 39 ÷ 52 ≈ 0.75; 4th dimension (standardized value of peak electricity consumption ratio): the sum of values is approximately 40.56, average value = 40.56 ÷ 52 ≈ 0.78; 5th dimension (standardized value of valley electricity consumption ratio): the sum of values is approximately -37.44, average value = -37.44 ÷ 52 ≈ -0.72; combining these average values, we obtain the final cluster center C1_final = [0.08, -0.55, 0.75, 0.78, -0.72]. Similarly, we calculate the final cluster center C2_final = [-0.09, 0.52, -0.65, -0.68, 0.65] for the group to which C2 belongs, and the final cluster center C3_final = [0.01, 0.08, -0.09, 0.22, -0.21].
[0126] Finally, the fourth and fifth dimensions of the three final cluster centers were analyzed: C1 had the highest fourth dimension value of 0.78 and the lowest fifth dimension value of -0.72, therefore, the 52 users including A001 were classified as peak-consumption dominant users; C2 had the highest fifth dimension value of 0.65 and the lowest fourth dimension value of -0.68, therefore, the 48 users including B001 were classified as off-peak-consumption dominant users; C3 had a fourth dimension value of 0.22 and a fifth dimension value of -0.21, both at intermediate levels, therefore, the 50 users included were classified as flat-peak-consumption dominant users. This user clustering result will then be transferred to step S105, where the peak-consumption dominant group will be adapted to the parameter optimization for peak-peak electricity price discounts, the off-peak-consumption dominant group will be adapted to the parameter optimization for off-peak electricity price discounts, and the flat-peak-consumption dominant group will be adapted to the parameter optimization for stable flat-peak electricity prices, providing a group basis for generating differentiated electricity sales plans.
[0127] The above-mentioned S104 overall solution uses the K-means clustering algorithm to group user electricity consumption feature vectors, achieving accurate classification of users with similar features. The selection of initial cluster centers provides a reasonable starting point for grouping, and the quantitative calculation of the degree of difference ensures the objectivity of the grouping basis, avoiding classification bias caused by subjective judgment. Finally, the calculation of cluster centers optimizes the representativeness of group features through the averaging of vectors within the group, making the core features of each group clearer. Based on the peak and valley segment proportion features, the group classification clarifies the division criteria of three types of groups: peak, valley, and flat segment electricity consumption-dominant, ensuring that the classification results are highly consistent with the needs of subsequent electricity sales plan formulation.
[0128] S105. Based on the user clustering results, and combined with the peak and valley power supply cost of the power grid and the user's electricity satisfaction requirements, a gradient boosting tree model is used to optimize the parameters of the electricity sales plan and generate a differentiated electricity sales plan that is suitable for each electricity user group.
[0129] Optionally, step S105, based on the user clustering results, and combined with the peak-valley power supply cost of the power grid and the user's electricity satisfaction requirements, uses a gradient boosting tree model to optimize the parameters of the electricity sales plan, generating differentiated electricity sales plans suitable for each electricity user group, including:
[0130] Step 1051: Based on the user clustering results, set the optimization targets for electricity price parameters to obtain the optimization target combinations corresponding to peak-consumption-dominant user groups, off-peak-consumption-dominant user groups, and neutral-consumption-dominant user groups, respectively.
[0131] Step 1052: Combine the peak and valley power supply costs of the power grid to construct power supply cost constraints and obtain cost constraints for each time period.
[0132] Step 1053: Based on the user electricity satisfaction requirements, construct user satisfaction constraints to obtain the satisfaction constraints for each user group.
[0133] Step 1054: Using a gradient boosting tree model, optimize the combination of optimization objectives, the cost constraints, and the satisfaction constraints to obtain the final combination of electricity price parameters. Based on the final combination of electricity price parameters, generate differentiated electricity sales schemes to form differentiated electricity sales schemes suitable for various electricity user groups.
[0134] Step 1054 may specifically include the following steps: based on the optimization target combination, using the gradient boosting tree model, evaluate the current electricity price parameter combination to obtain a comprehensive evaluation result including the power supply cost evaluation value and the user satisfaction evaluation value; based on the comprehensive evaluation result, identify parameter conflict items in the current electricity price parameter combination that do not meet the cost constraint condition and the satisfaction constraint condition, and obtain the parameter items to be optimized; adjust the parameter items to be optimized in the current electricity price parameter combination to generate the final electricity price parameter combination, wherein the final electricity price parameter combination satisfies the cost constraint condition and the satisfaction constraint condition.
[0135] Among them, parameter conflict items are all specific parameters in the current electricity price parameter combination that do not meet cost constraints or satisfaction constraints. For example, the peak electricity price for a certain group is lower than the cost floor, or the adjustment range of the off-peak electricity price for a certain group exceeds the acceptable range for users. The parameter items to be optimized are the key parameters identified from these parameter conflict items that can resolve the conflict through adjustment. That is, parameter conflict items are the source of parameter items to be optimized, and parameter items to be optimized are the specific objects in the parameter conflict items that need to be adjusted to meet the constraints. The two are related as "the whole and the part to be adjusted". That is, by adjusting the parameter items to be optimized, the corresponding parameter conflict items can be eliminated, so that the electricity price parameter combination meets all the constraints.
[0136] In the above scheme, the peak-valley power supply cost refers to the unit power supply cost data of the power grid during peak, valley, and flat periods. Peak periods have higher costs due to higher generation costs, while valley periods have lower costs due to lower demand, used to constrain the lower limit of electricity prices. User electricity satisfaction requirements refer to the user acceptance threshold for electricity price adjustments determined based on historical feedback, to avoid excessive price fluctuations affecting user experience, used to constrain the magnitude of electricity price adjustments. The gradient boosting tree model is an ensemble learning algorithm that uses iterative optimization across multiple decision trees to accurately assess the impact of electricity price parameters on costs and satisfaction, used for optimizing electricity sales scheme parameters. The optimization objective combination refers to the set of objectives set separately for the three groups. For example, peak-hour groups focus on reducing peak load, off-peak groups focus on increasing off-peak electricity consumption, and flat-hour groups focus on stabilizing electricity consumption; cost constraints refer to the lower limit rules for electricity prices built based on peak and off-peak power supply costs, ensuring that the electricity price is not lower than the cost for the corresponding time period; satisfaction constraints refer to the limits on the range of electricity price adjustments built based on user acceptance thresholds, ensuring that user satisfaction is not lower than the preset level; the final electricity price parameter combination refers to the peak, off-peak, and flat-hour electricity price parameters that meet all constraints after model optimization; differentiated electricity sales schemes refer to schemes adapted to the three groups generated based on the final electricity price parameter combination, including electricity prices for each time period, preferential rules, etc., used to guide actual electricity sales operations.
[0137] In this application example, firstly, the optimization objective combination is set through step 1051: based on the user clustering results of step S104, the optimization direction is determined by combining the electricity consumption characteristics of the three groups. For the peak-consumption-dominant group, the optimization objective focuses on reducing peak-hour electricity load while controlling the peak-hour power supply cost of the power grid; for the off-peak-consumption-dominant group, the optimization objective focuses on increasing the proportion of off-peak-hour electricity consumption while ensuring user satisfaction with electricity consumption; for the flat-hour-consumption-dominant group, the optimization objective focuses on stabilizing flat-hour electricity load while balancing power supply cost and user acceptance.
[0138] Secondly, cost constraints are constructed through step 1052: collect unit power supply cost data of the power grid during peak, valley and flat periods, and set lower limits for electricity prices for the three periods according to the principle that "electricity price shall not be lower than the unit power supply cost of the corresponding period", thus forming cost constraints for each period.
[0139] Next, step 1053 constructs satisfaction constraints: based on historical user feedback data, the maximum acceptable range of electricity price adjustments for the three groups at each time period is determined. For example, the peak group is more sensitive to peak electricity price adjustments, so an upper limit for their peak electricity price adjustment range needs to be set; the off-peak group has higher expectations for off-peak electricity price discounts, so a lower limit for their off-peak electricity price adjustment range needs to be set.
[0140] Finally, differentiated electricity sales plans are generated through step 1054: First, based on the optimization target combination from step 1051, the initial electricity price parameter combination is input into a gradient boosting tree model. The model learns the correlation between electricity price and cost, and user satisfaction from historical data, outputting a comprehensive evaluation result including power supply cost assessment and user satisfaction assessment. Second, the comprehensive evaluation result is compared with the constraints of steps 1052 and 1053 to identify conflicting parameters that do not meet the constraints, determining the parameters to be optimized. Third, the parameters to be optimized are adjusted, and the evaluation and adjustment process is repeated until a final electricity price parameter combination that satisfies all constraints is obtained. Fourth, based on the final electricity price parameter combination, differentiated electricity sales plans containing electricity prices and preferential rules for each time period are generated for the three groups. These plans will be used in actual electricity sales operations to achieve precise matching between the power grid and user needs.
[0141] In practical applications, for the 52 households in Group A (peak-dominated), 48 households in Group B (off-peak-dominated), and 50 households in Group C (flat-peak-dominated), obtained from step S104, and considering the peak-valley power supply costs (0.6 yuan / kWh for peak, 0.3 yuan / kWh for off-peak, and 0.45 yuan / kWh for flat-peak) and user satisfaction requirements (i.e., the peak-peak price adjustment for Group A should not exceed ±0.1 yuan / kWh, the off-peak price adjustment for Group B should not be less than -0.08 yuan / kWh, and the flat-peak price fluctuation for Group C should not exceed ±0.05 yuan / kWh), step S105 is carried out.
[0142] First, we set optimization target combinations: Group A's optimization targets are to reduce peak load, peak electricity price not lower than 0.6 yuan / kWh, and user satisfaction not lower than 80 points; Group B's optimization targets are to increase the proportion of electricity consumption during off-peak hours, off-peak electricity price not lower than 0.3 yuan / kWh, and user satisfaction not lower than 85 points; and Group C's optimization targets are to stabilize flat load, flat electricity price not lower than 0.45 yuan / kWh, and user satisfaction not lower than 82 points.
[0143] Next, cost constraints are constructed, and the cost constraint formula is set as follows: , , ,in, Represents peak electricity prices, Represents the unit cost of electricity supply during peak hours. Represents off-peak electricity prices. Represents the unit cost of electricity supply during off-peak hours. Represents the flat electricity price. This represents the unit cost of electricity supply during the flat period. Substituting the unit cost of electricity supply during the peak period of 0.6 yuan / kWh into the equation... To obtain peak electricity prices Yuan / kWh; similarly, substituting the off-peak unit power supply cost of 0.3 yuan / kWh into the equation. Obtain off-peak electricity prices Yuan / kWh; Substituting the flat-section unit power supply cost of 0.45 yuan / kWh into the equation. Obtain the flat electricity price Yuan / kWh.
[0144] Then, satisfaction constraints are constructed. The original electricity price levels are first determined as 0.7 yuan / kWh for peak periods, 0.4 yuan / kWh for off-peak periods, and 0.5 yuan / kWh for flat periods. The peak-period electricity price adjustment for Group A shall not exceed ±0.1 yuan / kWh. The calculated lower limit for the peak-period electricity price is 0.7 yuan / kWh - 0.1 yuan / kWh = 0.6 yuan / kWh, and the upper limit is 0.7 yuan / kWh + 0.1 yuan / kWh = 0.8 yuan / kWh. The final peak-period electricity price range for Group A is... The price range is between 0.6 yuan / kWh and 0.8 yuan / kWh; the off-peak electricity price adjustment for Group B shall not be less than -0.08 yuan / kWh. Therefore, the calculated upper limit for the off-peak electricity price is 0.4 yuan / kWh - 0.08 yuan / kWh = 0.32 yuan / kWh. The final off-peak electricity price range for Group B is... The flat-rate electricity price for Group C is calculated to be no more than ±0.05 yuan / kWh. The lower limit is calculated to be 0.5 yuan / kWh - 0.05 yuan / kWh = 0.45 yuan / kWh, and the upper limit is 0.5 yuan / kWh + 0.05 yuan / kWh = 0.55 yuan / kWh. Therefore, the final flat-rate electricity price range for Group C is... The price ranges from 0.45 yuan / kWh to 0.55 yuan / kWh.
[0145] Next, differentiated electricity sales plans are generated, first determining the initial electricity price parameter combinations: Group A: peak electricity price 0.65 yuan / kWh, valley electricity price 0.35 yuan / kWh, and flat electricity price 0.48 yuan / kWh; Group B: peak electricity price 0.7 yuan / kWh, valley electricity price 0.31 yuan / kWh, and flat electricity price 0.48 yuan / kWh; Group C: peak electricity price 0.7 yuan / kWh, valley electricity price 0.35 yuan / kWh, and flat electricity price 0.48 yuan / kWh. The initial combination was then input into a gradient boosting tree model for evaluation. Group A's cost assessment value was 0.6 yuan / kWh, which met the peak cost constraint, and its user satisfaction assessment value was 75 points, which was lower than the target requirement of 80 points, thus failing to meet the satisfaction constraint. Group B's cost assessment value was 0.3 yuan / kWh, which met the valley cost constraint, and its user satisfaction assessment value was 86 points, which was higher than the target requirement of 85 points, thus meeting the constraint. Group C's cost assessment value was 0.45 yuan / kWh, which met the flat cost constraint, and its user satisfaction assessment value was 83 points, which was higher than the target requirement of 82 points, thus meeting the constraint. Subsequently, the peak electricity price for Group A was identified as a parameter to be optimized. Considering the adjustment range of its peak electricity price, the peak electricity price for Group A was reduced from 0.65 yuan / kWh to 0.62 yuan / kWh, a reduction of 0.03 yuan / kWh, which is within the allowable range of ±0.1 yuan / kWh. The data was then re-entered into the model for evaluation. The user satisfaction evaluation score for Group A increased to 82 points, meeting the target requirement of 80 points. The cost evaluation value remained at 0.6 yuan / kWh, which met the cost constraint. Thus, the final combination of electricity price parameters was obtained. Based on this combination, differentiated electricity sales plans are generated: Group A's plan is 0.62 yuan / kWh during peak hours, 0.35 yuan / kWh during off-peak hours, and 0.48 yuan / kWh during normal hours, with a discount of 5 yuan for every 100kWh of peak-hour electricity consumption; Group B's plan is 0.7 yuan / kWh during peak hours, 0.31 yuan / kWh during off-peak hours, and 0.48 yuan / kWh during normal hours, with a cashback of 0.02 yuan per kWh during off-peak hours; Group C's plan is 0.7 yuan / kWh during peak hours, 0.35 yuan / kWh during off-peak hours, and 0.48 yuan / kWh during normal hours, with a stable reward of 5 yuan for monthly fluctuations in normal-hour electricity consumption not exceeding 5kWh.
[0146] Finally, these differentiated electricity sales plans will be directly applied to the actual electricity sales operations of Group A, Group B, and Group C. The plan for Group A can guide them to reduce peak-hour electricity consumption, the plan for Group B can encourage them to increase off-peak-hour electricity consumption, and the plan for Group C can maintain stable off-peak-hour electricity consumption. Going forward, we will continue to collect actual electricity consumption data and user feedback scores from the three groups. Based on this data, we will readjust the evaluation parameters of the gradient boosting tree model, further optimize the electricity sales plan parameters for each group, and form a dynamic optimization mechanism to continuously improve the grid's peak-valley load regulation efficiency and user satisfaction.
[0147] The aforementioned S105 overall solution, by setting targeted optimization objectives, ensures that the solution matches the electricity consumption characteristics of various groups; the construction of cost constraints avoids grid operation losses caused by pricing below the cost of electricity supply, ensuring the economic feasibility of the grid; the introduction of satisfaction constraints prevents electricity price adjustments from exceeding the user's acceptable range, maintaining user experience; the application of the gradient boosting tree model, through precise evaluation and iterative optimization, efficiently balances the relationship between cost and satisfaction, enabling the final differentiated electricity sales solution to adapt to the electricity consumption habits of peak, off-peak, and flat-peak groups, while also helping the grid optimize peak-valley load distribution. The overall process realizes the transformation from group characteristics to personalized solutions, providing a collaborative solution for efficient grid operation and meeting user needs, and promoting the development of electricity sales services towards precision and differentiation.
[0148] The following is a complete example for steps S101 to S105, such as Figure 2 As shown, the specific implementation process of this electricity sales scheme generation method for a certain area of electricity users is as follows: First, data collection is carried out to collect three types of core data from each electricity user. The historical electricity load data for residential user A001 consists of load records at 15-minute intervals daily for the past 30 days. The regional power grid defines peak hours as 8:00-22:00 (14 hours) and valley hours as 22:00-8:00 the next day (10 hours). A001's average peak load is 1.5 kWh / 15 minutes, and its average valley load is 0.6 kWh / 15 minutes. This data will be used for time series analysis via LSTM networks. A001's responsiveness data shows that a 0.08 yuan / kWh increase in peak electricity price resulted in a 2 kWh decrease in average daily electricity consumption, while a 0.05 yuan / kWh decrease in valley electricity price resulted in a 1 kWh increase in average daily electricity consumption. This data will be used to calculate quantifiable response indicators. A001's preference data shows that peak electricity consumption accounts for 75% of total daily electricity consumption, and valley electricity consumption accounts for 25%. This data will be used to extract quantifiable preference indicators. Historical electricity load data for micro and small enterprise user B001 shows an average peak load of 6.0 kWh / 15 minutes and an average off-peak load of 4.0 kWh / 15 minutes over the past 30 days, which will be used for LSTM analysis. Response data shows that after a peak electricity price increase of 0.08 yuan / kWh, the average daily electricity consumption decreased by 20 kWh, and after an off-peak electricity price decrease of 0.05 yuan / kWh, the average daily electricity consumption increased by 15 kWh, which will be used for calculating response quantification indicators. Preference data shows that peak electricity consumption accounts for 60% and off-peak electricity consumption accounts for 40%, which will be used for extracting preference quantification indicators.
[0149] Next, an LSTM network is used to process historical electricity load data. The 15-minute interval load data of A001 over the past 30 days is input into the LSTM network in chronological order. The memory units in the network capture the load variation patterns over time, including the peak load rise rate and the valley load stability characteristics, and output the electricity consumption trend characteristics of A001 for the next 7 days: average peak load 1.2 kWh / 15 minutes, average valley load 0.8 kWh / 15 minutes, and peak load fluctuation range 0.3 kWh. Similarly, the historical load data of B001 is input into the LSTM network to obtain its electricity consumption trend characteristics for the next 7 days: average peak load 5.8 kWh / 15 minutes, average valley load 4.2 kWh / 15 minutes, and peak load fluctuation range 0.3 kWh. This characteristic is also used for subsequent trend quantification index calculations.
[0150] Then, vector encoding processing is performed. The first step is to calculate the trend quantification index using the formula. Calculate the load change rate using the formula, where V is the load change rate in kWh / 15 minutes / hour. This represents the average load during future peak periods. The average load during the future valley period is given by T_peak, which represents the peak period duration (14 hours) and T_valley, which represents the valley period duration (10 hours). For A001, substituting the data yields V = (1.2 - 0.8) / (14 - 10) = 0.1 kWh / 15 minutes / hour. Combined with its peak load fluctuation range of 0.3 kWh, the trend quantification indicators for A001 are: 0.3 kWh, 0.1 kWh / 15 minutes / hour. For B001, substituting the data yields V = (5.8 - 4.2) / (14 - 10) = 0.4 kWh / 15 minutes / hour. Combined with the peak load fluctuation range of 0.3 kWh, the trend quantification indicators for B001 are: 0.3 kWh, 0.4 kWh / 15 minutes / hour. The second step is to calculate the response quantification indicators using the formula... Calculate the electricity price sensitivity coefficient, where S is the sensitivity coefficient. The daily average change in electricity consumption, when electricity consumption decreases Take the negative value. This refers to the adjustment range for peak electricity prices. The adjustment range for off-peak electricity prices. The peak duration is 14 hours. The duration of the valley period is 10 hours. For A001, =-2kWh, =0.08 yuan / kWh, = -0.05 yuan / kWh, calculated as S = -2 / 0.62 ≈ -3.23, that is, the response quantification index of A001 is -3.23; for B001, =-20kWh, similarly calculate the denominator=0.62, so S=-20 / 0.62≈-32.26, that is, the response quantification index of B001 is -32.26. The third step is to extract the preference quantification index, directly using the collected preference data. The preference quantification index of A001 is 75% and 25%, and the preference quantification index of B001 is 60% and 40%. The fourth step is to form the initial feature combination, which is concatenated in the order of "trend quantification index, response quantification index, preference quantification index". The initial feature combination of A001 is 0.3, 0.1, -3.23, 75%, 25%, and the initial feature combination of B001 is 0.3, 0.4, -32.26, 60%, 40%. The fifth step is standardization, which calculates the mean and standard deviation of each indicator in the initial feature combinations for all users: The trend fluctuation range has a mean of 0.3 and a standard deviation of 0; since the fluctuation range for all users is 0.3, the adjustment coefficient is set to 0. The trend change rate has a mean of 0.25 and a standard deviation of 0.212; the adjustment coefficient = 1 / standard deviation ≈ 4.72. The response sensitivity coefficient has a mean of -17.745 and a standard deviation of 20.58; the adjustment coefficient = 1 / standard deviation ≈ 0.0486. The preference peak percentage has a mean of 67.5% and a standard deviation of 10.6%; the adjustment coefficient = 1 / standard deviation ≈ 9.43. The preference trough percentage has a mean of 32.5% and a standard deviation of 10.6%; the adjustment coefficient = 1 / standard deviation ≈ 9.43. Then, the formula is applied... Standardization, in the formula, These are the standardized eigenvalues. Let μ be the initial characteristic value, k be the index mean, and k be the adjustment coefficient. The calculation process after standardization of A001 is as follows: Trend fluctuation range = (0.3-0.3)×0 = 0, Trend change rate = (0.1-0.25)×4.72≈-0.71, Response sensitivity coefficient = (-3.23+17.745)×0.0486≈0.71, Preference peak percentage = (75%-67.5%)×9.43≈0.71, Preference trough percentage = (25%-32.5%)×9.43≈-0.71, forming the user electricity consumption characteristic vector of A001: 0, -0.71, 0.71, 0.71, -0.71; B001 standardization The subsequent calculation process is as follows: Trend fluctuation range = (0.3-0.3)×0 = 0, Trend change rate = (0.4-0.25)×4.72≈0.71, Response sensitivity coefficient = (-32.26+17.745)×0.0486≈-0.71, Preference peak proportion = (60%-67.5%)×9.43≈-0.71, Preference valley proportion = (40%-32.5%)×9.43≈0.71, forming the user electricity consumption feature vector of B001: 0, 0.71, -0.71, -0.71, 0.71. These vectors are subsequently used for clustering processing.
[0151] Next, a clustering algorithm was used to group the data. K-means clustering was chosen, with the number of clusters set to K=3, corresponding to the three user groups. The first step was to select initial cluster centers by randomly selecting three vectors from all user electricity consumption feature vectors: vector [0.1, -0.6, 0.8, 0.8, -0.7] for A002, vector [-0.1, 0.5, -0.6, -0.7, 0.6] for B002, and vector [0, 0.1, -0.1, 0.2, -0.2] for A003. The second step was to calculate the degree of difference using the Euclidean distance formula. In the formula, d represents the Euclidean distance, i.e., the degree of difference, and i represents the vector dimension, with a value ranging from 1 to 5. Let be the value of the i-th dimension of the user vector. Let be the value of the i-th dimension of the cluster center. Calculate the distance between vector A001 and center A002: First, calculate the squares of the differences in each dimension: (0-0.1)²=0.01, (-0.71+0.6)²=0.0121, (0.71-0.8)²=0.0081, (0.71-0.8)²=0.0081, (-0.71+0.7)²=0.0001; then calculate the sum of squares: 0.01+0.0121+0.0081+0.0081+0.0001=0.0384; finally, take the square root to get d≈0.2. The distance between A001 and center B002 is approximately 2.1, and the distance between A001 and center A003 is approximately 1.5. Since the distance between A001 and center A002 is the smallest, A001 is assigned to the group to which center A002 belongs. Similarly, calculate the distance between the centers B001 and B002: First, calculate the squares of the differences in each dimension: (0+0.1)²=0.01, (0.71-0.5)²=0.0441, (-0.71+0.6)²=0.0081, (-0.71+0.7)²=0.0001, (0.71-0.6)²=0.0121; then calculate the sum of squares: 0.01+0.0441+0.0081+0.0001+0.0121=0.0744; finally, take the square root to get d≈0.26. Since B001 is farther from other centers, assign B001 to the group to which center B002 belongs. The third step is to determine the user clustering results. After allocating all users, three groups are formed: peak-hour electricity consumption-dominant group, off-peak electricity consumption-dominant group, and flat-hour electricity consumption-dominant group. These results will be used to generate differentiated electricity sales plans.
[0152] Finally, differentiated electricity sales plans are generated. The first step is to determine the basic parameters: the peak-valley power supply cost is 0.6 yuan / kWh for peak hours, 0.3 yuan / kWh for valley hours, and 0.45 yuan / kWh for flat hours, which is used to establish cost constraints; the user satisfaction requirements are: the peak electricity price adjustment range for the peak group should not exceed ±0.1 yuan / kWh, the original peak price is 0.7 yuan / kWh, so the peak electricity price range for the peak group is 0.6 yuan / kWh to 0.8 yuan / kWh; the valley electricity price reduction range for the off-peak group should not be less than 0.08 yuan / kWh, the original valley price is 0.4 yuan / kWh, so the upper limit of the valley electricity price for the off-peak group is 0.32 yuan / kWh. These requirements are used to establish satisfaction constraints. The second step is to set the initial electricity price parameter combination: Peak group: 0.65 yuan / kWh for peak hours, 0.35 yuan / kWh for valley hours, and 0.48 yuan / kWh for average hours; Off-peak group: 0.7 yuan / kWh for peak hours, 0.31 yuan / kWh for valley hours, and 0.48 yuan / kWh for average hours; Average group: 0.7 yuan / kWh for peak hours, 0.35 yuan / kWh for valley hours, and 0.48 yuan / kWh for average hours. The third step is model evaluation. The initial parameters are input into the gradient boosting tree model. Based on the correlation between electricity price, cost, and satisfaction in historical data, the model outputs a comprehensive evaluation result: Peak group cost assessment value: 0.6 yuan / kWh, meeting cost constraints; Satisfaction assessment value: 75 points, below the target of 80 points, not meeting constraints; Off-peak group cost assessment value: 0.3 yuan / kWh, meeting constraints; Satisfaction assessment value: 86 points, meeting the target of 85 points; Average group cost assessment value: 0.45 yuan / kWh, meeting constraints; Satisfaction assessment value: 83 points, meeting the target of 82 points. The fourth step is to optimize the parameters. The peak electricity price for the peak group is identified as a parameter to be optimized. Based on its price adjustment range, the peak electricity price is reduced from 0.65 yuan / kWh to 0.62 yuan / kWh, a reduction of 0.03 yuan / kWh, which is within the range of ±0.1 yuan / kWh. The reassessment yields a peak group satisfaction score of 82 points, which meets the target. The cost remains at 0.6 yuan / kWh, which complies with the constraints. The final combination of electricity price parameters is then determined. The fifth step generates the pricing schemes: For the peak-hour group, the price is 0.62 yuan / kWh during peak hours, with a 5 yuan discount for every 100kWh of peak-hour electricity consumption; 0.35 yuan / kWh during off-peak hours; and 0.48 yuan / kWh during normal hours. For the off-peak group, the price is 0.7 yuan / kWh during peak hours, 0.31 yuan / kWh during off-peak hours, with a 0.02 yuan cashback per kWh during off-peak hours; and 0.48 yuan / kWh during normal hours. For the normal-hour group, the price is 0.7 yuan / kWh during peak hours, 0.35 yuan / kWh during off-peak hours, and 0.48 yuan / kWh during normal hours. A 5 yuan stability bonus is given if the monthly fluctuation in normal-hour electricity consumption does not exceed 5kWh. Subsequently, based on the actual electricity consumption data of the three groups, including changes in peak-hour electricity consumption for the peak-hour group, changes in the proportion of off-peak electricity consumption for the off-peak group, and satisfaction feedback, the gradient boosting tree model will be re-entered to optimize the electricity price parameters, enabling dynamic adjustments to the schemes.
[0153] Figure 3 This application provides a schematic diagram of a specific implementation of a power sales scheme generation system based on electricity user behavior clustering, as illustrated in the embodiments of this application. Figure 3 The system may include:
[0154] The data acquisition module 31 is used to collect historical electricity load data, response data after electricity price adjustment, and preference data for daily peak and off-peak electricity consumption periods for each electricity user.
[0155] Analysis module 32 is used to perform time series analysis on the historical electricity load data using an LSTM network to obtain the electricity consumption behavior trend characteristics of each electricity user in the future time period.
[0156] The processing module 33 is used to perform vector encoding processing on the electricity consumption behavior trend features, the responsiveness data and the preference data to obtain the user electricity consumption feature vector.
[0157] Grouping module 34 is used to group the user electricity consumption feature vectors using a clustering algorithm to obtain user clustering results. The user clustering results include peak electricity consumption-dominant user groups, off-peak electricity consumption-dominant user groups, and neutral electricity consumption-dominant user groups.
[0158] The optimization module 35 is used to optimize the parameters of the electricity sales plan based on the user clustering results, combined with the peak and valley power supply cost of the power grid and the user's electricity satisfaction requirements, using a gradient boosting tree model, and generating a differentiated electricity sales plan that is suitable for each electricity user group.
[0159] The electricity sales plan generation system based on electricity user behavior clustering in this application embodiment is used to implement the aforementioned electricity sales plan generation method based on electricity user behavior clustering. Therefore, the specific implementation of the electricity sales plan generation system based on electricity user behavior clustering can be found in the embodiment section of the electricity sales plan generation method based on electricity user behavior clustering above. The specific implementation can be referred to the description of the corresponding embodiments, which will not be repeated here.
[0160] like Figure 4 As shown, this application also provides an electronic device, including: a memory 41 for storing a computer program; and a processor 42 for executing the computer program to implement the steps of the above-described method for generating electricity sales schemes based on clustering of electricity user behavior.
[0161] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above-described methods for generating electricity sales schemes based on clustering of electricity user behavior.
[0162] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory, random access memory, portable hard drives, magnetic disks, or optical disks.
[0163] Embodiments of the present invention also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the embodiments of the electricity sales scheme generation method based on electricity user behavior clustering.
[0164] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0165] The foregoing has provided a detailed description of the electricity sales scheme generation method and system based on electricity user behavior clustering provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of this application.
Claims
1. A method for generating electricity sales plans based on clustering of electricity user behavior, characterized in that, include: Collect historical electricity load data, responsiveness data after electricity price adjustments, and preference data for daily peak and off-peak electricity consumption periods for each electricity user; The historical electricity load data is processed by time series analysis using an LSTM network to obtain the electricity consumption behavior trend characteristics of each electricity user in the future time period. The electricity consumption behavior trend characteristics, the responsiveness data, and the preference data are vector-encoded to obtain the user electricity consumption feature vector. A clustering algorithm is used to group the user electricity consumption feature vectors to obtain user clustering results. The user clustering results include peak electricity consumption-dominant user groups, off-peak electricity consumption-dominant user groups, and neutral electricity consumption-dominant user groups. Based on the user clustering results, and combined with the peak and valley power supply costs of the power grid and the user's electricity satisfaction requirements, a gradient boosting tree model is used to optimize the parameters of the electricity sales plan and generate differentiated electricity sales plans that are suitable for each electricity user group. Based on the user clustering results, and combined with the peak-valley power supply cost of the power grid and user electricity satisfaction requirements, a gradient boosting tree model is used to optimize the parameters of the electricity sales plan, generating differentiated electricity sales plans suitable for various electricity user groups, including: Based on the user clustering results, the optimization objectives for electricity price parameters are set to obtain the optimization objective combinations corresponding to peak-consumption-dominant user groups, off-peak-consumption-dominant user groups, and flat-peak-consumption-dominant user groups, respectively. Specifically, for peak-consumption-dominant user groups, the optimization objective is to reduce peak-peak electricity load while controlling the peak-peak power supply cost of the power grid. For off-peak-consumption-dominant user groups, the optimization objective is to increase the proportion of off-peak electricity consumption while ensuring user satisfaction with electricity consumption. For flat-peak-consumption-dominant user groups, the optimization objective is to stabilize flat-peak electricity load while balancing power supply cost and user acceptance. Based on the peak and valley power supply costs of the power grid, power supply cost constraints are constructed to obtain cost constraints for each time period. Based on the user electricity satisfaction requirements, user satisfaction constraints are constructed to obtain satisfaction constraints for each user group. A gradient boosting tree model is used to optimize the combination of optimization objectives, the cost constraints, and the satisfaction constraints to obtain the final combination of electricity price parameters. Based on the final combination of electricity price parameters, a differentiated electricity sales plan is generated to form a differentiated electricity sales plan that is suitable for each electricity user group. The gradient boosting tree model is used to optimize the combination of optimization objectives, the cost constraints, and the satisfaction constraints to obtain the final combination of electricity price parameters, including: Based on the optimized objective combination, the gradient boosting tree model is used to evaluate the current electricity price parameter combination to obtain a comprehensive evaluation result that includes the power supply cost evaluation value and the user satisfaction evaluation value. Based on the comprehensive evaluation results, identify the parameter conflict items in the current electricity price parameter combination that do not meet the cost constraint and the satisfaction constraint, and obtain the parameter items to be optimized; The parameters to be optimized in the current electricity price parameter combination are adjusted to generate the final electricity price parameter combination, wherein the final electricity price parameter combination satisfies the cost constraint and the satisfaction constraint.
2. The method for generating electricity sales plans based on clustering of electricity user behavior according to claim 1, characterized in that, The LSTM network is used to perform time series analysis on the historical electricity load data to obtain the electricity consumption behavior trend characteristics of each electricity user in the future time period, including: The historical electricity load data is arranged in chronological order as a load time series with equal intervals. The memory unit of the LSTM network is used to extract time features from the load time series to obtain time dimension features. Then, multi-scale feature extraction is performed on the time dimension features to obtain multi-scale time series features. Based on the multi-scale time series features, sequence transformation processing is performed to obtain serialized trend features. The serialized trend features are then subjected to feature aggregation processing to form the electricity consumption behavior trend features of each electricity user in the future time period.
3. The method for generating electricity sales plans based on clustering of electricity user behavior according to claim 1, characterized in that, The step of performing vector encoding processing on the electricity consumption behavior trend characteristics, the responsiveness data, and the preference data to obtain the user electricity consumption feature vector includes: Based on the aforementioned electricity consumption behavior trend characteristics, the load fluctuation range and rate of change in the future time period are calculated to obtain trend quantification indicators; Based on the responsiveness data, the sensitivity coefficient of users to changes in peak and off-peak electricity prices is determined, and a quantitative response index is obtained. Based on the aforementioned preference data, the proportion of electricity consumption by users during peak and off-peak hours is statistically analyzed to obtain a quantitative indicator of preference. The trend quantification index, the response quantification index, and the preference quantification index are concatenated to form a standardized feature combination. The standardized feature combination is then subjected to dimensional standardization to obtain the user's electricity consumption feature vector.
4. The method for generating electricity sales plans based on clustering of electricity user behavior according to claim 3, characterized in that, The process of concatenating the trend quantification index, the response quantification index, and the preference quantification index to form a standardized feature combination, and then performing dimensional standardization on the standardized feature combination to obtain the user's electricity consumption feature vector, includes: According to the preset feature arrangement order, the trend quantification index, the response quantification index, and the preference quantification index are connected to form an initial feature combination; Based on the numerical distribution characteristics of each indicator in the initial feature combination, the numerical adjustment parameters corresponding to each indicator are obtained, wherein the numerical adjustment parameters include the baseline value and adjustment coefficient of each indicator. Based on the numerical adjustment parameters, the initial feature combination is adjusted to obtain a standardized feature combination; Based on the feature expression form of the preset dimension, the standardized feature combination is standardized to form the user electricity consumption feature vector.
5. The method for generating electricity sales schemes based on clustering of electricity user behavior according to claim 1, characterized in that, The method employs a clustering algorithm to group the user electricity consumption feature vectors, obtaining user clustering results. These results include peak-consumption-dominant user groups, off-peak-consumption-dominant user groups, and neutral-consumption-dominant user groups, including: Based on the user electricity consumption feature vector, a clustering algorithm is used to perform cluster center localization processing to obtain multiple initial cluster centers; Calculate the degree of difference between each user's electricity consumption feature vector and each of the initial cluster centers, and based on the degree of difference, assign each user to the corresponding user group to form the user grouping result; Based on the user grouping results, the average value of the electricity consumption feature vectors of all users in each user group is calculated to obtain the final cluster center; Based on the final cluster centers, user groups are classified to generate user clustering results that include peak-consumption-dominant user groups, off-peak-consumption-dominant user groups, and neutral-consumption-dominant user groups.
6. A power sales scheme generation system based on electricity user behavior clustering, characterized in that, A method for generating electricity sales schemes based on electricity user behavior clustering as described in claim 1 includes: The data acquisition module is used to collect historical electricity load data, response data after electricity price adjustments, and preference data for daily peak and off-peak electricity consumption periods for each electricity user. The analysis module is used to perform time series analysis on the historical electricity load data using an LSTM network to obtain the electricity consumption behavior trend characteristics of each electricity user in the future time period. The processing module is used to perform vector encoding processing on the electricity consumption behavior trend characteristics, the responsiveness data, and the preference data to obtain the user electricity consumption feature vector; The grouping module is used to process the user electricity consumption feature vectors into groups using a clustering algorithm to obtain user clustering results. The user clustering results include peak electricity consumption-dominant user groups, off-peak electricity consumption-dominant user groups, and neutral electricity consumption-dominant user groups. The optimization module is used to optimize the parameters of the electricity sales plan based on the user clustering results, combined with the peak and valley power supply cost of the power grid and the user's electricity satisfaction requirements, using a gradient boosting tree model to generate differentiated electricity sales plans that are suitable for each electricity user group.
7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the electricity sales scheme generation method based on electricity user behavior clustering as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, enables the generation method for electricity sales schemes based on electricity user behavior clustering as described in any one of claims 1 to 5.
Citation Information
Patent Citations
User behavior data mining and prediction analysis system in intelligent power grid environment
CN119599175A