Method and device for establishing harmonic source uncertainty general model

By combining the XGBoost and KDE methods, a general model of harmonic source uncertainty is established, which solves the problem that the existing model cannot reflect the uncertainty of harmonic sources, achieves more accurate harmonic current interval prediction, and supports power grid harmonic analysis and management.

CN120654536APending Publication Date: 2025-09-16CHINA SOUTHERN POWER GRID COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510658173.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

The existing general harmonic source model cannot fully reflect the uncertainty of the harmonic characteristics of the harmonic source, resulting in the inability to flexibly adjust the degree of conservatism and redundancy when assessing harmonic hazards and designing control plans, and its applicability is poor.

Method used

A hybrid interval construction method combining XGBoost and KDE is adopted. The data is sampled from the harmonic source port and divided into training set, validation set and test set after normalization. An XGBoost-based harmonic source deterministic model is established. KDE is used to fit the prediction error distribution, and the prediction error interval under the confidence level is calculated. The prediction interval results of harmonic current are obtained by combining the test set.

Benefits of technology

It can more accurately reflect the uncertainty of harmonic characteristics of harmonic sources, improve the prediction effect of harmonic current interval, and better support power grid harmonic analysis and control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654536A_ABST
    Figure CN120654536A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of power grid harmonic source modeling, in particular to a harmonic source uncertainty general model building method and device, and the method comprises the steps: sampling and collecting harmonic data at a harmonic source port, and carrying out the normalization processing of a harmonic data set; establishing a harmonic source deterministic general model based on XGBoost, and obtaining a prediction error of the verification set; fitting prediction error distribution of the verification set by using a KDE method, and calculating upper and lower bounds of a prediction error interval under a specified confidence level through a cumulative distribution function; inputting the test set into an established XGBoost-based harmonic source deterministic universal model, obtaining a predicted value of harmonic current, and calculating a harmonic current prediction interval result in combination with a prediction error interval; and evaluating the interval prediction result of the harmonic source uncertainty general model based on the XGBoost-KDE. The method can describe the uncertainty of the harmonic characteristics of the harmonic source, and provides powerful support for power grid harmonic analysis and treatment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of power grid harmonic source modeling, and in particular relates to a method and device for establishing a universal harmonic source uncertainty model. Background Art

[0002] With the continuous development of the national economy and the acceleration of industrialization, an increasing number of power electronics harmonic sources (such as photovoltaic power plants and wind power plants) and nonlinear load harmonic sources (such as arc furnaces) are being connected to the power grid. This has led to increasingly serious harmonic pollution problems, threatening the security of the power grid and the normal operation of electrical equipment. To effectively analyze and manage harmonic problems in power systems, appropriate models must be used to characterize the harmonic emission characteristics of harmonic sources. However, the harmonic sources in power systems are numerous, with varying structural parameters and harmonic generation mechanisms. Therefore, in-depth analysis of the harmonic emission characteristics of a specific type of harmonic source and the establishment of a precise model for it are not only inefficient but also lack applicability. Therefore, universal models have become a research focus in the field of harmonic source modeling.

[0003] Universal models can only describe harmonic characteristics based on the electrical properties shared by all harmonic sources. However, there are many types of harmonic sources, and their harmonic properties are affected by different physical quantities. For example, the harmonic characteristics of inverters are related to dead time, and the harmonic characteristics of arc furnaces are closely related to the physical properties of the arc. The harmonic current values ​​calculated by existing universal harmonic source models are all precise values. If the universal harmonic source model only uses precise values ​​to describe the harmonic characteristics of the harmonic source, it will not be able to fully reflect the uncertainty of the harmonic source characteristics caused by unaccounted physical factors, nor will it be able to reflect potential estimation biases. This makes it impossible to flexibly adjust the degree of conservatism and redundancy of the actual system when assessing harmonic hazards and designing control solutions. Therefore, it is necessary to establish a universal model of harmonic source uncertainty to more comprehensively describe the uncertainty of the harmonic characteristics of harmonic sources and provide strong support for power grid harmonic analysis and control. Summary of the Invention

[0004] The present invention provides a method and device for establishing a universal harmonic source uncertainty model, which is used to address the defect in the prior art that when evaluating harmonic hazards and designing control solutions, it is impossible to flexibly adjust according to the conservatism and redundancy of the actual system. This method can fully describe the uncertainty of the harmonic characteristics of the harmonic source and provide strong support for power grid harmonic analysis and control.

[0005] The present invention provides a method for establishing a universal model of harmonic source uncertainty, comprising the following steps: Sampling and collecting harmonic voltage and harmonic current data at the harmonic source port; The collected data are normalized to obtain a dataset, which is then randomly divided into a training set, a validation set, and a test set; According to the universal modeling method of harmonic sources, a deterministic universal model of harmonic sources based on XGBoost is established using the training set and validation set, and the prediction error of the validation set is obtained; Use the KDE method to fit the prediction error distribution of the validation set, and calculate the upper and lower bounds of the prediction error interval under the specified confidence level through the cumulative distribution function; The test set is input into the established deterministic general model of harmonic sources based on the extreme gradient boosting algorithm to obtain the predicted value of the harmonic current, and the final harmonic current prediction interval result is calculated in combination with the prediction error interval; According to the interval prediction evaluation index, the interval prediction results of the harmonic source uncertainty general model based on XGBoost-KDE are evaluated.

[0006] According to a method for establishing a universal harmonic source uncertainty model provided by the present invention, the normalization processing of harmonic data specifically includes: use min-max The normalization method preprocesses the feature data. The expression of the normalization method is:

[0007] Where, is the original data; is the normalized data; is the minimum value of the original data; is the maximum value of the original data.

[0008] According to a method for establishing a harmonic source uncertainty universal model provided by the present invention, the specific implementation method of establishing a harmonic source deterministic universal model based on XGBoost using a training set and a validation set according to the harmonic source universal modeling method, and obtaining the prediction error of the validation set is as follows: 1) The general modeling method of harmonic sources is expressed by the following formula:

[0009] Where, h Expressed as harmonic order; The first harmonic source h Subharmonic current; is the fundamental voltage of the harmonic source and h Subharmonic voltage; C is the load characteristic parameter; 2) The establishment of a deterministic general harmonic source model based on XGBoost includes the following steps: Taking the harmonic voltage and load characteristic parameters as the input variables of the model and the harmonic current as the output variables, XGBoost is used to mine the nonlinear mapping relationship between the input and output variables to build a deterministic model of the harmonic source, thereby achieving accurate point prediction of each harmonic current; XGBoost for n samples, each sample has m The training set of features ( x i , y i ), i =1, 2,…, n , x i ∈R m , y i ∈R; the prediction output of XGBoost is expressed as:

[0010] Where, For the input i samples; For the i The predicted output of samples; Expressed as k The output of a CART regression tree (Classification and Regression Tree classification regression tree algorithm); is the function space F A function in F Represents the set of all possible CART regression trees; The objective function of XGBoost is:

[0011]

[0012] Where, Is the loss function, whose value is the predicted value With actual value The error between Ω( f k ) is a regular term used to suppress complexity and prevent overfitting; T is the number of leaf nodes; is the leaf node weight; and is the penalty coefficient; The XGBoost-based harmonic source deterministic model was trained using the training set. The mean absolute percentage error (MAPE) between the predicted and actual values ​​was then calculated using the validation set as a performance evaluation metric. Model hyperparameters were continuously adjusted and optimized based on this evaluation metric. Model training was considered complete when the number of iterations reached 30, and the final model was constructed using the optimal hyperparameters. 3) The prediction error of the validation set is expressed as: The absolute error between the actual value and the predicted value of harmonic current is calculated as follows:

[0013] Where, Indicates the i The point prediction error of samples is Indicates the i The prediction results of harmonic current points of samples are: It represents the i The true value of the harmonic current of each sample.

[0014] According to a general method for establishing a harmonic source uncertainty model provided by the present invention, the prediction error distribution of the validation set is fitted using the KDE method, and the upper and lower bounds of the prediction error interval at a specified confidence level are calculated using the cumulative distribution function. Specifically, the following are included: The KDE method is used to fit the prediction error of the validation set, and the obtained probability density function expression is:

[0015] Where, is the number of samples of prediction error; h is the bandwidth of the kernel function; is the kernel function; right Integrate to get the cumulative distribution function , calculated by the inverse function of the probability distribution function at the confidence level The upper and lower bounds of the lower forecast error interval are calculated as follows:

[0016] Where, for The inverse function of and are the lower and upper bounds of the forecast error interval, respectively.

[0017] According to a method for establishing a harmonic source uncertainty universal model provided by the present invention, the test set is input into the established harmonic source deterministic universal model based on the extreme gradient boosting algorithm to obtain the predicted value of the harmonic current, and the specific calculation formula for calculating the final harmonic current prediction interval result in combination with the prediction error interval is as follows:

[0018] Where, and In the test set, they are i The upper and lower bounds of the harmonic current interval estimation range of samples; For the test set i The predicted value of harmonic current point of each sample.

[0019] According to a method for establishing a universal model of harmonic source uncertainty provided by the present invention, the interval prediction results of the universal model of harmonic source uncertainty based on XGBoost-KDE are evaluated according to the interval prediction evaluation index, specifically comprising: The accuracy of the model interval prediction results is evaluated using two evaluation indicators: interval coverage ratio (PICP) and prediction interval normalized width (PINAW). The interval coverage is defined as the ratio of the true value of the harmonic current falling within the model output interval. The calculation expression is:

[0020]

[0021] Where, N is the sample size; up i 、 low i They are i The lower and upper bounds of the samples; k i The model's i Whether the true value is within the model output range; The normalized width of the prediction interval is expressed as the average distance between the upper and lower bounds of the prediction interval, and the calculation expression is:

[0022] Where, R = x max x min It is the difference between the maximum and minimum true values.

[0023] The present invention also provides a device for establishing a universal model of harmonic source uncertainty, comprising: a data acquisition module, a data processing module, a modeling module, an error prediction module, a calculation module and an evaluation module; The data acquisition module is used to sample and collect harmonic voltage and harmonic current data at the harmonic source port; The data processing module is used to normalize the collected data to obtain a data set, and randomly divide the data set into a training set, a validation set, and a test set; According to the universal modeling method of harmonic sources, a deterministic universal model of harmonic sources based on XGBoost is established using the training set and validation set, and the prediction error of the validation set is obtained; The modeling module is used to fit the prediction error distribution of the validation set using the KDE method, and calculate the upper and lower bounds of the prediction error interval under the specified confidence level through the cumulative distribution function; The calculation module is used for error prediction. The module is used to input the test set into the established harmonic source deterministic general model based on the extreme gradient boosting algorithm to obtain the predicted value of the harmonic current and calculate the final harmonic current prediction interval result in combination with the prediction error interval; The evaluation module is used to evaluate the interval prediction results of the harmonic source uncertainty general model based on XGBoost-KDE according to the interval prediction evaluation index.

[0024] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for establishing a general harmonic source uncertainty model as described above is implemented.

[0025] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for establishing a general harmonic source uncertainty model as described in any one of the above is implemented.

[0026] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-mentioned methods for establishing a universal harmonic source uncertainty model.

[0027] Compared with the existing technology, the beneficial effect is: the present invention adopts a hybrid interval construction method combining XGBoost and KDE to establish a general model of harmonic source uncertainty, thereby realizing the interval prediction of harmonic current. Compared with the existing harmonic source uncertainty modeling method, the interval prediction effect of the method of the present invention is better and can better reflect the uncertainty of the harmonic characteristics of the harmonic source. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0029] Figure 1 1. It is a schematic diagram of a modeling process of a method for establishing a general harmonic source uncertainty model provided by an embodiment of the present invention; Figure 2 This is a comparison diagram of interval predictions of two power electronic harmonic source models provided in the first embodiment of the present invention; Figure 3 This is a comparison chart of interval predictions of two arc furnace harmonic source models provided in the second embodiment of the present invention; Figure 4 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0030] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0031] This embodiment is achieved through the following technical solutions: Figure 1 As shown in FIG, a general method for establishing a harmonic source uncertainty model is shown in FIG. The specific steps are as follows: Step 1: Sample and collect the data of harmonic voltage and harmonic current at the harmonic source port, process the data using the normalization method, and randomly divide the processed data set into training set, validation set, and test set.

[0032] Then use min-max The normalization method preprocesses the feature data. The expression of the normalization method is:

[0033] Where, is the original data; is the normalized data; is the minimum value of the original data; is the maximum value of the original data.

[0034] Step 2: Based on the universal modeling method for harmonic sources, a universal deterministic model of harmonic sources based on the extreme gradient boosting algorithm (XGBoost) is established using the training set and the validation set, and the prediction error of the validation set is obtained.

[0035] The general model establishment method of harmonic source can be expressed by the following formula:

[0036] Where, h Expressed as harmonic order; The first harmonic source h Subharmonic current; is the fundamental voltage of the harmonic source and h Subharmonic voltage; C is the load characteristic parameter.

[0037] Taking the harmonic voltage and load characteristic parameters as the input variables of the model, and the harmonic current as the output variable of the model, the XGBoost algorithm is used to mine the nonlinear mapping relationship between the input variables and the output variables, and a deterministic model of the harmonic source is constructed, thereby achieving accurate point prediction of each harmonic current.

[0038] The XGBoost algorithm is a machine learning algorithm used to solve regression prediction problems. n samples, each sample has m The training set of features ( x i , y i ), i =1, 2,…, n , x i ∈R m , y i ∈R. The prediction output of XGBoost is expressed as:

[0039] Where, For the input i samples; For the i The predicted output of samples; Expressed as k The output of a CART regression tree; is the function space F A function in F Represents the set of all possible CART regression trees.

[0040] The objective function of XGBoost is:

[0041]

[0042] Where, Is the loss function, whose value is the predicted value With actual value The error between Ω( f k ) is a regular term used to suppress complexity and prevent overfitting; T is the number of leaf nodes; is the leaf node weight; and is the penalty coefficient.

[0043] The XGBoost-based harmonic source deterministic model was trained using the training set. The mean absolute percentage error (MAPE) between the predicted and actual values ​​was then calculated on the validation set, serving as a performance metric. Model hyperparameters were continuously adjusted and optimized based on this metric. Model training was considered complete when 30 iterations were reached, and the final model was constructed using the optimal hyperparameters.

[0044] Step 3: Use the kernel density estimation (KDE) method to fit the prediction error distribution of the validation set, and calculate the upper and lower bounds of the prediction error interval at the specified confidence level through the cumulative distribution function.

[0045] The prediction error of the validation set is the absolute error between the actual value and the predicted value of the harmonic current, and the calculation formula is as follows:

[0046] Where, Indicates the i The point prediction error of samples is Indicates the i The prediction results of harmonic current points of samples are: It represents the i The true value of the harmonic current of each sample.

[0047] The kernel density estimation method is used to fit the prediction error of the validation set, and the obtained probability density function expression is:

[0048] Where, is the number of samples of prediction error; h is the bandwidth of the kernel function; is the kernel function.

[0049] right Integrate to get the cumulative distribution function , calculated by the inverse function of the probability distribution function at the confidence level The upper and lower bounds of the lower forecast error interval. The upper and lower bounds of the forecast error interval are calculated as follows:

[0050] Where, for The inverse function of and are the lower and upper bounds of the prediction error interval respectively; Step 4: Input the test set into the established XGBoost-based harmonic source deterministic general model to obtain the predicted value of the harmonic current, and calculate the final harmonic current prediction interval result in combination with the prediction error interval.

[0051] The test set is input into the established XGBoost harmonic source deterministic model to perform deterministic point prediction on the harmonic current. The deterministic point prediction result is superimposed with the prediction error interval to obtain the harmonic current prediction interval under the predetermined confidence level. The specific calculation formula is as follows:

[0052] Where, and In the test set, they are i The upper and lower bounds of the harmonic current interval estimation range of samples; For the test set i The predicted value of harmonic current point of each sample.

[0053] Step 5: Evaluate the interval prediction results of the harmonic source uncertainty general model based on XGBoost-KDE according to the interval prediction evaluation index.

[0054] The accuracy of the model interval prediction results is evaluated using two evaluation indicators: Prediction Interval Coverage Probability (PICP) and prediction interval normalized width PINAW.

[0055] The interval coverage is defined as the proportion of the true value of the harmonic current that falls within the model output interval. The higher the coverage, the more actual harmonic current values ​​are included, the better the effect, and the more reliable the interval prediction results of the model. The calculation expression is:

[0056]

[0057] Where, N is the sample size; up i 、 low i They are i The lower and upper bounds of the samples; k i The model's i Whether the true value is within the model output interval.

[0058] The normalized width of the prediction interval is expressed as the average distance between the upper and lower bounds of the prediction interval, reflecting the accuracy of the prediction interval. The smaller the result, the more information and practical value it can provide. The calculation expression is:

[0059] Where, R = x max x min It is the difference between the maximum and minimum true values.

[0060] In order to verify the versatility and effectiveness of the present invention in harmonic source uncertainty modeling, this paper selects power electronic harmonic sources and arc furnace harmonic sources as research objects, and conducts case analysis based on measured data and simulation data respectively.

[0061] Two application cases are provided below: In the following application cases, the data of harmonic voltage and harmonic current are all frequency domain harmonic data at the harmonic source port, the harmonic data sampling period is 1 second, the sampling time is 1000 seconds, and the sampling frequency is 5000HZ. All sampled data constitute a data set.

[0062] The normalized dataset is randomly divided into training set, validation set and test set. The division ratio of the dataset is 7:2:1. The number of samples in the training set is 700, the number of samples in the validation set is 200, and the number of samples in the test set is 100.

[0063] Application Case 1: To verify the effectiveness of this invention for power electronics harmonic sources, a photovoltaic power station was used as the research object. Sampling points were located on the high-voltage side of the transformer at the grid connection point of the photovoltaic power station. 1000 sets of sample data were collected at these sampling points. The 5th harmonic content was relatively high at these sampling points, so the 5th harmonic current was used as the model output. The model inputs were the 1st, 5th, 7th, 11th, and 13th harmonic voltages, active power, and reactive power. With a confidence interval of 95%, XGBoost-KDE and the existing Gaussian Process Regression (GPR) method were used for modeling. The accuracy of the interval prediction results of the two models was evaluated using the interval coverage and normalized prediction interval width evaluation metrics.

[0064] The calculation results of the two evaluation indicators are: the PICP value of XGBoost-KDE is 0.95, the PINAW value is 0.217, while the PICP value of GPR is 0.94, and the PINAW value is 0.299. This shows that XGBoost-KDE has a better interval prediction effect. Not only is the interval coverage higher, but the width of the prediction interval is also smaller.

[0065] In order to more clearly present the accuracy of the interval prediction results of the two power electronic harmonic source models, 20 samples are randomly selected from the test set results of the two models for display. The comparison results between the interval prediction results of the two models and the true values ​​of the harmonic current are shown in the following figure. Figure 2 As shown, it can be seen that the interval prediction width of the XGBoost-KDE model is smaller, indicating that the prediction performance of the model proposed in the present invention is better.

[0066] Application Case 2: To verify the feasibility of applying this invention to an arc furnace harmonic source, an AC arc furnace load was established using the Matlab / Simulink simulation platform. Data sampling was performed on the high-voltage side of the arc furnace transformer. To simulate actual conditions, the grid voltage was set to a baseline value of 110 kV, the fundamental voltage ranged from 0.97 to 1.03, and the distortion ratio of each harmonic voltage ranged from 0.99 to 1.01. 1,000 sets of sample data were randomly selected for modeling. The arc furnace simulation model assumes a stable load characteristic, so the harmonic source model does not consider the influence of load characteristic parameters. The model inputs are the 1st, 3rd, 5th, 7th, and 9th harmonic voltages, and the model output is the 5th harmonic current. A confidence interval of 95% was set, and modeling was performed using XGBoost-KDE and existing Gaussian process regression methods. The accuracy of the interval prediction results of the two models was evaluated using the interval coverage and normalized prediction interval width evaluation metrics.

[0067] The calculation results of the two evaluation indicators are: the PICP value of XGBoost-KDE is 0.96, the PINAW value is 0.329, while the PICP value of GPR is 0.94, and the PINAW value is 0.456. It can be seen that the evaluation indicators of interval coverage and prediction interval width of the XGBoost-KDE model are better than those of GPR.

[0068] In order to more clearly show the accuracy of the interval prediction results of the two arc furnace harmonic source models, 20 samples are randomly selected from the test set results of the two models for display. The comparison results between the interval prediction results of the two models and the true values ​​of the harmonic current are shown in the figure below. Figure 3 As shown, it can be seen that the interval prediction width of the XGBoost-KDE model is smaller, indicating that the model proposed in the present invention can better reflect uncertainty.

[0069] The following describes a device for establishing a universal model of harmonic source uncertainty provided by the present invention, which includes: a data acquisition module, a data processing module, a modeling module, an error prediction module, a calculation module, and an evaluation module; The data acquisition module is used to sample and collect harmonic voltage and harmonic current data at the harmonic source port; The data processing module is used to normalize the collected data to obtain a data set, and randomly divide the data set into a training set, a validation set, and a test set; According to the universal modeling method of harmonic sources, a deterministic universal model of harmonic sources based on XGBoost is established using the training set and validation set, and the prediction error of the validation set is obtained; The modeling module is used to fit the prediction error distribution of the validation set using the KDE method, and calculate the upper and lower bounds of the prediction error interval under the specified confidence level through the cumulative distribution function; The calculation module is used for error prediction. The module is used to input the test set into the established harmonic source deterministic general model based on the extreme gradient boosting algorithm to obtain the predicted value of the harmonic current and calculate the final harmonic current prediction interval result in combination with the prediction error interval; The evaluation module is used to evaluate the interval prediction results of the harmonic source uncertainty general model based on XGBoost-KDE according to the interval prediction evaluation index. The apparatus for establishing a harmonic source uncertainty general model described below and the method for establishing a harmonic source uncertainty general model described above can be used in conjunction with each other.

[0070] Figure 4 An example of a physical structure diagram of an electronic device is shown below. Figure 4As shown, the electronic device may include: a processor, a communications interface, a memory, and a communications bus, wherein the processor, the communications interface, and the memory communicate with each other via the communications bus. The processor may invoke logic instructions in the memory to execute the method for establishing a universal harmonic source uncertainty model.

[0071] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.

[0072] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the method of establishing a general model of harmonic source uncertainty provided by the above methods.

[0073] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the method for establishing a general harmonic source uncertainty model provided by the above methods.

[0074] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0075] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for establishing a universal model of harmonic source uncertainty, characterized in that: The following steps are involved: Sampling and collecting harmonic voltage and harmonic current data at the harmonic source port; The collected data are normalized to obtain a dataset, which is then randomly divided into a training set, a validation set, and a test set; According to the universal modeling method of harmonic sources, a deterministic universal model of harmonic sources based on XGBoost is established using the training set and validation set, and the prediction error of the validation set is obtained; Use the KDE method to fit the prediction error distribution of the validation set, and calculate the upper and lower bounds of the prediction error interval under the specified confidence level through the cumulative distribution function; The test set is input into the established deterministic general model of harmonic sources based on the extreme gradient boosting algorithm to obtain the predicted value of the harmonic current, and the final harmonic current prediction interval result is calculated in combination with the prediction error interval; According to the interval prediction evaluation index, the interval prediction results of the harmonic source uncertainty general model based on XGBoost-KDE are evaluated.

2. The method for establishing a universal harmonic source uncertainty model according to claim 1, characterized in that: The normalization processing of the harmonic data specifically includes: use min-max The normalization method preprocesses the feature data. The expression of the normalization method is: Where, is the original data; is the normalized data; is the minimum value of the original data; is the maximum value of the original data.

3. The method for establishing a universal harmonic source uncertainty model according to claim 1, characterized in that: The specific implementation method of establishing a harmonic source deterministic universal model based on XGBoost using the training set and the validation set according to the harmonic source universal modeling method and obtaining the prediction error of the validation set is as follows: 1) The general modeling method of harmonic sources is expressed by the following formula: Where, h Expressed as harmonic order; The first harmonic source h Subharmonic current; is the fundamental voltage of the harmonic source and h Subharmonic voltage; C is the load characteristic parameter; 2) The establishment of a deterministic general harmonic source model based on XGBoost includes the following steps: Taking the harmonic voltage and load characteristic parameters as the input variables of the model and the harmonic current as the output variables, XGBoost is used to mine the nonlinear mapping relationship between the input and output variables to build a deterministic model of the harmonic source, thereby achieving accurate point prediction of each harmonic current; XGBoost for n samples, each sample has m The training set of features ( x i , y i ), i =1, 2,…, n , x i ∈R m , y i ∈R; the prediction output of XGBoost is expressed as: Where, For the input i samples; For the i The predicted output of samples; Expressed as k The output of a CART regression tree; is the function space F A function in F Represents the set of all possible CART regression trees; The objective function of XGBoost is: Where, Is the loss function, whose value is the predicted value With actual value The error between Ω( f k ) is a regular term used to suppress complexity and prevent overfitting; T is the number of leaf nodes; is the leaf node weight; and is the penalty coefficient; The XGBoost-based harmonic source deterministic model was trained using the training set. The mean absolute percentage error (MAPE) between the predicted and actual values ​​was then calculated using the validation set as a performance evaluation metric. Model hyperparameters were continuously adjusted and optimized based on this evaluation metric. Model training was considered complete when 30 iterations were reached, and the final model was constructed using the optimal hyperparameters. 3) The prediction error of the validation set is expressed as: The absolute error between the actual value and the predicted value of harmonic current is calculated as follows: Where, Indicates the i The point prediction error of samples is Indicates the i The prediction results of harmonic current points of samples are: It represents the i The true value of the harmonic current of each sample.

4. The method for establishing a universal harmonic source uncertainty model according to claim 1, characterized in that: The KDE method is used to fit the prediction error distribution of the validation set, and the upper and lower bounds of the prediction error interval at the specified confidence level are calculated by the cumulative distribution function. Specifically, The KDE method is used to fit the prediction error of the validation set, and the obtained probability density function expression is: Where, is the number of samples of prediction error; h is the bandwidth of the kernel function; is the kernel function; right Integrate to get the cumulative distribution function , calculated by the inverse function of the probability distribution function at the confidence level The upper and lower bounds of the lower forecast error interval are calculated as follows: Where, for The inverse function of and are the lower and upper bounds of the forecast error interval, respectively.

5. The method for establishing a universal harmonic source uncertainty model according to claim 1, characterized in that: The test set is input into the established harmonic source deterministic general model based on the extreme gradient boosting algorithm to obtain the predicted value of the harmonic current, and the specific calculation formula for calculating the final harmonic current prediction interval result in combination with the prediction error interval is as follows: Where, and In the test set, they are i The upper and lower bounds of the harmonic current interval estimation range of samples; For the test set i The predicted value of harmonic current point of each sample.

6. The method for establishing a universal model of harmonic source uncertainty according to claim 1, characterized in that: The evaluation of the interval prediction results of the harmonic source uncertainty general model based on XGBoost-KDE according to the interval prediction evaluation index specifically includes: The accuracy of the model interval prediction results is evaluated using two evaluation indicators: interval coverage and normalized prediction interval width; The interval coverage is defined as the ratio of the true value of the harmonic current falling within the model output interval. The calculation expression is: Where, N is the sample size; up i 、 low i They are i The lower and upper bounds of the samples; k i The model's i Whether the true value is within the model output range; The normalized width of the prediction interval is expressed as the average distance between the upper and lower bounds of the prediction interval, and the calculation expression is: Where, R = x max x min It is the difference between the maximum and minimum true values.

7. A device for establishing a universal model of harmonic source uncertainty, characterized in that: The method for establishing a universal harmonic source uncertainty model as claimed in claims 1 to 6 comprises: a data acquisition module, a data processing module, a modeling module, an error prediction module, a calculation module and an evaluation module; The data acquisition module is used to sample and collect harmonic voltage and harmonic current data at the harmonic source port; The data processing module is used to normalize the collected data to obtain a data set, and randomly divide the data set into a training set, a validation set, and a test set; According to the universal modeling method of harmonic sources, a deterministic universal model of harmonic sources based on XGBoost is established using the training set and validation set, and the prediction error of the validation set is obtained; The modeling module is used to fit the prediction error distribution of the validation set using the KDE method, and calculate the upper and lower bounds of the prediction error interval under the specified confidence level through the cumulative distribution function; The calculation module is used for error prediction. The module is used to input the test set into the established harmonic source deterministic general model based on the extreme gradient boosting algorithm to obtain the predicted value of the harmonic current and calculate the final harmonic current prediction interval result in combination with the prediction error interval; The evaluation module is used to evaluate the interval prediction results of the harmonic source uncertainty general model based on XGBoost-KDE according to the interval prediction evaluation index.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method for establishing a general harmonic source uncertainty model according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the steps of the method for establishing a universal harmonic source uncertainty model as claimed in any one of claims 1 to 6 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the method for establishing a universal harmonic source uncertainty model according to any one of claims 1 to 6 are implemented.