Method and device for calculating line loss of low-voltage transformer area, electronic equipment and medium

By using a combination of three-phase IoT table and single-phase table in the low-voltage distribution transforming table area, combined with the improved bat algorithm random forest model, the problem of low-line loss calculation accuracy in the existing technology medium and low-voltage table area is solved, and the problem of low-voltage line loss calculation accuracy is realized. Higher calculation accuracy and stability.

CN119125667AInactive Publication Date: 2024-12-13SHANGHAI XINYING POWERTECH

Patent Information

Application Number
CN202411153962.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-12-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing low-voltage distribution transformer platform has low accuracy and cannot effectively calculate the line loss information inside or local platform. In addition, traditional methods such as PLC and HPLC have poor instability and reliability, resulting in low calculation accuracy.

Method used

Using a combination of three-phase IoT table and single-phase table, the linear loss calculation model is obtained by reading the power and obtaining the electrical characteristic quantity using the improved bat algorithm random forest model, and the first line loss result and the second line loss are used. The results are weighted to improve the accuracy of line loss calculation.

Benefits of technology

Improve the accuracy of line loss calculation in low-voltage table area. Through the combination of power calculation of three-phase IoT tables and single-phase tables and artificial intelligence methods, more fine-grained line loss data is provided, enhancing the reliability and stability of the calculation. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119125667A_ABST
    Figure CN119125667A_ABST
Patent Text Reader

Abstract

The invention provides a low-voltage transformer area line loss calculation method and device, electronic equipment and a medium, and the method is applied to a three-phase Internet of Things meter of a target low-voltage transformer area, and comprises the steps: reading the electric quantity of the three-phase Internet of Things meter and the electric quantity of each single-phase meter, and obtaining the electrical characteristic quantity of the target low-voltage transformer area; calculating a first line loss result based on the electric quantity of the three-phase Internet of Things meter and the electric quantity of each single-phase meter; inputting the electrical characteristic quantity into a pre-trained line loss calculation model to obtain a second line loss result; wherein the line loss calculation model is obtained by training a random forest model based on an improved bat algorithm; and performing weighted calculation on the first line loss result and the second line loss result to obtain a line loss result of the target low-voltage transformer area. According to the invention, the line loss calculation precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power distribution networks, and in particular to a method, device, electronic equipment and medium for calculating line loss in a low-voltage area. Background Art

[0002] At present, there are many power supply lines in the low-voltage distribution transformer area, the wiring is complex, the distribution area is wide, the user's electricity consumption behavior is changeable and difficult to predict, and the line loss has a large dynamic range. For a long time, the substation total meter-user meter model based on the electricity consumption information collection system can only calculate the total line loss of the substation, and more line loss information inside or locally in the substation cannot be given.

[0003] Lean line loss analysis provides a solution to eliminate blind spots. On the basis of the existing substation total meter and user meter, hardware sensing devices are installed at key nodes of the line to collect the power inside and locally in the substation, thereby providing a channel for calculating finer-grained line loss data. One feasible solution is to install an intelligent fusion terminal on the transformer side of the substation, a branch sensing terminal on the branch box, and a terminal sensing terminal on the meter box. Each sensing terminal and user meter interacts with the intelligent fusion terminal in the form of carrier (PLC) or high-speed broadband carrier (HPLC). The intelligent fusion terminal serves as the "brain of the substation" to summarize the frozen power of each downstream device and then calculate the line loss and line loss rate. However, from the perspective of application effect, both PLC and HPLC have inherent disadvantages of instability, poor reliability, and periodic ups and downs, resulting in low accuracy in line loss calculation. Summary of the invention

[0004] In view of this, an object of the present invention is to provide a method, device, electronic equipment and medium for calculating line loss in a low voltage substation area, so as to improve the accuracy of line loss calculation.

[0005] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:

[0006] In the first aspect, an embodiment of the present invention provides a method for calculating line loss in a low-voltage substation, which is applied to a three-phase IoT meter of a target low-voltage substation, and includes: reading the electrical quantity of the three-phase IoT meter and the electrical quantity of each single-phase meter, and obtaining the electrical characteristic quantity of the target low-voltage substation; calculating a first line loss result based on the electrical quantity of the three-phase IoT meter and the electrical quantity of each single-phase meter; inputting the electrical characteristic quantity into a pre-trained line loss calculation model to obtain a second line loss result; wherein the line loss calculation model is obtained by training a random forest model based on an improved bat algorithm; performing weighted calculation on the first line loss result and the second line loss result to obtain the line loss result of the target low-voltage substation.

[0007] In one embodiment, before reading the power of the three-phase IoT meter and the power of each single-phase meter, it also includes: obtaining original training sample data, and preprocessing the original training sample data to obtain a training sample set and a test sample set; determining the input characteristic value of the random forest model based on the training sample set; wherein the input characteristic value includes: the electrical characteristic value of the target low-voltage substation; initializing the parameters of the improved bat algorithm and the model parameters of the random forest model; wherein the model parameters include at least: the number of decision trees, the depth of the tree, the number of randomly sampled input characteristic values ​​and the pruning threshold; generating a decision tree based on the model parameters and input characteristic values ​​of the random forest model, constructing a random forest model, and optimizing the parameters of the random forest model based on the improved bat algorithm, until the fitness function of the random forest model meets the preset requirements, and a trained line loss calculation model is obtained.

[0008] In one embodiment, the parameters of the random forest model are optimized based on the improved bat algorithm until the fitness function of the random forest model meets the preset requirements, including: calculating the output result of the random forest model based on the test sample set, and calculating the error value between the output result and the test sample set based on the fitness function; if the error value is within the preset range, a trained line loss calculation model is obtained; if the error value is not within the preset range, the model parameters are updated based on the improved bat algorithm, and the random forest model is rebuilt based on the updated model parameters until the error value is within the preset range.

[0009] In one embodiment, the electric quantity of the three-phase IoT meter and the electric quantity of each single-phase meter are read, including: using the current injection method to construct the topological relationship between the three-phase IoT meter and the single-phase meters of the target low-voltage substation, and synchronizing the three-phase IoT meter and the single-phase meters; reading the frozen data of the synchronized three-phase IoT meter and the single-phase meters to obtain the electric quantity of the three-phase IoT meter and the electric quantity of each single-phase meter.

[0010] In one embodiment, weighted calculation is performed on the first line loss result and the second line loss result to obtain the line loss result of the target low-voltage substation, including: determining a first weight coefficient of the first line loss result and a second weight coefficient of the second line loss result; and calculating the line loss result of the target low-voltage substation according to the following formula:

[0011] E=δ·E 电量计算 +λ·E 数据分析

[0012] Where E represents the line loss result, δ represents the first weight coefficient, and E 电量计算 represents the first line loss result, λ represents the second weight coefficient, E 数据分析 Indicates the second line loss result.

[0013] In the second aspect, an embodiment of the present invention provides a device for calculating line loss in a low-voltage substation, which is applied to a three-phase IoT meter of a target low-voltage substation, and includes: a data reading module, used to read the power of the three-phase IoT meter and the power of each single-phase meter, and to obtain the electrical characteristic quantity of the target low-voltage substation; a first line loss calculation module, used to calculate a first line loss result based on the power of the three-phase IoT meter and the power of each single-phase meter; a second line loss calculation module, used to input the electrical characteristic quantity into a pre-trained line loss calculation model to obtain a second line loss result; wherein the line loss calculation model is obtained by training a random forest model based on an improved bat algorithm; a line loss result fusion module, used to perform weighted calculation on the first line loss result and the second line loss result to obtain the line loss result of the target low-voltage substation.

[0014] In one embodiment, the above device further includes: a line loss calculation model training module, which is used to:

[0015] The original training sample data is obtained, and the original training sample data is preprocessed to obtain a training sample set and a test sample set; the input characteristic value of the random forest model is determined based on the training sample set; wherein the input characteristic value includes: the electrical characteristic quantity of the target low-voltage substation; the parameters of the improved bat algorithm and the model parameters of the random forest model are initialized; wherein the model parameters include at least: the number of decision trees, the depth of the tree, the number of randomly sampled input characteristic values ​​and the pruning threshold; a decision tree is generated based on the model parameters and input characteristic values ​​of the random forest model, a random forest model is constructed, and the parameters of the random forest model are optimized based on the improved bat algorithm, until the fitness function of the random forest model meets the preset requirements, and a trained line loss calculation model is obtained.

[0016] In one embodiment, the line loss calculation model training module is specifically used to: calculate the output result of the random forest model based on the test sample set, and calculate the error value between the output result and the test sample set based on the fitness function; if the error value is within a preset range, a trained line loss calculation model is obtained; if the error value is not within the preset range, the model parameters are updated based on the improved bat algorithm, and the random forest model is rebuilt based on the updated model parameters until the error value is within the preset range.

[0017] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the steps of any one of the methods provided in the first aspect above.

[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the methods provided in the first aspect are executed.

[0019] The embodiments of the present invention bring the following beneficial effects:

[0020] The above-mentioned method, device, electronic device and medium for calculating the line loss of the low-voltage substation provided by the embodiment of the present invention are applied to the three-phase IoT table of the target low-voltage substation. First, the power of the three-phase IoT table and the power of each single-phase table are read, and the electrical characteristic quantity of the target low-voltage substation is obtained; then the first line loss result is calculated based on the power of the three-phase IoT table and the power of each single-phase table; then the electrical characteristic quantity is input into the pre-trained line loss calculation model (obtained by training the random forest model based on the improved bat algorithm) to obtain the second line loss result; finally, the first line loss result and the second line loss result are weightedly calculated to obtain the line loss result of the target low-voltage substation. The above-mentioned method is based on the three-phase IoT table, calculates the first line loss result through the power of the three-phase IoT table and each single-phase table, and calculates the second line loss result using the line loss calculation model obtained by training the random forest model based on the improved bat algorithm, and finally weightedly fuses the results obtained by the two settlement methods to obtain the final pre-calculated result, thereby improving the accuracy of line loss calculation.

[0021] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0022] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 A flow chart of a method for calculating line loss in a low voltage area provided by an embodiment of the present invention;

[0025] Figure 2 A schematic diagram of a topological relationship of a low-voltage station area provided in an embodiment of the present invention;

[0026] Figure 3 A flowchart of a random forest algorithm provided by an embodiment of the present invention;

[0027] Figure 4A flow chart of a BA-RF optimization algorithm provided in an embodiment of the present invention;

[0028] Figure 5 A schematic diagram of the structure of a low voltage area line loss calculation device provided by an embodiment of the present invention;

[0029] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] For the power grid, the total power supply comes from the power supply data of the power plant, while the total power sales come from the power users. Line losses occur during the power distribution process due to line transmission and line distribution, as well as the difference in the power meter between the power supplier and the power seller. This loss can be expressed as:

[0032] ΔA=A G -A S

[0033] In the formula, A G is the power supply of the power plant, A S is the electricity sales amount of the power company, and ΔA is the statistical line loss of the line.

[0034] The line loss rate can be expressed as:

[0035]

[0036] The line loss in the substation area is affected by many factors, mainly including the following points.

[0037] (1) Load factors. When the power supply equipment is working, the large fluctuation of its load will affect its power supply efficiency, resulting in additional power loss, and this loss will gradually increase with the imbalance of the three phases.

[0038] (2) Grid operation factors. Power equipment, especially power transmission and transformation equipment, contains iron cores, which are affected by electromagnetic fields and generate eddy currents inside them, causing the temperature of the equipment to rise, resulting in a large amount of heat loss and line loss.

[0039] (3) Grid planning factors. The planning of urban and rural transmission lines is not unified. The line conditions in rural areas are poor and the funds are insufficient, resulting in long-term overload operation. In addition, the transmission lines are too long, which further aggravates the line losses. Problems such as aging of urban lines have caused some unreasonable line loads. During peak hours of electricity consumption, a large amount of load is generated on the transmission and transformation equipment, increasing line losses. At the same time, the lack of understanding of the user's electricity consumption patterns during the distribution configuration process has caused the power equipment to have no-load or overload problems, resulting in high line losses.

[0040] (4) Management factors. In the management of substation lines, inconsistent relationships between substation users, lack of archival information, data errors in electric energy meters, failures in data collection equipment, and user electricity theft can all lead to a large number of high line losses.

[0041] At present, there are many power supply lines in low-voltage distribution substations, with complex wiring and a wide distribution area. The power consumption behavior of users is changeable and difficult to predict, and the dynamic range of line loss is large. For a long time, the substation total meter-user meter model based on the power consumption information collection system can only calculate the total line loss of the substation, and more line loss information inside or locally in the substation cannot be given. Lean line loss analysis provides a solution to eliminate blind spots. On the basis of the existing substation total meter and user meter, hardware sensing equipment is installed at key nodes of the line to collect the power inside and locally in the substation, thereby providing a channel for calculating finer granularity line loss data. However, from the perspective of application effect, both PLC and HPLC have inherent disadvantages of instability, poor reliability, and periodic ups and downs, resulting in low accuracy in line loss calculation.

[0042] In addition, traditional methods for calculating line loss in distribution networks also include the equivalent resistance method. Although this method is highly accurate and widely used, it requires numerous electrical parameters and has a complex calculation process. Due to the small number of characteristic quantities of line loss in the distribution network, especially under the condition of incomplete distribution network operation information, the characteristic quantities of line loss in the distribution network will be even smaller. The small number of characteristic quantities will make the classifiers obtained after algorithm training not very different, resulting in poor accuracy of line loss calculation results. The line loss is calculated by reading the total meter of the substation and each single-phase meter, but due to the asynchronous clock of the meter and the change of the topological structure, it is easy to cause deviation in the line loss calculation results. In summary, the existing line loss calculation method has low accuracy.

[0043] Based on this, the embodiments of the present invention provide a method, device, electronic device and medium for calculating line loss in a low-voltage area, which can improve the accuracy of line loss calculation.

[0044] To facilitate understanding of this embodiment, a method for calculating line loss in a low-voltage substation disclosed in an embodiment of the present invention is first introduced in detail. This method is applied to a three-phase IoT meter in a target low-voltage substation. The three-phase IoT meter is used as the total meter of the substation to calculate line loss. The strong edge computing capability of the three-phase IoT meter is utilized, and a method for calculating line loss based on power consumption is combined with an artificial intelligence method to calculate line loss.

[0045] See also Figure 1 The flowchart of a method for calculating line loss in a low voltage area is shown, which illustrates that the method mainly includes the following steps S101 to S104:

[0046] Step S101: read the power of the three-phase IoT meter and the power of each single-phase meter, and obtain the electrical characteristic quantity of the target low-voltage area.

[0047] In one embodiment, see Figure 2 As shown, a three-phase IoT table is used as the total table of the substation, and multiple single-phase tables are mounted on each item. First, the current injection method is used to construct the topological relationship between the three-phase IoT table and each single-phase table of the target low-voltage substation, and the three-phase IoT table and each single-phase table are synchronized; then the frozen data of the synchronized three-phase IoT table and each single-phase table are read to obtain the power of the three-phase IoT table and the power of each single-phase table. At the same time, the electrical characteristic quantities related to the line loss of the distribution network are obtained. The electrical characteristic quantities selected in this embodiment include at least: total line length, trunk line length, branch line length, conductor unit length resistance, monthly active power supply, monthly reactive power supply, distribution transformer capacity, three-phase imbalance of the distribution network and distribution network load factor.

[0048] Step S102: Calculate the first line loss result based on the power of the three-phase IoT meter and the power of each single-phase meter.

[0049] In one embodiment, after reading the power of the three-phase IoT meter and the power of each single-phase meter, the phase of each single-phase meter can be determined according to the topological relationship between the constructed three-phase IoT meter and each single-phase meter, and the corresponding first line loss result can be calculated.

[0050] In specific implementation, taking the line loss of phase A as an example, the line loss of phase A can be calculated according to the following formula:

[0051]

[0052] Among them, E 1a 、E 2a ...are the power of each single-phase meter mounted on phase A, E a is the total power of phase A. Similarly, the line loss of phase B and phase C can also be calculated based on the power of each single-phase meter mounted on phase B and phase C.

[0053] Furthermore, the bus loss can be calculated according to the following formula:

[0054]

[0055] Among them, E n is the electric quantity of the three-phase IoT meter, and E1, E2, ... are the electric quantities of the single-phase meters connected after the three-phase IoT meter.

[0056] Step S103: input the electrical characteristic quantity into a pre-trained line loss calculation model to obtain a second line loss result.

[0057] In one implementation, the line loss calculation model is obtained by training a random forest model based on an improved bat algorithm. In the embodiment of the present invention, the acquired electrical characteristic quantity can be input into a pre-trained line loss calculation model for line loss analysis to obtain a second line loss result.

[0058] Step S104: Perform weighted calculation on the first line loss result and the second line loss result to obtain the line loss result of the target low-voltage substation.

[0059] In one embodiment, the line loss result may be calculated in the following manner including but not limited to: firstly determining a first weight coefficient of the first line loss result and a second weight coefficient of the second line loss result; and then calculating the line loss result of the target low voltage substation according to the following formula:

[0060] E=δ·E 电量计算 +λ·E 数据分析

[0061] Where E represents the line loss result, δ represents the first weight coefficient, and E 电量计算 represents the first line loss result, λ represents the second weight coefficient, E 数据分析 Indicates the second line loss result.

[0062] In the specific implementation, in order to improve the accuracy of the overall line loss analysis, the first line loss result obtained by the power calculation method and the second line loss result obtained based on the random forest analysis method are weighted and analyzed, and the weight parameters (i.e., the first weight coefficient and the second weight coefficient) are determined according to the test results of the target low-voltage substation, and then the actual line loss results are determined. For example: assuming that the target low-voltage substation is small in scale and the result obtained by the power calculation method is more accurate, the first weight coefficient can be set higher; if the lines passing through the target low-voltage substation are more complex, the second weight coefficient can be set higher, and it can be set according to the actual situation.

[0063] The method for calculating the line loss in the low-voltage substation provided in the embodiment of the present invention is based on the three-phase IoT table. The first line loss result is calculated by the electrical quantity of the three-phase IoT table and each single-phase table, and the second line loss result is calculated by using the line loss calculation model obtained by training the random forest model based on the improved bat algorithm. Finally, the results obtained by the two settlement methods are weightedly fused to obtain the final preliminary calculation result, thereby improving the accuracy of line loss calculation.

[0064] The line loss calculation model used in the embodiment of the present invention is obtained by training the random forest model based on the improved bat algorithm. It is assumed that the random forest is composed of multiple decision trees {h(x, θ t ),t=1,2,3...,T}, where x is the data of the training sample set, θ t is a random variable, T is the number of decision trees in the random forest, then the prediction result output by the random forest model is:

[0065]

[0066] Among them, Y RF (x) represents the prediction result of the random forest algorithm for the sample data x to be tested, h(x,θ t ) represents the relationship between x and θ t The random forest model has strong generalization ability and robustness, can handle high-dimensional data and a large number of features, and can still give accurate prediction results for abnormal data in the data. At the same time, it can capture the nonlinear relationship between input variables and output variables and provide information about the importance of each feature in the prediction model.

[0067] During the construction of the random forest model, the learners are not interdependent, and the parameters that need to be adjusted in the model are fewer than those of other models, thereby speeding up the model training. The main parameters involved include: the number of decision trees, the depth of the tree (also called the number of tree layers), and the number of randomly sampled eigenvalues.

[0068] 1. Number of decision trees

[0069] During the training process, the random forest model generates a decision tree each time it is trained. In theory, the more decision trees there are, the better the model fit will increase with the number of trees. However, too many trees will increase the corresponding model training time, and too few decision trees will lead to poor model performance and reduced accuracy. Therefore, selecting the right number of trees is a key factor in model training.

[0070] 2. Tree Depth

[0071] When a decision tree splits, it generates new nodes layer by layer, thereby increasing the depth of the tree. Generally speaking, the deeper the decision tree is, the higher the learning effect and prediction accuracy of the model will be. This is because the decision tree can more accurately describe the characteristics and patterns of the data, thereby improving the prediction performance of the model. However, this will also make the entire model more complex, increase the training time of the model, and may cause overfitting, so appropriate pruning or controlling the depth of the tree is required.

[0072] 3. Number of eigenvalues ​​randomly sampled

[0073] The random forest model uses a random sampling training mode. As the number of eigenvalues ​​increases, each leaf node can have more eigenvalues ​​for reference and selection, thereby improving the performance of the prediction model. However, if too many eigenvalues ​​are extracted each time, the random forest model's ability to fit different data types will decrease, causing each tree to lack its own "characteristics". This multi-feature feature is also the advantage of random forests over other models. There are many ways to select eigenvalues. You can select all eigenvalues ​​for training; you can also only consider log2 eigenvalue data samples log2N, or sqrt, which means the number of eigenvalues ​​is Etc. Generally speaking, the best eigenvalue is int(log2N+1), where N is the total number of eigenvalues ​​in the training sample.

[0074] See also Figure 3 As shown, the random forest algorithm process includes the following Step 1 to Step 6:

[0075] Step 1: Set the model parameters of the random forest model, including: the number of training sample sets X, the number of decision trees T, the number of randomly sampled eigenvalues ​​m, and the pruning threshold ε.

[0076] Step 2: Sample the original training sample data with replacement, randomly generate X training sample sets, and select L test sample data from each training sample set;

[0077] Step 3: Select attributes for the node, randomly select m eigenvalues ​​from all the eigenvalues ​​of the training sample set as the attribute values ​​of the node, and then select the optimal attribute for splitting according to the evaluation criteria of the CART algorithm.

[0078] Step4: Train a decision tree using the training samples generated in Step2 and Step3.

[0079] Step 5: Use the pruning threshold to perform pruning. If the number of samples contained in the node is less than the pruning threshold ε, the node is treated as a leaf node.

[0080] Step 6: If the number of decision trees obtained is less than T, return to Step 2 to continue sampling. Otherwise, all T decision trees are used to form a random forest model, and the model is used to calculate the prediction result or the final category.

[0081] Furthermore, the line loss calculation model in the embodiment of the present invention is trained in the following manner, and the specific training process includes the following steps (1) to (4):

[0082] Step (1): Obtain original training sample data and preprocess the original training sample data to obtain a training sample set and a test sample set.

[0083] In the specific implementation, the original training sample data is: the line loss calculation results of the equivalent resistance method and the electrical characteristics that affect the line loss of the distribution network are used as the sample data for training and testing the line loss calculation model. The selected electrical characteristics related to line loss are: total line length, trunk line length, branch line length, conductor unit length resistance, monthly active power supply, monthly reactive power supply, distribution transformer capacity, distribution network three-phase imbalance and distribution network load factor. The parameters of the improved bat algorithm include at least: bat population size m, number of iterations N, objective function f(X) (i.e., optimal classification surface function), bat position x i =(i=1,2,...,m) and speed v i , sound wave frequency f i , sound wave loudness A i Sum frequency r i .

[0084] After obtaining the original training sample data, the original training sample data is first preprocessed to remove data with obvious errors and deviations, and the preprocessed data is divided into a training sample set and a test sample set according to a certain ratio (such as 8:2); or the original training sample data is sampled with replacement to randomly generate multiple training sets, and a training sample set and a test sample set are selected in each training set.

[0085] Step (2): Determine the input feature value of the random forest model based on the training sample set.

[0086] The input feature value includes: the electrical feature value of the target low-voltage area. In this embodiment, the electrical feature value in the training sample set can be used as the input feature value of the random forest model.

[0087] Step (3): Initialize the parameters of the improved bat algorithm and the model parameters of the random forest model.

[0088] The model parameters include at least: the number of decision trees, the depth of the trees, the number of randomly sampled input feature values, and the pruning threshold.

[0089] Step (4): Generate a decision tree based on the model parameters and input feature values ​​of the random forest model, build a random forest model, and optimize the parameters of the random forest model based on the improved bat algorithm until the fitness function of the random forest model meets the preset requirements, thereby obtaining a trained line loss calculation model.

[0090] In the specific implementation, a decision tree is generated according to the initialized model parameters and input feature values. When the number of decision trees reaches the number of initialized decision trees, all decision trees are used to form a random forest model. Then, a fitness function is set. The fitness function evaluates the prediction performance of the random forest model based on the cross-validated R2 score and calculates the error value. If the error value is no longer within the preset range, the parameters of the random forest model are optimized through the improved bat algorithm until the fitness function meets the preset requirements (that is, the error value is within the preset range), and the optimal model parameter combination is obtained, thereby obtaining a trained line loss calculation model.

[0091] In one embodiment, when the parameters of the random forest model are optimized based on the improved bat algorithm until the fitness function of the random forest model meets the preset requirements, methods including but not limited to the following can be adopted: calculating the output result of the random forest model based on the test sample set, and calculating the error value between the output result and the test sample set based on the fitness function; if the error value is within the preset range, a trained line loss calculation model is obtained; if the error value is not within the preset range, the model parameters are updated based on the improved bat algorithm, and the random forest model is rebuilt based on the updated model parameters until the error value is within the preset range.

[0092] In this embodiment, the fitness function is as follows:

[0093] Fitness(p)=MSE(p i ) (4)

[0094] Among them, p i For the output of each decision tree of the random forest model, MSE calculates the average of the squares of the differences between all sample predictions (i.e., output results) and the true values ​​(i.e., sample data in the test sample set).

[0095] If the error value is within the preset range, the current model parameters are used as the optimal parameter combination to obtain a trained line loss calculation model; if the error value is not within the preset range, the parameters of the improved bat algorithm are updated, and then the model parameters are updated according to the improved bat algorithm, and the random forest model is rebuilt until the error value is within the preset range.

[0096] Specifically, the Bat Algorithm (BA) is mainly used for objective function optimization, and realizes function optimization based on the characteristics of bat populations using the sound waves they generate to search for prey and control the direction of flight. A bat is used as the basic unit, and each bat has a fitness value to optimize the function solution space. Each bat can adjust the loudness and frequency of the sound waves it emits to search the space, so that the activities of the entire population gradually change from disorder to order. However, the bat algorithm is prone to fall into local extreme values ​​at the end of the optimization stage. The embodiment of the present invention introduces a variable speed weight factor correction coefficient to avoid the dilemma of local extreme values ​​as much as possible, thereby achieving the effect of global optimization.

[0097] When a bat is searching for a target, object, or prey, it i At speed v i Random flight with a static frequency f, varying wavelength λ, loudness A i The frequency range is f min to f max The loudness of the sound can be adjusted between A0 and A min In the embodiment of the present invention, a series of rules are established to update the speed, position and loudness of bats when searching for prey. The mathematical formula of the improved bat algorithm is as follows:

[0098] f i =f min +(f max -f min )×β (5)

[0099]

[0100] Among them, β is a random number uniformly distributed in [0,1], x * represents the global optimal solution in the current population, r is the pulse emission rate, α and γ are constants, and 0<α<1, γ>0.

[0101] After selecting the global optimal solution, each local solution (x old ) can update its position using equation (10):

[0102] x new =x xld +εA t (10)

[0103] Among them, ε is any number between [-1,1], and A is the average loudness of all bats at the current time t.

[0104] The BA algorithm combines the best features of particle swarm optimization, genetic algorithm and acoustic search, and therefore can provide good results. Among them, the adjustment of parameters α and γ will affect the convergence speed. The specific process of the improved BA algorithm includes the following steps 1 to 6:

[0105] Step 1: Parameter initialization: bat population size m, number of iterations N, objective function f(X) (i.e., formula (3)), bat position x i =(i=1,2,...,m) and speed v i , sound wave frequency f i , sound wave loudness A i Sum frequency r i .

[0106] Step 2: Find the optimal bat position x in the current population * , and updates the bat's speed and position.

[0107] Specifically, we can find the optimal bat position x in the current population according to the above formula (5)-formula (6): * , and updates the bat's speed and position.

[0108] Step 3: Generate a random number rand1, where rand1 is a random number on [0, 1]. If rand1>r i , then select an optimal individual from the best bats, and then generate a local solution near the selected optimal individual using formula (10), otherwise update the bat position according to formula (7).

[0109] Step 4: Generate a random number rand2, where rand2 is a random number on [0, 1]. i , and the fitness of the objective function f(X) is better than the new solution in step 3, then accept this position and adjust A according to formula (8) i (decrease) and r i (increase).

[0110] Step 5: Sort the fitness values ​​of all individuals in the population and find the current best x * .

[0111] Step 6: Repeat steps 2-5 to determine whether the maximum number of iterations is met, and output the global optimal value when the maximum number of iterations is reached.

[0112] For ease of understanding, the present invention also provides a BA-RF optimization algorithm process, see Figure 4 As shown, it mainly includes the following steps a to e:

[0113] ​Step a: Input the original training sample data, preprocess the original training sample data, and divide the samples into a training sample set and a test sample set.

[0114] Step b: Determine the input feature values ​​for the random forest model.

[0115] Step c: Initialize the improved bat algorithm, bat population size m, number of iterations N, objective function f(X), bat position x i =(i=1,2,...,m) and speed v i , sound wave frequency f i , sound wave loudness A i Sum frequency r i And initialize the bat's speed and position through the BA algorithm.

[0116] Step d: Initialize the model parameters of the random forest model, generate a decision tree to build a random forest model, set the fitness function, and calculate the error value.

[0117] The fitness function evaluates the prediction performance of the random forest based on the cross-validation R2 score, as shown in formula (4).

[0118] Step e: If the error value does not meet the conditions, return to step c to continue iterative optimization to find the best parameter combination of the random forest model; otherwise, the process ends, the BA-RF prediction model is established, and the line loss numerical prediction is performed.

[0119] Specifically, if the error value does not meet the conditions, return to step c, update the speed and position of the bat, and when the objective function meets the conditions, obtain the updated model parameters of the random forest model, and rebuild the random forest model until the error value meets the conditions; otherwise, end the optimization process, establish the BA-RF prediction model (i.e., the line loss calculation model), and use the BA-RF prediction model to perform line loss numerical prediction.

[0120] In the embodiment of the present invention, in order to solve the problems that there are many factors affecting the line loss calculated by using the total meter and single-phase meter of the substation in the past, and the artificial intelligence analysis method has insufficient generalization ability for the change of substation topology, based on the modular design of the three-phase Internet of Things meter, using the carrier or dual-mode module of the Internet of Things meter, and the electric energy intelligence or line loss analysis module, the substation topology is first calculated in the carrier module, and then the first line loss result based on the three-phase Internet of Things meter and each single-phase meter is calculated, and then the second line loss result is calculated by combining the substation characteristics and electricity data using the BA-RF method, and finally the line loss calculation accuracy is improved through weighted calculation.

[0121] The embodiment of the present invention proposes a line loss calculation method for a three-phase IoT meter and each single-phase meter based on HPLC, and a line loss analysis method based on RF of an improved BA. By setting different weights for the two methods, a line loss analysis method that integrates the two methods is obtained, thereby improving the line loss calculation accuracy of the IoT meter.

[0122] For the calculation method of the low-voltage area line loss provided in the above embodiment, the embodiment of the present invention also provides a calculation device for the low-voltage area line loss, which is applied to the three-phase IoT table of the target low-voltage area, see Figure 5 The schematic diagram of the structure of a low voltage area line loss calculation device is shown, indicating that the device mainly includes the following parts:

[0123] The data reading module 501 is used to read the power of the three-phase IoT meter and the power of each single-phase meter, and obtain the electrical characteristic quantity of the target low-voltage area;

[0124] A first line loss calculation module 502, configured to calculate a first line loss result based on the power of the three-phase IoT meter and the power of each single-phase meter;

[0125] The second line loss calculation module 503 is used to input the electrical characteristic quantity into a pre-trained line loss calculation model to obtain a second line loss result; wherein the line loss calculation model is obtained by training a random forest model based on an improved bat algorithm;

[0126] The line loss result fusion module 504 is used to perform weighted calculation on the first line loss result and the second line loss result to obtain the line loss result of the target low-voltage substation.

[0127] The above-mentioned low-voltage substation line loss calculation device provided by the embodiment of the present invention is based on the three-phase IoT table, calculates the first line loss result through the electrical quantity of the three-phase IoT table and each single-phase meter, and calculates the second line loss result using the line loss calculation model obtained by training the random forest model based on the improved bat algorithm. Finally, the results obtained by the two settlement methods are weightedly fused to obtain the final preliminary calculation result, thereby improving the accuracy of line loss calculation.

[0128] In one embodiment, the above-mentioned device includes a line loss calculation model training module, which is used to: obtain original training sample data, and preprocess the original training sample data to obtain a training sample set and a test sample set; determine the input feature value of the random forest model based on the training sample set; wherein the input feature value includes: the electrical characteristic value of the target low-voltage substation; initialize the parameters of the improved bat algorithm and the model parameters of the random forest model; wherein the model parameters include at least: the number of decision trees, the depth of the tree, the number of randomly sampled input feature values ​​and the pruning threshold; generate a decision tree based on the model parameters and input feature values ​​of the random forest model, construct a random forest model, and optimize the parameters of the random forest model based on the improved bat algorithm until the fitness function of the random forest model meets the preset requirements, and a trained line loss calculation model is obtained.

[0129] In one embodiment, the line loss calculation model training module is specifically used to: calculate the output result of the random forest model based on the test sample set, and calculate the error value between the output result and the test sample set based on the fitness function; if the error value is within a preset range, a trained line loss calculation model is obtained; if the error value is not within the preset range, the model parameters are updated based on the improved bat algorithm, and the random forest model is rebuilt based on the updated model parameters until the error value is within the preset range.

[0130] In one embodiment, the data reading module 501 is specifically used to: use the current injection method to construct the topological relationship between the three-phase IoT table and each single-phase meter of the target low-voltage substation, and synchronize the three-phase IoT table and each single-phase meter; read the frozen data of the synchronized three-phase IoT table and each single-phase meter to obtain the power of the three-phase IoT table and the power of each single-phase meter.

[0131] In one embodiment, the line loss result fusion module 504 is specifically used to: determine a first weight coefficient of the first line loss result and a second weight coefficient of the second line loss result; and calculate the line loss result of the target low voltage substation according to the following formula:

[0132] E=δ·E 电量计算 +λ·E 数据分析

[0133] Where E represents the line loss result, δ represents the first weight coefficient, and E 电量计算 represents the first line loss result, λ represents the second weight coefficient, E 数据分析 Indicates the second line loss result.

[0134] It should be noted that the implementation principle and technical effects of the device provided in the embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0135] An embodiment of the present invention further provides an electronic device. Specifically, the electronic device includes a processor and a storage device. The storage device stores a computer program, and when the computer program is executed by the processor, it executes the method described in any one of the above implementation methods.

[0136] Figure 6 A structural diagram of an electronic device provided in an embodiment of the present invention, the electronic device 100 includes: a processor 60, a memory 61, a bus 62 and a communication interface 63, wherein the processor 60, the communication interface 63 and the memory 61 are connected via the bus 62; the processor 60 is used to execute an executable module stored in the memory 61, such as a computer program.

[0137] The memory 61 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 63 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.

[0138] The bus 62 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0139] Among them, the memory 61 is used to store programs, and the processor 60 executes the program after receiving the execution instruction. The method executed by the device for flow process definition disclosed in any embodiment of the above-mentioned embodiment of the present invention can be applied to the processor 60 or implemented by the processor 60.

[0140] The processor 60 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 60. The above processor 60 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 61, and the processor 60 reads the information in the memory 61 and completes the steps of the above method in combination with its hardware.

[0141] The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be referred to the previous method embodiments, which will not be repeated here.

[0142] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0143] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A method for calculating line loss in a low voltage area, characterized in that: The method is applied to a three-phase IoT meter in a target low-voltage area, and includes: Read the electric quantity of the three-phase IoT meter and the electric quantity of each single-phase meter, and obtain the electrical characteristic quantity of the target low-voltage area; Calculating a first line loss result based on the power of the three-phase IoT meter and the power of each single-phase meter; Inputting the electrical characteristic quantity into a pre-trained line loss calculation model to obtain a second line loss result; wherein the line loss calculation model is trained based on a random forest model of an improved bat algorithm; The first line loss result and the second line loss result are weightedly calculated to obtain the line loss result of the target low-voltage substation.

2. The method according to claim 1, characterized in that: Before reading the electric quantity of the three-phase IoT meter and the electric quantity of each single-phase meter, the method further includes: Acquire original training sample data, and preprocess the original training sample data to obtain a training sample set and a test sample set; Determine the input characteristic value of the random forest model based on the training sample set; wherein the input characteristic value includes: the electrical characteristic value of the target low-voltage area; Initializing the parameters of the improved bat algorithm and the model parameters of the random forest model; wherein the model parameters include at least: the number of decision trees, the depth of the tree, the number of randomly sampled input feature values ​​and the pruning threshold; A decision tree is generated based on the model parameters of the random forest model and the input feature values, a random forest model is constructed, and the parameters of the random forest model are optimized based on the improved bat algorithm until the fitness function of the random forest model meets the preset requirements, thereby obtaining a trained line loss calculation model.

3. The method according to claim 2, characterized in that Optimizing the parameters of the random forest model based on the improved bat algorithm until the fitness function of the random forest model meets the preset requirements, including: Calculating an output result of the random forest model based on the test sample set, and calculating an error value between the output result and the test sample set based on the fitness function; If the error value is within a preset range, a trained line loss calculation model is obtained; If the error value is not within the preset range, the model parameters are updated based on the improved bat algorithm, and the random forest model is reconstructed based on the updated model parameters until the error value is within the preset range.

4. The method according to claim 1, characterized in that: Reading the power of the three-phase IoT meter and the power of each single-phase meter includes: Using the current injection method, construct the topological relationship between the three-phase IoT table and each single-phase table of the target low-voltage area, and synchronize the three-phase IoT table with each single-phase table; The frozen data of the synchronized three-phase IoT meter and each single-phase meter are read to obtain the electric quantity of the three-phase IoT meter and the electric quantity of each single-phase meter.

5. The method according to claim 1, characterized in that The first line loss result and the second line loss result are weightedly calculated to obtain the line loss result of the target low-voltage area, including: Determine a first weight coefficient of the first line loss result and a second weight coefficient of the second line loss result; The line loss result of the target low-voltage area is calculated according to the following formula: E=δ·E 电量计算 +λ·E 数据分析 Where E represents the line loss result, δ represents the first weight coefficient, and E 电量计算 represents the first line loss result, λ represents the second weight coefficient, E 数据分析 Indicates the second line loss result.

6. A device for calculating line loss in a low voltage area, characterized in that: The three-phase IoT meter applied to the target low-voltage area includes: A data reading module, used to read the power of the three-phase IoT meter and the power of each single-phase meter, and to obtain the electrical characteristic quantity of the target low-voltage area; A first line loss calculation module, used to calculate a first line loss result based on the power of the three-phase IoT meter and the power of each single-phase meter; A second line loss calculation module, used for inputting the electrical characteristic quantity into a pre-trained line loss calculation model to obtain a second line loss result; wherein the line loss calculation model is obtained by training a random forest model based on an improved bat algorithm; The line loss result fusion module is used to perform weighted calculation on the first line loss result and the second line loss result to obtain the line loss result of the target low-voltage substation.

7. The device according to claim 6, characterized in that Also includes: Line loss calculation model training module, used for: Acquire original training sample data, and preprocess the original training sample data to obtain a training sample set and a test sample set; Determine the input characteristic value of the random forest model based on the training sample set; wherein the input characteristic value includes: the electrical characteristic value of the target low-voltage area; Initializing the parameters of the improved bat algorithm and the model parameters of the random forest model; wherein the model parameters include at least: the number of decision trees, the depth of the tree, the number of randomly sampled input feature values ​​and the pruning threshold; A decision tree is generated based on the model parameters of the random forest model and the input feature values, a random forest model is constructed, and the parameters of the random forest model are optimized based on the improved bat algorithm until the fitness function of the random forest model meets the preset requirements, thereby obtaining a trained line loss calculation model.

8. The device according to claim 7, characterized in that The line loss calculation model training module is specifically used for: Calculating an output result of the random forest model based on the test sample set, and calculating an error value between the output result and the test sample set based on the fitness function; If the error value is within a preset range, a trained line loss calculation model is obtained; If the error value is not within the preset range, the model parameters are updated based on the improved bat algorithm, and the random forest model is reconstructed based on the updated model parameters until the error value is within the preset range.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the steps of the method according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are executed.

Citation Information

Patent Citations

  • Precise wireless sensor network node deployment system

    CN109302715A

  • A big data feature selection method based on an improved bat algorithm

    CN109711373A

  • Electricity larceny prevention analysis method based on Pearson correlation coefficient

    CN112380496A

  • Reference crop evapotranspiration prediction method based on MIV and improved bat algorithm

    CN112801364A

  • Low-voltage transformer area theoretical line loss calculation method based on ensemble learning

    CN113723844A

Cited By

  • Low-voltage transformer area theoretical line loss rate calculation method considering electric energy quality factor

    CN119623674A

  • Low-voltage transformer area line loss diagnosis method, system and device and storage medium

    CN119902005A

  • A low-voltage substation line loss diagnosis method, system, device and storage medium

    CN119902005B