A low-voltage transfer identification method and system based on a random forest model

Through the low-voltage transfer identification method based on the random forest model, low-voltage transfer events are automatically identified, which solves the power supply reliability and safety problems caused by manual operations in the existing technology and realizes efficient and accurate low-voltage transfer identification.

CN118739259BActive Publication Date: 2025-10-14JIANGSU ELECTRIC POWER RES INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410727973.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2025-10-14
Estimated Expiration
2044-06-06

AI Technical Summary

Technical Problem

In the existing technology, the identification of low-voltage load transfer relies on manual operation, which leads to power supply reliability and safety problems, and is unable to timely and accurately identify low-voltage side transfer events, affecting the operating efficiency and safety of the power system.

Method used

The low-voltage power transfer identification method based on the random forest model obtains data from the electricity consumption information collection system, performs preprocessing and feature extraction, constructs a random forest model, uses machine learning to automatically identify low-voltage power transfer events, and combines topological connection relationships and power data characteristics to achieve automated identification.

Benefits of technology

It improves the accuracy and efficiency of low-voltage power transfer identification, reduces reliance on manual operation, and improves the operating efficiency and safety performance of the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118739259B_ABST
    Figure CN118739259B_ABST
Patent Text Reader

Abstract

The application discloses a low-voltage transfer identification method and system based on a random forest model, and the method comprises the following steps: acquiring daily frozen electric indication numbers of a transformer area and low-voltage users, active power at different time points, and electric meter frozen indication data at different time points; pre-processing the data to eliminate noise and abnormal values; acquiring transformer area topology connection relationships and basic account data of the transformer area and the users; extracting key features from the pre-processed data, marking whether the data set is transferred, the type of the transfer, and dividing the sample set; constructing a random forest model; training and testing the model; predicting whether the transformer area is transferred and the type of the transfer through low-voltage transfer identification, combining time periods of zero drop of the transformer area power at different time points or negative line loss at different time points and the transformer area topology connection relationships, and finally outputting low-voltage transfer identification results, including in / out transformer area information, the type of the transfer, and the start / end time of the transfer. The automatic transfer identification function of the application significantly improves the efficiency and economy of low-voltage transfer identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of power systems, and in particular relates to a low-voltage power transfer identification method and system based on a random forest model. Background Art

[0002] The low-voltage load transfer plan refers to transferring the electricity load of a residential area from the original power system to a nearby substation or distribution room on the grid side using a low-voltage bus tie switch, in order to achieve load balancing and optimize the electricity structure while ensuring power supply reliability and power quality.

[0003] When a distribution transformer or its upstream equipment undergoes maintenance or fails, manual operations such as closing the low-voltage bus tie breaker and opening the section breaker are often performed to restore power to the lost load. However, some of these on-site emergency repairs may not be recorded in the system, leading to abnormal line loss rates in the substation area. In severe cases, this can lead to incorrect dispatch decisions, resulting in personal injury, severe overloads, equipment failures, and power outages, impacting power supply reliability. Therefore, timely and accurate identification of low-voltage power transfer events is essential. Summary of the Invention

[0004] Purpose of the invention: The purpose of the present invention is to provide a low-voltage power supply transfer identification method and system based on a random forest model. This solution obtains the daily frozen electricity meter readings, active power at time-sharing points, and frozen electricity meter readings at time-sharing points of the substation and low-voltage users from the electricity consumption information collection system, obtains effective data features from them, establishes a random forest model, and realizes the automatic identification of low-voltage power supply transfer.

[0005] Technical solution: A low-voltage power supply transfer identification method based on a random forest model of the present invention includes:

[0006] Measurement data acquisition: Obtain the daily frozen electricity meter readings, active power at different time points, and frozen meter reading data at different time points for the substation and low-voltage users from the electricity consumption information collection system;

[0007] Measurement data preprocessing: Preprocess the acquired data, use the isnull function to identify missing values, use the median absolute deviation method to identify outliers, and use the Lagrange polynomial interpolation method to fill in the identified outliers and missing values;

[0008] Ledger data acquisition: obtain the topological relationship of the substation area, as well as the basic ledger data of the substation area and users;

[0009] Feature extraction: Extract data features from preprocessed data and substation ledger data, combine them with the substation's power supply transfer and transfer type labels to form a sample set, and randomly divide the sample set into a training sample set, a validation sample set, and a test sample set;

[0010] Model construction: Select the random forest model from the Scikit-learn library, set the initial hyperparameter range of the random forest model based on the sample information, and use the network search method to select the optimal hyperparameter value to build a basic random forest model;

[0011] Model training and testing: The feature data of the training sample set is imported into the basic random forest model. Each time the model training reaches the preset number of trees, the basic random forest model training will stop. Finally, the basic random forest model outputs the result of whether the substation area switches power supply and the type of switching power supply based on the mode of all tree prediction categories. During the training of the basic random forest model, the grid search method is used to adjust the hyperparameters within a range. The basic random forest model that achieves the best prediction accuracy on the validation sample set is selected to finally obtain the random forest classification model. The random forest classification model is tested using the test sample set, and the performance of the random forest model is evaluated using precision, recall, and F1 score.

[0012] Low-voltage power transfer identification: Low-voltage power transfer identification is used to predict whether the substation will transfer power and the type of transfer. Combined with the time period when the substation's time-sharing power drops to zero or the time-sharing line loss is negative and the substation's topological connection relationship, the low-voltage power transfer identification result is finally output, including transfer-in / out substation information, transfer type, and transfer start / end time.

[0013] Furthermore, the standard formula of the Lagrange polynomial interpolation method is as follows:

[0014]

[0015] Where P(x) represents the polynomial function obtained by Lagrange interpolation, which is used to estimate the interpolation result at the given position x of the measurement data point; n represents the number of existing measurement data points minus one; y i represents the measured data value of the i-th data point; L i (x) represents the Lagrangian basis function of the i-th measurement data value.

[0016] Furthermore, data features are extracted from the pre-processed data and the station area ledger data, including:

[0017] Through the ledger data of the substation, it is possible to obtain whether there are dual power users in the substation, whether there is a peer contact substation in the substation, and the operation time of the substation;

[0018] The daily line loss rate of the substation and the daily line loss rate of the opposite contact substation are calculated through the measurement data of the substation;

[0019] Through the measurement data of the substation, calculate whether the substation's time-of-day power drops to zero, the number of time-of-day power drop points in the substation, whether the time-of-day line loss rate in the substation is negative, and the number of time-of-day line loss rates in the substation that are negative;

[0020] Through the measurement data of the substation, the line loss rate of the opposite-end connecting substation during the period when the substation's time-sharing power drops to zero, the line loss rate of the opposite-end connecting substation during the period when the substation's time-sharing power drops to zero, the line loss rate of the opposite-end connecting substation during the period when the substation's time-sharing line loss is negative, and the combined line loss rate of the opposite-end connecting substation during the period when the substation's time-sharing line loss is negative are calculated.

[0021] Furthermore, the daily line loss rate of the said area and the daily line loss rate of the opposite end contact area of ​​the area are calculated as follows:

[0022] Obtain the frozen electricity meter readings of the substation and the low-voltage users in the substation on the current day and the previous day, and use the frozen electricity meter readings to calculate the frozen electricity of the current day. If the frozen electricity calculation for the current day is empty, use the active power of the meter to make up the frozen electricity value, and then use the frozen electricity of the substation and the frozen electricity of the low-voltage users in the substation to calculate the substation line loss rate; Among them,

[0023] The formula for frozen power is as follows:

[0024] E=(r t -r t-1 )×F

[0025] Among them, E represents the frozen power; r t Indicates that the meter freezes the electricity display value on that day, r t-1 Indicates the meter’s frozen reading from the previous day, and F indicates the meter’s comprehensive multiplier.

[0026] Furthermore, the active power of the electric meter is used to compensate for the frozen electric quantity, and the compensation formula is as follows:

[0027]

[0028] Among them, E represents the frozen power; P i represents the active power of the i-th point; T represents the duration; F represents the comprehensive multiplication factor of the meter; N represents the number of metering segments.

[0029] Furthermore, the calculation formula of the substation line loss rate is as follows:

[0030]

[0031] Among them, lineloss_rate represents the line loss rate of the substation area; E In Indicates the daily input power of the substation; E Out Indicates the daily output power of the substation; represents the frozen power of the i-th user in the substation; n represents the number of users in the substation.

[0032] Furthermore, the calculation process of whether the substation's time-sharing power drops to zero, the number of time-sharing power drop points in the substation, whether the time-sharing line loss rate in the substation is negative, and the number of time-sharing line loss rates in the substation are negative is as follows:

[0033] Obtain the substation's hourly power data through the power consumption collection system to determine whether the substation's hourly power has dropped to zero.

[0034] If zero drop occurs, calculate the number of zero drop points of the substation power and the time period of zero drop of the substation power;

[0035] If zero drop does not occur, the time-sharing line loss rate of the substation is calculated based on the time-sharing power of the substation and the time-sharing power of downstream users in the substation to determine whether the time-sharing line loss rate of the substation is negative;

[0036] If a negative value appears, the number of negative values ​​of the line loss rate in the substation area and the time period in which the line loss rate in the substation area is negative are calculated;

[0037] The calculation formula for the time-of-day line loss rate in the substation area is as follows:

[0038]

[0039] Where, lineloss_rate_t represents the time-sharing line loss rate; P total Indicates the total power of the substation at a certain time point; F total Indicates the comprehensive multiplication factor of the electric meter in the substation area; represents the load power of the i-th user; represents the comprehensive multiplier of the electricity meter of the i-th user; n represents the number of users; T represents the segment duration.

[0040] Furthermore, the line loss rate of the opposite-end connected station area during the period when the power of the substation area drops to zero, the combined line loss rate of the substation area and its opposite-end connected station area during the period when the power of the substation area drops to zero, the line loss rate of the opposite-end connected station area during the period when the line loss of the substation area is negative, and the combined line loss rate of the opposite-end connected station area during the period when the line loss of the substation area is negative are obtained as follows:

[0041] If the substation's time-sharing power drops to zero, the time-sharing frozen power meter data of the substation, the opposite contact substation, and the downstream users at the beginning and end of the time period are obtained from the power consumption collection system based on the time period when the substation's time-sharing power drops to zero. The line loss rate of the opposite contact substation during the period when the substation's time-sharing power drops to zero is calculated, and the combined line loss rate of the substation and its opposite substation during the period when the substation's time-sharing power drops to zero is calculated.

[0042] If the substation's time-sharing line loss rate is negative, the time-sharing frozen electricity meter data of the substation, the opposite liaison substation and the downstream users at the beginning and end of the time period are obtained from the electricity consumption collection system through the time period when the substation's time-sharing line loss is negative, and the line loss rate of the opposite substation during the period when the substation's time-sharing line loss is negative is calculated, and the combined line loss rate of the substation and the opposite liaison substation during the period when the substation's time-sharing line loss is negative is calculated.

[0043] Furthermore, the initial hyperparameter ranges for setting the random forest model include the number of trees n_estimators, the number of features to consider when finding the best split max_features, the maximum depth of the tree max_depth, the minimum number of samples required to split an internal node min_samples_split, the minimum number of samples required at a leaf node min_samples_leaf, and whether bootstrap sampling can be performed with replacement.

[0044] Based on the same inventive concept, the present invention provides a low-voltage power supply identification system based on a random forest model, comprising:

[0045] The measurement data acquisition module is used to obtain the daily frozen electricity meter readings, active power at time points, and frozen meter reading data at time points of the substation and low-voltage users from the electricity consumption information collection system;

[0046] The measurement data preprocessing module is used to preprocess the acquired data, identify missing values ​​using the isnull function, identify outliers using the median absolute deviation method, and fill in the identified outliers and missing values ​​using the Lagrange polynomial interpolation method;

[0047] The ledger data acquisition module is used to obtain the topological contact relationship of the substation area, as well as the basic ledger data of the substation area and users;

[0048] The feature extraction module is used to extract data features from the pre-processed data and the substation ledger data, and combine the substation area's power supply transfer and transfer type labels to form a sample set, and randomly divide the sample set into a training sample set, a validation sample set, and a test sample set;

[0049] The model building module is used to select the random forest model from the Scikit-learn library, set the initial hyperparameter range of the random forest model based on sample information, and use the network search method to select the optimal hyperparameter value to build a basic random forest model;

[0050] The model training and testing module is used to import the feature data of the training sample set into the basic random forest model. Each time the model training reaches the preset number of trees, the training of the basic random forest model will stop. Finally, the basic random forest model outputs the result of whether the substation area has switched power and the type of switching power based on the mode of all tree prediction categories. During the training of the basic random forest model, the grid search method is used to adjust the hyperparameters within a range, and the basic random forest model that achieves the best prediction accuracy on the validation sample set is selected to finally obtain the random forest classification model. The random forest classification model is tested using the test sample set, and the performance of the random forest model is evaluated using the precision, recall rate and F1 score.

[0051] The low-voltage transfer identification module is used to predict whether the substation will transfer power and the type of transfer through low-voltage transfer identification. Combined with the time period when the substation's time-sharing power drops to zero or the time-sharing line loss is negative and the substation topology connection relationship, it finally outputs the low-voltage transfer identification result, including transfer-in / out substation information, transfer type, and transfer start / end time.

[0052] Beneficial effects: Compared with the prior art, the technical solution of the present invention has the following beneficial effects:

[0053] This solution uses the electricity consumption information collection system to collect daily frozen power meter readings for substations and low-voltage users, active power at specific time points, frozen power meter readings at specific time points, topological connections, and basic ledger data for substations and users. This solution deeply mines these data characteristics and builds a random forest machine learning model to identify instances where a substation transfers power to a low-voltage user via a low-voltage interconnector switch.

[0054] Experimental verification demonstrates that the proposed random forest model demonstrates superior performance and significant improvement in low-voltage power supply transfer identification. Leveraging the powerful capabilities of machine learning for processing sequential data, this model significantly improves the accuracy and efficiency of low-voltage power supply transfer identification, contributing positively to the advancement of this field.

[0055] The identification method adopted by the present invention is highly automated, greatly reducing dependence on manual operation, thereby effectively improving the operating efficiency and safety performance of the power system. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A flowchart of a low-voltage power supply transfer identification method based on a random forest model disclosed in an embodiment of the present invention;

[0057] Figure 2 A confusion matrix diagram of the four-classification model for low-voltage power supply identification based on the random forest model disclosed in an embodiment of the present invention on a test set;

[0058] Figure 3 A histogram showing the evaluation of the four-classification model for low-voltage power supply transfer identification based on the random forest model disclosed in an embodiment of the present invention on a test set;

[0059] Figure 4 A schematic diagram of feature importance of a four-classification model for low-voltage power supply identification based on a random forest model disclosed in an embodiment of the present invention;

[0060] Figure 5 A power stacking diagram of an identification case substation and its transfer substation disclosed in an embodiment of the present invention;

[0061] Figure 6 A combined power stacking diagram of an identification case substation and its transfer substation disclosed in an embodiment of the present invention;

[0062] Figure 7 This is a structural diagram of a low-voltage power supply identification system based on a random forest model disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0063] The technical solution of the present invention is described in detail below in conjunction with specific implementation methods and the accompanying drawings.

[0064] Example 1

[0065] like Figure 1 As shown, a low-voltage power supply identification method based on a random forest model of the present invention includes the following steps:

[0066] S1. Measurement data acquisition: From the electricity consumption information collection system, obtain the daily frozen electricity meter readings, active power at time-sharing points, and meter frozen reading data at time-sharing points for the substation and low-voltage users.

[0067] In this step, the sensors and metering equipment deployed in the power system are used to collect the daily frozen electricity meter readings, active power at time-sharing points, and frozen electricity meter readings at time-sharing points of the substation and low-voltage users.

[0068] S2. Measurement data preprocessing: Preprocess the acquired data, use the isnull function to identify missing values, use the median absolute deviation method to identify outliers, and use the Lagrange polynomial interpolation method to fill in the identified outliers and missing values.

[0069] During the data collection process, due to various factors, the raw data often contains noise and outliers. In order to ensure the accuracy and reliability of the data, it is crucial to preprocess the raw data. Preprocessing mainly includes data cleaning and eliminating outliers, thereby reducing the negative impact on model training. Step S2 specifically includes the following:

[0070] In this step, the acquired measurement data is formatted and integrated into a Python Dataframe data structure; the isnull function in the Pandas library is used to identify missing values, and the median absolute deviation method is used to identify outliers; the Lagrange polynomial interpolation method is used to fill in the identified outliers and missing values. The standard formula of the Lagrange polynomial interpolation method is as follows:

[0071]

[0072] Where P(x) represents the polynomial function obtained by Lagrange interpolation, which is used to estimate the interpolation result at the given position x of the measurement data point; n represents the number of existing measurement data points minus one; y i Indicates the

[0073] The measured data value of i data point; L i (x) represents the Lagrangian basis function of the i-th measurement data value.

[0074] S3. Ledger data acquisition: Obtain the topological connection relationship of the substation area, as well as the basic ledger data of the substation area and users.

[0075] In this step, the topological contact relationship of the substation area and some basic ledger data of the substation area and users are obtained, including the substation area commissioning time, dual power user information, household change relationship, etc.

[0076] S4. Feature extraction: Extract data features from the preprocessed data and the substation ledger data, and combine the substation whether it is transferred and the transfer type label to form a sample set. The sample set is randomly divided into a training sample set, a verification sample set, and a test sample set.

[0077] In this step, from the daily frozen electricity meter data of the substation and low-voltage users, the active power at the time-sharing point, the frozen electricity meter data at the time-sharing point, the topological connection relationship, and some basic ledger data of the substation and users, including the substation's input time, dual power user information, and household-to-substation relationship data, several features are calculated and extracted to construct a feature set; based on the output label label of whether the substation is switching and the switching type, a sample set is formed; the sample set is divided into a training sample set, a verification sample set, and a test sample set. Step S4 specifically includes the following steps:

[0078] S4.1. Through the ledger data of the substation, determine whether there are dual power users in the substation, whether there is a counterpart contact substation in the substation, and the operation time of the substation.

[0079] In this embodiment, the process of obtaining some features through the basic ledger data of the substation area and the substation area topology connection relationship is as follows:

[0080] Through the PMS account system, whether there is a double power supply user in the transformer area, the transformer area input time and whether there is a terminal contact transformer area in the transformer area are obtained.

[0081] S4.2, through the measurement data of the transformer area, the transformer area daily line loss rate and the terminal contact transformer area daily line loss rate of the transformer area are calculated.

[0082] In this embodiment, the transformer area daily line loss rate and the terminal contact transformer area daily line loss rate are calculated as follows:

[0083] The frozen electricity meter data of the transformer area and the low-voltage users under the transformer area on the same day and the previous day are obtained, the frozen electricity quantity on the same day is calculated by using the frozen electricity meter, if the frozen electricity quantity on the same day is calculated as empty due to the missing of a certain frozen electricity meter data, the frozen electricity quantity is supplemented by using the active power of the meter, and then the transformer area line loss rate is calculated by using the transformer area frozen electricity quantity and the low-voltage user frozen electricity quantity under the transformer area. Among them,

[0084] The formula of the frozen electricity quantity is as follows:

[0085] E=(r t -r t-1 )×F

[0086] Among them, E represents the frozen electricity quantity; r t represents the frozen electricity meter on the same day, r t-1 represents the frozen electricity meter of the previous day, and F represents the comprehensive rate of the meter.

[0087] In this embodiment, the frozen electricity quantity is supplemented by using the active power of the meter, and the supplement formula is as follows:

[0088]

[0089] Among them, E represents the frozen electricity quantity; P i represents the active power of the i-th point; T represents the time length; F represents the comprehensive rate of the meter; and N represents the number of measurement segments.

[0090] In this embodiment, the calculation formula of the transformer area line loss rate is as follows:

[0091]

[0092] Among them, lineloss_rate represents the transformer area line loss rate; E In represents the input electricity quantity of the transformer area on the same day; E Out represents the output electricity quantity of the transformer area on the same day; represents the frozen electricity quantity of the i-th user of the transformer area; and n represents the number of transformer area users.

[0093] S4.3, through the measurement data of the transformer area, the transformer area time-sharing power whether zero, transformer area time-sharing power zero point number, transformer area time-sharing line loss rate whether negative value, transformer area time-sharing line loss rate for negative value number. The specific calculation process is as follows:

[0094] Through the power collection system to obtain the transformer area time-sharing power data, judge whether the transformer area time-sharing power appears zero;

[0095] If zero appears, the number of transformer area time-sharing power zero point is calculated, and the time period of transformer area time-sharing power zero is calculated;

[0096] If zero does not appear, the transformer area time-sharing line loss rate is calculated through the transformer area time-sharing power and the transformer area downstream user time-sharing power, and whether the transformer area time-sharing line loss rate appears negative value is judged;

[0097] If negative value appears, the number of transformer area time-sharing line loss rate for negative value is calculated, and the time period of transformer area time-sharing line loss rate for negative value is calculated;

[0098] Wherein, the calculation formula of transformer area time-sharing line loss rate is as follows:

[0099]

[0100] In the formula, lineloss_rate_t represents time-sharing line loss rate; P total Represents the total power of transformer area at time-sharing point; F total Represents the comprehensive multiplier of transformer meter; F Represents the load power of the i-th user; Represents the comprehensive multiplier of the i-th user; n represents the number of users; T represents the segment length.

[0101] S4.4, through the measurement data of the transformer area, the transformer area time-sharing power zero period its opposite end contact transformer area line loss rate, transformer area time-sharing power zero period and its opposite end contact transformer area joint line loss rate, transformer area time-sharing line loss for negative value period its opposite end contact transformer area line loss rate, transformer area time-sharing line loss for negative value period and its opposite end contact transformer area joint line loss rate. The specific acquisition process is as follows:

[0102] If the transformer area time-sharing power appears zero, through the time period of transformer area time-sharing power zero, the time-sharing frozen electricity consumption data of transformer area and opposite end contact transformer area and their downstream users at the beginning and end of the time period is obtained from power collection system, the line loss rate of opposite end contact transformer area during transformer area time-sharing power zero period is calculated, and the joint line loss rate of opposite end transformer area during transformer area time-sharing power zero period is calculated. The calculation method is consistent with the transformer area line loss rate, and will not be repeated here;

[0103] If the substation's time-sharing line loss rate is negative, the time-sharing frozen electricity meter data of the substation, the opposite-end liaison substation and their downstream users at the beginning and end of the time period are obtained from the electricity consumption collection system through the time period when the substation's time-sharing line loss is negative. The line loss rate of the opposite-end substation during the period when the substation's time-sharing line loss is negative is calculated, and the combined line loss rate of the substation and the opposite-end liaison substation during the period when the substation's time-sharing line loss is negative is calculated. This is consistent with the method for calculating the substation's line loss rate and will not be repeated here.

[0104] S4.5. Combine the labels of whether the substation area is switching power and the switching type to form a sample set, and randomly divide the sample set into a 60% training sample set, a 20% validation sample set, and a 20% test sample set;

[0105] S5. Model construction: Select the random forest model from the Scikit-learn library, set the initial hyperparameter range of the random forest model based on the sample information, and use the network search method to select the optimal hyperparameter value to build a basic random forest model.

[0106] In this step, we set the initial hyperparameter ranges for the random forest model, including the number of trees (n_estimators), the number of features (max_features) to consider when finding the best split, the maximum depth of the tree (max_depth), the minimum number of samples required to split an internal node (min_samples_split), the minimum number of samples required at a leaf node (min_samples_leaf), and whether or not to use bootstrap sampling with replacement.

[0107] In this example, the random forest model in the Sklearn library is selected, and the parameters of the model are set as follows:

[0108] S5.1. n_estimators: This is the number of trees in the random forest. Generally speaking, increasing the number of trees improves model stability. We choose 100-200 as the initial number of trees for training, with a step size of 10.

[0109] S5.2. max_depth: This is the maximum depth of each tree. For our dataset, we need to limit the tree depth to prevent overfitting. We set the initial tree depth of the model to 5-10, with a step size of 1.

[0110] S5.3, min_samples_split: The minimum number of samples required to split an internal node. This parameter can affect the complexity of the model. The initial value is set to 2 to 10, with a step size of 1.

[0111] S5.4, min_samples_leaf: The minimum number of samples required at a leaf node. This parameter helps smooth the model and prevent overfitting. I set the initial value to 1-10 with a step size of 1.

[0112] S5.5, max_features: The number of features to consider when finding the best split. For this classification problem, the default value is set to the square root of the total number of features.

[0113] S5.6, bootstrap: Whether to perform sampling with replacement to build the tree. Since the dataset is small, set it to False, which ensures that each tree uses the entire data.

[0114] S6. Model training and testing: Import the feature data of the training sample set into the above-mentioned preset basic random forest model. Each time training is performed, as the model training reaches the preset number of trees, the training of the basic random forest model will stop. Finally, the basic random forest model outputs the result of whether the substation area is switched and the type of switched supply based on the mode of all tree prediction categories. During the training of the basic random forest model, the grid search method is used to adjust the hyperparameters within the range, and the basic random forest model that achieves the best prediction accuracy on the verification sample set is selected to finally obtain the random forest classification model. The test sample set is used to test the random forest classification model, and the precision, recall rate and F1 score are used to evaluate the performance of the random forest model.

[0115] S7. Low-voltage transfer identification: Low-voltage transfer identification is used to predict whether the substation will transfer power and the type of transfer. Combined with the time period when the substation's time-sharing power drops to zero or the time-sharing line loss is negative and the substation's topological connection relationship, the low-voltage transfer identification result is finally output, including transfer-in / out substation information, transfer type, and transfer start / end time.

[0116] The technical solution of the present invention collects the daily frozen electricity meter number, time-sharing active power, time-sharing frozen electricity meter number, topological connection relationship between substations and basic ledger data of substations and low-voltage users; pre-processes the data to eliminate noise and outliers; extracts key features from the pre-processed data, and labels the data set whether it is transferred and the type of transfer, thereby forming training samples, verification sample sets and test sample sets; constructs a random forest model, and trains it with the training sample set, and uses the grid search method to optimize hyperparameters. Each training is based on the mode of all tree prediction categories to output the results of whether the substation transfers power and the type of transfer. Select the model with the best accuracy on the verification set; evaluate the generalization ability and performance of the random forest model with the test sample set; predict whether the substation transfers power and the type of transfer through the model, and combine the time period when the substation power drops to zero or the time-sharing line loss is negative and the substation topological connection relationship, and finally output the low-voltage transfer identification result, including the transfer-in / transfer-out substation information, transfer type, and transfer start / end time. The automatic identification and transfer function of the present invention significantly improves the efficiency and economy of low-voltage transfer identification.

[0117] The following is a further introduction to the low-voltage power supply identification method and system based on the random forest model of the present invention through specific embodiments.

[0118] like Figure 1 As shown, an embodiment of the present invention provides a method for identifying dual power supply of a low-voltage user electricity meter based on a hybrid neural network, which specifically includes the following steps:

[0119] S1. Data acquisition: Obtain the daily frozen electricity meter data, active power at time-sharing points, frozen electricity meter data at time-sharing points, topological connection relationships, and some basic ledger data of the substation and users, including the substation's commissioning time, dual power user information, and household-to-transformer relationships.

[0120] S2. Data preprocessing: The isnull function in the Pandas library is used to identify missing values, the median absolute deviation method is used to identify outliers, and the Lagrange polynomial interpolation method is used for interpolation.

[0121] S3. Ledger data acquisition: Obtain the topological relationship of the substation area, as well as some basic ledger data of the substation area and users, including the substation area commissioning time, dual power user information, household change relationship, etc.

[0122] S4. Feature extraction: I. Using the substation's ledger data, determine whether the substation has dual power users, whether the substation has a peer-to-peer contact substation, and the length of time the substation has been in operation. II. Using the substation's measurement data, calculate the substation's daily line loss rate and the substation's peer-to-peer contact substation's daily line loss rate. III. Using the substation's measurement data, calculate whether the substation's time-of-day line loss drops to zero, the number of times the substation's time-of-day line loss drops to zero, whether the substation's time-of-day line loss is negative, and the number of times the substation's time-of-day line loss rate is negative. IV. Using the substation's measurement data, calculate the line loss rate of the peer-to-peer contact substation during the period when the substation's time-of-day power drops to zero, the combined line loss rate of the substation and its peer-to-peer contact substation during the period when the substation's time-of-day power drops to zero, the line loss rate of the peer-to-peer contact substation during the period when the substation's time-of-day line loss is negative, and the combined line loss rate of the substation and its peer-to-peer contact substation during the period when the substation's time-of-day line loss is negative. V. Combine the labels of whether the substation is transferring power and the type of transfer power to form a sample set. The sample set is randomly divided into 300 groups of substations as training sample sets, 100 groups of substations as validation sample sets, and 100 groups of substations as test sample sets.

[0123] S5. Model Construction: Select the random forest model from the Sklearn library. Based on the above features, use a grid search method, with the number of trees n_estimators ranging from 100 to 200, with a step size of 10. Set the square root of the total number of features to be considered when finding the optimal split, max_features. The maximum tree depth max_depth is set from 5 to 10, with a step size of 1. The minimum number of samples required to split an internal node, min_samples_split, is set from 2 to 10, with a step size of 1. The minimum number of samples required at a leaf node, min_samples_leaf, is set from 1 to 10, with a step size of 1. The tree is constructed using sampling without replacement, with the bootstrap initial value set to false.

[0124] S6. Model training and testing: I. Import the training sample set feature data into the preset basic random forest model. Each time the model training reaches the preset number of trees, the random forest model training will stop. Finally, the model outputs the result of whether the substation area has switched power and the type of switching power based on the mode of all tree prediction categories. II. During this process, we use the grid search method to adjust the above hyperparameters within a range and select the model that achieves the best prediction accuracy on the validation sample set. III. Finally, the performance of the obtained random forest classification model is evaluated using precision, recall, and F1 score on the test sample set.

[0125] S7. Low-voltage power transfer identification: The model is used to predict whether the substation will transfer power and the type of transfer. Combined with the time period when the substation's time-sharing power drops to zero or the time-sharing line loss is negative and the substation's topological connection relationship, the low-voltage power transfer identification result is finally output, including the transfer-in / out substation information, transfer type, and transfer start / end time.

[0126] When performing a grid search, the optimal value was achieved on the validation set when the model parameters n_estimators equaled 140, max_depth equaled 7, min_samples_split equaled 5, and min_samples_leaf equaled 5. The model was tested on the test set and the results showed that among the 100 test data sets, 24 substations experienced full power outages and full power transfers. Of these, 23 were predicted by the model to be fully powered off and full power transfers, while 1 was predicted to not be switched. Among the 100 test data sets, 11 substations experienced partial power transfers. Of these, 10 were predicted by the model to be partial power transfers, while 1 was predicted to be a dual power switch. Among the 100 test data sets, 11 substations experienced dual power switchovers. Of these, 10 were predicted by the model to be dual power switchovers, while 1 was predicted to not be switched. Among the 100 test data sets, there were 54 areas with no power transfer, of which 53 were predicted by the model as no power transfer and 1 was predicted as full power cut-off and full power transfer. After calculation, the model achieved an average precision of 95.78% for each label on the test set, an average recall of 93.95%, and an average F1 score of 94.81%. Figure 2 and Figure 3 The importance of each parameter is detailed in Figure 4 It can be seen that the accuracy of the transfer identification and transfer type identification of this model is relatively high. The power stacking diagram of one of the identification cases and its transfer area, and its combined power stacking diagram, as shown in the figure below: Figure 5 and Figure 6 .

[0127] Example 2

[0128] like Figure 7 As shown, the present invention provides a low voltage power supply identification system based on a random forest model, comprising:

[0129] The measurement data acquisition module is used to obtain the daily frozen electricity meter readings, active power at time points, and frozen meter reading data at time points of the substation and low-voltage users from the electricity consumption information collection system;

[0130] The measurement data preprocessing module is used to preprocess the acquired data, identify missing values ​​using the isnull function, identify outliers using the median absolute deviation method, and fill in the identified outliers and missing values ​​using the Lagrange polynomial interpolation method;

[0131] The ledger data acquisition module is used to obtain the topological contact relationship of the substation area, as well as the basic ledger data of the substation area and users;

[0132] The feature extraction module is used to extract data features from the pre-processed data and the basic ledger data of the substation area, and combine the labels of whether the substation area is switched and the type of switched supply to form a sample set, and randomly divide the sample set into a training sample set, a verification sample set, and a test sample set;

[0133] The model building module is used to select the random forest model from the Scikit-learn library, set the initial hyperparameter range of the random forest model based on sample information, and use the network search method to select the optimal hyperparameter value to build a basic random forest model;

[0134] The model training and testing module is used to import the feature data of the training sample set into the basic random forest model. Each time the model training reaches the preset number of trees, the training of the basic random forest model will stop. Finally, the basic random forest model outputs the result of whether the substation area has switched power and the type of switching power based on the mode of all tree prediction categories. During the training of the basic random forest model, the grid search method is used to adjust the hyperparameters within a range, and the basic random forest model that achieves the best prediction accuracy on the validation sample set is selected to finally obtain the random forest classification model. The random forest classification model is tested using the test sample set, and the performance of the random forest model is evaluated using the precision, recall rate and F1 score.

[0135] The low-voltage transfer identification module is used to predict whether the substation will transfer power and the type of transfer through low-voltage transfer identification. Combined with the time period when the substation's time-sharing power drops to zero or the time-sharing line loss is negative and the substation topology connection relationship, it finally outputs the low-voltage transfer identification result, including transfer-in / out substation information, transfer type, and transfer start / end time.

[0136] In an optional embodiment, a low-voltage power supply identification method based on a random forest model includes: a) obtaining the daily frozen electricity meter count, active power at the time-sharing point, and frozen electricity meter count at the time-sharing point of the substation and low-voltage users in the electricity consumption information collection system; b) performing data cleaning and value supplementation on the obtained user data; c) obtaining topological connection relationships and some basic ledger data of the substation and users from the PMS system, including the substation's input time, dual power user information, household transformer relationship, etc.; d) calculating and extracting several features from the daily frozen electricity meter count, active power at the time-sharing point, frozen electricity meter count at the time-sharing point, topological connection relationships, and some basic ledger data of the substation and users to form a training sample set, a verification sample set, and a test sample set; e) selecting a random forest model in the Sklearn library, and setting some parameter ranges of the model according to the sample information, including the maximum number of features, the number of trees, the maximum depth of the tree, the minimum number of samples required for internal node re-division, the minimum number of samples of leaf nodes, and the sampling method; f) using the preset random forest model to train using the training sample set, and stopping after reaching the preset number of trees. Optimize hyperparameters through grid search and select the model with the best prediction accuracy on the validation set. Evaluate model performance on the test set. g) Use this model to predict substation power transfers and ultimately output low-voltage power transfer identification results, including transfer entry / exit information, transfer type, and transfer start / end time.

Claims

1. A low voltage power supply identification method based on random forest model, characterized in that: include: Measurement data acquisition: Obtain the daily frozen electricity meter readings, active power at different time points, and frozen meter reading data at different time points for the substation and low-voltage users from the electricity consumption information collection system; Measurement data preprocessing: Preprocess the acquired data, use the isnull function to identify missing values, use the median absolute deviation method to identify outliers, and use the Lagrange polynomial interpolation method to fill in the identified outliers and missing values; Ledger data acquisition: obtain the topological relationship of the substation area, as well as the basic ledger data of the substation area and users; Feature extraction: Extract data features from preprocessed data and substation ledger data, combine them with the substation's power supply transfer and transfer type labels to form a sample set, and randomly divide the sample set into a training sample set, a validation sample set, and a test sample set; Model construction: Select the random forest model from the Scikit-learn library, set the initial hyperparameter range of the random forest model based on the sample information, and use the network search method to select the optimal hyperparameter value to build a basic random forest model; Model training and testing: The feature data of the training sample set is imported into the basic random forest model. Each time the model is trained, the training of the basic random forest model will stop as the number of trees reached. Finally, the basic random forest model outputs the result of whether the substation area should switch power and the type of power switching based on the mode of all tree prediction categories. During the training of the basic random forest model, the grid search method is used to adjust the hyperparameters within a certain range, and the basic random forest model that achieves the best prediction accuracy on the validation sample set is selected to finally obtain the random forest classification model. The random forest classification model was tested using the test sample set, and the performance of the random forest model was evaluated using precision, recall, and F1 score. Low-voltage power transfer identification: The model predicts whether the substation will transfer power and the type of transfer. Combined with the time period when the substation's time-sharing power drops to zero or the time-sharing line loss is negative and the substation's topological connection relationship, the low-voltage power transfer identification result is finally output, including transfer-in / out substation information, transfer type, and transfer start / end time.

2. The low voltage power supply identification method based on random forest model according to claim 1 is characterized in that: The standard formula of the Lagrange polynomial interpolation method is as follows: Where P(x) represents the polynomial function obtained by Lagrange interpolation, which is used to estimate the interpolation result at the given position x of the measurement data point; n represents the number of existing measurement data points minus one; y i represents the measured data value of the i-th data point; L i (x) represents the Lagrangian basis function of the i-th measurement data value.

3. The low voltage power supply identification method based on random forest model according to claim 1 is characterized in that: Extract data features from preprocessed data and station ledger data, including: Through the ledger data of the substation, it is possible to obtain whether there are dual power users in the substation, whether there is a peer contact substation in the substation, and the operation time of the substation; The daily line loss rate of the substation and the daily line loss rate of the opposite contact substation are calculated through the measurement data of the substation; Through the measurement data of the substation, calculate whether the substation's time-of-day power drops to zero, the number of time-of-day power drop points in the substation, whether the time-of-day line loss rate in the substation is negative, and the number of time-of-day line loss rates in the substation that are negative; Through the measurement data of the substation, the line loss rate of the opposite-end connecting substation during the period when the substation's time-sharing power drops to zero, the line loss rate of the opposite-end connecting substation during the period when the substation's time-sharing power drops to zero, the line loss rate of the opposite-end connecting substation during the period when the substation's time-sharing line loss is negative, and the combined line loss rate of the opposite-end connecting substation during the period when the substation's time-sharing line loss is negative are calculated.

4. The low voltage power supply identification method based on random forest model according to claim 3 is characterized in that: The calculation process of the daily line loss rate of the station area and the daily line loss rate of the opposite terminal contact station area is as follows: Obtain the frozen electricity meter readings of the substation and the low-voltage users in the substation on the current day and the previous day, and use the frozen electricity meter readings to calculate the frozen electricity of the current day. If the frozen electricity calculation for the current day is empty, use the active power of the meter to make up the frozen electricity value, and then use the frozen electricity of the substation and the frozen electricity of the low-voltage users in the substation to calculate the substation line loss rate; Among them, The formula for frozen power is as follows: E=(r t -r t-1 )×F Among them, E represents the frozen power; r t Indicates that the meter freezes the electricity display value on that day, r t-1 Indicates the meter’s frozen reading from the previous day, and F indicates the meter’s comprehensive multiplier.

5. The low voltage power supply identification method based on random forest model according to claim 4 is characterized in that: The active power of the electric meter is used to compensate for the frozen electric quantity. The compensation formula is as follows: Among them, E represents the frozen power; P i represents the active power of the i-th point; T represents the duration; F represents the comprehensive multiplication factor of the meter; N represents the number of metering segments.

6. The low voltage power supply identification method based on random forest model according to claim 4 is characterized in that: The calculation formula of the line loss rate of the transformer area is as follows: Among them, lineloss_rate represents the line loss rate of the substation area; E In Indicates the daily input power of the substation; E Out Indicates the daily output power of the substation; represents the frozen power of the i-th user in the substation; n represents the number of users in the substation.

7. The low voltage power supply identification method based on random forest model according to claim 3 is characterized in that: The calculation process of whether the substation's time-sharing power drops to zero, the number of time-sharing power drop points in the substation, whether the time-sharing line loss rate in the substation is negative, and the number of negative time-sharing line loss rates in the substation is as follows: Obtain the substation's hourly power data through the power consumption collection system to determine whether the substation's hourly power has dropped to zero. If zero drop occurs, calculate the number of zero drop points of the substation power and the time period of zero drop of the substation power; If zero drop does not occur, the time-sharing line loss rate of the substation is calculated based on the time-sharing power of the substation and the time-sharing power of downstream users in the substation to determine whether the time-sharing line loss rate of the substation is negative; If a negative value appears, the number of negative values ​​of the line loss rate in the substation area and the time period in which the line loss rate in the substation area is negative are calculated; The calculation formula for the time-of-day line loss rate in the substation area is as follows: Where, lineloss_rate_t represents the time-sharing line loss rate; P total Indicates the total power of the substation at a certain time point; F total Indicates the comprehensive multiplication factor of the electric meter in the substation area; represents the load power of the i-th user; represents the comprehensive multiplier of the electricity meter of the i-th user; n represents the number of users; T represents the segment duration.

8. The low voltage power supply identification method based on random forest model according to claim 7 is characterized in that: The acquisition process of the line loss rate of the opposite-end contact area during the period when the power of the substation drops to zero, the combined line loss rate of the substation and its opposite-end contact area during the period when the power of the substation drops to zero, the line loss rate of the opposite-end contact area during the period when the line loss of the substation is negative, and the combined line loss rate of the opposite-end contact area during the period when the line loss of the substation is negative is as follows: If the substation's time-sharing power drops to zero, the time-sharing frozen power meter data of the substation, the opposite contact substation, and the downstream users at the beginning and end of the time period are obtained from the power consumption collection system based on the time period when the substation's time-sharing power drops to zero. The line loss rate of the opposite contact substation during the period when the substation's time-sharing power drops to zero is calculated, and the combined line loss rate of the substation and its opposite substation during the period when the substation's time-sharing power drops to zero is calculated. If the substation's time-sharing line loss rate is negative, the time-sharing frozen electricity meter data of the substation, the opposite liaison substation and the downstream users at the beginning and end of the time period are obtained from the electricity consumption collection system through the time period when the substation's time-sharing line loss is negative, and the line loss rate of the opposite substation during the period when the substation's time-sharing line loss is negative is calculated, and the combined line loss rate of the substation and the opposite liaison substation during the period when the substation's time-sharing line loss is negative is calculated.

9. The low voltage power supply identification method based on random forest model according to claim 1 is characterized in that: The initial hyperparameter ranges for setting the random forest model include the number of trees n_estimators, the number of features to consider when finding the best split max_features, the maximum depth of the tree max_depth, the minimum number of samples required to split an internal node min_samples_split, the minimum number of samples required at a leaf node min_samples_leaf, and whether to use bootstrap sampling with replacement.

10. A low voltage power supply identification system based on random forest model, characterized in that: include: The measurement data acquisition module is used to obtain the daily frozen electricity meter readings, active power at time points, and frozen meter reading data at time points of the substation and low-voltage users from the electricity consumption information collection system; The measurement data preprocessing module is used to preprocess the acquired data, identify missing values ​​using the isnull function, identify outliers using the median absolute deviation method, and fill in the identified outliers and missing values ​​using the Lagrange polynomial interpolation method; The ledger data acquisition module is used to obtain the topological contact relationship of the substation area, as well as the basic ledger data of the substation area and users; The feature extraction module is used to extract data features from the pre-processed data and the substation ledger data, and combine the substation area's power supply transfer and transfer type labels to form a sample set, and randomly divide the sample set into a training sample set, a validation sample set, and a test sample set; The model building module is used to select the random forest model from the Scikit-learn library, set the initial hyperparameter range of the random forest model based on sample information, and use the network search method to select the optimal hyperparameter value to build a basic random forest model; The model training and testing module is used to import the feature data of the training sample set into the basic random forest model. Each time the model is trained, the training of the basic random forest model will stop as the number of trees is reached. Finally, the basic random forest model outputs the result of whether the substation area should transfer power and the type of transfer based on the mode of all tree prediction categories. During the training of the basic random forest model, the grid search method was used to adjust the hyperparameters within a certain range. The basic random forest model that achieved the best prediction accuracy on the validation sample set was selected, and the random forest classification model was finally obtained. The random forest classification model was tested on the test sample set, and the performance of the random forest model was evaluated using precision, recall, and F1 score. The low-voltage power transfer identification module is used to predict whether the substation will transfer power and the type of transfer through a model. Combined with the time period when the substation's time-sharing power drops to zero or the time-sharing line loss is negative and the substation's topological connection relationship, it ultimately outputs the low-voltage power transfer identification results, including transfer-in / out substation information, transfer type, and transfer start / end time.

Citation Information

Patent Citations

  • Medium-voltage distribution network transfer operation identification method and device based on machine learning

    CN112180188A

  • Voltage quality analysis method and system based on low-voltage transformer area

    CN115809761A