Baseline typical day screening method based on random forest and related device
By using a baseline typical day selection method based on random forest, the problem of baseline distortion in virtual power plant baseline calculation is solved, which realizes accurate reflection of the electricity consumption patterns of industrial users and improves the regulation efficiency and energy utilization efficiency of virtual power plants.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUANENG HEBEI ENERGY SALES CO LTD
- Filing Date
- 2026-01-30
- Publication Date
- 2026-05-19
AI Technical Summary
Existing virtual power plant baseline calculation methods suffer from baseline distortion in industrial load scenarios, making it impossible to accurately assess regulation potential, especially due to the contradiction between the dynamic characteristics of industrial loads and traditional calendar attribute assumptions.
A baseline typical day selection method based on random forest is adopted. By acquiring the load time series data of the target industrial users, feature information is extracted, and a pre-trained random forest model is used to classify production days and non-production days to select typical days for calculating the virtual power plant baseline load.
It enables accurate reflection of the electricity consumption patterns of industrial users, improves the representativeness and practicality of the baseline load of virtual power plants, promotes the precise allocation and management of power resources, and enhances energy utilization efficiency.
Smart Images

Figure CN122066151A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of virtual power plant baseline calculation technology, and relates to a baseline typical day screening method and related apparatus based on random forest. Background Technology
[0002] With the deepening of energy transition, virtual power plants (VPS), as an innovative model for aggregating distributed resources to participate in the electricity market and grid regulation, are becoming increasingly important. Through advanced information and communication technologies and software systems, VPS integrate and coordinate widely distributed distributed power sources, flexible loads, and energy storage systems, participating in power system operation as a special "power plant" to provide ancillary services such as peak shaving, frequency regulation, and reserve. Accurately assessing the regulation capacity of the aggregated resources of a VPS is a prerequisite for conducting all market activities and obtaining compensation, and the core of this assessment lies in constructing a reasonable and accurate "baseline." The baseline refers to the benchmark load or output level predicted through historical operating data, industry standard parameters, or dynamic models when not participating in ancillary services such as peak shaving and frequency regulation. It is the core reference benchmark for measuring the actual regulation volume (such as peak shaving and valley filling) of a VPS or a specific resource within it during a specific period. The accuracy of the baseline directly affects the fairness of the regulation effect assessment, the rationality of compensation settlement, and the effectiveness of market participation strategies.
[0003] Currently, in engineering practice and some existing technologies, the baseline calculation of virtual power plants generally adopts traditional methods based on calendar attributes, the most representative of which is the "historical averaging method." The core logic of this method is based on the assumption that load behavior is strongly correlated with calendar cycles (such as weekdays, rest days, and holidays). Its typical implementation is as follows: First, historical load data is classified according to date type. For example, Monday to Friday are classified as weekdays, and Saturday and Sunday are classified as rest days. Then, when it is necessary to calculate the baseline for a certain day (e.g., a weekday), the load data of the same time period of all dates (i.e., weekdays) of the same type within a specific period before that date (e.g., the previous 4 or 5), and their arithmetic mean is calculated. This arithmetic mean is used as the base load value for that period, ultimately forming a complete daily baseline load curve.
[0004] While the traditional baseline calculation method based on calendar attributes has achieved some success in load scenarios with regular work and rest patterns, such as commercial buildings and residential communities, its inherent technical limitations are exposed when applied to large industrial load scenarios such as steel, chemical, and non-ferrous metal smelting. This often leads to severe baseline distortion, mainly due to the following reasons: 1. Differences in production modes: Process industries such as steel and chemicals generally adopt 24-hour continuous production and shift work, with production lines operating year-round. The difference between the load curves of workdays and rest days is minimal, rendering calendar attribute division meaningless.
[0005] 2. Changes in driving factors: Industrial load is mainly regulated by order volume and production plan, rather than date type. The "historical periodicity" assumed by traditional methods is difficult to adapt to the dynamic changes in load caused by order fluctuations. 3. Non-periodic disturbances: Unexpected factors such as equipment maintenance, raw material shortages, and process adjustments can cause non-periodic load fluctuations, further weakening the ability of the historical average method to represent the "recent baseline load".
[0006] In summary, existing virtual power plant baseline calculation techniques, especially the historical averaging method based on calendar attributes, suffer from an irreconcilable contradiction between their inherent static assumptions and the dynamic characteristics of industrial loads. This leads to a distortion in the assessment of the virtual power plant's regulation potential for industrial users. Therefore, there is an urgent need for a new baseline construction method that can capture the characteristics of industrial load production patterns. Summary of the Invention
[0007] The purpose of this invention is to provide a baseline typical day screening method and related apparatus based on random forest, so as to solve the technical problem that traditional baseline calculation methods in the prior art may lead to distortion in the assessment of the regulation potential of virtual power plants to industrial users.
[0008] To achieve the above objectives, the present invention employs the following technical solution: In a first aspect, the present invention provides a baseline typical day selection method based on random forest, comprising the following steps: Obtain load time-series data of the target industrial user within a preset historical period, wherein the load time-series data is recorded at preset time intervals; Based on the load time-series data, feature information is extracted; The feature information is input into a pre-trained random forest model, which outputs the classification results for production days and non-production days. Based on the classification results, dates belonging to production days are selected as typical days to calculate the virtual power plant baseline load for the target industrial users.
[0009] Furthermore, the characteristic information includes at least the total daily energy consumption, maximum instantaneous power consumption, minimum instantaneous power consumption, daily load rate, load range change rate, peak load time, load curve standard deviation, date type, highest temperature, and lowest temperature.
[0010] Furthermore, the formula for calculating the load range change rate is as follows:
[0011] In the formula, This represents the maximum instantaneous power consumption. Minimum instantaneous power consumption; express The moment we are in, express The moment; This represents the rate of change of the load range.
[0012] Furthermore, the formula for calculating the standard deviation of the load curve is as follows:
[0013] In the formula, S This represents the standard deviation of the load curve. N Indicates the number of data points; Indicates the first Point load.
[0014] Furthermore, the training method for the random forest model specifically includes: Obtain a sample dataset containing load time-series data for multiple historical dates and corresponding manually labeled data, which are used to indicate production days or non-production days; Feature information is calculated based on load time series data from multiple historical dates, and the feature information is preprocessed. The random forest model is initialized with parameters, using preprocessed feature information as input and the corresponding manually labeled tags as expected output, and then trained. Furthermore, the step of preprocessing the feature information specifically includes: flattening the feature information into a one-dimensional vector and normalizing it to the range [0,1] using min-max.
[0015] Furthermore, the step of initializing the parameters of the random forest model specifically includes: setting the number of decision trees to 3 to 10, limiting the depth of the decision trees to 8 to 10 layers, selecting 3 random features, and setting the minimum number of split samples to 5.
[0016] Secondly, the present invention provides a baseline typical day screening system based on random forest, comprising: The data acquisition module is used to acquire the load time series data of the target industrial user within a preset historical period, wherein the load time series data is recorded at preset time intervals; The feature extraction module is used to extract feature information based on the load time series data; The classification module is used to input the feature information into a pre-trained random forest model and output the classification results for production days and non-production days; The filtering and calculation module is used to filter out the production days as typical days based on the classification results in order to calculate the virtual power plant baseline load of the target industrial user.
[0017] Thirdly, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the baseline typical day screening method based on random forest as described above.
[0018] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the baseline typical day screening method based on random forest as described above.
[0019] Compared with the prior art, the present invention has the following beneficial effects: This invention discloses a baseline typical day selection method and related apparatus based on random forest. First, by acquiring load time-series data recorded at preset time intervals within a preset historical period for the target industrial user, the temporal distribution characteristics of the user's electricity consumption can be comprehensively and accurately grasped, providing a solid data foundation for subsequent analysis. Second, feature information is extracted and input into a pre-trained random forest model. Leveraging its powerful ensemble learning capabilities and ability to handle complex data relationships, the random forest model can efficiently and accurately classify production days and non-production days. Finally, based on the accurate classification results, production days are selected as typical days to calculate the virtual power plant baseline load. This more realistically reflects the electricity consumption patterns of the target industrial user under normal production conditions, making the calculation results of the virtual power plant baseline load more representative and practical. This helps the virtual power plant to more accurately allocate and manage power resources, improve energy utilization efficiency, and provide a reliable basis for electricity market trading decisions. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a schematic diagram of the system of the present invention; Figure 3 This is the construction and inference process of a typical daily screening model based on random forest in an embodiment of the present invention. Detailed Implementation
[0022] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.
[0023] The following detailed description is exemplary and intended to provide further detailed explanation of the invention. Unless otherwise specified, all technical terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this invention is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention.
[0024] See Figure 1 This invention discloses a baseline typical day selection method based on random forest, comprising the following steps: S1, acquire the load time series data of the target industrial user within a preset historical period, wherein the load time series data is recorded at preset time intervals; S2, extract feature information based on the load time series data; The characteristic information includes at least the total daily energy consumption, maximum instantaneous power consumption, minimum instantaneous power consumption, daily load rate, load range change rate, peak load time, load curve standard deviation, date type, highest temperature, and lowest temperature.
[0025] In this embodiment, 11 features are extracted based on historical industrial load energy consumption data and environmental factors for training the random forest model. The historical energy consumption data is divided into 15-minute intervals, totaling 96 data points per day. Each data point represents the positive active power generated in the 15 minutes preceding that moment. The extracted features are shown in Table 1 below.
[0026] Table 1. Random Forest Feature Calculation Table
[0027] S3, input the feature information into the pre-trained random forest model and output the classification results of production days and non-production days; Using the features in Table 1 above, construct a random forest model for typical day selection. When preparing the training dataset, it is recommended to prepare more than 3 months of daily 96-point energy consumption data, calculate the features using the method in Table 1, and manually label the load according to the actual production situation (marking whether it is a production day or a non-production day).
[0028] The model building process is as follows: Figure 3 .
[0029] 1) Input historical industrial load data at a 15-minute granularity (each row represents 1 day, containing 96 load values) and production day / non-production day labels (1 / 0). Flatten the 96 daily load values into a one-dimensional vector and normalize them to the range [0,1] using min-max; extract features according to the method in Table 1; divide the training set (containing features and labels) and the test set (containing features only) in a 7:3 ratio.
[0030] 2) Random Forest Model Parameter Initialization: Considering the numerous adjustable resources in the virtual power plant, efficiency and accuracy must be balanced when constructing the random forest model. It is recommended to set the number of trees (n_estimators) to 3-10 to balance model performance and computational efficiency; the tree depth (max_depth) should be limited to 8-10 layers to avoid noise in model learning; the number of random features selected (max_features) should be 3 to enhance diversity between trees; and the minimum number of split samples (min_samples_split) should be 5 to prevent oversensitivity to noise from small samples.
[0031] 3) The CART algorithm is used to recursively split nodes with the goal of minimizing the Gini coefficient until max_depth=10 or min_samples_split=5 is reached, completing the training. The random forest model can be trained using the Scikit-learn library in Python.
[0032] During inference, features are generated based on the input data, and calculations are performed on different decision trees in the input random forest. The prediction results of all decision trees are statistically analyzed, and the category with the highest percentage is taken as the final output.
[0033] S4. Based on the classification results described in S3, select the dates that belong to the production days as typical days to calculate the virtual power plant baseline load of the target industrial users.
[0034] Traditional baseline calculation methods filter weekdays and rest days based on calendar days. This method is not suitable for order-driven industrial load production. This invention extracts information from historical industrial load data using statistical methods, constructs a feature information training set, describes load characteristics using mathematical methods, and trains a random forest model based on the extracted features, thus achieving the filtering function for production days and non-production days. This provides a strong basis for calculating industrial load baselines, thereby reflecting the recent benchmark level of industrial load.
[0035] See Figure 2This invention discloses a baseline typical day screening system based on random forest, comprising a data acquisition module, a feature extraction module, a classification module, and a screening calculation module. The data acquisition module acquires load time-series data of target industrial users within a preset historical period. This load time-series data is recorded at preset time intervals, comprehensively and meticulously capturing dynamic changes in user electricity consumption, providing rich and accurate basic data for subsequent analysis, and ensuring the entire screening process is based on reliable information. The feature extraction module extracts feature information based on the load time-series data, transforming the raw data into more representative and analytically valuable features, providing strong support for accurate classification. The classification module inputs the feature information into a pre-trained random forest model and outputs classification results for production days and non-production days, efficiently and accurately classifying feature information into production days and non-production days, effectively reducing classification errors and improving the reliability of the results. The screening calculation module, based on the classification results, selects dates belonging to production days as typical days to calculate the virtual power plant baseline load of the target industrial users. This will make the calculation results more closely match the actual production and electricity consumption of target industrial users, provide a scientific basis for the allocation of power resources and market transaction decisions of virtual power plants, help improve energy utilization efficiency, ensure the stable operation of the power system, and promote the sustainable development of the power industry.
[0036] In one embodiment of the present invention, a computer device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions from the computer storage medium to achieve a corresponding method flow or corresponding function. The processor described in this embodiment of the present invention can be used for the operation of a baseline typical day screening method based on random forest.
[0037] This invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the baseline typical day screening method based on random forest in the above embodiments.
[0038] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0039] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0040] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.
[0041] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0042] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A baseline typical day selection method based on random forest, characterized in that, Includes the following steps: Obtain load time-series data of the target industrial user within a preset historical period, wherein the load time-series data is recorded at preset time intervals; Based on the load time-series data, feature information is extracted; The feature information is input into a pre-trained random forest model, which outputs the classification results for production days and non-production days. Based on the classification results, dates belonging to production days are selected as typical days to calculate the virtual power plant baseline load for the target industrial users.
2. The baseline typical day selection method based on random forest according to claim 1, characterized in that, The characteristic information includes at least the total daily energy consumption, maximum instantaneous power consumption, minimum instantaneous power consumption, daily load rate, load range change rate, peak load time, load curve standard deviation, date type, highest temperature, and lowest temperature.
3. The baseline typical day selection method based on random forest according to claim 2, characterized in that, The formula for calculating the load range change rate is: In the formula, This represents the maximum instantaneous power consumption. Minimum instantaneous power consumption; express The moment we are in, express The moment; This represents the rate of change of the load range.
4. The baseline typical day selection method based on random forest according to claim 2, characterized in that, The formula for calculating the standard deviation of the load curve is: In the formula, S This represents the standard deviation of the load curve. N Indicates the number of data points; Indicates the first Point load.
5. The baseline typical day selection method based on random forest according to claim 1, characterized in that, The training method for the random forest model specifically includes: Obtain a sample dataset containing load time-series data for multiple historical dates and corresponding manually labeled data, which are used to indicate production days or non-production days; Feature information is calculated based on load time series data from multiple historical dates, and the feature information is preprocessed. The random forest model is initialized with parameters, using preprocessed feature information as input and the corresponding manually labeled tags as expected output, and then trained.
6. The baseline typical day selection method based on random forest according to claim 5, characterized in that, The steps for preprocessing the feature information specifically include: flattening the feature information into a one-dimensional vector and normalizing it to the range [0,1] using min-max.
7. The baseline typical day selection method based on random forest according to claim 5, characterized in that, The steps for initializing the parameters of the random forest model specifically include: setting the number of decision trees to 3 to 10, limiting the depth of the decision trees to 8 to 10 layers, selecting 3 random features, and setting the minimum number of split samples to 5.
8. A baseline typical day screening system based on random forest, characterized in that, include: The data acquisition module is used to acquire the load time series data of the target industrial user within a preset historical period, wherein the load time series data is recorded at preset time intervals; The feature extraction module is used to extract feature information based on the load time series data; The classification module is used to input the feature information into a pre-trained random forest model and output the classification results for production days and non-production days; The filtering and calculation module is used to filter out the production days as typical days based on the classification results in order to calculate the virtual power plant baseline load of the target industrial user.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the baseline typical day screening method based on random forest as described in any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the baseline typical day screening method based on random forest as described in any one of claims 1-7.