CN115426282B - Voltage abnormality detection method, system, electronic device and storage medium - Google Patents
Voltage abnormality detection method, system, electronic device and storage medium Download PDFInfo
- Publication number
- CN115426282B CN115426282B CN202210910702.8A CN202210910702A CN115426282B CN 115426282 B CN115426282 B CN 115426282B CN 202210910702 A CN202210910702 A CN 202210910702A CN 115426282 B CN115426282 B CN 115426282B
- Authority
- CN
- China
- Prior art keywords
- network
- layer
- detection model
- voltage detection
- generator
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 161
- 230000005856 abnormality Effects 0.000 title abstract description 9
- 238000012549 training Methods 0.000 claims abstract description 123
- 230000002159 abnormal effect Effects 0.000 claims abstract description 37
- 230000006870 function Effects 0.000 claims description 82
- 238000013527 convolutional neural network Methods 0.000 claims description 60
- 230000004913 activation Effects 0.000 claims description 28
- 238000000034 method Methods 0.000 claims description 22
- 238000004590 computer program Methods 0.000 claims description 3
- 238000007726 management method Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 239000000758 substrate Substances 0.000 description 5
- 230000003213 activating effect Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 3
- 238000013459 approach Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 239000006185 dispersion Substances 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R19/00—Arrangements for measuring currents or voltages or for indicating presence or sign thereof
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R19/00—Arrangements for measuring currents or voltages or for indicating presence or sign thereof
- G01R19/165—Indicating that current or voltage is either above or below a predetermined value or within or outside a predetermined range of values
- G01R19/16566—Circuits and arrangements for comparing voltage or current with one or several thresholds and for indicating the result not covered by subgroups G01R19/16504, G01R19/16528, G01R19/16533
- G01R19/16576—Circuits and arrangements for comparing voltage or current with one or several thresholds and for indicating the result not covered by subgroups G01R19/16504, G01R19/16528, G01R19/16533 comparing DC or AC voltage with one threshold
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0631—Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/14—Network analysis or design
- H04L41/142—Network analysis or design using statistical or mathematical methods
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/14—Network analysis or design
- H04L41/145—Network analysis or design involving simulating, designing, planning or modelling of a network
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y04—INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
- Y04S—SYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
- Y04S10/00—Systems supporting electrical power generation, transmission or distribution
- Y04S10/50—Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Theoretical Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Computational Linguistics (AREA)
- Mathematical Optimization (AREA)
- Algebra (AREA)
- Probability & Statistics with Applications (AREA)
- Pure & Applied Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Environmental & Geological Engineering (AREA)
- Artificial Intelligence (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Mathematical Analysis (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Power Engineering (AREA)
- Supply And Distribution Of Alternating Current (AREA)
- Emergency Alarm Devices (AREA)
Abstract
The application provides a voltage abnormality detection method, a system, electronic equipment and a storage medium, which comprise the steps of randomly selecting a plurality of normal voltage data as a training set; constructing a voltage detection model and performing preliminary countermeasure training, wherein the voltage detection model comprises a generator network and a discriminator network; judging whether the voltage detection model is converged or not according to the loss function and the accuracy of the discriminator network; if the voltage detection model converges, stopping training the generator network, continuing to train the discriminator network until the accuracy is no longer improved, and storing the generator network and the discriminator network at the moment to determine a trained target voltage detection model; and acquiring real-time voltage data corresponding to the equipment, inputting the real-time voltage data into a trained target voltage detection model, if the output result is true, continuing to acquire the real-time voltage data corresponding to the equipment, and otherwise, generating alarm information. By constructing a stable model, abnormal voltage data is judged rapidly in real time; effectively improve the voltage detection efficiency.
Description
Technical Field
The present application relates to the field of voltage detection, and in particular, to a method, a system, an electronic device, and a storage medium for detecting voltage anomalies.
Background
In the switch product, many load end chips have very strict requirements on voltage, and any abnormal voltage output can have great influence on equipment, so that the voltage state can be obtained simply and quickly in the equipment work, so that quick response to abnormal conditions can be realized.
In the prior art, voltage detection is generally performed by a baseboard management controller; under the working state of the equipment, the baseboard management controller can acquire the current voltage value of any power supply; when a user reads, the device is connected through a serial port line, and the device enters a substrate management controller and inputs a corresponding instruction to acquire a voltage value; the method can accurately acquire the voltage value, but cannot judge whether the read voltage value is abnormal or not, and cannot detect the voltage state.
Therefore, a method for detecting voltage quickly and simply is needed to solve the above technical problems in the prior art.
Disclosure of Invention
In order to solve the deficiencies of the prior art, the present application is directed to a method, a system, an electronic device and a storage medium for detecting a voltage abnormality, so as to solve the above technical problems of the prior art.
In order to achieve the above object, the present application provides, in a first aspect, a voltage abnormality detection method including:
randomly selecting a plurality of normal voltage data as a training set;
constructing a voltage detection model and performing preliminary countermeasure training, wherein the voltage detection model comprises a generator network and a discriminator network; calculating the loss of the generator network and the discriminator network respectively according to the loss function to judge whether the voltage detection model is converged or not;
if the voltage detection model is not converged, normal voltage data in the training set is increased, the generator network is continuously trained by using the increased training set, and the discriminator network is continuously trained by using the abnormal voltage data generated by the generator and the increased training set until the voltage detection model is converged;
if the voltage detection model converges, stopping training the generator network, continuing training the discriminator network by using the abnormal voltage data generated by the generator network and the training set until the accuracy is not improved, and storing the generator network and the discriminator network at the moment to determine a trained target voltage detection model;
and acquiring real-time voltage data corresponding to the equipment, inputting the trained target voltage detection model, continuously acquiring the real-time voltage data corresponding to the equipment if the output result of the target voltage detection model is true, and generating alarm information if the output result of the target voltage detection model is false.
In some embodiments, the architecture of the generator network includes:
an input layer, a full connection layer, a three-layer first convolutional neural network and an output layer;
each first convolutional neural network consists of a convolutional layer, a standardized layer and an activation function layer;
the activation function in each layer of the first convolutional neural network is an LReLU function.
In some embodiments, the architecture of the discriminator network comprises:
an input layer, a five-layer second convolutional neural network, and an output layer;
each second convolutional neural network consists of a convolutional layer, a standardized layer and an activation function layer, wherein the activation functions in the first layer of the second convolutional neural network, the second layer of the second convolutional neural network, the third layer of the second convolutional neural network and the fourth layer of the second convolutional neural network are LReLU functions, and the activation functions in the fifth layer of the second convolutional neural network are sigmod functions.
In some embodiments, the generating employs a loss function L against a network loss function G The formula is as follows:
where α=1, β=0.5, γ=0.5, g (Y i ) Representing data generated by said generator network, x i Representing real data, D representing the discriminator network.
In some embodiments, the generating the objective function expression for the countermeasure network model is:
wherein ,indicating the desire of real voltage data in the discriminator network,representing the expectation in the discriminator network of the abnormal voltage data generated by the generator network, Z representing random noise.
In some embodiments, the convolution kernel size of each of the convolution layers in the generator network and the discriminator network is set to 3, and the step size is set to 1.
In some embodiments, the learning rate of the generator network and the discriminator network is set to 10 when the voltage detection model is trained -4 The batch sizes were set to 128 and the iteration numbers were set to 200.
In a second aspect, the present application provides a voltage anomaly detection system, the system comprising:
the model preparation module is used for randomly selecting a plurality of normal voltage data as a training set;
the model training module is used for constructing a voltage detection model and performing preliminary countermeasure training, and the voltage detection model comprises a generator network and a discriminator network;
the model training module is further used for respectively calculating the losses of the generator network and the discriminator network and the accuracy of the discriminator network according to a loss function so as to judge whether the voltage detection model converges or not;
the model training module is further configured to, when the voltage detection model is not converged, increase normal voltage data in the training set, continuously train the generator network by using the increased training set, and continuously train the discriminator network by using abnormal voltage data generated by the generator and the increased training set until the voltage detection model is converged;
the model training module is further configured to stop training the generator network when the voltage detection model converges, continue training the discriminator network by using the abnormal voltage data generated by the generator network and the training set until the accuracy rate is no longer improved, and store the generator network and the discriminator network at the time to determine a trained target voltage detection model;
the voltage detection module is used for acquiring real-time voltage data corresponding to the equipment and inputting the trained target voltage detection model, if the output result of the target voltage detection model is true, the real-time voltage data corresponding to the equipment is continuously acquired, and if the output result of the target voltage detection model is false, alarm information is generated.
In a third aspect, the present application provides an electronic device, including:
one or more processors;
and a memory associated with the one or more processors, the memory for storing program instructions that, when read for execution by the one or more processors, perform the following:
randomly selecting a plurality of normal voltage data as a training set;
constructing a voltage detection model and performing preliminary countermeasure training, wherein the voltage detection model comprises a generator network and a discriminator network; calculating the loss of the generator network and the discriminator network respectively according to the loss function to judge whether the voltage detection model is converged or not;
if the voltage detection model is not converged, normal voltage data in the training set is increased, the generator network is continuously trained by using the increased training set, and the discriminator network is continuously trained by using the abnormal voltage data generated by the generator and the increased training set until the voltage detection model is converged;
if the voltage detection model converges, stopping training the generator network, continuing training the discriminator network by using the abnormal voltage data generated by the generator network and the training set until the accuracy is not improved, and storing the generator network and the discriminator network at the moment to determine a trained target voltage detection model;
and acquiring real-time voltage data corresponding to the equipment, inputting the trained target voltage detection model, continuously acquiring the real-time voltage data corresponding to the equipment if the output result of the target voltage detection model is true, and generating alarm information if the output result of the target voltage detection model is false.
In a fourth aspect, the present application also provides a computer-readable storage medium having stored thereon a computer program that causes a computer to perform the operations of:
randomly selecting a plurality of normal voltage data as a training set;
constructing a voltage detection model and performing preliminary countermeasure training, wherein the voltage detection model comprises a generator network and a discriminator network; calculating the loss of the generator network and the discriminator network respectively according to the loss function to judge whether the voltage detection model is converged or not;
if the voltage detection model is not converged, normal voltage data in the training set is increased, the generator network is continuously trained by using the increased training set, and the discriminator network is continuously trained by using the abnormal voltage data generated by the generator and the increased training set until the voltage detection model is converged;
if the voltage detection model converges, stopping training the generator network, continuing training the discriminator network by using the abnormal voltage data generated by the generator network and the training set until the accuracy is not improved, and storing the generator network and the discriminator network at the moment to determine a trained target voltage detection model;
and acquiring real-time voltage data corresponding to the equipment, inputting the trained target voltage detection model, continuously acquiring the real-time voltage data corresponding to the equipment if the output result of the target voltage detection model is true, and generating alarm information if the output result of the target voltage detection model is false.
The beneficial effects achieved by the application are as follows:
the application provides a voltage abnormality detection method, a system, electronic equipment and a storage medium, which comprise the steps of randomly selecting a plurality of normal voltage data as a training set; constructing a voltage detection model and performing preliminary countermeasure training, wherein the voltage detection model comprises a generator network and a discriminator network; calculating the loss of the generator network and the discriminator network respectively according to the loss function to judge whether the voltage detection model is converged or not; if the voltage detection model is not converged, normal voltage data in the training set is increased, the generator network is continuously trained by using the increased training set, and the discriminator network is continuously trained by using the abnormal voltage data generated by the generator and the increased training set until the voltage detection model is converged; if the voltage detection model converges, stopping training the generator network, continuing training the discriminator network by using the abnormal voltage data generated by the generator network and the training set until the accuracy is not improved, and storing the generator network and the discriminator network at the moment to determine a trained target voltage detection model; and acquiring real-time voltage data corresponding to the equipment, inputting the trained target voltage detection model, continuously acquiring the real-time voltage data corresponding to the equipment if the output result of the target voltage detection model is true, and generating alarm information if the output result of the target voltage detection model is false. By constructing a stable model, abnormal voltage data can be judged rapidly in real time; effectively improve the voltage detection efficiency.
Drawings
For a clearer description of the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the description below are only some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art, wherein:
FIG. 1 is a schematic diagram of a voltage anomaly detection method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a generator network structure according to an embodiment of the present application
FIG. 3 is a schematic diagram of a network architecture of a discriminator according to an embodiment of the application;
FIG. 4 is a flowchart of a voltage anomaly detection method according to an embodiment of the present application;
FIG. 5 is a block diagram of a voltage anomaly detection system provided by an embodiment of the present application;
fig. 6 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be understood that throughout this specification and the claims, unless the context clearly requires otherwise, the words "comprise", "comprising", and the like, are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is, it is the meaning of "including but not limited to".
It should also be appreciated that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Furthermore, in the description of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
It should be noted that the terms "S1", "S2", and the like are used for the purpose of describing the steps only, and are not intended to be construed to be specific as to the order or sequence of steps, nor are they intended to limit the present application, which is merely used to facilitate the description of the method of the present application, and are not to be construed as indicating the sequence of steps. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent and not within the scope of protection claimed in the present application.
Example 1
As shown in fig. 1, the application discloses a voltage abnormality detection method, and a process of detecting whether acquired voltage data is abnormal by applying the method disclosed in the embodiment includes:
s1, acquiring real-time voltage data of switch equipment.
Specifically, the current voltage value of any power supply can be obtained in real time by using the substrate management controller; the method comprises the steps of entering a basic management controller through serial port line connection equipment, and inputting a corresponding voltage acquisition instruction into the substrate management controller to acquire voltage data of any circuit in real time.
S2, inputting the acquired real-time voltage data into a trained voltage detection model, and determining whether the input real-time voltage data is abnormal or not according to the output result of the voltage detection model.
Specifically, if the output result of the voltage detection model is true, the input real-time voltage data is normal, and the voltage data of the switch equipment is continuously obtained in real time by using the substrate management controller; if the voltage detection is false, the substrate management controller generates alarm information and sends out an alarm signal. The staff can confirm unusual switch equipment according to alarm information, further detects switch equipment in order to solve unusual problem, further improves the robustness of switch equipment work.
The embodiment of the application also discloses the construction of the voltage detection model:
specifically, the voltage detection model provided by the embodiment of the application is a generation countermeasure network model, and comprises a generator network and a discriminator network. The basic principle is to generate new data by inputting random noise into the generator network; the data generated by the generator and the real data are input into the discriminator network, and the authenticity of the data is judged through the discriminator network.
As shown in fig. 2, the network structure of the generator provided in the embodiment of the present application specifically includes: an input layer, a full connection layer, a three-layer first convolutional neural network and an output layer; each first convolutional neural network is composed of a convolutional layer, a normalization layer, and an activation function layer. The input layer is used for inputting random noise, and the activation function in each layer of the first convolutional neural network is an LReLU function (Leaky Rectified Linear Unit, linear unit function with leakage correction), which is defined as:
LReLU(i)=min(0,ηi)+max(0,i)
wherein i represents the input of the activation function layer and is a fixed parameter in the (0, 1) interval, and the value of i is set to be 0.1 in order to better prevent gradient dispersion and better complete training of the generated network.
As shown in fig. 3, the identifier network structure provided in the embodiment of the present application specifically includes: an input layer, a five-layer second convolutional neural network, and an output layer; the input layer is used for inputting real voltage data acquired in real time and voltage data generated by the generator network; the output layer is used for outputting the result: true or false; wherein each of the second convolutional neural networks is composed of a convolutional layer, a normalizing layer and an activating function layer, the activating functions in the first layer of the second convolutional neural network, the second layer of the second convolutional neural network, the third layer of the second convolutional neural network and the fourth layer of the second convolutional neural network are lrehu functions as activating functions used in a generator network, and the activating functions in the fifth layer of the second convolutional neural network are sigmod functions (S-type growth curve functions) defined as:t represents the input to activate the function layer. In additionIn the embodiment of the application, the convolution kernel size of each convolution layer in the generator network and the discriminator network is set to 3, and the step size is set to 1.
In addition, the embodiment of the application also discloses a training process of the voltage detection model, which comprises the following steps of;
randomly selecting a plurality of normal voltage data as a training set, extracting N real normal voltage data from the training set as N real samples, and generating N false samples in a generator by using defined noise distribution. The discriminator network is then trained by the N real samples and the N false samples described above. Embodiments of the present application utilize a loss function L G The loss of the generator network and the discriminator network and the readiness of the discriminator are calculated to judge whether the network converges, namely whether the game between the generator network and the discriminator network reaches Nash balance, wherein false samples generated by the generator network gradually approach real data, and the judging capability of the discriminator is gradually enhanced. In the embodiment of the application, when the loss fluctuation of the generator network and the discriminator network is stabilized at +/-0.2%, and the accuracy of the judgment of the discriminator network is stabilized above a preset threshold, the convergence of the voltage detection model, namely the preliminary training of the voltage detection model is successfully judged, wherein the loss function L G Is a weighted combination of three commonly used simple loss functions, the formula is defined as follows:
where α=1, β=0.5, γ=0.5, g (Y i ) Representing data generated by said generator network, x i Representing real data, D representing the discriminator network.
After the voltage detection model converges, stopping training the generator network, and continuing to train the discriminator network by using the abnormal voltage data generated by the generator network and the real voltage data in the training set until the accuracy of the discriminator network for judging whether the voltage data is normal voltage or abnormal voltage is not increased any more. Preserving the generator network and the discriminator network at this time as trained voltage detectionA model (i.e., a target voltage detection model). If the voltage detection model is not converged, randomly selecting real voltage data to be added into a training set, continuing to train the generator network by using the added training set, and continuing to train the discriminator network by using the abnormal voltage data generated by the generator and the real voltage data in the added training set until the voltage detection model is converged. Wherein, in order to better complete the training of the model, the learning rate of the discriminator network and the generator network is set to 10 during the training process -4 The batch sizes were set to 128 and the iteration numbers were set to 200.
According to the method disclosed by the embodiment of the application, the real-time voltage is continuously acquired in the whole working process of the switch equipment, and the voltage can be efficiently and accurately detected based on the trained voltage detection model; and alarming immediately when the voltage abnormality occurs so as to prevent the switch from suffering larger faults.
Example two
Corresponding to the above embodiment, the present application provides a voltage anomaly method, as shown in fig. 4, including:
4100. randomly selecting a plurality of normal voltage data as a training set;
4200. constructing a voltage detection model and performing preliminary countermeasure training, wherein the voltage detection model comprises a generator network and a discriminator network;
wherein the structure of the generator network comprises:
an input layer, a full connection layer, a three-layer first convolutional neural network and an output layer;
each first convolutional neural network consists of a convolutional layer, a standardized layer and an activation function layer;
the activation function in each layer of the first convolutional neural network is an LReLU function.
Wherein the structure of the discriminator network comprises:
an input layer, a five-layer second convolutional neural network, and an output layer;
each second convolutional neural network consists of a convolutional layer, a standardized layer and an activation function layer, wherein the activation functions in the first layer of the second convolutional neural network, the second layer of the second convolutional neural network, the third layer of the second convolutional neural network and the fourth layer of the second convolutional neural network are LReLU functions, and the activation functions in the fifth layer of the second convolutional neural network are sigmod functions.
Wherein the loss function in the voltage detection model adopts a loss function L G The formula is as follows:
where α=1, β=0.5, γ=0.5, g (Y i ) Representing data generated by said generator network, x i Representing real data, D representing the discriminator network.
The objective function expression of the voltage detection model is as follows:
wherein ,indicating the desire of real voltage data in the discriminator network,representing the expectation in the discriminator network of the abnormal voltage data generated by the generator network, Z representing random noise.
Wherein the convolution kernel size of each of the convolution layers in the generator network and the discriminator network is set to 3, and the step size is set to 1.
Wherein the learning rates of the generator network and the discriminator network are set to 10 when the voltage detection model is trained -4 The batch sizes were set to 128 and the iteration numbers were set to 200.
4300. Calculating the loss of the generator network and the discriminator network respectively according to the loss function to judge whether the voltage detection model is converged or not;
4400. if the voltage detection model is not converged, normal voltage data in the training set is increased, the generator network is continuously trained by using the increased training set, and the discriminator network is continuously trained by using the abnormal voltage data generated by the generator and the increased training set until the voltage detection model is converged;
4500. if the voltage detection model converges, stopping training the generator network, continuing training the discriminator network by using the abnormal voltage data generated by the generator network and the training set until the accuracy is not improved, and storing the generator network and the discriminator network at the moment to determine a trained target voltage detection model;
4600. and acquiring real-time voltage data corresponding to the equipment, inputting the trained target voltage detection model, continuously acquiring the real-time voltage data corresponding to the equipment if the output result of the target voltage detection model is true, and generating alarm information if the output result of the target voltage detection model is false.
Example III
Corresponding to the first and second embodiments, as shown in fig. 5, the present application further provides a voltage abnormality detection system, which is characterized in that the system includes:
the model preparation module 510 is configured to randomly select a plurality of normal voltage data as a training set;
a model training module 520 for constructing a voltage detection model and performing preliminary countermeasure training, the voltage detection model including a generator network and a discriminator network;
the model training module 520 is further configured to calculate losses of the generator network and the discriminator network and an accuracy of the discriminator network according to a loss function, respectively, so as to determine whether the voltage detection model converges;
the model training module 520 is further configured to, when the voltage detection model does not converge, increase normal voltage data in the training set and continue training the generator network using the increased training set, and continue training the discriminator network using the abnormal voltage data generated by the generator and the increased training set until the voltage detection model converges;
the model training module 520 is further configured to stop training the generator network when the voltage detection model converges, continue training the discriminator network using the abnormal voltage data generated by the generator network and the training set until the accuracy rate is no longer improved, and save the generator network and the discriminator network at this time to determine a trained target voltage detection model; the voltage detection module 530 is configured to obtain real-time voltage data corresponding to the device and input the trained target voltage detection model, if the output result of the target voltage detection model is true, continue to obtain the real-time voltage data corresponding to the device, and if the output result of the target voltage detection model is false, generate alarm information.
In some embodiments, the architecture of the generator network includes:
an input layer, a full connection layer, a three-layer first convolutional neural network and an output layer;
each first convolutional neural network consists of a convolutional layer, a standardized layer and an activation function layer;
the activation function in each layer of the first convolutional neural network is an LReLU function.
In some embodiments, the architecture of the discriminator network comprises:
an input layer, a five-layer second convolutional neural network, and an output layer;
each second convolutional neural network consists of a convolutional layer, a standardized layer and an activation function layer, wherein the activation functions in the first layer of the second convolutional neural network, the second layer of the second convolutional neural network, the third layer of the second convolutional neural network and the fourth layer of the second convolutional neural network are LReLU functions, and the activation functions in the fifth layer of the second convolutional neural network are sigmod functions.
In some embodiments, the loss function within the voltage detection model employs a loss function L G The formula is as follows:
where α=1, β=0.5, γ=0.5, g (Y i ) Representing data generated by said generator network, x i Representing real data, D representing the discriminator network.
In some embodiments, the objective function expression of the voltage detection model is:
wherein ,indicating the desire of real voltage data in the discriminator network,representing the expectation in the discriminator network of the abnormal voltage data generated by the generator network, Z representing random noise.
In some embodiments, the convolution kernel size of each of the convolution layers in the generator network and the discriminator network is set to 3, and the step size is set to 1.
In some embodiments, the learning rate of the generator network and the discriminator network is set to 10 when the voltage detection model is trained -4 The batch sizes were set to 128 and the iteration numbers were set to 200.
Example IV
Corresponding to all the embodiments described above, an embodiment of the present application provides an electronic device, including: one or more processors; and a memory associated with the one or more processors, the memory for storing program instructions that, when read for execution by the one or more processors, perform the following:
randomly selecting a plurality of normal voltage data as a training set;
constructing a voltage detection model and performing preliminary countermeasure training, wherein the voltage detection model comprises a generator network and a discriminator network; calculating the loss of the generator network and the discriminator network respectively according to the loss function to judge whether the voltage detection model is converged or not;
if the voltage detection model is not converged, normal voltage data in the training set is increased, the generator network is continuously trained by using the increased training set, and the discriminator network is continuously trained by using the abnormal voltage data generated by the generator and the increased training set until the voltage detection model is converged;
if the voltage detection model converges, stopping training the generator network, continuing training the discriminator network by using the abnormal voltage data generated by the generator network and the training set until the accuracy is not improved, and storing the generator network and the discriminator network at the moment to determine a trained target voltage detection model;
and acquiring real-time voltage data corresponding to the equipment, inputting the trained target voltage detection model, continuously acquiring the real-time voltage data corresponding to the equipment if the output result of the target voltage detection model is true, and generating alarm information if the output result of the target voltage detection model is false.
Fig. 6 illustrates an architecture of an electronic device, which may include a processor 610, a video display adapter 611, a disk drive 612, an input/output interface 613, a network interface 614, and a memory 620, to name a few. The processor 610, video display adapter 611, disk drive 612, input/output interface 613, network interface 614, and memory 620 may be communicatively coupled via bus 630.
The processor 610 may be implemented by a general-purpose CPU (Central Processing Unit ), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc., for executing related programs to implement the technical scheme provided by the present application.
The Memory 620 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory ), static storage device, dynamic storage device, or the like. The memory 620 may store an operating system 621 for controlling the execution of the electronic device 600, and a Basic Input Output System (BIOS) 622 for controlling the low-level operation of the electronic device 600. In addition, a web browser 623, a data storage management system 624, an icon font processing system 625, and the like may also be stored. The icon font processing system 625 may be an application program that specifically implements the operations of the foregoing steps in the embodiment of the present application. In general, when the technical solution provided by the present application is implemented by software or firmware, relevant program codes are stored in the memory 620 and invoked by the processor 610 to be executed.
The input/output interface 613 is used to connect with an input/output module to realize information input and output. The input/output module may be configured as a component in a device (not shown) or may be external to the device to provide corresponding functionality. Wherein the input devices may include a keyboard, mouse, touch screen, microphone, various types of sensors, etc., and the output devices may include a display, speaker, vibrator, indicator lights, etc.
The network interface 614 is used to connect communication modules (not shown) to enable communication interactions of the device with other devices. The communication module may implement communication through a wired manner (such as USB, network cable, etc.), or may implement communication through a wireless manner (such as mobile network, WIFI, bluetooth, etc.).
Bus 630 includes a path to transfer information between components of the device (e.g., processor 610, video display adapter 611, disk drive 612, input/output interface 613, network interface 614, and memory 620).
In addition, the electronic device 600 may also obtain information of specific acquisition conditions from the virtual resource object acquisition condition information database, for making condition judgment, and so on.
It should be noted that although the above devices only show the processor 610, video display adapter 611, disk drive 612, input/output interface 613, network interface 614, memory 620, bus 630, etc., the devices may include other components necessary to achieve proper execution in an implementation. Furthermore, it will be appreciated by those skilled in the art that the apparatus may include only the components necessary to implement the present application, and not all of the components shown in the drawings.
Example five
Corresponding to all the above embodiments, the embodiments of the present application further provide a computer-readable storage medium, characterized in that it stores a computer program that causes a computer to operate as follows:
randomly selecting a plurality of normal voltage data as a training set;
constructing a voltage detection model and performing preliminary countermeasure training, wherein the voltage detection model comprises a generator network and a discriminator network; calculating the loss of the generator network and the discriminator network respectively according to the loss function to judge whether the voltage detection model is converged or not;
if the voltage detection model is not converged, normal voltage data in the training set is increased, the generator network is continuously trained by using the increased training set, and the discriminator network is continuously trained by using the abnormal voltage data generated by the generator and the increased training set until the voltage detection model is converged;
if the voltage detection model converges, stopping training the generator network, continuing training the discriminator network by using the abnormal voltage data generated by the generator network and the training set until the accuracy is not improved, and storing the generator network and the discriminator network at the moment to determine a trained target voltage detection model;
and acquiring real-time voltage data corresponding to the equipment, inputting the trained target voltage detection model, continuously acquiring the real-time voltage data corresponding to the equipment if the output result of the target voltage detection model is true, and generating alarm information if the output result of the target voltage detection model is false.
From the above description of embodiments, it will be apparent to those skilled in the art that the present application may be implemented in software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a cloud server, or a network device, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present application.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for a system or system embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, with reference to the description of the method embodiment being made in part. The systems and system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present application without undue burden.
The foregoing description of the preferred embodiments of the application is not intended to limit the application to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the application are intended to be included within the scope of the application.
Claims (6)
1. A method for detecting voltage anomalies, the method comprising: randomly selecting a plurality of normal voltage data as a training set;
constructing a voltage detection model and performing preliminary countermeasure training, wherein the voltage detection model comprises a generator network and a discriminator network;
the structure of the generator network comprises: an input layer, a full connection layer, a three-layer first convolutional neural network and an output layer; each first convolutional neural network consists of a convolutional layer, a standardized layer and an activation function layer; wherein the activation function in each layer of the first convolutional neural network is an LReLU function;
the structure of the discriminator network comprises: an input layer, a five-layer second convolutional neural network, and an output layer;
each second convolutional neural network consists of a convolutional layer, a standardized layer and an activation function layer, wherein the activation functions in the first layer of the second convolutional neural network, the second layer of the second convolutional neural network, the third layer of the second convolutional neural network and the fourth layer of the second convolutional neural network are LReLU functions, and the activation functions in the fifth layer of the second convolutional neural network are sigmod functions;
calculating the loss of the generator network and the discriminator network respectively according to the loss function to judge whether the voltage detection model is converged or not;
if the voltage detection model is not converged, normal voltage data in the training set is increased, the generator network is continuously trained by using the increased training set, and the discriminator network is continuously trained by using abnormal voltage data generated by the generator network and the increased training set until the voltage detection model is converged;
if the voltage detection model converges, stopping training the generator network, continuing training the discriminator network by using the abnormal voltage data generated by the generator network and the training set until the accuracy is not improved, and storing the generator network and the discriminator network at the moment to determine a trained target voltage detection model;
acquiring real-time voltage data corresponding to equipment and inputting the trained target voltage detection model, if the output result of the target voltage detection model is true, continuously acquiring the real-time voltage data corresponding to the equipment, and if the output result of the target voltage detection model is false, generating alarm information;
randomly selecting a plurality of normal voltage data as a training set, extracting N real normal voltage data from the training set as N real samples, generating N false samples by using defined noise distribution in a generator, and training a discriminator network through the N real samples and the N false samples; the loss function in the voltage detection model adopts a loss function L G The formula is as follows:
where α=1, β=0.5, γ=0.5, g (Y i ) Representing data generated by said generator network, x i Representing real data, D representing the discriminator network;
the objective function expression of the voltage detection model is as follows:
wherein ,indicating the desire of real voltage data in the discriminator network,representing the abnormal voltage generated by the generator networkThe expectation of data in the discriminator network, Z, represents random noise.
2. The method of claim 1, wherein the convolution kernel size of each of the convolution layers in the generator network and the discriminator network is set to 3 and the step size is set to 1.
3. The method of claim 1, wherein the generator network and the discriminator network each have a learning rate set to 10 when the voltage detection model is trained -4 The batch sizes were set to 128 and the iteration numbers were set to 200.
4. A voltage anomaly detection system, the system comprising:
the model preparation module is used for randomly selecting a plurality of normal voltage data as a training set;
the model training module is used for constructing a voltage detection model and performing preliminary countermeasure training, and the voltage detection model comprises a generator network and a discriminator network; the structure of the generator network comprises: an input layer, a full connection layer, a three-layer first convolutional neural network and an output layer; each first convolutional neural network consists of a convolutional layer, a standardized layer and an activation function layer; wherein the activation function in each layer of the first convolutional neural network is an LReLU function;
the structure of the discriminator network comprises: an input layer, a five-layer second convolutional neural network, and an output layer;
each second convolutional neural network consists of a convolutional layer, a standardized layer and an activation function layer, wherein the activation functions in the first layer of the second convolutional neural network, the second layer of the second convolutional neural network, the third layer of the second convolutional neural network and the fourth layer of the second convolutional neural network are LReLU functions, and the activation functions in the fifth layer of the second convolutional neural network are sigmod functions;
the model training module is further used for respectively calculating the losses of the generator network and the discriminator network and the accuracy of the discriminator network according to a loss function so as to judge whether the voltage detection model converges or not;
the model training module is further configured to, when the voltage detection model is not converged, increase normal voltage data in the training set, continuously train the generator network by using the increased training set, and continuously train the discriminator network by using abnormal voltage data generated by the generator network and the increased training set until the voltage detection model is converged;
the model training module is further configured to stop training the generator network when the voltage detection model converges, continue training the discriminator network by using the abnormal voltage data generated by the generator network and the training set until the accuracy rate is no longer improved, and store the generator network and the discriminator network at the time to determine a trained target voltage detection model;
the voltage detection module is used for acquiring real-time voltage data corresponding to equipment and inputting the trained target voltage detection model, if the output result of the target voltage detection model is true, the real-time voltage data corresponding to the equipment is continuously acquired, and if the output result of the target voltage detection model is false, alarm information is generated;
the system is specifically used for randomly selecting a plurality of normal voltage data as a training set, extracting N real normal voltage data from the training set as N real samples, generating N false samples by using defined noise distribution in a generator, and training a discriminator network through the N real samples and the N false samples; the loss function in the voltage detection model adopts a loss function L G The formula is as follows:
where α=1, β=0.5, γ=0.5, g (Y i ) Representing data generated by said generator network, x i Representation ofTrue data, D representing the discriminator network;
the objective function expression of the voltage detection model is as follows:
wherein ,indicating the desire of real voltage data in the discriminator network,representing the expectation in the discriminator network of the abnormal voltage data generated by the generator network, Z representing random noise.
5. An electronic device, the electronic device comprising: one or more processors;
and a memory associated with the one or more processors, the memory for storing program instructions that, when read for execution by the one or more processors, perform the method of any of claims 1-3.
6. A computer-readable storage medium, characterized in that it stores a computer program, which causes a computer to perform the method of any one of claims 1-3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210910702.8A CN115426282B (en) | 2022-07-29 | 2022-07-29 | Voltage abnormality detection method, system, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210910702.8A CN115426282B (en) | 2022-07-29 | 2022-07-29 | Voltage abnormality detection method, system, electronic device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115426282A CN115426282A (en) | 2022-12-02 |
CN115426282B true CN115426282B (en) | 2023-08-18 |
Family
ID=84196606
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210910702.8A Active CN115426282B (en) | 2022-07-29 | 2022-07-29 | Voltage abnormality detection method, system, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115426282B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106779069A (en) * | 2016-12-08 | 2017-05-31 | 国家电网公司 | A kind of abnormal electricity consumption detection method based on neutral net |
CN113157771A (en) * | 2021-04-27 | 2021-07-23 | 广东海聊科技有限公司 | Data anomaly detection method and power grid data anomaly detection method |
CN114400019A (en) * | 2021-12-31 | 2022-04-26 | 深圳市声扬科技有限公司 | Model generation method, abnormality detection device, and electronic apparatus |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11386972B2 (en) * | 2020-01-30 | 2022-07-12 | Macronix International Co., Ltd. | Determining read voltages for memory systems with machine learning |
-
2022
- 2022-07-29 CN CN202210910702.8A patent/CN115426282B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106779069A (en) * | 2016-12-08 | 2017-05-31 | 国家电网公司 | A kind of abnormal electricity consumption detection method based on neutral net |
CN113157771A (en) * | 2021-04-27 | 2021-07-23 | 广东海聊科技有限公司 | Data anomaly detection method and power grid data anomaly detection method |
CN114400019A (en) * | 2021-12-31 | 2022-04-26 | 深圳市声扬科技有限公司 | Model generation method, abnormality detection device, and electronic apparatus |
Also Published As
Publication number | Publication date |
---|---|
CN115426282A (en) | 2022-12-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022068645A1 (en) | Database fault discovery method, apparatus, electronic device, and storage medium | |
CN114844768B (en) | Information analysis method and device and electronic equipment | |
WO2024021908A1 (en) | Door lock security assessment method and related device | |
CN106201843A (en) | The processing method of a kind of terminal data, device and terminal | |
CN109920193A (en) | Intelligent detection method, system, equipment and medium for electrical fire hazard | |
CN113438106A (en) | Content distribution network processing method and device and electronic equipment | |
CN112463432A (en) | Inspection method, device and system based on index data | |
CN116245808A (en) | Workpiece defect detection method and device, electronic equipment and storage medium | |
CN117687860A (en) | Chip performance testing method and device | |
CN108334427A (en) | Method for diagnosing faults in storage system and device | |
CN111983412A (en) | Monitoring system, monitoring method, monitoring terminal and storage medium | |
CN111813632A (en) | CPU power consumption test method, test device, test equipment and storage medium | |
CN115426282B (en) | Voltage abnormality detection method, system, electronic device and storage medium | |
CN117033146B (en) | Identification method, device, equipment and medium for appointed consensus contract execution process | |
CN113849356A (en) | Equipment testing method and device, electronic equipment and storage medium | |
CN117170969A (en) | Operation and maintenance method, partition equilibrium recovery device, equipment and medium of server cluster | |
CN116089197A (en) | Fault equipment switching exercise method, device, equipment and storage medium | |
CN115481594B (en) | Scoreboard implementation method, scoreboard, electronic equipment and storage medium | |
CN112905445B (en) | Log-based test method, device and computer system | |
CN115248779A (en) | Code coverage testing method and device, computer equipment and storage medium | |
CN112463626A (en) | Memory leak positioning method and device, computer equipment and storage medium | |
CN112199781A (en) | Accidental fault detection method and system for ship main engine control system | |
KR20220003388A (en) | Electronic device for analyzing power system and operating method thereof | |
CN110989814A (en) | Server protection method, device and equipment | |
CN111880637A (en) | Protection method, device and equipment of server system and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |