Power quality monitoring method, device, terminal and medium based on MQTT protocol
Through the power quality monitoring method based on the MQTT protocol, combined with the power grid digital twin and deep neural network, the problems of low data processing efficiency and insufficient abnormal detection accuracy of the power quality monitoring system in the prior art are solved, and more efficient grid data processing and optimized power consumption suggestions are achieved.
Patent Information
- Application Number
- CN202411564628.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-11-05
AI Technical Summary
The existing power quality monitoring systems have low data processing efficiency, insufficient abnormal detection accuracy, and poor adaptability to dynamic power load changes when processing data in complex power systems.
The power quality monitoring method based on the MQTT protocol is adopted to collect power system data and actual sensor data, build a power grid digital twin, generate virtual sensor data, and perform data fusion and power quality analysis through deep neural networks.
It improves the detection accuracy of grid abnormalities, can effectively adapt to dynamic power load changes, and provides optimization suggestions to optimize electricity consumption and reduce energy consumption and environmental impact.
Smart Images

Figure CN119070489B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power quality monitoring, and in particular to a power quality monitoring method, device, terminal and medium based on the MQTT protocol. Background Art
[0002] With the rapid development of smart grid technology, the monitoring of power system operation efficiency and power quality has become an important research direction in the field of power engineering. Smart grids not only improve the reliability of power systems, but also support more complex power data collection and analysis. In recent years, power system data acquisition technology has continued to advance. By introducing advanced sensor technology and data processing technology, the operation status of power systems can be monitored and managed in real time. For example, modern power systems usually use SCADA systems (supervisory control and data acquisition systems) for status monitoring and data collection of power equipment, and introduce real-time data stream processing technology to support efficient data analysis. However, existing power quality monitoring systems still have certain limitations when processing complex power system data, including low data processing efficiency, insufficient anomaly detection accuracy, and poor adaptability to dynamic power load changes.
[0003] Current power quality monitoring methods mainly focus on traditional statistical analysis and simple machine learning models. Although these methods can detect abnormal conditions in the power grid to a certain extent, they are often unable to effectively handle large-scale power data and real-time changing load models. Especially in the fusion of power grid data and sensor data, existing technologies usually face problems such as data integration difficulties, processing delays, and poor adaptability of analysis models. Traditional methods are difficult to fully consider the dynamic characteristics of the power grid and complex environmental factors, which limits the accurate assessment of power quality. Summary of the invention
[0004] The purpose of the present invention is to provide a power quality monitoring method based on the MQTT protocol to solve the problems of insufficient anomaly detection accuracy and poor adaptability to dynamic power load changes in the prior art.
[0005] To solve the above technical problems, the present invention provides the following technical solutions, including: collecting power system data and actual sensor data, wherein the power system data includes power grid topology, power equipment parameters, and load model; constructing a power grid digital twin to generate virtual sensor data; fusing actual sensor data and virtual sensor data; and based on the MQTT protocol, transmitting the fused data to a central server for power quality analysis.
[0006] As a preferred solution of the power quality monitoring method based on the MQTT protocol described in the present invention, the actual sensor data is collected, including: installing and configuring the OPC UA server, the configuration parameters include node address, endpoint URL, authentication and security policy; defining the OPC UA node in the OPC UA server, and each actual sensor data point is mapped to an OPC UA node; selecting the OPC UA client library to connect the SCADA system to the OPC UA server; obtaining the actual sensor data, including temperature, pressure and vibration data, through a subscription mechanism.
[0007] As a preferred solution of the power quality monitoring method based on the MQTT protocol described in the present invention, the generating of virtual sensor data includes: establishing a digital twin of the power grid according to the power system data and through a modeling tool; setting the working conditions according to the operating conditions, simulating the operating status of the power grid on the digital twin of the power grid, and generating virtual sensor data.
[0008] As a preferred solution of the power quality monitoring method based on the MQTT protocol described in the present invention, the fusion of actual sensor data and virtual sensor data includes:
[0009] Q(t)=λ1(t)D(t)+λ2(t)V(t)+δ(t)
[0010] Where Q is the fused data at time t, λ1(t) and λ2(t) are the fusion weights dynamically adjusted with time t, λ1(t)+λ2(t)=1, D(t) is the actual sensor data at time t, V(t) is the virtual sensor data at time t, and δ(t) is the adaptive error correction term at time t.
[0011] As a preferred solution of the power quality monitoring method based on the MQTT protocol described in the present invention, power quality analysis includes: a central server is provided with an analysis model, and the analysis model includes an input layer, a convolution layer, a deep neural network layer, an attention mechanism layer, a regularization layer and an output layer; the fused data enters the analysis model through the input layer to perform power quality analysis, and detect abnormal conditions in the power grid, including voltage abnormalities, current abnormalities, frequency abnormalities, equipment failures, and load abnormalities; wherein the deep neural network layer includes four hidden layers, and a residual connection is set between every two hidden layers.
[0012] As a preferred solution of the power quality monitoring method based on the MQTT protocol described in the present invention, it also includes: according to the carbon footprint data and power analysis results , using genetic algorithm GA to generate optimization suggestions , to optimize electricity usage behavior;
[0013]
[0014] In the formula, is the optimization coefficient, v is the correction coefficient, To optimize the results.
[0015] As a preferred solution of the power quality monitoring method based on the MQTT protocol described in the present invention, it also includes: monitoring the MQTT network status, analyzing network delay and packet loss rate, and identifying network faults; when a network fault is detected, switching to a backup network path or restarting the faulty node.
[0016] The present invention also provides an electric energy quality monitoring device based on the MQTT protocol, comprising: a data acquisition module, configured to execute the collection of power system data and actual sensor data, wherein the power system data includes the power grid topology, power equipment parameters, and load model; a virtual data generation module, configured to execute the construction of a power grid digital twin and generate virtual sensor data; a data fusion module, configured to execute the fusion of actual sensor data and virtual sensor data; and an analysis module, configured to execute based on the MQTT protocol and transmit the fused data to a central server for power quality analysis.
[0017] The present invention also provides a terminal device, comprising:
[0018] one or more processors;
[0019] A memory, coupled to the processor, for storing one or more programs;
[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the power quality monitoring method based on the MQTT protocol as described in any one of the above items.
[0021] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the power quality monitoring method based on the MQTT protocol as described in any one of the above items.
[0022] Beneficial effects of the present invention: The present invention deeply integrates actual power grid operation data with virtual data by constructing a digital twin of the power grid and generating virtual sensor data, and improves the detection accuracy of power grid anomalies by optimizing the deep neural network structure. It can also provide optimization suggestions based on carbon footprint data and electric energy analysis results, thereby improving the operating efficiency of the power system while reducing energy consumption and environmental impact. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:
[0024] Figure 1 A schematic diagram of a flow chart of a power quality monitoring method based on the MQTT protocol according to a first embodiment of the present invention;
[0025] Figure 2 It is a schematic diagram of the process of generating optimization results described in the first embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0027] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0028] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0029] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0030] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0031] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0032] Example 1
[0033] Reference Figure 1~Figure 2 , which is the first embodiment of the present invention, and provides a method for monitoring power quality based on the MQTT protocol, comprising:
[0034] S1: Collect power system data and actual sensor data. The power system data includes power grid topology, power equipment parameters, and load model.
[0035] Grid topology: The physical structure of the grid, including the location and connection relationships of power plants, substations, transmission lines, distribution lines, etc.
[0036] Power equipment parameters: rated capacity, voltage level, winding ratio of transformer; rated power and efficiency of generator; resistance, reactance, length of line, etc.
[0037] Load model: data such as load type (industrial, commercial, residential, etc.), load curve, load forecast, etc.
[0038] This embodiment designs an OPC UA (OPC Unified Architecture) interface and connects it to the SCADA system to obtain sensor data in real time. Specifically, the OPC UA server is installed and configured, and the configuration parameters include node address, endpoint URL, authentication and security policy;
[0039] Define OPC UA nodes in the OPC UA server. Each sensor data point is mapped to an OPC UA node.
[0040] Select the OPC UA client library, choose to use the opcua library in Python, and write code to connect the SCADA system to the OPC UA server;
[0041] The actual sensor data, including temperature, pressure and vibration data, is obtained through the subscription mechanism. After subscribing to a node, when the data changes, the server will automatically push updates to the client.
[0042] The collected power system data and actual sensor data are cleaned and formatted to ensure data consistency and accuracy.
[0043] S2: Build a digital twin of the power grid and generate virtual sensor data.
[0044] A digital twin of the power grid is established based on the power system data and through modeling tools. Specifically, a modular approach is used in Simulink to define the topology of the power grid, and components in the power system library, such as generators, transformers, transmission lines, loads, etc., are connected according to the actual power grid structure. Power equipment parameters, load models, etc. are input into the corresponding components, and specific parameters of each component are set.
[0045] Add control and protection system models of the power grid, such as voltage regulators, relay protection devices, etc., to simulate the control strategy and fault handling mechanism of the power grid.
[0046] Set operating conditions according to the operating conditions (such as normal operation, fault status, maintenance status, etc.), simulate the operating status of the power grid on the power grid digital twin, and generate virtual sensor data, including temperature, pressure and vibration data.
[0047] S3: Fusion of actual sensor data and virtual sensor data.
[0048] Before data fusion, the actual sensor data and virtual sensor data are preprocessed, and noise filtering techniques (such as wavelet transform, empirical mode decomposition, etc.) are applied to reduce the impact of measurement noise and ensure the compatibility of different data sources. The actual sensor data and virtual sensor data need to be standardized or normalized to eliminate the dimensional differences between the data sources so that the data can be effectively fused.
[0049] Time-varying weights and adaptive adjustment mechanisms are introduced into the data fusion formula, including:
[0050] Q(t)=λ1(t)D(t)+λ2(t)V(t)+δ(t)
[0051] Where Q is the fused data at time t, λ1(t) and λ2(t) are the fusion weights dynamically adjusted with time t, λ1(t)+λ2(t)=1, D(t) is the actual sensor data at time t, V(t) is the virtual sensor data at time t, and δ(t) is the adaptive error correction term at time t.
[0052]
[0053] In the formula, δ0 is the initial error value, e(t-1) is the prediction error at the previous moment, and α is the adjustment coefficient, which determines the response degree of the error correction term δ(t) to the error e(t-1) at the previous moment. This application dynamically optimizes α through a PID controller, and the formula is as follows:
[0054]
[0055] in: is the output of the PID controller, i.e., the value of adjusting α; q(t) is the difference between the target value and the actual value; K p K is the proportional gain, which determines the instantaneous response of the error to the output of the PID controller; i K is the integral gain, i.e., the cumulative response of the PID controller to the error. The integral term is used to eliminate long-term deviations in the system. d is the differential gain, which is the response of the PID controller to the rate of change of the error. The differential term is used to predict future changes in the error, which helps to improve the stability and response speed of the system. Represents the error accumulation from time 0 to the current time t, used for integral control, Represents any time point between the start time and the current time t, which is used to calculate the cumulative effect; It is a feedforward control item, which is adjusted according to the system input or external disturbance to improve the system's response to external disturbance.
[0056] Preferably, the PID controller designed in the present application combines feedforward control and feedback control, thereby improving control performance, especially when the disturbance changes greatly.
[0057] S4: Based on the MQTT protocol, the integrated data is transmitted to the central server for power quality analysis.
[0058] Monitor MQTT network status, analyze network latency and packet loss rate, and identify network failures;
[0059] When a network failure is detected, it switches to an alternate network path or restarts the failed node to ensure data transmission continuity.
[0060] The central server is equipped with an analysis model, which includes an input layer, a convolution layer, a deep neural network layer, an attention mechanism layer, a regularization layer, and an output layer. The fused data is fed into the analysis model through the input layer to perform power quality analysis and detect abnormal conditions in the power grid, including voltage abnormalities (voltage fluctuations, voltage mutations), current abnormalities (overload, short circuit, etc.), frequency abnormalities, equipment failures (transformer, circuit breaker failures), and load abnormalities.
[0061] Among them, the input layer is used to process the input data; the convolution layer includes 32 convolution kernels (size is 3x3), the maximum pooling layer (size is 2x2), and the ReLU activation function is used.
[0062] The deep neural network layer includes four hidden layers, of which the first hidden layer includes 128 neurons and uses ReLU as the activation function; the second hidden layer includes 256 neurons and uses ReLU as the activation function; the third hidden layer includes 512 neurons and uses ReLU as the activation function; the fourth hidden layer includes 256 neurons and uses ReLU as the activation function. A residual connection is set between every two hidden layers to improve the training stability and convergence speed of the network. Specifically, a skip connection is used to directly add the output of the previous layer to the input of the subsequent layer. The residual connection formula is:
[0063] Outputresidual=Outputlayer+Inputlayer
[0064] In the formula, Outputresidual is the residual output, Outputlayer is the output of the current layer, and Inputlayer is the input of the current layer.
[0065] The attention mechanism layer includes positional encoding and self-attention mechanism. Positional Encoding: Positional encoding is introduced to enhance the understanding of position information in sequence data; Self-Attention: Self-Attention layer is used to weight features and highlight important input features.
[0066] Regularization layers: (1) Dropout: Dropout is applied after each hidden layer with a ratio of 0.5 to reduce overfitting; (2) Batch Normalization: Batch Normalization layers are added after each layer to standardize the input of each batch and reduce internal covariate shift; (3) L2 Regularization: L2 regularization terms are added to the loss function to prevent weights from being too large, thereby reducing overfitting.
[0067] S5: Based on carbon footprint data and power analysis results , Genetic Algorithm (GA) is used to generate optimization suggestions , to optimize electricity usage behavior.
[0068] Carbon footprint data Including electricity consumption, device usage time, energy source, etc.
[0069] Reference Figure 2 , using carbon footprint data and power analysis results , generate the initial population, each individual represents a possible combination of optimization strategies, such as adjusting power usage time, changing equipment priority or optimizing equipment configuration.
[0070] Set the fitness function to evaluate the pros and cons of each individual (i.e. each optimization strategy).
[0071] Based on the initial population, the genetic algorithm is used to perform selection, crossover and mutation operations to generate a new population. This process is repeated until the algorithm converges or reaches the preset number of iterations. Finally, an optimization result is output. , which represents the carbon emission minimization and power quality maximization that can be achieved through the optimal strategy combination under current conditions.
[0072] Furthermore, a data-driven rule set based on expert knowledge or experience is established to process the output of the genetic algorithm. For example, fuzzy classification of equipment (such as "high energy efficiency equipment" and "medium energy efficiency equipment") is performed based on changes in power consumption patterns.
[0073] The optimization results generated by the genetic algorithm are further adjusted and optimized using a fuzzy logic system, making the suggestions more practical and adaptable.
[0074] Defuzzify the output of the fuzzy logic system. Finally, combine the genetic algorithm optimization results with the fuzzy logic processing results to generate specific optimization suggestions. :
[0075]
[0076] In the formula, is the optimization coefficient, which is used to adjust the weight of the genetic algorithm results in the final recommendation; v is the correction coefficient, which is used to compensate for the possible deviation in the results of the genetic algorithm. To optimize the results.
[0077] Specific optimization suggestions For example: adjust the usage time of high-energy-consuming equipment, and shift the use of equipment during peak electricity consumption periods to low electricity consumption periods; optimize equipment scheduling and priority settings to reduce energy consumption and improve energy efficiency; recommend replacing high-efficiency equipment to reduce overall carbon emissions.
[0078] The following types of suggestions may be included, the specific content of which depends on the initial state of the carbon footprint and power quality, and is not limited in this embodiment: (1) Optimization of equipment usage time: It is recommended to use high-power consumption equipment (such as air conditioners, electric water heaters, etc.) during non-peak hours to reduce grid load and carbon emissions. (2) Equipment replacement or upgrade: It is recommended to replace old low-efficiency equipment (such as replacing energy-saving light bulbs, upgrading to appliances with higher energy efficiency levels) to reduce carbon footprint. (3) Behavior change suggestions: It is recommended that users change their daily electricity usage behavior, such as reducing standby power consumption or reducing unnecessary equipment use. (4) Power quality improvement suggestions: For detected power quality problems, it is recommended to install filters or stabilizers to improve voltage fluctuations or harmonic distortion problems.
[0079] Example 2
[0080] The present invention provides a power quality monitoring device based on the MQTT protocol, which is used to implement the steps of the power quality monitoring method based on the MQTT protocol as in any of the above embodiments. The power quality monitoring device based on the MQTT protocol includes:
[0081] A data acquisition module is configured to acquire power system data and sensor data, wherein the power system data includes a power grid topology, power equipment parameters, and a load model;
[0082] A virtual data generation module is configured to execute the construction of a power grid digital twin and generate virtual sensor data;
[0083] A data fusion module is configured to perform fusion of actual sensor data and virtual sensor data;
[0084] The analysis module is configured to execute the MQTT protocol and transmit the fused data to the central server for power quality analysis.
[0085] Example 3
[0086] This embodiment provides a terminal device, including:
[0087] one or more processors;
[0088] A memory, coupled to the processor, for storing one or more programs;
[0089] When the one or more programs are executed by the one or more processors, the one or more processors implement the power quality monitoring method based on the MQTT protocol as described above.
[0090] The processor is used to control the overall operation of the terminal device to complete all or part of the steps of the above-mentioned power quality monitoring method based on the MQTT protocol. The memory is used to store various types of data to support the operation of the terminal device, and these data may include, for example, instructions for any application or method used to operate on the terminal device, and application-related data. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (ErasableProgrammable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, disk or optical disk.
[0091] The terminal device can be implemented by one or more application-specific integrated circuits (Application Specific1n Integrated Circuit, ASC), digital signal processors (Digital Signal Processor, DSP), digital signal processing devices (Digital Signal Processing Device, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field Programmable Gate Array, FPGA), controllers, microcontrollers, microprocessors or other electronic components, and is used to execute the power quality monitoring method based on the MQTT protocol as described in any of the above embodiments, and achieve the technical effect consistent with the above method.
[0092] Example 4
[0093] This embodiment provides a computer-readable storage medium, and when the program instructions are executed by a processor, the steps of the power quality monitoring method based on the MQTT protocol as described in any of the above embodiments are implemented. For example, the computer-readable storage medium can be the above-mentioned memory including the program instructions, and the above-mentioned program instructions can be executed by the processor of the terminal device to complete the power quality monitoring method based on the MQTT protocol as described in any of the above embodiments, and achieve the technical effect consistent with the above method.
[0094] It should be appreciated that embodiments of the present invention may be implemented or enforced by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable memory. The method may be implemented in a computer program using standard programming techniques - including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the methods and drawings described in the specific embodiments. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if desired, the program may be implemented in an assembly or machine language. In any case, the language may be a compiled or interpreted language. In addition, the program may be run on a programmed ASIC for this purpose.
[0095] Furthermore, the operations of the processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) that is executed collectively on one or more processors, by hardware, or a combination thereof. The computer program includes a plurality of instructions that may be executed by one or more processors.
[0096] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or part thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor, the invention described herein includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques described in the present invention, the present invention also includes the computer itself. The computer program can be applied to input data to perform the functions described herein, thereby converting the input data to generate output data stored in a non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the converted data represents a physical and tangible object, including a specific visual depiction of the physical and tangible object produced on a display.
[0097] As used in this application, the terms "component", "module", "system", etc. are intended to refer to a computer-related entity, which can be hardware, firmware, a combination of hardware and software, software, or software in operation. For example, a component can be, but is not limited to: a process running on a processor, a processor, an object, an executable file, a thread in execution, a program, and / or a computer. As an example, an application running on a computing device and the computing device can both be components. One or more components can exist in a process and / or thread in execution, and a component can be located in a computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures thereon. These components can communicate in a local and / or remote process manner, such as according to a signal having one or more data packets (e.g., data from a component that interacts with another component in a local system, a distributed system, and / or interacts with other systems in a signal manner through a network such as the Internet).
[0098] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for monitoring power quality based on the MQTT protocol, characterized in that: include: Collecting power system data and actual sensor data, wherein the power system data includes power grid topology, power equipment parameters, and load models; Constructing a digital twin of the power grid and generating virtual sensor data; wherein the generating virtual sensor data comprises: establishing a digital twin of the power grid based on the power system data and using a modeling tool; setting working conditions based on the operating conditions, simulating the operating state of the power grid on the digital twin of the power grid, and generating virtual sensor data, including temperature, pressure and vibration data; Fusion of real sensor data and virtual sensor data; Based on the MQTT protocol, the fused data is transmitted to the central server for power quality analysis; Collecting actual sensor data includes: installing and configuring the OPC UA server, with configuration parameters including node address, endpoint URL, authentication and security policy; defining OPC UA nodes in the OPC UA server, with each actual sensor data point mapped to an OPC UA node; selecting the OPC UA client library to connect the SCADA system to the OPC UA server; obtaining actual sensor data, including temperature, pressure and vibration data, through a subscription mechanism; The fusion of actual sensor data and virtual sensor data includes: Q(t)=λ1(t)D(t)+λ2(t)V(t)+δ(t) Where Q is the fused data at time t, λ1(t) and λ2(t) are the fusion weights dynamically adjusted with time t, λ1(t)+λ2(t)=1, D(t) is the actual sensor data at time t, V(t) is the virtual sensor data at time t, and δ(t) is the adaptive error correction term at time t; ; In the formula, δ0 is the initial error value, e(t-1) is the prediction error at the previous moment, and α is the adjustment coefficient, which determines the response degree of the error correction term δ(t) to the error e(t-1) at the previous moment. This application dynamically optimizes α through a PID controller, and the formula is as follows: ; in: is the output of the PID controller, i.e., the value of adjusting α; q(t) is the difference between the target value and the actual value; K p K is the proportional gain, which determines the instantaneous response of the error to the output of the PID controller; i K is the integral gain, i.e., the cumulative response of the PID controller to the error. The integral term is used to eliminate long-term deviations in the system. d is the differential gain, which is the response of the PID controller to the rate of change of the error. The differential term is used to predict future changes in the error, which helps to improve the stability and response speed of the system. Represents the error accumulation from time 0 to the current time t, used for integral control, Represents any time point between the start time and the current time t, which is used to calculate the cumulative effect; It is a feedforward control item, which is adjusted according to the system input or external disturbance to improve the system's response to external disturbance; Among them, power quality analysis includes: The central server is provided with an analysis model, which includes an input layer, a convolution layer, a deep neural network layer, an attention mechanism layer, a regularization layer and an output layer; the fused data is fed into the analysis model through the input layer to perform power quality analysis and detect abnormal conditions in the power grid, including voltage abnormality, current abnormality, frequency abnormality, equipment failure, and load abnormality; Among them, the input layer is used to process input data; the convolution layer includes 32 convolution kernels and a maximum pooling layer, using the ReLU activation function; the deep neural network layer includes four hidden layers, of which the first hidden layer includes 128 neurons and uses the ReLU activation function; the second hidden layer includes 256 neurons and uses the ReLU activation function; the third hidden layer includes 512 neurons and uses the ReLU activation function; the fourth hidden layer includes 256 neurons and uses the ReLU activation function. A residual connection is set between every two hidden layers, and a jump connection is used to directly add the output of the previous layer to the input of the subsequent layer. The residual connection formula is: Outputresidual=Outputlayer+Inputlayer In the formula, Outputresidual is the residual output, Outputlayer is the output of the current layer, and Inputlayer is the input of the current layer.
2. The power quality monitoring method based on the MQTT protocol according to claim 1, characterized in that: Also includes: According to carbon footprint data and power analysis results , using genetic algorithm GA to generate optimization suggestions , to optimize electricity usage behavior; ; In the formula, is the optimization coefficient, v is the correction coefficient, To optimize the results.
3. The power quality monitoring method based on the MQTT protocol according to claim 2, characterized in that: Also includes: Monitor MQTT network status, analyze network latency and packet loss rate, and identify network failures; When a network failure is detected, switch to an alternate network path or reboot the failed node.
4. A power quality monitoring device based on the MQTT protocol, used to implement the power quality monitoring method based on the MQTT protocol as described in any one of claims 1 to 3, characterized in that: The power quality monitoring device based on the MQTT protocol includes: A data acquisition module is configured to acquire power system data and actual sensor data, wherein the power system data includes a power grid topology, power equipment parameters, and a load model; A virtual data generation module is configured to execute the construction of a power grid digital twin and generate virtual sensor data; A data fusion module is configured to perform fusion of actual sensor data and virtual sensor data; The analysis module is configured to execute the MQTT protocol and transmit the fused data to the central server for power quality analysis.
5. A terminal device, characterized in that: include: one or more processors; A memory, coupled to the processor, for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the power quality monitoring method based on the MQTT protocol as described in any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program is executed by a processor to implement the power quality monitoring method based on the MQTT protocol as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Microgrid energy management system based on digital twinning
CN112332444A
Power grid digital twin system construction method and device, electronic equipment and storage medium
CN115954933A
Digital twin power grid data transmission system
CN117674421A