Disclosure of Invention
The invention aims to provide a power distribution network fault analysis method and system based on the Internet of things, and aims to solve the defects in the background technology.
In order to achieve the above object, the present invention provides the following technical solutions: the power distribution network fault analysis method based on the Internet of things comprises the following steps:
The analysis system collects operation data of the power distribution network in real time through the Internet of things equipment, automatically constructs an objective function based on the power distribution network optimization target and the operation data, and initializes an initial point, a Hessian matrix, iteration parameters and a convergence threshold in the objective function;
Solving the gradient of the objective function at the current decision variable, calculating a search direction according to the Hessian matrix and the gradient of the objective function at the current decision variable, outputting a step length by using a line search method, updating the decision variable by combining the search direction and the step length, calculating a step length vector and a gradient difference by the updated decision variable and the current decision variable, and updating the Hessian matrix by using a BFGS updating algorithm and combining the step length vector and the gradient difference;
Judging whether convergence conditions are met according to the comparison result of the norm of the gradient at the updated decision variable and the convergence threshold value of the objective function, iterating repeatedly or outputting the optimized decision variable based on the judgment result, when outputting the optimized decision variable, carrying out real-time fault detection on the power distribution network by the analysis system according to the optimized decision variable, identifying fault points in the power distribution network, determining fault types and reasons through analyzing the detected fault characteristics, and finally generating a fault report and sending the fault report to management staff.
In a preferred embodiment, automatically constructing the objective function based on the power distribution network optimization objective and the operational data comprises the steps of:
The operation data of the power distribution network comprises fault occurrence and detection time stamps, the number of true positives, true negatives, false positives and false negatives of fault diagnosis, average fault interval time and average repair time, fault detection time threshold and reliability index threshold;
the initial point x of the objective function includes a fault detection time thresholdReliability index thresholdWeights of parameters in error diagnosis rate;
The constructed objective function expression is:
In which, in the process,As a function of the object to be processed,The time of the failure detection is indicated,The error diagnosis rate is indicated by the number of the error diagnosis,The reliability index is indicated as such,、、Respectively, the fault detection time, the fault diagnosis rate and the reliability index, and。
In a preferred embodiment, solving the gradient of the objective function at the current decision variable, calculating the search direction from the Hessian matrix and the gradient of the objective function at the current decision variable, comprising the steps of:
Calculating an objective functionAt the current decision variableGradient at the point, expressed as:
In which, in the process,In the form of a gradient,Is a numerical gradient and,Represent the firstThe number of unit vectors is one,For convergence threshold, use is made of the current Hessian matrixAnd gradientCalculating a search directionThe expression is:。
In a preferred embodiment, the step size is output by using a line search method, and the decision variable is updated in combination with the search direction and the step size, comprising the steps of:
setting initial step lengthCalculating an objective functionAt the current step sizeThe function value of the position,And calculates Armijo conditional expression,Is Armijo parameter, andIs a constant less than 1;
If it isOutputting the current step length;
If it isThe step size is scaled down, according to the scale,Wherein, the method comprises the steps of, wherein,To a reduced scale, andThe step length after shrinking is reducedCalculating an objective functionAt the current step sizeFunction value at place and calculation of Armijo conditional expressionWhen either one iteratesOutputting the current step length;
By step sizeAnd search directionUpdating current decision variablesValue to next iterationThe expression is:。
in a preferred embodiment, the step size vector and gradient difference are calculated from the updated decision variable and the current decision variable, comprising the steps of:
calculating the difference value between the updated decision variable and the current decision variable as a step size vector, wherein the expression is as follows: In which, in the process,As a vector of the step size,As a function of the current decision variable,Is the updated decision variable;
calculating gradient vectors of the objective function at the current decision variable and the updated decision variable, and calculating a difference value of the gradient at the updated decision variable and the current decision variable, wherein the expression is as follows:
In which, in the process,In order to be a gradient difference,As the gradient vector of the current decision variable,Gradient vectors for updated decision variables.
In a preferred embodiment, the Hessian matrix is updated using the BFGS update algorithm in combination with the step size vector and the gradient difference, comprising the steps of:
updating a Hessian matrix approximation using BFGS update formulasTo the point ofThe expression is:
In which, in the process,Represent the firstThe Hessian matrix approximation of the step,In order to be a gradient difference,As a vector of the step size,Representing vectorsIs to be used in the present invention,Representing vectorsThe outer product of the transpose with itself, the result is a matrix,Representing vectorsMultiplication of the transpose by the matrixMultiplying by vectorThe result is a scalar.
In a preferred embodiment, judging whether the convergence condition is satisfied according to the comparison result of the norm of the gradient of the objective function at the updated decision variable and the convergence threshold, and iterating or outputting the optimized decision variable based on the judgment result, comprising the following steps:
Calculating norms of gradients of the objective function at the update decision variables, the expressions being:
In which, in the process,Representing the norms of the gradients of the objective function at the updated decision variables,In the form of a numerical gradient,Is the updated decision variable;
The norm of the gradient of the objective function at the update decision variable is combined with a preset convergence thresholdComparing;
If it isJudging that convergence conditions are met, and outputting optimized decision variables;
If it isJudging that the convergence condition is not satisfied, and using the updated decision variableRepeating the iterative operation until the requirement is satisfiedUntil that point.
In a preferred embodiment, the optimization objectives include minimizing fault detection time, minimizing false diagnostic rate and maximizing power supply reliability, minimizing fault detection time, minimizing error diagnosis rate and maximizing power supply reliability are quantitatively expressed as: In which, in the process,The value of the minimization is indicated as a minimum,The time of the failure detection is indicated,The error diagnosis rate is indicated by the number of the error diagnosis,The reliability index is indicated as such,、、Respectively, the fault detection time, the fault diagnosis rate and the reliability index, and,,,、、、Respectively represent the numbers of true positives, true negatives, false positives and false negatives,The mean time between failures is indicated and,The average repair time is indicated as being the time to repair,、、、Weights of true positive, true negative, false positive and false negative respectively, and、、、Are all greater than 0;
and the optimization objective satisfies the divisor condition:, In which, in the process,、Representing nodes respectivelyThe voltage and the current at which the current is supplied,In order to be in the voltage safety range,Is a current safety range.
The power distribution network fault analysis system based on the Internet of things comprises an initialization module, a matrix updating module and a decision variable output module;
An initialization module: the method comprises the steps of collecting operation data of a power distribution network in real time through Internet of things equipment, automatically constructing an objective function based on a power distribution network optimization target and the operation data, and initializing an initial point, a Hessian matrix, iteration parameters and a convergence threshold in the objective function;
Matrix updating module: solving the gradient of the objective function at the current decision variable, calculating a search direction according to the Hessian matrix and the gradient of the objective function at the current decision variable, outputting a step length by using a line search method, updating the decision variable by combining the search direction and the step length, calculating a step length vector and a gradient difference by the updated decision variable and the current decision variable, and updating the Hessian matrix by using a BFGS updating algorithm and combining the step length vector and the gradient difference;
Decision variable output module: judging whether convergence conditions are met or not according to the comparison result of the norm of the gradient at the updated decision variable of the objective function and the convergence threshold, iterating repeatedly or outputting the optimized decision variable based on the judgment result, detecting the fault point in the power distribution network in real time according to the optimized decision variable when outputting the optimized decision variable, identifying the fault point in the power distribution network, determining the fault type and the cause by analyzing the detected fault characteristic, and finally generating a fault report and sending the fault report to a manager.
In the technical scheme, the invention has the technical effects and advantages that:
1. According to the invention, the gradient of the objective function at the current decision variable is solved, the search direction is calculated according to the gradient of the objective function at the current decision variable, the step length is output by using a line search method, the decision variable is updated by combining the search direction and the step length, the step length vector and the gradient difference are calculated by combining the updated decision variable with the current decision variable, the Hessian matrix is updated by combining the step length vector and the gradient difference by using a BFGS updating algorithm, and when the optimized decision variable is output, the analysis system carries out real-time fault detection on the power distribution network according to the optimized decision variable, so that the fault point in the power distribution network is identified. The analysis system combines the information of gradient and approximate Hessian matrix, can quickly approximate to an optimal solution at the speed of super-linear convergence, improves the real-time performance of fault detection and diagnosis, and can more effectively jump out a local optimal solution to find a global optimal solution;
2. the invention can comprehensively consider the fault detection speed, the accuracy (error diagnosis rate) and the stability index of the system by simultaneously optimizing the fault detection time threshold, the error diagnosis rate, the parameter weight and the stability index threshold. By doing so, the system can achieve higher efficiency and precision in the fault detection and diagnosis process, and the system resource can be maximally utilized by precisely optimizing the fault detection time threshold value and the parameter weight of the fault diagnosis rate, so that unnecessary maintenance and detection time is reduced, the operation efficiency and cost efficiency of the system are improved, the system can better adapt to the operation environment and fault scene under different conditions, and the flexibility and coping capacity of the system are improved.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1: referring to fig. 1, the method for analyzing faults of a power distribution network based on the internet of things according to the embodiment includes the following steps:
The analysis system acquires operation data of the power distribution network in real time through the Internet of things equipment, automatically builds an objective function based on an optimization target of the power distribution network and the operation data, initializes an initial point, a Hessian matrix, iteration parameters and a convergence threshold in the objective function, solves gradients of the objective function at a current decision variable, calculates a search direction according to the gradients of the Hessian matrix and the objective function at the current decision variable, utilizes a line search method to output a step length, updates the decision variable by combining the search direction and the step length, calculates a step length vector and a gradient difference through the updated decision variable and the current decision variable, updates the Hessian matrix by combining a BFGS (binary search algorithm) updating algorithm with the step length vector and the gradient difference, judges whether convergence conditions are met according to a comparison result of the norms of the gradients of the objective function at the updated decision variable and the convergence threshold, repeatedly iterates or outputs the optimized decision variable based on the judgment result, when outputting the optimized decision variable, identifies a fault point in the power distribution network according to the optimized decision variable, determines a fault type and a cause through analyzing the detected fault characteristic, and finally generates a fault report and sends the fault report to a manager.
According to the application, the gradient of the objective function at the current decision variable is solved, the search direction is calculated according to the gradient of the objective function at the current decision variable, the step length is output by using a line search method, the decision variable is updated by combining the search direction and the step length, the step length vector and the gradient difference are calculated by combining the updated decision variable with the current decision variable, the Hessian matrix is updated by combining the step length vector and the gradient difference by using a BFGS updating algorithm, and when the optimized decision variable is output, the analysis system carries out real-time fault detection on the power distribution network according to the optimized decision variable, so that the fault point in the power distribution network is identified. The analysis system combines the information of gradient and approximate Hessian matrix, can quickly approach to the optimal solution at the speed of super-linear convergence, improves the real-time performance of fault detection and diagnosis, and can more effectively jump out the local optimal solution to find the global optimal solution.
Example 2: the analysis system collects operation data of the power distribution network in real time through the Internet of things equipment, and automatically constructs an objective function based on the power distribution network optimization objective and the operation data, and the analysis system comprises the following steps:
The operation data of the power distribution network, including parameters such as voltage, current, temperature, load and the like, are collected in real time through the Internet of things equipment (such as a sensor and a smart meter), noise and abnormal values are removed, interpolation or complementation is carried out on the missing data, the integrity and the accuracy of the data are ensured, and characteristics which are helpful for fault detection and diagnosis, such as current waveforms, harmonic components and the like, are extracted from the original data;
In the application, the power distribution network optimization targets comprise minimized fault detection time, minimized error diagnosis rate and maximized power supply reliability, the minimized fault detection time, the minimized error diagnosis rate and the maximized power supply reliability are quantitatively represented by the following expression:
In which, in the process,The value of the minimization is indicated as a minimum,The time of the failure detection is indicated,The error diagnosis rate is indicated by the number of the error diagnosis,The reliability index is indicated as such,、、Respectively, the fault detection time, the fault diagnosis rate and the reliability index, and,,,、、、Respectively represent the numbers of true positives, true negatives, false positives and false negatives,The mean time between failures is indicated and,The average repair time is indicated as being the time to repair,、、、Weights of true positive, true negative, false positive and false negative respectively, and、、、Are all greater than 0;
and the optimization objective satisfies the divisor condition:, In which, in the process,、Representing nodes respectivelyThe voltage and the current at which the current is supplied,In order to be in the voltage safety range,Is a current safety range.
Automatically constructing an objective function based on an optimization objective and operation data of the power distribution network, comprising the following steps:
The operation data of the power distribution network comprises fault occurrence and detection time stamps, the number of true positives, true negatives, false positives and false negatives of fault diagnosis, average fault interval time and average repair time, fault detection time threshold and reliability index threshold;
the initial point x of the objective function includes a fault detection time thresholdReliability index thresholdWeights of parameters in error diagnosis rate;
The constructed objective function expression is:
In which, in the process,As a function of the object to be processed,The time of the failure detection is indicated,The error diagnosis rate is indicated by the number of the error diagnosis,The reliability index is indicated as such,、、Respectively, the fault detection time, the fault diagnosis rate and the reliability index, and。
Initializing an initial point, a Hessian matrix, iteration parameters and a convergence threshold in an objective function, wherein the initialization comprises the following steps:
acquiring a preset initial point, namely a fault detection time threshold value according to the background and priori knowledge of the problemReliability index thresholdWeights of parameters in error diagnosis rateTo Hessian matrixInitializing and setting the unit matrix, and setting the maximum iteration numberFor example, the maximum number of iterations isSetting a convergence thresholdExamples are:。
solving the gradient of the objective function at the current decision variable, and calculating the search direction according to the Hessian matrix and the gradient of the objective function at the current decision variable, wherein the method comprises the following steps of:
Calculating an objective functionAt the current decision variableGradient at the point, expressed as:
In which, in the process,In the form of a gradient,Is a numerical gradient and,Represent the firstThe number of unit vectors is one,For convergence threshold, use is made of the current Hessian matrixAnd gradientCalculating a search directionThe expression is:。
Outputting a step length by using a line search method, and updating a decision variable by combining a search direction and the step length, wherein the method comprises the following steps of:
setting initial step lengthCalculating an objective functionAt the current step sizeThe function value of the position,And calculates Armijo conditional expression,Is Armijo parameter, andIs a constant less than 1;
If it isOutputting the current step length;
If it isThe step size is scaled down, according to the scale,Wherein, the method comprises the steps of, wherein,To a reduced scale, andThe step length after shrinking is reducedCalculating an objective functionAt the current step sizeFunction value at place and calculation of Armijo conditional expressionWhen either one iteratesOutputting the current step length,Representing gradientsTranspose of (i), i.e.)A transpose operation is represented to describe the multiplication and operation between the matrix and the vector.
By step sizeAnd search directionUpdating current decision variablesValue to next iteration(I.e., updated decision variables), the expression is:。
Calculating a step length vector and a gradient difference through the updated decision variable and the current decision variable, wherein the step length vector and the gradient difference comprise the following steps of:
calculating the difference value between the updated decision variable and the current decision variable as a step size vector, wherein the expression is as follows: In which, in the process,As a vector of the step size,As a function of the current decision variable,Is the updated decision variable;
the gradient difference represents the gradient change of the objective function between the updated decision variable and the current decision variable, and the calculation steps are as follows:
calculating gradient vectors of the objective function at the current decision variable and the updated decision variable, and calculating a difference value of the gradient at the updated decision variable and the current decision variable, wherein the expression is as follows:
In which, in the process,In order to be a gradient difference,As the gradient vector of the current decision variable,Gradient vectors for updated decision variables.
Updating the Hessian matrix by using a BFGS updating algorithm in combination with the step size vector and the gradient difference, comprising the steps of:
updating a Hessian matrix approximation using BFGS update formulasTo the point ofThe expression is:
In which, in the process,Represent the firstThe Hessian matrix approximation of the step,In order to be a gradient difference,As a vector of the step size,Representing vectorsIs to be used in the present invention,Representing vectorsThe outer product of the transpose with itself, the result is a matrix,Representing vectorsMultiplication of the transpose by the matrixMultiplying by vectorThe result is a scalar.
Judging whether convergence conditions are met or not according to the comparison result of the norm of the gradient of the objective function at the updated decision variable and the convergence threshold, and iterating or outputting the optimized decision variable based on the judgment result, wherein the method comprises the following steps:
Calculating norms of gradients of the objective function at the update decision variables, the expressions being:
In which, in the process,Representing the norms of the gradients of the objective function at the updated decision variables,In the form of a numerical gradient,Is the updated decision variable;
The norm of the gradient of the objective function at the update decision variable is combined with a preset convergence thresholdComparing;
If it isJudging that convergence conditions are met, and outputting optimized decision variables;
If it isJudging that the convergence condition is not satisfied, and using the updated decision variableRepeating the iterative operation until the requirement is satisfiedUntil that point.
In this embodiment, the weights of the parameters in the formula are calculated by the error diagnosis rateOptimization is as example:
, the error diagnosis rate is indicated by the number of the error diagnosis,、、、Respectively represent the numbers of true positives, true negatives, false positives and false negatives,、、、Weights of true positive, true negative, false positive and false negative respectively, and、、、Are all greater than 0;
Wherein,、、、Our goal is to adjust the weights、、、To minimize the false diagnostic rate, assuming an initial weight of、、、;
The iterative process:
Calculating an objective functionAnd calculating the gradient of the objective function on the weight, wherein the expression is as follows:;
Using the identity matrix as an initial Hessian matrix, updating the search direction to be a negative gradient, wherein the expression is as follows: Obtaining step length by line searching method;
Updating the weight vector using the step size and the search direction, there are:
In the repeated iteration process, when the norm of the gradient of any objective function about the weight is smaller than or equal to the convergence threshold, an optimal weight vector is output, and it should be noted that in practical application, the numerical calculation of each step may be implemented by using a calculation tool or a programming language, and in particular, the example steps of optimizing the fault detection time threshold, each parameter weight of the fault diagnosis rate and the stability index threshold are complicated, which is not described herein.
In the application, the fault detection speed, the accuracy (error diagnosis rate) and the stability index of the system can be comprehensively considered by simultaneously optimizing the fault detection time threshold, the error diagnosis rate, the parameter weight and the stability index threshold. By doing so, the system can achieve higher efficiency and precision in the fault detection and diagnosis process, and the system resource can be maximally utilized by precisely optimizing the fault detection time threshold value and the parameter weight of the fault diagnosis rate, so that unnecessary maintenance and detection time is reduced, the operation efficiency and cost efficiency of the system are improved, the system can better adapt to the operation environment and fault scene under different conditions, and the flexibility and coping capacity of the system are improved.
When the optimized decision variables are output, the analysis system carries out real-time fault detection on the power distribution network according to the optimized decision variables, identifies fault points in the power distribution network, determines fault types and reasons through analyzing the detected fault characteristics, and finally generates a fault report and sends the fault report to management staff.
Example 3: the power distribution network fault analysis system based on the Internet of things comprises an initialization module, a matrix updating module and a decision variable output module;
an initialization module: the method comprises the steps that operation data of a power distribution network are collected in real time through Internet of things equipment, an objective function is automatically built based on a power distribution network optimization target and the operation data, after initial points, hessian matrixes, iteration parameters and convergence thresholds in the objective function are initialized, the objective function is sent to a matrix updating module and a decision variable output module, and the initialized parameters are sent to the matrix updating module and the decision variable output module;
Matrix updating module: solving the gradient of the objective function at the current decision variable, calculating a search direction according to the Hessian matrix and the gradient of the objective function at the current decision variable, outputting a step length by using a line search method, updating the decision variable by combining the search direction and the step length, calculating a step length vector and a gradient difference by the updated decision variable and the current decision variable, updating the Hessian matrix by using a BFGS updating algorithm and combining the step length vector and the gradient difference, and transmitting the updated decision variable to a decision variable output module;
Decision variable output module: judging whether convergence conditions are met or not according to the comparison result of the norm of the gradient at the updated decision variable of the objective function and the convergence threshold, iterating repeatedly or outputting the optimized decision variable based on the judgment result, detecting the fault point in the power distribution network in real time according to the optimized decision variable when outputting the optimized decision variable, identifying the fault point in the power distribution network, determining the fault type and the cause by analyzing the detected fault characteristic, and finally generating a fault report and sending the fault report to a manager.
The above formulas are all formulas with dimensions removed and numerical values calculated, the formulas are formulas with a large amount of data collected for software simulation to obtain the latest real situation, and preset parameters in the formulas are set by those skilled in the art according to the actual situation.
In the description of the present specification, the descriptions of the terms "one embodiment," "example," "specific example," and the like, mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The preferred embodiments of the invention disclosed above are intended only to assist in the explanation of the invention. The preferred embodiments are not intended to be exhaustive or to limit the invention to the precise form disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best understand and utilize the invention.