Load loss evaluation method for voltage sag and related device
By analyzing the characteristic data of voltage drop and using a random forest evaluation model for feature optimization and model iterative optimization, the problem of load loss in the prior art that cannot accurately evaluate voltage drop results in the load loss is solved, and more accurate and reliable evaluation results are achieved.
Patent Information
- Application Number
- CN202411752938.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-25
AI Technical Summary
The prior art cannot accurately evaluate the load loss caused by voltage drop, mainly due to the unpredictability of voltage drop and the incompleteness of the detection data.
By analyzing the characteristic data of voltage drop, the trajectory feature vector and the true value of load loss of historical voltage drop events are obtained, and feature optimization and model iterative optimization are used to achieve accurate evaluation of load loss.
Accurate evaluation of load loss caused by voltage drop is achieved, and the accuracy and reliability of evaluation results are improved.
Smart Images

Figure CN119691600A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of load loss assessment, and in particular to a load loss assessment method for voltage sag and related devices. Background Art
[0002] At present, the challenges brought by voltage sags are huge for high-tech industries and industries that are sensitive to power quality, especially in the context of large-scale application of power electronic equipment. Although smart meters and power quality monitoring devices provide rich monitoring data, due to the unpredictability of voltage sags and the varying frequency of occurrence, the detection data cannot directly reflect the load loss of users under different circumstances, resulting in insufficient accuracy of the evaluation results.
[0003] Therefore, how to accurately assess the load loss caused by voltage sag needs to be solved urgently. Summary of the invention
[0004] The embodiment of the present application provides a load loss assessment method for voltage sag and a related device, which analyzes characteristic data of voltage sag and iteratively optimizes the model to achieve accurate assessment of load loss.
[0005] In a first aspect, an embodiment of the present application provides a method for evaluating load loss for voltage sag, the method comprising:
[0006] A first sample set within a preset time period is obtained, and the first sample set is evenly divided into K first subsets; the first sample set includes a plurality of trajectory feature vectors and a plurality of load loss real values corresponding to a plurality of historical voltage sag events; each historical voltage sag event corresponds to a trajectory feature vector and a load loss real value; K is an integer greater than 1;
[0007] Determine a first target model parameter combination according to the K first subsets;
[0008] Determine a first random forest evaluation model according to the first target model parameter combination;
[0009] Performing feature optimization on the first sample set according to the first random forest evaluation model to obtain a second sample set;
[0010] Dividing the second sample set into K second subsets on average, and determining a second target model parameter combination according to the K second subsets;
[0011] Determine a second random forest evaluation model according to the second target model parameter combination;
[0012] A current trajectory feature vector is obtained, and the current trajectory feature vector is input into the second random forest assessment model to obtain a target load loss prediction value; the current trajectory feature vector is a trajectory feature vector corresponding to the current voltage sag event.
[0013] In a second aspect, an embodiment of the present application provides a load loss assessment device for voltage sag, the device comprising an acquisition module, a determination module, an optimization module and an assessment module, wherein:
[0014] The acquisition module is used to acquire a first sample set within a preset time period, and divide the first sample set into K first subsets on average; the first sample set includes a plurality of trajectory feature vectors and a plurality of load loss real values corresponding to a plurality of historical voltage sag events; each historical voltage sag event corresponds to a trajectory feature vector and a load loss real value; K is an integer greater than 1;
[0015] The determination module is used to determine a first target model parameter combination according to the K first subsets; and determine a first random forest evaluation model according to the first target model parameter combination;
[0016] The optimization module is used to perform feature optimization on the first sample set according to the first random forest evaluation model to obtain a second sample set;
[0017] The determination module is used to divide the second sample set into K second subsets on average, and determine a second target model parameter combination according to the K second subsets; and determine a second random forest evaluation model according to the second target model parameter combination;
[0018] The evaluation module is used to obtain a current trajectory feature vector and input the current trajectory feature vector into the second random forest evaluation model to obtain a target load loss prediction value; the current trajectory feature vector is a trajectory feature vector corresponding to a current voltage sag event.
[0019] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps of any method in the first aspect of the embodiment of the present application.
[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in any method of the first aspect of the embodiment of the present application.
[0021] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in any method of the first aspect of the embodiment of the present application. The computer program product may be a software installation package.
[0022] By implementing the embodiments of the present application, the characteristic data of the voltage sag is analyzed, and the model is iteratively optimized to achieve accurate assessment of load loss. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0024] Figure 1 It is a flow chart of a method for evaluating load loss due to voltage sag provided in an embodiment of the present application;
[0025] Figure 2 This is a schematic diagram of a trajectory mutation of a voltage sag event provided in an embodiment of the present application;
[0026] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0027] Figure 4 It is a functional module composition block diagram of a load loss assessment device for voltage sag provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0029] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0030] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article indicates that the associated objects before and after are in an "or" relationship. The "plurality" appearing in the embodiments of the present application refers to two or more.
[0031] In the embodiments of the present application, "at least one item" or similar expressions refer to any combination of these items, including any combination of single items or plural items, and refer to one or more, and multiple refers to two or more. For example, at least one item of a, b, or c can represent the following seven situations: a, b, c, a and b, a and c, b and c, a, b, and c. Among them, each of a, b, and c can be an element or a set containing one or more elements.
[0032] The "connection" that appears in the embodiments of the present application refers to various connection methods such as direct connection or indirect connection to achieve communication between devices, and the embodiments of the present application do not impose any limitations on this.
[0033] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0034] At present, the challenges brought by voltage sags are huge for high-tech industries and industries that are sensitive to power quality, especially in the context of large-scale application of power electronic equipment. Although smart meters and power quality monitoring devices provide rich monitoring data, due to the unpredictability of voltage sags and the varying frequencies of occurrence, the detection data cannot directly reflect the load loss of users under different circumstances, resulting in insufficient accuracy of the evaluation results. Therefore, how to accurately evaluate the load loss caused by voltage sags needs to be solved urgently.
[0035] To solve the above problems, the embodiment of the present application provides a load loss assessment method and related device for voltage sag, obtaining a first sample set within a preset time period, and dividing the first sample set into K first subsets on average; the first sample set includes multiple trajectory feature vectors and multiple load loss real values corresponding to multiple historical voltage sag events; each historical voltage sag event corresponds to a trajectory feature vector and a load loss real value; K is an integer greater than 1; a first target model parameter combination is determined according to the K first subsets; a first random forest assessment model is determined according to the first target model parameter combination; the first sample set is feature optimized according to the first random forest assessment model to obtain a second sample set; the second sample set is evenly divided into K second subsets, and a second target model parameter combination is determined according to the K second subsets; a second random forest assessment model is determined according to the second target model parameter combination; a current trajectory feature vector is obtained, and the current trajectory feature vector is input into the second random forest assessment model to obtain a target load loss prediction value; the current trajectory feature vector is the trajectory feature vector corresponding to the current voltage sag event. Among them, by analyzing the characteristic data of the voltage sag and iteratively optimizing the model, accurate assessment of load loss can be achieved.
[0036] Combine the following Figure 1 A load loss assessment method for voltage sag in an embodiment of the present application is described. Figure 1 : is a flow chart of a method for evaluating load loss due to voltage sag provided in an embodiment of the present application, which specifically includes the following steps:
[0037] Step S101: Acquire a first sample set within a preset time period, and evenly divide the first sample set into K first subsets.
[0038] Among them, the first sample set includes multiple trajectory feature vectors and multiple load loss real values corresponding to multiple historical voltage sag events; each historical voltage sag event corresponds to a trajectory feature vector and a load loss real value; K is an integer greater than 1.
[0039] The step of obtaining the first sample set within a preset time period specifically includes:
[0040] Acquire voltage effective value data and active power data corresponding to a reference voltage sag event; the reference voltage sag event is any one of the multiple historical voltage sag events; process the voltage effective value data and the active power data according to a preset maximum stacking discrete wavelet transform method to obtain multiple first trajectory mutation point coordinates corresponding to the voltage effective value data and multiple second trajectory mutation point coordinates corresponding to the active power data; determine n reference trajectory features corresponding to the reference voltage sag event according to the multiple first trajectory mutation point coordinates and the multiple second trajectory mutation point coordinates; n is a positive integer; determine a reference trajectory feature vector according to the n reference trajectory features; the reference trajectory feature vector is a trajectory feature vector corresponding to the reference voltage sag event among the multiple trajectory feature vectors.
[0041] Specifically, the monitoring data corresponding to the reference voltage event is obtained, and the voltage effective value data and active power data are extracted from the monitoring data. Then, the voltage effective value data and the active power data are processed respectively according to the preset maximum stacking discrete wavelet transform method to obtain the first trajectory corresponding to the voltage effective value data and the second trajectory corresponding to the active power data. The first trajectory is identified and extracted to obtain multiple first trajectory mutation point coordinates, and the second trajectory is identified and extracted to obtain multiple second trajectory mutation point coordinates. Then, the multiple first trajectory mutation point coordinates and the multiple second trajectory mutation point coordinates are calculated according to the preset calculation formula to determine the n reference trajectory features corresponding to the reference voltage sag event. Finally, the reference trajectory feature vector is determined based on the n reference trajectory features.
[0042] It can be seen that by extracting representative feature data from the voltage effective value and active power data and identifying the trajectory mutation points corresponding to the feature data, and then calculating the trajectory features, the effective features in the voltage sag event can be more accurately described, so as to improve the accuracy of the analysis of the voltage sag event.
[0043] For easier understanding, see Figure 2 , Figure 2It is a schematic diagram of trajectory mutation of a voltage sag event provided by an embodiment of the present application, wherein the UT trajectory diagram and the PT trajectory diagram respectively represent the UT trajectory and the PT trajectory of the voltage sag event. In the UT trajectory diagram, the curve U is used to represent the relationship between the effective value of the voltage and time, that is, the UT trajectory, and the curve △ε(U) is used to represent the relationship between the energy difference and time of the UT trajectory, wherein the horizontal axis represents time, the left vertical axis represents the effective value of the voltage, and the right vertical axis represents the energy difference of the UT trajectory. In the PT trajectory diagram, the curve P is used to represent the relationship between the active power and time, that is, the PT trajectory, and the curve △ε(P) is used to represent the relationship between the energy difference and time of the PT trajectory, wherein the horizontal axis represents time, the left vertical axis represents the active power, and the right vertical axis represents the energy difference of the PT trajectory. When the energy difference is significantly reduced, it indicates that the UT trajectory or the PT trajectory undergoes an instantaneous change, and the mutation point coordinates at the corresponding moment are obtained. Among them, the UT trajectory includes four first mutation point coordinates, and the corresponding horizontal coordinates are t u1 -t u4 , the left vertical coordinate is u1-u4, and the PT trajectory also includes four second mutation point coordinates, whose corresponding horizontal coordinate is t p1 -t p4 , the left vertical coordinate is p1-p4. Then, the coordinates of the first mutation point and the second mutation point are calculated according to the preset calculation formula to obtain the six trajectory features corresponding to the voltage sag event. It should be noted that a voltage sag event refers to a voltage drop in the power system to a certain level of the rated value in a short period of time, usually caused by short circuit, equipment failure, grid switching and other reasons. Among them, sensitive loads refer to loads that are particularly sensitive to voltage changes, especially voltage sags, fluctuations and instantaneous interruptions. The sensitive load is generally composed of multiple power electronic devices, whose operation depends on stable voltage and frequency. When a voltage sag event occurs in the power grid, the normal operation of these devices may be affected, resulting in power system shutdown, failure or activation of protection mechanisms.
[0044] Among them, the average voltage drop amplitude (U drop ) is larger, the more loads will be affected by the voltage sag event. The calculation formula is as follows:
[0045]
[0046] Among them, the duration of voltage sag (T duration ) is larger, the more loads will be affected by voltage sag. The calculation formula is as follows:
[0047] T duration =t u4 -t u1
[0048] Among them, the active power change duration (T vary ) represents the duration of time that sensitive loads are affected by a single voltage sag event. vary The longer the voltage sag is, the longer the load will be affected by the voltage sag. The calculation formula is as follows:
[0049] T vary =t p4 -t p1
[0050] Among them, the active power difference before and after the event (P dif ) is related to the loss of sensitive load, and the two are positively correlated. The calculation formula is as follows:
[0051] P dif = p(t p4 +5t cycle )-p1
[0052] Among them, t cycle It is the time of one cycle in the voltage waveform, which is usually 20ms in a 50Hz power system and is not specifically limited here.
[0053] Among them, the average drop amplitude of active power (△P) is related to the proportion of active power of sensitive loads affected by voltage sag to total load, and is defined as follows:
[0054]
[0055] Among them, the active power change delay (T vd ) is positively correlated with the tolerance of trip-sensitive equipment. The calculation formula is as follows:
[0056] T vd =t p1 -t u1
[0057] Next, according to the average voltage drop amplitude (U drop ), voltage sag duration (T duration ), active power change duration (T vary ), the active power difference before and after the event (P dif ), average drop amplitude of active power (△P) and active power change delay (T vd) Determine the six trajectory features corresponding to the voltage sag event and form a trajectory feature vector to represent the change trend of the UT trajectory and the PT trajectory, thereby reflecting the impact of the voltage sag event on the sensitive load. Then, obtain the trajectory feature vectors and the true value of the load loss corresponding to multiple historical voltage sag events within a preset time period, thereby obtaining a first sample set, wherein the preset time period includes but is not limited to one week, one month, and one year, which is not specifically limited here. Finally, divide the first sample into K first subsets on average, and the K first subsets do not intersect with each other.
[0058] Step S102: determining a first target model parameter combination according to the K first subsets.
[0059] The step of determining the first target model parameter combination according to the K first subsets specifically includes:
[0060] Obtain a preset reference model parameter range, and determine multiple model parameter combinations based on the reference model parameter range; determine multiple error averages based on the K first subsets and the multiple model parameter combinations; each model parameter combination corresponds to an error average; obtain the minimum error average among the multiple error averages, and determine the model parameter combination corresponding to the minimum error average as the first target model parameter combination.
[0061] Specifically, multiple model parameter combinations can be generated within a preset reference model parameter range according to a grid search method, a random search method or other methods to cover different regions of the reference model parameter range. Then, the K first subsets are calculated according to each model parameter combination to obtain the corresponding error averages. Finally, among all the calculated error averages, the minimum error average is found, and the model parameter combination corresponding to the error average is determined as the first target model parameter combination, that is, the current optimal model parameter combination.
[0062] It can be seen that by evaluating and selecting the model parameter combination, not only can the accuracy and stability of the model be effectively improved, but also overfitting can be avoided to the greatest extent, ensuring the reliability and generalization ability of the model in practical applications.
[0063] The reference model parameter range includes multiple model parameter ranges, and the steps of obtaining a preset reference model parameter range and determining multiple model parameter combinations according to the reference model parameter range include:
[0064] Each model parameter range in the multiple model parameter ranges is randomly selected to obtain multiple model parameters; each model parameter corresponds to a model parameter range; a first model parameter combination is determined according to the multiple model parameters; the first model parameter combination is any one model parameter combination in the multiple model parameter combinations.
[0065] Specifically, each model parameter range in the multiple model parameter ranges corresponds to a model parameter, for example, the number of decision tree models, the maximum number of node features, and the maximum depth of the decision tree, which are not specifically limited here. Then, a random selection is performed within each model parameter range to obtain multiple model parameters. Finally, the multiple model parameters are combined to obtain a first model parameter combination. It should be noted that multiple model parameter ranges can be randomly sampled multiple times to exhaust all model parameter combinations, so as to facilitate the subsequent finding of the best model parameter combination.
[0066] The step of determining a plurality of error averages according to the K first subsets and the plurality of model parameter combinations comprises:
[0067] Obtain the first model parameter combination; the first model parameter combination includes the number of decision tree models a, the maximum feature number of nodes b, and the maximum depth of the decision tree c; a, b, and c are all positive integers; repeatedly perform a preset random extraction steps on the K first subsets to obtain a first training sets and a first test sets; the first training set includes K-1 first subsets; the first test set includes a first subset other than the K-1 first subsets in the K first subsets; K is greater than or equal to a; train according to each first training set in the a first training sets to obtain a decision tree models; test the a decision tree models according to the a first test sets to obtain a load loss groups; each load loss group includes d load loss prediction values; d is a positive integer; calculate the a load loss groups according to a preset error calculation formula to obtain a first error values; determine the average value of the a first error values as the first error average value; the first error average value is the error average value corresponding to the first model parameter combination among the multiple error average values.
[0068] Specifically, any one model parameter combination can be selected from multiple model parameter combinations as the current model parameter configuration, that is, the first model parameter combination, which includes the number of decision tree models a, the maximum number of node features b, and the maximum depth of the decision tree c. Repeat the preset random extraction step a times for the K first subsets to obtain a first training set and a first test set. Among them, in the random extraction step, K-1 first subsets are selected from the K first subsets as the first training set, and the remaining first subset is used as the first test set. It should be noted that when randomly extracting, the extraction can be performed according to the bagging algorithm, which is not specifically limited here. Then, according to each first training set in the a first training sets, training can be performed to obtain a decision tree model. Each first test set in the a first test sets is tested with its corresponding decision tree model to obtain a load loss group. Each load loss group contains d load loss prediction values, where d is a positive integer, representing the number of load loss prediction values of each decision tree model on the test set. Next, a load loss groups are calculated according to a preset error calculation formula to obtain a first error values. Finally, the average value of the a first error values is determined as the first error average value, that is, the error average value corresponding to the first model parameter combination. Therefore, the error average values corresponding to multiple model parameter combinations can be calculated, which facilitates the subsequent determination of the optimal model parameter combination corresponding to the minimum error average value.
[0069] It should be noted that when constructing each decision tree model, the tree structure of the decision tree model can be constructed according to a top-down greedy algorithm. Among them, corresponding to each decision tree model, the data set is divided into two subsets at each node, and the optimal division point is the s value of the jth feature, then two regions can be obtained, namely data sets M1 and M2. The calculation can be performed according to the preset calculation formula to obtain the optimal division point s while minimizing the error. The calculation formula of the objective function is as follows:
[0070]
[0071] Among them, y i represents the load loss prediction value, m1 and m2 are the average values of the output data in the data sets M1 and M2 respectively. It should be noted that we can first assume that j is determined, then traverse the value s; then traverse j again, and finally find the optimal value pair (j, s) that satisfies the objective function.
[0072] It can be seen that by calculating and selecting multiple model parameter combinations, each model parameter combination is verified on different training sets and test sets, ensuring the generalization ability of the model and effectively optimizing the model selection process. It can not only improve the accuracy, robustness and generalization ability of the model, but also avoid overfitting through multiple verifications, and ultimately help select the optimal model parameter combination.
[0073] The step of calculating the a load loss groups according to a preset error calculation formula to obtain a first error values specifically includes:
[0074] Calculating the a load loss groups according to the error calculation formula to obtain the a first error values;
[0075] The error calculation formula is as follows:
[0076]
[0077] Among them, the E i represents the first error value corresponding to the i-th decision tree model among the a decision tree models; P i,j represents the jth load loss true value corresponding to the i-th load loss group in the a load loss groups; It represents the j-th load loss prediction value corresponding to the ith load loss group among the a load loss groups.
[0078] Step S103: determining a first random forest evaluation model according to the first target model parameter combination.
[0079] Specifically, the first target model parameter combination includes the number of first decision tree models, the maximum number of features of the first node, and the maximum depth of the first decision tree. The number of decision trees in the first random forest evaluation model is determined according to the number of first decision tree models, the maximum number of features considered by each decision tree at each split is determined according to the maximum number of features of the first node, and the maximum depth limit of each decision tree is determined according to the maximum depth of the first decision tree, so as to obtain the first random forest evaluation model.
[0080] Step S104: optimizing the features of the first sample set according to the first random forest evaluation model to obtain a second sample set.
[0081] The step of performing feature optimization on the first sample set according to the first random forest evaluation model to obtain the second sample set specifically includes:
[0082] The multiple trajectory feature vectors and the multiple load loss true values in the first sample set are obtained; each trajectory feature vector includes n trajectory features; the average value of the multiple load loss true values is determined as the reference load loss true value; the multiple trajectory feature vectors are input into the first random forest evaluation model to obtain a reference load loss prediction value; the original error value is determined according to the reference load loss true value and the reference load loss prediction value; the multiple trajectory feature vectors are feature optimized according to the original error value to obtain a target feature set; the target feature set includes at least one trajectory feature among the n trajectory features; the intersection of each trajectory feature vector in the multiple trajectory feature vectors and the target feature set is obtained to obtain multiple target trajectory feature vectors; the second sample set is determined according to the multiple target trajectory feature vectors.
[0083] Specifically, multiple trajectory feature vectors and multiple load loss true values in the first sample set are obtained, each trajectory feature vector contains n trajectory features, and each trajectory feature vector corresponds to a load loss true value, wherein n here can be 6, that is, each trajectory feature vector contains six trajectory features, which is not specifically limited here. Then, the average value of the multiple load loss true values is calculated to obtain the reference load loss true value. Next, the multiple trajectory feature vectors are input into the first random forest evaluation model, and the first random forest evaluation model predicts the load loss according to the multiple trajectory feature vectors to obtain the reference load loss prediction value. Then, the absolute value of the difference between the reference load loss true value and the reference load loss prediction value is calculated to obtain the original error value. Then, the multiple trajectory feature vectors are feature optimized according to the original error value to obtain a target feature set, and the target feature set includes at least one trajectory feature among the n trajectory features. Finally, the intersection of each trajectory feature vector and the target feature set is determined as the target trajectory feature vector, thereby obtaining multiple target trajectory feature vectors, and the second sample set is determined according to the multiple target trajectory feature vectors.
[0084] It can be seen that the prediction accuracy of the model can be effectively improved by optimizing the features and analyzing the model errors. In the feature optimization process, the interference of redundant features is reduced by selecting the features most relevant to the load loss prediction. This not only improves the efficiency of the model, but also avoids the negative impact of feature diversity on the model training process.
[0085] The step of performing feature optimization on the plurality of trajectory feature vectors according to the original error value to obtain a target feature set specifically includes:
[0086] A preset white noise is added to the first trajectory feature of each trajectory feature vector in the multiple trajectory feature vectors to obtain multiple first trajectory feature vectors; the first trajectory feature is any one of the n trajectory features; the multiple first trajectory feature vectors are input into the first random forest assessment model to obtain a first load loss prediction value; a first noise error value is determined according to the reference load loss true value and the first load loss prediction value; a first error change is determined according to the original error value and the first noise error value; if the first error change is greater than or equal to a preset change threshold, the first trajectory feature is determined to be a first target trajectory feature; the first target trajectory feature is any one of the target features in the target feature set; if the first error change is less than the preset change threshold, the first trajectory feature is not added to the target feature set.
[0087] Specifically, any one trajectory feature can be selected from n trajectory features as the first trajectory feature, and then a preset white noise is added to the first trajectory feature of each trajectory feature vector in the multiple trajectory feature vectors to obtain multiple first trajectory feature vectors. Wherein, white noise refers to a random noise with a mean of 0 and a fixed variance, which can simulate various random disturbances, wherein white noise is added to the trajectory feature, that is, a disturbance variable with a mean of 0 and a fixed variance is added to the numerical value of the input trajectory feature. Then, the multiple first trajectory feature vectors are input into the first random forest evaluation model, and the first random forest evaluation model predicts the load loss according to the multiple first trajectory feature vectors, thereby obtaining the first load loss prediction value. Then, the absolute value of the difference between the true value of the reference load loss and the first load loss prediction value is calculated to obtain the first noise error value. Then, the absolute value of the difference between the original error value and the first noise error value is calculated to obtain the first error change. Finally, the preset change threshold is obtained to determine whether the error change is significant. If the first error change is greater than or equal to the change threshold, it is considered that the first trajectory feature has a greater impact on the prediction effect of the model, so it can be considered as an important feature and added to the target feature set. If the first error change is less than the change threshold, it is considered that the first trajectory feature has no significant impact on the prediction effect of the model, the first trajectory feature has a low importance, and the first trajectory feature is not added to the target feature set.
[0088] It can be seen that by eliminating irrelevant or redundant features, not only can the predictive ability of the model be optimized and the risk of overfitting be reduced, but also the robustness, accuracy and efficiency of the model can be improved.
[0089] Step S105: divide the second sample set into K second subsets on average, and determine a second target model parameter combination according to the K second subsets.
[0090] Specifically, the second sample set is evenly divided into K second subsets, and the K second subsets are disjoint. Then, recalculation is performed based on the K second subsets to obtain the average error values corresponding to all model parameter combinations, and the model parameter combination corresponding to the minimum average error value is determined as the second target model parameter combination.
[0091] Step S106, determining a second random forest evaluation model according to the second target model parameter combination.
[0092] Specifically, the second target model parameter combination includes the number of second decision tree models, the maximum number of features of the second nodes, and the maximum depth of the second decision tree. The number of decision trees in the second random forest evaluation model is determined according to the number of second decision tree models, the maximum number of features considered by each decision tree at each split is determined according to the maximum number of features of the second nodes, and the maximum depth limit of each decision tree is determined according to the maximum depth of the second decision tree, so as to obtain the second random forest evaluation model.
[0093] Step S107, obtaining a current trajectory feature vector, and inputting the current trajectory feature vector into the second random forest evaluation model to obtain a target load loss prediction value.
[0094] The current trajectory feature vector is a trajectory feature vector corresponding to the current voltage sag event. The current trajectory feature vector is input into the second random forest assessment model, and the second random forest assessment model predicts the load loss according to the current trajectory feature vector to obtain the target load loss prediction value. It should be noted that the trajectory features in the current trajectory feature vector are consistent with the trajectory features in the target feature set.
[0095] It can be seen that by analyzing the characteristic data of voltage sag and iteratively optimizing the model, accurate assessment of load loss can be achieved.
[0096] Combine the following Figure 3 The electronic device in the embodiment of the present application is described. Figure 3 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 3 As shown, the electronic device includes one or more processors, a memory, a communication interface and one or more programs, and the processor is communicatively connected with the memory and the communication interface via an internal communication bus.
[0097] Among them, the processor is mainly used for:
[0098] A first sample set within a preset time period is obtained, and the first sample set is evenly divided into K first subsets; the first sample set includes multiple trajectory feature vectors and multiple load loss real values corresponding to multiple historical voltage sag events; each historical voltage sag event corresponds to a trajectory feature vector and a load loss real value; K is an integer greater than 1;
[0099] Determine a first target model parameter combination according to the K first subsets;
[0100] Determine a first random forest evaluation model according to the first target model parameter combination;
[0101] Perform feature optimization on the first sample set according to the first random forest evaluation model to obtain a second sample set;
[0102] Dividing the second sample set into K second subsets on average, and determining a second target model parameter combination according to the K second subsets;
[0103] Determining a second random forest evaluation model according to a second target model parameter combination;
[0104] A current trajectory feature vector is obtained, and the current trajectory feature vector is input into a second random forest evaluation model to obtain a target load loss prediction value; the current trajectory feature vector is a trajectory feature vector corresponding to the current voltage sag event.
[0105] The one or more programs are stored in the above-mentioned memory and are configured to be executed by the above-mentioned processor, and the one or more programs include instructions for executing any step in the above-mentioned method embodiment.
[0106] Among them, the processor can be, for example, a central processing unit (CPU), a general processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, units and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like. The communication unit can be a communication interface, a transceiver, a transceiver circuit, etc., and the storage unit can be a memory.
[0107] The memory may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).
[0108] It is understandable that the electronic device may include more or fewer structural elements than those in the above structural block diagram, for example, including a power module, a physical button, a Wi-Fi module, a speaker, a Bluetooth module, a sensor, a display module, etc., which are not limited here. It is understandable that the electronic device may perform the following operations: Figure 1 The steps described.
[0109] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that, in order to realize the above functions, the electronic device includes a hardware structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0110] The embodiment of the present application can divide the electronic device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0111] In the case of dividing each functional module into corresponding functional modules, Figure 4 4 is a functional module composition block diagram of a load loss assessment device for voltage sag provided in an embodiment of the present application. The load loss assessment device 400 for voltage sag includes an acquisition module 410, a determination module 420, an optimization module 430 and an assessment module 440, wherein:
[0112] The acquisition module 410 is used to acquire a first sample set within a preset time period, and divide the first sample set into K first subsets on average; the first sample set includes a plurality of trajectory feature vectors and a plurality of load loss real values corresponding to a plurality of historical voltage sag events; each historical voltage sag event corresponds to a trajectory feature vector and a load loss real value; K is an integer greater than 1;
[0113] The determination module 420 is used to determine a first target model parameter combination according to the K first subsets; and determine a first random forest evaluation model according to the first target model parameter combination;
[0114] The optimization module 430 is used to perform feature optimization on the first sample set according to the first random forest evaluation model to obtain a second sample set;
[0115] The determination module 420 is used to divide the second sample set into K second subsets on average, and determine a second target model parameter combination according to the K second subsets; and determine a second random forest evaluation model according to the second target model parameter combination;
[0116] The evaluation module 440 is used to obtain a current trajectory feature vector and input the current trajectory feature vector into the second random forest evaluation model to obtain a target load loss prediction value; the current trajectory feature vector is a trajectory feature vector corresponding to a current voltage sag event.
[0117] Optionally, in determining the first target model parameter combination according to the K first subsets, the determination module 420 is specifically configured to:
[0118] Acquiring a preset reference model parameter range, and determining a plurality of model parameter combinations according to the reference model parameter range;
[0119] Determine a plurality of error averages according to the K first subsets and the plurality of model parameter combinations; each model parameter combination corresponds to an error average;
[0120] The minimum error average value among the multiple error average values is obtained, and the model parameter combination corresponding to the minimum error average value is determined as the first target model parameter combination.
[0121] Optionally, the reference model parameter range includes multiple model parameter ranges. In the aspect of obtaining a preset reference model parameter range and determining multiple model parameter combinations according to the reference model parameter range, the determination module 420 is further specifically used to:
[0122] Randomly selecting each model parameter range from the multiple model parameter ranges to obtain multiple model parameters; each model parameter corresponds to a model parameter range;
[0123] A first model parameter combination is determined according to the multiple model parameters; the first model parameter combination is any one of the multiple model parameter combinations.
[0124] Optionally, in determining a plurality of error averages according to the K first subsets and the plurality of model parameter combinations, the determination module 420 is further specifically configured to:
[0125] Obtain the first model parameter combination; the first model parameter combination includes the number of decision tree models a, the maximum number of node features b, and the maximum depth of the decision tree c; a, b, and c are all positive integers;
[0126] Repeating a preset random extraction step for the K first subsets to obtain a first training sets and a first test sets; the first training set includes K-1 first subsets; the first test set includes a first subset among the K first subsets except the K-1 first subsets; K is greater than or equal to a;
[0127] Perform training according to each of the a first training sets to obtain a decision tree models;
[0128] The a decision tree models are tested according to the a first test sets to obtain a load loss groups; each load loss group includes d load loss prediction values; d is a positive integer;
[0129] Calculating the a load loss groups according to a preset error calculation formula to obtain a first error values;
[0130] Determine the average value of the a first error values as a first error average value; the first error average value is the error average value corresponding to the first model parameter combination among the multiple error average values.
[0131] Optionally, in the aspect of calculating the a load loss groups according to a preset error calculation formula to obtain a first error values, the determination module 420 is further specifically configured to:
[0132] Calculating the a load loss groups according to the error calculation formula to obtain the a first error values;
[0133] The error calculation formula is as follows:
[0134]
[0135] Among them, the E i represents the first error value corresponding to the i-th decision tree model among the a decision tree models; P i,j represents the jth load loss true value corresponding to the i-th load loss group in the a load loss groups; It represents the j-th load loss prediction value corresponding to the ith load loss group among the a load loss groups.
[0136] Optionally, in the aspect of acquiring the first sample set within a preset time period, the acquiring module 410 is specifically configured to:
[0137] Acquire voltage effective value data and active power data corresponding to a reference voltage sag event; the reference voltage sag event is any one of the multiple historical voltage sag events;
[0138] Processing the voltage effective value data and the active power data according to a preset maximum stacked discrete wavelet transform method to obtain a plurality of first trajectory mutation point coordinates corresponding to the voltage effective value data and a plurality of second trajectory mutation point coordinates corresponding to the active power data;
[0139] Determine n reference trajectory features corresponding to the reference voltage sag event according to the plurality of first trajectory mutation point coordinates and the plurality of second trajectory mutation point coordinates; n is a positive integer;
[0140] A reference trajectory feature vector is determined according to the n reference trajectory features; the reference trajectory feature vector is a trajectory feature vector corresponding to the reference voltage sag event among the multiple trajectory feature vectors.
[0141] Optionally, in the aspect of performing feature optimization on the first sample set according to the first random forest evaluation model to obtain the second sample set, the optimization module 430 is specifically used to:
[0142] Acquire the plurality of trajectory feature vectors and the plurality of load loss true values in the first sample set; each trajectory feature vector includes n trajectory features;
[0143] determining an average value of the plurality of load loss true values as a reference load loss true value;
[0144] Inputting the plurality of trajectory feature vectors into the first random forest assessment model to obtain a reference load loss prediction value;
[0145] Determine an original error value according to the actual value of the reference load loss and the predicted value of the reference load loss;
[0146] Performing feature optimization on the multiple trajectory feature vectors according to the original error value to obtain a target feature set; the target feature set includes at least one trajectory feature among the n trajectory features;
[0147] Obtaining an intersection of each trajectory feature vector in the plurality of trajectory feature vectors and the target feature set to obtain a plurality of target trajectory feature vectors;
[0148] The second sample set is determined according to the multiple target trajectory feature vectors.
[0149] Optionally, in the aspect of performing feature optimization on the plurality of trajectory feature vectors according to the original error value to obtain a target feature set, the optimization module 430 is further specifically configured to:
[0150] Adding a preset white noise to the first trajectory feature of each trajectory feature vector in the plurality of trajectory feature vectors to obtain a plurality of first trajectory feature vectors; the first trajectory feature is any one trajectory feature in the n trajectory features;
[0151] Inputting the plurality of first trajectory feature vectors into the first random forest evaluation model to obtain a first load loss prediction value;
[0152] Determine a first noise error value according to the reference load loss true value and the first load loss prediction value;
[0153] Determine a first error variation according to the original error value and the first noise error value;
[0154] If the first error variation is greater than or equal to a preset variation threshold, the first trajectory feature is determined to be a first target trajectory feature; the first target trajectory feature is any target feature in the target feature set;
[0155] If the first error variation is less than the preset variation threshold, the first trajectory feature is not added to the target feature set.
[0156] It can be seen that by analyzing the characteristic data of voltage sag and iteratively optimizing the model, accurate assessment of load loss can be achieved.
[0157] It should be noted that the specific implementation of each operation can adopt the corresponding description of the method embodiment shown above. The load loss assessment device 400 for voltage sag can be used to execute the above method embodiment of the present application, which will not be described in detail.
[0158] An embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method recorded in the above method embodiments, and the above computer includes an electronic device.
[0159] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.
[0160] It should be noted that, for the above-mentioned various embodiments, for the sake of simple description, they are all expressed as a series of action combinations. Those skilled in the art should be aware that the present application is not limited by the described order of actions, because some steps in the embodiments of the present application can be performed in other orders or simultaneously. In addition, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions, steps, modules or units involved are not necessarily required by the embodiments of the present application.
[0161] In the above embodiments, the embodiments of the present application have different focuses on the description of each embodiment. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0162] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0163] The steps of the method or algorithm described in the embodiments of the present application can be implemented in hardware or by executing software instructions by a processor. The software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM, flash memory, ROM, EPROM, electrically erasable programmable read-only memory (electrically EPROM, EEPROM), registers, hard disks, mobile hard disks, read-only compact disks (CD-ROMs) or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a terminal device or a management device. Of course, the processor and the storage medium can also be present in a terminal device or a management device as discrete components.
[0164] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server, or data center to another website site, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0165] The modules / units included in the devices and products described in the above embodiments may be software modules / units or hardware modules / units, or may be partially software modules / units and partially hardware modules / units. For example, for the devices and products applied to or integrated in the chip, the modules / units included therein may all be implemented in the form of hardware such as circuits, or at least some of the modules / units may be implemented in the form of software programs, which run on the processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits; for the devices and products applied to or integrated in the chip module, the modules / units included therein may all be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component (such as a chip, circuit module, etc.) or in different components of the chip module, or at least some of the modules / units may be implemented in the form of software programs. The software programs run on the processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits. It is implemented in the form of a software program, which runs on a processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in hardware such as circuits; for various devices and products applied to or integrated in the terminal equipment, the various modules / units contained therein can be implemented in hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or in different components in the terminal equipment, or, at least some modules / units can be implemented in the form of a software program, which runs on a processor integrated inside the terminal equipment, and the remaining (if any) modules / units can be implemented in hardware such as circuits.
[0166] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above description is only the specific implementation method of the embodiments of the present application and is not intended to limit the protection scope of the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.
Claims
1. A method for evaluating load loss due to voltage sag, characterized in that: The method comprises: A first sample set within a preset time period is obtained, and the first sample set is evenly divided into K first subsets; the first sample set includes a plurality of trajectory feature vectors and a plurality of load loss real values corresponding to a plurality of historical voltage sag events; each historical voltage sag event corresponds to a trajectory feature vector and a load loss real value; K is an integer greater than 1; Determine a first target model parameter combination according to the K first subsets; Determine a first random forest evaluation model according to the first target model parameter combination; Performing feature optimization on the first sample set according to the first random forest evaluation model to obtain a second sample set; Dividing the second sample set into K second subsets on average, and determining a second target model parameter combination according to the K second subsets; Determine a second random forest evaluation model according to the second target model parameter combination; A current trajectory feature vector is obtained, and the current trajectory feature vector is input into the second random forest assessment model to obtain a target load loss prediction value; the current trajectory feature vector is a trajectory feature vector corresponding to the current voltage sag event.
2. The method according to claim 1, characterized in that The determining a first target model parameter combination according to the K first subsets includes: Acquiring a preset reference model parameter range, and determining a plurality of model parameter combinations according to the reference model parameter range; Determine a plurality of error averages according to the K first subsets and the plurality of model parameter combinations; each model parameter combination corresponds to an error average; The minimum error average value among the multiple error average values is obtained, and the model parameter combination corresponding to the minimum error average value is determined as the first target model parameter combination.
3. The method according to claim 2, characterized in that The reference model parameter range includes a plurality of model parameter ranges, and the obtaining of a preset reference model parameter range and determining a plurality of model parameter combinations according to the reference model parameter range includes: Randomly selecting each model parameter range from the multiple model parameter ranges to obtain multiple model parameters; each model parameter corresponds to a model parameter range; A first model parameter combination is determined according to the multiple model parameters; the first model parameter combination is any one of the multiple model parameter combinations.
4. The method according to claim 3, characterized in that The step of determining a plurality of error averages according to the K first subsets and the plurality of model parameter combinations comprises: Obtain the first model parameter combination; the first model parameter combination includes the number of decision tree models a, the maximum number of node features b, and the maximum depth of the decision tree c; a, b, and c are all positive integers; Repeating a preset random extraction step for the K first subsets to obtain a first training sets and a first test sets; the first training set includes K-1 first subsets; the first test set includes a first subset among the K first subsets except the K-1 first subsets; K is greater than or equal to a; Perform training according to each of the a first training sets to obtain a decision tree models; The a decision tree models are tested according to the a first test sets to obtain a load loss groups; each load loss group includes d load loss prediction values; d is a positive integer; Calculating the a load loss groups according to a preset error calculation formula to obtain a first error values; Determine the average value of the a first error values as a first error average value; the first error average value is the error average value corresponding to the first model parameter combination among the multiple error average values.
5. The method according to claim 4, characterized in that The step of calculating the a load loss groups according to a preset error calculation formula to obtain a first error values includes: Calculating the a load loss groups according to the error calculation formula to obtain the a first error values; The error calculation formula is as follows: Among them, the E i represents the first error value corresponding to the i-th decision tree model among the a decision tree models; P i,j represents the jth load loss true value corresponding to the i-th load loss group in the a load loss groups; It represents the j-th load loss prediction value corresponding to the ith load loss group among the a load loss groups.
6. The method according to any one of claims 1 to 5, characterized in that: The obtaining of a first sample set within a preset time period includes: Acquire voltage effective value data and active power data corresponding to a reference voltage sag event; the reference voltage sag event is any one of the multiple historical voltage sag events; Processing the voltage effective value data and the active power data according to a preset maximum stacked discrete wavelet transform method to obtain a plurality of first trajectory mutation point coordinates corresponding to the voltage effective value data and a plurality of second trajectory mutation point coordinates corresponding to the active power data; Determine n reference trajectory features corresponding to the reference voltage sag event according to the plurality of first trajectory mutation point coordinates and the plurality of second trajectory mutation point coordinates; n is a positive integer; A reference trajectory feature vector is determined according to the n reference trajectory features; the reference trajectory feature vector is a trajectory feature vector corresponding to the reference voltage sag event among the multiple trajectory feature vectors.
7. The method according to claim 6, characterized in that The step of performing feature optimization on the first sample set according to the first random forest evaluation model to obtain a second sample set includes: Acquire the plurality of trajectory feature vectors and the plurality of load loss true values in the first sample set; each trajectory feature vector includes n trajectory features; determining an average value of the plurality of load loss true values as a reference load loss true value; Inputting the plurality of trajectory feature vectors into the first random forest assessment model to obtain a reference load loss prediction value; Determine an original error value according to the actual value of the reference load loss and the predicted value of the reference load loss; Performing feature optimization on the multiple trajectory feature vectors according to the original error value to obtain a target feature set; the target feature set includes at least one trajectory feature among the n trajectory features; Obtaining an intersection of each trajectory feature vector in the plurality of trajectory feature vectors and the target feature set to obtain a plurality of target trajectory feature vectors; The second sample set is determined according to the multiple target trajectory feature vectors.
8. The method according to claim 7, characterized in that The step of performing feature optimization on the plurality of trajectory feature vectors according to the original error value to obtain a target feature set includes: Adding a preset white noise to the first trajectory feature of each trajectory feature vector in the plurality of trajectory feature vectors to obtain a plurality of first trajectory feature vectors; the first trajectory feature is any one trajectory feature in the n trajectory features; Inputting the plurality of first trajectory feature vectors into the first random forest evaluation model to obtain a first load loss prediction value; Determine a first noise error value according to the reference load loss true value and the first load loss prediction value; Determine a first error variation according to the original error value and the first noise error value; If the first error variation is greater than or equal to a preset variation threshold, the first trajectory feature is determined to be a first target trajectory feature; the first target trajectory feature is any target feature in the target feature set; If the first error variation is less than the preset variation threshold, the first trajectory feature is not added to the target feature set.
9. A load loss assessment device for voltage sag, characterized in that: The device comprises an acquisition module, a determination module, an optimization module and an evaluation module, wherein: The acquisition module is used to acquire a first sample set within a preset time period, and divide the first sample set into K first subsets on average; the first sample set includes a plurality of trajectory feature vectors and a plurality of load loss real values corresponding to a plurality of historical voltage sag events; each historical voltage sag event corresponds to a trajectory feature vector and a load loss real value; K is an integer greater than 1; The determination module is used to determine a first target model parameter combination according to the K first subsets; and determine a first random forest evaluation model according to the first target model parameter combination; The optimization module is used to perform feature optimization on the first sample set according to the first random forest evaluation model to obtain a second sample set; The determination module is used to divide the second sample set into K second subsets on average, and determine a second target model parameter combination according to the K second subsets; and determine a second random forest evaluation model according to the second target model parameter combination; The evaluation module is used to obtain a current trajectory feature vector and input the current trajectory feature vector into the second random forest evaluation model to obtain a target load loss prediction value; the current trajectory feature vector is a trajectory feature vector corresponding to a current voltage sag event.
10. An electronic device, characterized in that: include: A processor, a memory, a communication interface, and one or more programs; The one or more programs are stored in the memory and configured to be executed by the processor, the programs comprising instructions for executing the steps in the method according to any one of claims 1 to 8.