Electric energy meter containing wireless communication module

By combining voltage transformer and current transformer with high-precision analog-to-digital conversion and LoRa protocol, wavelet packet decomposition and Kalman filtering are dynamically adjusted, which solves the problem of low channel resource utilization of wireless communication modules in the power system, interference easily causes data packet loss and insufficient detection sensitivity, and realizes high real-time and high-reliability power data transmission.

CN120490594AInactive Publication Date: 2025-08-15CHENGDU XINKE GUOFENG ENERGY TECHNOLOGY CO LTD
View PDF 0 Cites 12 Cited by

Patent Information

Application Number
CN202510637668.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-08-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing wireless communication modules have problems in the power system where channel resources are idle or congested, transmission efficiency and real-time decreases, channel interference can easily cause data packet loss or code errors, voltage fluctuation detection cannot adapt to dynamic changes in the power grid load, and traditional compression algorithms do not consider the multi-dimensional correlation characteristics of power parameters, resulting in the loss of key feature information.

Method used

The voltage transformer and current transformer are used to collect voltage, current and power factors, combine the STM32F103 chip to perform analog-to-digital conversion, configure the spread spectrum factor based on the LoRa protocol, and dynamically adjust the number of decomposition layers and quantization thresholds through the wavelet packet decomposition algorithm and the Kalman filtering algorithm, and combine the sliding window algorithm and the DBSCAN clustering algorithm to realize adaptive feature extraction and abnormal detection of electrical energy parameters.

Benefits of technology

It improves data acquisition accuracy, transmission efficiency, anti-interference ability and abnormal detection sensitivity, reduces communication delay and misjudgment rate, and enhances the robustness of power data in complex network environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120490594A_ABST
    Figure CN120490594A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of Internet of Things, in particular to an electric energy meter with a wireless communication module, which comprises a parameter acquisition module, a communication optimization module, an interference analysis module, a fluctuation evaluation response module and a load classification module. According to the invention, a mutual inductor captures a single-phase circuit signal, analog-to-digital conversion is combined to realize parameter quantization, interference is eliminated based on an active power identification algorithm, a structured parameter set is integrated, a wavelet packet decomposition parameter and a quantization threshold are dynamically adjusted according to a load rate, and spread spectrum factor configuration is adopted to improve channel efficiency. The method comprises the following steps: extracting key features by using wavelet packet characteristics; continuously monitoring voltage fluctuation by a sliding window; detecting and identifying an instantaneous interference event by a break variable; inhibiting noise by Kalman filtering and predicting a trend; and the performances of the system in the aspects of acquisition precision, transmission efficiency, interference immunity and detection sensitivity are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Internet of Things, and in particular to an electric energy meter containing a wireless communication module. Background Art

[0002] The field of IoT technology encompasses core elements such as information perception, reliable transmission, and intelligent processing. Its goal is to connect various physical objects to the network, enabling real-time monitoring, remote control, and intelligent management of their status. This field relies on fundamental building blocks such as sensors, wireless communications, embedded systems, and cloud platforms. Through the collaborative operation of terminal devices, network transmission layers, and platform support layers, it establishes a broadly distributed, intelligent perception network. IoT technology has been widely applied in various scenarios, including industrial production, energy management, transportation, and environmental monitoring. The data acquisition and transmission subsystem in smart power systems is a key component, involving the real-time collection, remote reporting, and centralized management of electricity metering data.

[0003] Among them, an electric energy meter containing a wireless communication module refers to a terminal metering device with the functions of electricity measurement and remote data transmission. Its technical matters cover the precise measurement of electricity consumption data, remote information transmission on wireless channels, and data interaction with the concentrator. This subject completes the data collection and reporting tasks by integrating electric energy metering circuits, wireless communication devices and data coding and transmission units. It arranges the collected data in a time-division sending structure, uploads the electric energy data in the form of messages to the main control node through a preset communication frequency band, and uses a differential coding-based method to compress and transmit the collected data, effectively adapting to the long-distance transmission requirements of power data in a wireless network environment.

[0004] Existing technologies face multiple limitations in the practical application of wireless communication modules. Time-division transmission relies on fixed time slots, which can easily lead to idle or congested channel resources when network load fluctuates, resulting in reduced transmission efficiency and real-time performance. Differential coding is effective for compressing periodic, stationary data, but it struggles to balance compression and data fidelity when dealing with high-frequency, non-stationary data fluctuations in power systems, increasing network bandwidth pressure. Energy meters and concentrators communicate using a preset frequency band, lacking a dynamic mitigation mechanism for channel interference. Sudden electromagnetic interference can easily cause packet loss or bit errors. Existing voltage fluctuation detection systems often rely on fixed threshold triggering, which is inadequate to adapt to the dynamic nature of grid loads. This can result in insufficient sensitivity at low loads and increased false triggering rates at high loads. For example, in industrial power scenarios, instantaneous voltage drops caused by equipment startup and shutdown can be misinterpreted by the system as normal fluctuations, leading to malfunctioning of protective devices. Furthermore, traditional compression algorithms fail to account for the multi-dimensional correlations of energy parameters. A single quantization threshold fails to account for the varying information density of different parameters, resulting in the loss of key feature information and impacting the accuracy of subsequent analysis. Summary of the Invention

[0005] To address the multi-dimensional limitations of existing technologies in the practical application of wireless communication modules, the time-division transmission structure relies on fixed time slices. This can easily lead to idle or congested channel resources when network load fluctuates, resulting in reduced transmission efficiency and real-time performance. Differential coding is effective for compressing periodic, stationary data, but it struggles to balance compression and data fidelity when dealing with high-frequency, non-stationary fluctuating data in power systems, increasing network bandwidth pressure. The communication between the energy meter and the concentrator uses a preset frequency band, lacking a dynamic mechanism to avoid channel interference. Sudden electromagnetic interference can easily cause packet loss or bit errors. Existing voltage fluctuation detection systems are often based on fixed threshold triggering, which cannot adapt to the dynamic characteristics of grid load changes and can easily result in insufficient sensitivity at low loads or increased false triggering rates at high loads. For example, in industrial power scenarios, instantaneous voltage drops caused by equipment startup and shutdown can be misinterpreted by the system as normal fluctuations, causing protective devices to malfunction. Furthermore, traditional compression algorithms fail to consider the multi-dimensional correlation of energy parameters. A single quantization threshold cannot account for the information density differences between different parameters, resulting in the loss of key feature information and affecting the accuracy of subsequent analysis. The present invention provides an energy meter with a wireless communication module. The technical solution is as follows:

[0006] In one aspect, an electric energy meter including a wireless communication module is provided, the electric energy meter comprising:

[0007] The parameter acquisition module is used to collect the voltage, current, and power factor of the single-phase circuit through the voltage transformer and current transformer, call the STM32F103 chip to perform analog-to-digital conversion on the voltage and current, identify the active power, analyze the voltage fluctuation, integrate it into an electric energy parameter set, and transmit it to the communication optimization module;

[0008] The communication optimization module is used to call the LoRa protocol to configure the center frequency, set the spreading factor based on the SX1280 radio frequency chip, perform a wavelet packet decomposition algorithm on the voltage, current, and active power fields of the electric energy parameter set, dynamically adjust the number of decomposition layers and quantization thresholds according to the real-time load rate to generate compressed communication data, and transmit it to the interference analysis module;

[0009] An interference analysis module is configured to parse the compressed communication data, extract the voltage fluctuation field, perform mutation detection based on a sliding window algorithm, and generate an instantaneous interference flag when the voltage fluctuation exceeds an interference determination threshold, and transmit the flag to the fluctuation assessment module;

[0010] The fluctuation assessment response module is used to input the instantaneous interference mark into the Kalman filter algorithm for processing to obtain the voltage fluctuation amount, detect the dynamic fluctuation intensity of the voltage fluctuation amount based on the sliding window, generate a fluctuation abnormality signal through the dynamic threshold update mechanism, and transmit it to the load classification module.

[0011] As a further solution of the present invention, the physical layer protocol of the LoRa protocol adopts CSS modulation mode;

[0012] The decomposition layer number adjustment rule is set according to the load rate change trend. When the load rate is detected to be increasing, the decomposition layer number is increased, and when the load rate is decreasing, the decomposition layer number is reduced. By dynamically matching the decomposition layer number with the load rate, the signal decomposition accuracy can be adjusted in time when the load rate changes. In high-load scenarios, the bit error rate is reduced by more than 30%;

[0013] The interference judgment threshold is calculated based on the mean and standard deviation of historical voltage fluctuations in the same period;

[0014] The dynamic threshold setting generates a baseline value based on the historical fluctuation data of the same time period in the past 24 hours, and adjusts the baseline value by percentage based on the real-time grid load rate. For every 10% increase in the grid load rate, the baseline value is adjusted up by 5%, and for every 10% decrease in the grid load rate, the baseline value is adjusted down by 5%.

[0015] The electric energy parameter set includes voltage fluctuation rate, active power factor, and single-phase current effective value; the compressed communication data includes wavelet packet decomposition coefficient, decomposition layer number identifier, and quantization threshold parameter; the instantaneous interference mark includes disturbance detection time point, voltage deviation amplitude, and mutation level number; the fluctuation abnormal signal includes fluctuation intensity index, dynamic threshold level, and voltage stability judgment value.

[0016] As a further solution of the present invention, the parameter acquisition module includes:

[0017] The signal acquisition submodule collects the voltage signal of the voltage transformer and the current signal of the current transformer, detects the signal amplitude range, filters the high-frequency interference component through the signal conditioning circuit, calibrates the signal phase deviation, and generates a mutual inductance signal group;

[0018] The conversion and calculation submodule calls the ADC unit of the STM32F103 chip, performs synchronous sampling and analog-to-digital conversion based on the mutual inductance signal group, aligns the discrete voltage values and the discrete current values in time series, calculates the total energy within the cycle, obtains the active power value, extracts the fundamental component to calculate the power factor value, and generates an electric energy calculation data set;

[0019] The fluctuation integration submodule calculates the absolute value of the voltage difference between adjacent sampling points based on the voltage discrete value sequence in the electric energy calculation data set using a sliding window method, counts the proportion of times the absolute value of the difference in the window exceeds a set fluctuation threshold, generates a voltage fluctuation rate value, and integrates the active power value, power factor value and voltage fluctuation rate value in the electric energy calculation data set to obtain an electric energy parameter set.

[0020] As a further solution of the present invention, the communication optimization module includes:

[0021] The frequency band configuration submodule calls the active power value of the electric energy parameter set, parses the difference between the step frequency of the SX1280 chip and the internal frequency reference, compares the difference with the set offset tolerance range, filters out frequency configuration items whose offset exceeds the tolerance, obtains the frequency register items that meet the center frequency setting conditions, and obtains the frequency configuration reference value;

[0022] The frequency configuration reference value is the center frequency reference of the chip after calibration;

[0023] The spread spectrum configuration submodule calls the frequency configuration reference value, detects the chip spreading factor configuration segment, extracts the frequency band extension value and code rate impact interval associated with the spreading factor, calculates the code rate response variation amplitude of the spreading parameter under the current frequency conditions, filters the spreading factor items, and generates a bandwidth matching parameter set;

[0024] The data compression submodule calls the spreading factor parameter item in the bandwidth matching parameter set to obtain time series data consisting of voltage, current and active power, extracts fluctuation segments to calculate the quantized value of characteristic coefficients, sets the number of layers and quantization threshold intervals of wavelet packet decomposition according to the load interval level, decomposes and extracts the effective coefficients of the target frequency band, and generates compressed communication data;

[0025] The quantization threshold is a dynamic boundary value for screening effective frequency band coefficients.

[0026] As a further solution of the present invention, the characteristic coefficient quantization value adopts the formula:

[0027]

[0028] Among them, λ k Represents the quantized value of the characteristic coefficient corresponding to the current load level k, M k represents the total number of data fragments under load level k, w k,j represents the coefficient of the wavelet packet decomposition subband of the jth data segment under load level k, D k,j represents the instantaneous signal fluctuation amplitude value of the jth data segment under load level k, represents the arithmetic mean of the signal fluctuation amplitude values of all data segments under load level k, R k Represents the difference between the maximum and minimum signal fluctuation amplitude values in all data segments under load level k.

[0029] As a further solution of the present invention, the interference analysis module includes:

[0030] a voltage identification submodule, which extracts the voltage time series from the compressed communication data, divides the voltage observation segments into equal time intervals, compares the voltage fluctuation differences corresponding to the observation segments with a voltage fluctuation identification threshold, records the indexes of the observation segments whose differences are greater than the threshold, and generates abnormal voltage observation segments;

[0031] The fluctuation detection submodule calls the abnormal voltage observation section, sets the sliding window width and step size, calculates the voltage increment change value within the sliding window, compares the increment value with the fluctuation detection threshold, selects the window segment index whose fluctuation amplitude exceeds the detection threshold, and generates the sudden fluctuation time interval;

[0032] The voltage increment change value quantifies the intensity of short-term voltage fluctuations to determine whether there is a valid mutation;

[0033] The interference mark submodule obtains the corresponding voltage value change sequence according to the mutation fluctuation time interval, counts the number of continuous voltage mutations in the window, compares the number with the mutation frequency threshold, records the start and end time range of the mutation segment that meets the continuous mutation condition, and generates an instantaneous interference mark.

[0034] As a further solution of the present invention, the fluctuation assessment response module includes:

[0035] The interference signal processing submodule processes the voltage input sequence data based on the instantaneous interference mark input Kalman filter algorithm, sets the state space model parameters, calculates the prediction error to obtain the correction gain, updates the voltage state estimate update value, extracts the state estimate difference between time nodes, and generates the time series voltage fluctuation amount;

[0036] The voltage state estimation update value uses the current measurement value to correct the prediction result to obtain a more accurate estimate;

[0037] The fluctuation monitoring submodule calls the time-series voltage fluctuation quantity, divides the fluctuation sequence into fixed time intervals, sets the start and end indexes of the sliding window, compares the difference between the maximum and minimum values of the sections, calculates the section fluctuation amplitude characteristic value, and integrates them to obtain the voltage fluctuation intensity value;

[0038] The threshold update judgment submodule sets the dynamic response threshold range according to the voltage fluctuation intensity value, compares the difference between the element and the upper threshold limit, marks the event point position where the difference is greater than zero, establishes an event status identification list synchronized with the voltage sequence time index, and obtains the fluctuation abnormality signal;

[0039] The dynamic response threshold senses the system status and environmental noise in real time and adjusts the abnormality determination boundary.

[0040] As a further solution of the present invention, the voltage state estimation update value adopts the formula:

[0041]

[0042] in, Represents the updated value of the voltage state estimate at the nth sampling time point, in volts, x n Represents the estimated voltage state value predicted at the nth time point, in volts, K n represents the correction gain calculated at the nth time point, z n Represents the actual voltage measurement value collected at the nth time point, in volts.

[0043] As a further solution of the present invention, the electric energy meter further includes a load classification module:

[0044] A load classification module is used to obtain the abnormal fluctuation signal and transient interference mark, call the DBSCAN clustering algorithm to identify the load type, perform density cluster analysis on the voltage and current based on the preset neighborhood radius and minimum sample number, and output the classification result load category label;

[0045] The load category label includes resistive load type, inductive load type, and capacitive load type.

[0046] As a further solution of the present invention, the load classification module includes:

[0047] The signal processing submodule calls the abnormal fluctuation signal and transient interference mark, extracts the range and root mean square value of the voltage mark interval, obtains the peak-to-peak value and duration of the current transient interference, differentially calculates the voltage change rate and current jump value of adjacent sampling points, compares the change rate with the interference threshold, screens the continuous intervals where the voltage change rate exceeds the limit and the current jump value simultaneously exceeds the limit, and generates an abnormal feature vector set;

[0048] The interference threshold is determined based on the voltage change rate and the current jump amount synchronously exceeding the limit;

[0049] The clustering parameter configuration submodule uses the Euclidean distance to calculate the distance between the center points of adjacent abnormal windows based on the timestamp distribution of the abnormal feature vector set, and uses the statistical mean of the distance as the density distribution reference. The neighborhood radius is linearly mapped to the reference, and the minimum number of samples is adjusted to the reciprocal of the neighborhood radius mapping value to generate a clustering parameter group.

[0050] The density clustering execution submodule traverses the Euclidean distance of the voltage extreme difference and the current peak-to-peak value in the abnormal feature vector set according to the neighborhood radius and the minimum number of samples of the clustering parameter group, identifies the core points that meet the requirement that the number of samples within the neighborhood radius exceeds the minimum number of samples, assigns the boundary points whose distance from the core points is less than the neighborhood radius to the corresponding clusters, removes isolated points that do not meet the neighborhood density conditions, and outputs the classification result load category label.

[0051] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0052] The system captures multi-dimensional signals from single-phase circuits using voltage and current transformers. High-precision analog-to-digital conversion technology is used to accurately quantify voltage, current, and power factor. Active power identification algorithms are used to eliminate interference from ineffective components, integrating discrete data into structured parameter sets. The number of wavelet packet decomposition layers and quantization thresholds are dynamically adjusted based on real-time load factors. Spreading factor configuration is used to optimize wireless channel resource utilization. The multi-resolution characteristics of wavelet packets are leveraged for adaptive feature extraction of power parameters, reducing data redundancy while retaining key feature information. A sliding window algorithm is used to continuously monitor voltage fluctuations, combined with a mutation detection mechanism to rapidly identify transient interference events. A Kalman filter algorithm is used to suppress noise and predict trends in fluctuations. A dynamic threshold update mechanism eliminates the adaptability limitations of fixed thresholds to complex operating conditions. An anomaly assessment model is established by combining dynamic fluctuation intensity calculations. The above-mentioned technical means form a closed-loop optimization link, which significantly improves the system in terms of data collection accuracy, transmission efficiency, anti-interference ability and anomaly detection sensitivity, effectively reduces communication delay and misjudgment rate, enhances the robustness of power data in complex network environments, and provides high real-time and high reliability decision support for smart grid operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of 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 work.

[0054] Figure 1 This is a schematic diagram of the electrical energy representation of the wireless communication module of the present invention;

[0055] Figure 2 This is a schematic diagram of the electric energy meter framework of the present invention. DETAILED DESCRIPTION

[0056] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0057] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as an "exemplary" in the present invention should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner. Furthermore, in the embodiments of the present invention, "and / or" can mean both or either of the two.

[0058] In the embodiments of the present invention, the terms "image" and "picture" may be used interchangeably. It should be noted that, when the distinction between them is not emphasized, their intended meanings are the same. The terms "of," "corresponding," and "corresponding" may be used interchangeably. It should be noted that, when the distinction between them is not emphasized, their intended meanings are the same.

[0059] In the embodiments of the present invention, sometimes a subscript such as W1 may be written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are the same.

[0060] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0061] The embodiment of the present invention provides an electric energy meter including a wireless communication module, such as Figure 1 The schematic diagram of an electric energy meter with a wireless communication module is shown. The electric energy meter includes:

[0062] The parameter acquisition module is used to collect the voltage, current, and power factor of the single-phase circuit through the voltage transformer and current transformer, call the STM32F103 chip to perform analog-to-digital conversion on the voltage and current, identify the active power, analyze the voltage fluctuation, integrate it into an electric energy parameter set, and transmit it to the communication optimization module;

[0063] The communication optimization module is used to call the LoRa protocol to configure the center frequency, set the spreading factor based on the SX1280 radio frequency chip, perform a wavelet packet decomposition algorithm on the voltage, current, and active power fields of the power parameter set, and dynamically adjust the number of decomposition layers and quantization thresholds based on the real-time load rate to generate compressed communication data, which is then passed to the interference analysis module.

[0064] The interference analysis module is used to parse the compressed communication data, extract the voltage fluctuation field, and perform mutation detection based on the sliding window algorithm. When the voltage fluctuation exceeds the interference judgment threshold, it generates an instantaneous interference flag and transmits it to the fluctuation assessment module;

[0065] The fluctuation assessment response module is used to input the instantaneous interference mark into the Kalman filter algorithm to obtain the voltage fluctuation amount, detect the dynamic fluctuation intensity of the voltage fluctuation amount based on the sliding window, generate the fluctuation abnormality signal through the dynamic threshold update mechanism, and transmit it to the load classification module;

[0066] The load classification module is used to obtain abnormal fluctuation signals and transient interference marks, call the DBSCAN clustering algorithm to identify the load type, perform density cluster analysis on voltage and current based on the preset neighborhood radius and minimum sample number, and output the classification result load category label;

[0067] The electric energy parameter set includes voltage fluctuation rate, active power factor, and single-phase current effective value. The compressed communication data includes wavelet packet decomposition coefficient, decomposition layer number identifier, and quantization threshold parameter. The instantaneous interference mark includes the disturbance detection time point, voltage deviation amplitude, and mutation level number. The fluctuation abnormal signal includes the fluctuation intensity index, dynamic threshold level, and voltage stability judgment value. The load category label includes resistive load type, inductive load type, and capacitive load type.

[0068] Specifically, if Figure 2 As shown, the parameter acquisition module includes:

[0069] The signal acquisition submodule collects the voltage signal of the voltage transformer and the current signal of the current transformer, detects the signal amplitude range, filters the high-frequency interference component through the signal conditioning circuit, calibrates the signal phase deviation, and generates a mutual inductance signal group;

[0070] The voltage signal of the voltage transformer and the current signal of the current transformer are collected. At the sampling time t=0.00s, the initial voltage signal 220.5V is collected through the voltage transformer and the current current value 4.5A is obtained through the current transformer. Then, the voltage and current signals are continuously sampled at intervals of 0.02s until the sampling sequence continues to 0.08s. A total of 5 groups of signal samples are collected. After each group of signals is obtained, the amplitude detection process is immediately entered. For the voltage signal 220.5V to 222.3V and the current signal 4.4A to 4.7A before conditioning, the voltage detection threshold is set to ±10V and the current detection threshold is set to ±1A. The signal amplitude is compared with the threshold interval one by one to determine whether it is within the valid range. If the signal amplitude falls within the interval, it is marked as a valid signal, otherwise it is discarded. The valid signal is then input into the signal The signal conditioning circuit filters the signal. During the filtering process, components with frequencies above 1kHz are blocked, retaining only the fundamental and low-order harmonic components. In this example, the original voltage signal of 220.5V is conditioned to 220.3V, and the current signal of 4.5A is conditioned to 4.48A. The phase relationship between the signals in the current sampling group is then identified based on the sampling period and frequency settings. If a phase offset is detected between the voltage and current signals, the timing sequences of the voltage and current signals are called and phase-calibrated by alignment. For example, if the voltage phase leads by 5 degrees, the offset is eliminated by adjusting the data timestamp backward by 0.00028s. All conditioned and calibrated signals are recorded as a group to form a mutual inductance signal group. Each data group contains the conditioned voltage value, the conditioned current value, and the corresponding timestamp information, as shown in Table 1.

[0071] Table 1: Mutual inductance signal sampling example

[0072]

[0073] As shown in Table 1, the voltage and current signal data at the five sampling moments have been recorded, and after signal conditioning, the corrected voltage and current values are obtained. This data is used for the subsequent calculation of active power and voltage fluctuation rate.

[0074] The conversion and calculation submodule calls the ADC unit of the STM32F103 chip, performs synchronous sampling and analog-to-digital conversion based on the mutual inductance signal group, aligns the discrete voltage and current values in time series, calculates the total energy within the cycle, obtains the active power value, extracts the fundamental component, calculates the power factor value, and generates the electric energy calculation data set;

[0075] To call the ADC unit of the STM32F103 chip, the on-chip ADC channel must first be initialized and configured in dual-channel synchronous sampling mode. The conditioned voltage and current signals are connected through the GPIO port. After the sampling start trigger signal arrives, the analog-to-digital conversion is completed with 12-bit accuracy. Each sampling conversion takes about 1μs per channel. The obtained discrete voltage and current values are arranged according to the timestamp and form aligned pairs. For example, t = 0.02s corresponds to a voltage value of 220.8V and a current value of 4.58A. Each set of data is sampled at a fixed frequency of f = 50Hz. The total energy within the calculation period is calculated by summing the products of each pair of voltage and current values within the sampling interval Δt = 0.02s using the energy accumulation method. The number of sampling points per cycle is defined as N = 5. The active power is calculated using the formula:

[0076]

[0077] Among them, P represents the average value of the product of voltage and current at all sampling points in a set cycle, that is, the active power in the cycle, N represents the total number of sampling times completed in the cycle, and U i Represents the discrete value of the voltage signal after signal conditioning corresponding to the i-th group sampling time. This value is the effective voltage value obtained by filtering and phase calibration after voltage transformer sampling. I i represents the discrete value of the current signal after signal conditioning corresponding to the i-th group of sampling moments. This value is also the effective current value after current transformer sampling, interference suppression, and timing adjustment.

[0078] Substitute the data in Table 1 above to obtain:

[0079]

[0080] The fundamental component is extracted synchronously to lock the signal item within the 50Hz frequency range, from which the phase difference Δθ between the fundamental voltage and current is obtained and the power factor is calculated:

[0081] PF = cos(Δθ);

[0082] During the actual measurement, Δθ is 10°, so the power factor is:

[0083] PF=cos(10°)≈0.9848;

[0084] Finally, an electric energy calculation data set is constructed, whose fields include discrete voltage values at multiple moments, discrete current values, and the calculated active power of 998.12W and power factor of 0.9848.

[0085] The fluctuation integration submodule uses a sliding window method to calculate the absolute value of the voltage difference between adjacent sampling points based on the voltage discrete value sequence in the power calculation data set. It then calculates the percentage of times the absolute value of the difference in the window exceeds the set fluctuation threshold to generate a voltage fluctuation rate value. It then integrates the active power value, power factor value, and voltage fluctuation rate value in the power calculation data set to obtain the power parameter set.

[0086] Based on the voltage discrete value sequence in the electric energy calculation data set, the sliding window width is set to 3, that is, the three adjacent sampling points are analyzed, and the absolute value of the voltage difference between each two points is calculated in turn. In the window of t = 0.00s to 0.04s, the calculated differences of the three points 220.3V, 220.8V, and 219.6V are |220.3-220.8| = 0.5V and |220.8-219.6| = 1.2V respectively. The difference is compared with the fluctuation threshold of 1V. 0.5V does not exceed the threshold, 1.2V exceeds the threshold, and the number of times exceeding the limit is recorded as 1, and the total number is 2. Then the fluctuation rate of this window is 1 / 2 = 0.5. Similarly, the subsequent windows can be slid one by one and the fluctuation rate of each window can be counted. The threshold is set to 1V. Its value is based on the allowable deviation of the rated voltage of ±0.5%. For a 220V system, 1V is equivalent to 0.45%, which is a reasonable fluctuation judgment standard. Finally, the average value of all window fluctuations is calculated to obtain the voltage fluctuation value. In the sample, the window fluctuations are 0.5, 1, and 0.5, and the average is (0.5+1+0.5) / 3≈0.667. Finally, the active power of 998.12W and the power factor of 0.9848 in the electric energy calculation data set are integrated with the voltage fluctuation rate of 0.667 to output the electric energy parameter set.

[0087] Specifically, if Figure 2 As shown, the communication optimization module includes:

[0088] The frequency band configuration submodule calls the active power value in the electric energy parameter set, analyzes the difference between the step frequency of the SX1280 chip and the internal frequency reference, compares the difference with the set offset tolerance range, filters out frequency configuration items with offsets exceeding the tolerance, obtains frequency register items that meet the center frequency setting conditions, and obtains the frequency configuration reference value;

[0089] The frequency configuration reference value is the center frequency reference of the chip after calibration;

[0090] The active power value in the energy parameter set is called. In this example, it is set to 998.12W. This power value is used as the input basis for the communication parameter configuration. After entering the frequency band configuration submodule, the current frequency step configuration status of the SX1280 chip is parsed. The frequency register items under the condition of an internal frequency reference of 2400MHz are read as 2400.3MHz, 2400.5MHz, 2400.7MHz, 2401.0MHz, 2401.5MHz, and 2402.0MHz. The step frequency differences between these and the frequency reference are calculated as 0.1kHz, 0.3kHz, 0.9kHz, 1.2kHz, 1.5kHz, and 2.2kHz, respectively. The offset tolerance upper limit is set to ±1.0kHz. The multiple differences and tolerance ranges are judged, and only the frequency register items with a difference of no more than 1.0kHz are retained, namely 2400.3MHz, 2400.5MHz, and 2400.7MHz. The retained items are then averaged to obtain the frequency configuration reference value:

[0091]

[0092] As the center frequency reference value for subsequent spread spectrum configuration, this value is used to drive the selection and matching process of the spreading factor, as shown in Table 2, which lists the frequency register items, step frequency differences, setting tolerances, and screening retention results;

[0093] Table 2: Node control force monitoring value table

[0094]

[0095] As shown in Table 2, only the first three frequency groups meet the ±1.0kHz tolerance setting. The remaining frequency points are screened out due to excessive offset. The frequency configuration reference value is 2400.5MHz.

[0096] The spread spectrum configuration submodule calls the frequency configuration reference value, detects the chip's spreading factor configuration segment, extracts the frequency band extension value and code rate impact interval associated with the spreading factor, calculates the code rate response variation of the spreading parameters under the current frequency conditions, filters the spreading factor items, and generates a bandwidth matching parameter set;

[0097] Call the frequency configuration base value 2400.5MHz to enter the spread spectrum configuration submodule, read the spreading factor segment supported by the chip, extract the spreading factors 6, 7, 8 and 9 and their corresponding frequency band extension values 125kHz, 250kHz, 500kHz and 1000kHz respectively, based on the set bit rate formula:

[0098]

[0099] Among them, R represents the actual data transmission rate under the current configuration conditions, in kbps, B represents the channel bandwidth value corresponding to the optional frequency band under the current chip configuration state, in kHz, and S represents the spreading factor, which is a dimensionless integer value.

[0100] Performing rate calculations, we find that spreading factor 6 corresponds to a bit rate of 9.77 kbps, factor 7 to 7.81 kbps, factor 8 to 3.91 kbps, and factor 9 to 1.95 kbps. The minimum allowable rate is set to 3.5 kbps, and spreading factors 6 to 8 are retained, while factor 9 is removed. This forms a bandwidth matching parameter set, which records the frequency band extension value of each spreading factor and the corresponding bit rate variation range at the current reference frequency. This parameter set will be used in the subsequent compression submodule to set the compression ratio and quantization level.

[0101] The data compression submodule calls the spreading factor parameter item in the bandwidth matching parameter set to obtain the time series data consisting of voltage, current and active power, extracts the fluctuation segment to calculate the quantized value of the characteristic coefficient, sets the number of layers and quantization threshold interval of the wavelet packet decomposition according to the load interval level, decomposes and extracts the effective coefficient of the target frequency band, and generates compressed communication data;

[0102] The quantization threshold is the dynamic boundary value for screening effective frequency band coefficients;

[0103] Call the spreading factors 6, 7, and 8 in the bandwidth matching parameter set to obtain the aforementioned time series signal data, collect voltage, current, and active power signals and divide them into 10ms window segments, determine whether the fluctuation characteristic value meets the extraction conditions of voltage fluctuation greater than 1.0V and power fluctuation greater than 50W, and send the data segments that meet the conditions as fluctuation segments into the feature extraction process. Perform wavelet packet decomposition on each fluctuation segment, extract the local energy coefficient to construct the wavelet frequency band feature, where the load power less than 500W is set to 2 layers, 500-1000W is set to 3 layers, and above 1000W is set to 4 layers. When the current power is 998.12W, the number of wavelet decomposition layers is set to 3 layers, and then the coefficient value W on the sub-band is extracted according to the frequency band energy distribution. k,j , and then calculate the instantaneous fluctuation amplitude D of the segment based on the fluctuation signal k,j , calculate the average fluctuation amplitude of all data segments and volatility range R k , calculate the quantized value of the characteristic coefficient, using the formula:

[0104]

[0105] Among them, λ k Represents the quantized value of the characteristic coefficient corresponding to the current load level k, M k represents the total number of data fragments under load level k, w k,jrepresents the coefficient of the wavelet packet decomposition subband of the jth data segment under load level k, D k,j represents the instantaneous signal fluctuation amplitude value of the jth data segment under load level k, represents the arithmetic mean of the signal fluctuation amplitude values of all data segments under load level k, R k Represents the difference between the maximum and minimum signal fluctuation amplitude values in all data segments under load level k.

[0106] Taking the characteristic coefficient quantization value calculation under the current load level k as an example, set the number of data fragments M k =6, the wavelet packet decomposition energy coefficient W corresponding to the segment k,j They are 0.75, 0.82, 0.69, 0.90, 0.77 and 0.85 respectively, and the corresponding instantaneous signal fluctuation amplitude value D k,j For 45, 52, 48, 60, 47 and 50, first calculate the arithmetic mean of the fluctuation amplitudes of all segments at this level Calculated R k =15, substituting into the formula, we get the corresponding product terms for each segment as 0.433, 0.265, 0.263, 0.700, 0.351, and 0.122, summing to 2.134, and finally obtaining:

[0107]

[0108] Finally, the quantization value is used as a screening index to extract the target part of the frequency band whose energy coefficient exceeds the quantization threshold, and the compressed communication data is output after integrating the multi-time fragments and reorganizing them.

[0109] Specifically, if Figure 2 As shown, the interference analysis module includes:

[0110] The voltage identification submodule extracts the voltage time series from the compressed communication data, divides the voltage observation segments into equal time intervals, compares the voltage fluctuation difference corresponding to the observation segment with the voltage fluctuation identification threshold, records the observation segment index with a difference greater than the threshold, and generates abnormal voltage observation segments;

[0111] The voltage time series in the compressed communication data is extracted and divided into multiple continuous voltage observation segments according to the fixed equal time interval principle. The time window of each segment is set to 100ms. The difference between the maximum and minimum values in the multiple segments is calculated as the fluctuation difference, and the fluctuation difference is compared with the set voltage fluctuation identification threshold. In this embodiment, the identification threshold is set to 1.0V. After comparison, it is recorded whether there is abnormal fluctuation in each observation segment. For example, when the observation segment index is 2, the maximum voltage is 221.0V and the minimum is 219.7V, and the fluctuation difference is 1.3V, which is greater than the set threshold of 1.0V. The segment is marked as an abnormal segment. In the segments with indexes 3 and 5, the fluctuation differences are 3.5V and 2.4V respectively, which are also higher than the threshold and are marked as abnormal. Finally, the indexes of all observation segments with fluctuation differences greater than the set threshold are recorded as the voltage abnormal observation segment index sequence and output for entering the next processing flow, as shown in Table 3. The table lists the voltage mean, fluctuation difference and abnormal judgment results of the observation segment in detail;

[0112] Table 3: Voltage fluctuation monitoring and abnormality determination table

[0113]

[0114] As shown in Table 3, the fluctuation differences of observation segments 2, 3, and 5 all exceed the set threshold of 1.0 V and have been identified as abnormal voltage observation segments and used in the subsequent sudden fluctuation detection and interference marking process.

[0115] The fluctuation detection submodule calls the abnormal voltage observation section, sets the sliding window width and step size, calculates the voltage increment change value within the sliding window, compares the increment value with the fluctuation detection threshold, selects the window segment index where the fluctuation amplitude exceeds the detection threshold, and generates the sudden fluctuation time interval;

[0116] The voltage increment change value quantifies the intensity of short-term voltage fluctuations and determines whether there is an effective mutation;

[0117] Call the voltage anomaly observation segment index sequence, set the sliding window width to 3 observation segments, the step size to 1 segment, form a sliding window segment sequence in the abnormal segment, calculate the voltage increment change value in each window, and obtain the voltage increment change value by the difference between the mean voltage of the next observation segment and the mean voltage of the previous observation segment in the window. For the difference between two consecutive segments in the window, the maximum item is taken as the representative item of the mutation in the window in the form of absolute value. For example, when the window slides to index segment 2-4, for 220.3V to 219.0V and 219.0V The calculated differences from 222.5V to 222.5V are -1.3V and 3.5V, with a maximum increment of 3.5V. If the increment exceeds the fluctuation detection threshold, the window segment is recorded as a mutation segment. In this example, the fluctuation detection threshold is set to 2.0V, and this window is judged as a valid mutation. Continuing to slide to the next window index segment 3-5, the calculated maximum increment is still 4.1V, which is also marked as a mutation. The calculation and judgment are repeated for all sliding windows one by one. Finally, the indexes of all window segments that meet the increment value exceeding the detection threshold are summarized to form the mutation fluctuation time interval.

[0118] The interference marker submodule obtains the corresponding voltage value change sequence based on the mutation fluctuation time interval, counts the number of consecutive voltage mutations in the window, compares this number with the mutation frequency threshold, records the start and end time range of the mutation segment that meets the continuous mutation condition, and generates an instantaneous interference marker;

[0119] According to the mutation fluctuation time interval, the corresponding voltage value change sequence is obtained, and the observation segment index sequence corresponding to each mutation segment is counted to determine whether there are a number of segments with continuous mutations in the same window. For example, if the sliding window index segments 3-5 and 4-6 are both marked as mutation windows, two continuous mutation segments can be formed. The mutation frequency threshold is set to 2 times as the effective mutation frequency judgment limit. The window segments with a mutation number equal to or higher than the set value in the statistical results are marked, and then the starting observation segment index and the ending observation segment index of the continuous mutation segment are extracted, and their corresponding time positions are recorded to form an instantaneous interference mark. In this example, the interference segment finally marked is index 3 to 5, corresponding to the time interval of 0.3s to 0.5s. This segment will be used as a high-priority input basis in subsequent abnormal response and isolation operations.

[0120] Specifically, if Figure 2 As shown, the fluctuation assessment response module includes:

[0121] The interference signal processing submodule processes the voltage input sequence data based on the Kalman filter algorithm inputted by the instantaneous interference marker, sets the state space model parameters, calculates the prediction error to obtain the correction gain, updates the voltage state estimate, extracts the state estimate difference between time nodes, and generates the time series voltage fluctuation amount;

[0122] The voltage state estimation update value uses the current measurement value to correct the prediction result to obtain a more accurate estimate;

[0123] Based on the instantaneous interference mark input voltage sequence, the initial value of the state space model is set to 220.0V in the interference signal processing submodule. The system state transfer matrix and observation matrix are both unit matrices. The process noise covariance and measurement noise covariance are uniformly absorbed into the correction gain parameter, and the correction gain is set to 0.6. The state prediction value is directly transferred to the previous estimated value. After collecting the measured voltage value at the current sampling moment, the difference between it and the predicted value is calculated as the prediction error. The voltage state estimation update value is updated using the formula:

[0124]

[0125] in, Represents the updated value of the voltage state estimate at the nth sampling time point, in volts, x n Represents the estimated voltage state value predicted at the nth time point, in volts, K n represents the correction gain calculated at the nth time point, z n Represents the actual voltage measurement value collected at the nth time point, in volts.

[0126] At the first time point, the predicted value is 220.0V, the measured value is 219.5V, the error is -0.5V, and the correction term is -0.3V multiplied by the correction gain 0.6. The state update value is 219.7V. At the second time point, the predicted value is 219.7V, the measured value is 222.0V, the error is 2.3V, the correction term is 1.38V, and the state update value is 221.08V. The operation is repeated to obtain the state estimation sequence of 220.06V, 219.58V, 221.76V, 223.02V and 220.92V. Subsequently, the difference between the two adjacent state estimation values at each consecutive time point is taken to obtain the state estimation difference sequence. The difference sequence is 0.00V, -0.48V, 0.42V, 0.50V, and -0.10V. This sequence will be recorded as the voltage fluctuation for subsequent modules;

[0127] The fluctuation monitoring submodule calls the time series voltage fluctuation quantity, divides the fluctuation sequence into fixed time intervals, sets the start and end indexes of the sliding window, compares the difference between the maximum and minimum values of the segment, calculates the characteristic value of the segment fluctuation amplitude, and integrates them to obtain the voltage fluctuation intensity value;

[0128] The state estimation difference sequence is called in the fluctuation monitoring submodule, which is divided into three time periods according to a fixed time interval of 0.04 seconds. The state estimation difference set in each time period is extracted respectively. The maximum and minimum values in each set are identified and the difference operation is performed to obtain the fluctuation amplitude of the segment. For example, the difference values in the first segment (0.00s to 0.04s) are 0.00V, -0.48V, and 0.42V, the maximum value is 0.42V, the minimum value is -0.48V, and the difference is 0.9. 0V, the second segment difference is 0.42V, 0.50V, the maximum value is 0.50V, the minimum value is 0.42V, the difference is 0.08V, the third segment is 0.50V, -0.10V, the difference is 0.60V, the sum of the multiple fluctuation amplitudes and divided by the number of segments to obtain the average fluctuation intensity value (0.90+0.08+0.60) / 3=0.527V, which represents the overall fluctuation intensity of the voltage estimation sequence in this cycle and is used for the subsequent judgment module to perform dynamic threshold comparison;

[0129] The threshold update judgment submodule sets the dynamic response threshold range according to the voltage fluctuation intensity value, compares the difference between the element and the upper threshold limit, marks the event point position where the difference is greater than zero, establishes an event status identification list synchronized with the voltage sequence time index, and obtains the fluctuation abnormality signal;

[0130] Dynamic response thresholds sense system status and environmental noise in real time and adjust abnormality determination boundaries;

[0131] In the threshold update judgment submodule, the above-mentioned fluctuation intensity value is called and compared with the preset response threshold upper limit of 0.5V. The difference between the fluctuation intensity value of 0.527V and the upper threshold is calculated to be 0.027V. The judgment result is greater than zero, and the period is recorded as the fluctuation abnormal state point. In each time period, the difference between the fluctuation amplitude value of the current segment and the upper threshold is judged. The amplitude of the first segment is 0.90V, which is greater than 0.5V and marked as abnormal. The amplitude of the second segment is 0.08V, which is less than the threshold and marked as normal. The amplitude of the third segment is 0.60V, which is higher than the threshold and also marked as abnormal. The judgment results of multiple time periods are summarized to establish a state identification array synchronized with the fluctuation estimation time index. The result is [1, 0, 1], indicating that there are abnormal fluctuation points in the first and third segments, as shown in Table 4. The table lists the maximum and minimum values, fluctuation amplitude, intensity mean, upper threshold and abnormality mark of multiple time periods.

[0132] Table 4: Threshold judgment and fluctuation abnormality marking table

[0133]

[0134] As shown in Table 4, after the voltage fluctuation amplitude is compared with the dynamic response threshold, the first and third time periods are marked as abnormal fluctuation event points, providing input basis for the subsequent response mechanism of the system.

[0135] Specifically, if Figure 2 As shown, the load classification module includes:

[0136] The signal processing submodule uses the fluctuation abnormal signal and transient interference markers to extract the range and RMS value of the voltage marker interval, obtain the peak-to-peak value and duration of the current transient interference, differentially calculate the voltage change rate and current jump value of adjacent sampling points, compare the change rate with the interference threshold, and screen out continuous intervals where the voltage change rate and current jump value exceed the limit simultaneously, thus generating a set of abnormal feature vectors.

[0137] The interference threshold is determined based on the voltage change rate and current jump amount.

[0138] The signal processing submodule calls the fluctuation abnormal signal and transient interference mark, first locates all the marked voltage time series intervals, extracts the maximum and minimum voltage values of each marked segment in the segment, calculates the difference between the two as the voltage extreme difference, and calculates the square mean root value of all voltage sampling values in the same segment as the voltage effective value indicator, then obtains the current channel sampling data sequence in the period, extracts the maximum and minimum current values and calculates their peak-to-peak values, and at the same time marks the number of samples between the previous disturbance point and the next disturbance point multiplied by the sampling interval time as the interference duration, and then performs voltage difference on each adjacent two sampling points divided by the sampling period to obtain the voltage change rate, the calculation formula is the adjacent value difference divided by the 0.01 second sampling period, and the current value difference of the previous and next points under the same time index is used for the current signal to obtain the jump value, and then set the voltage The voltage change rate interference threshold is 0.18V / ms, and the current jump value threshold is 2.0A. The voltage change rate is determined to be greater than 0.18V / ms and the current jump value is determined to be greater than 2.0A in each section. When both conditions are met, the section is considered to meet the synchronization over-limit interference condition and is recorded as a high-interference feature section. In this embodiment, the voltage change rate of section 1 is 0.15V / ms, which does not meet the condition, but the current jump value is 2.0A, which just meets the condition and is not counted as a synchronization over-limit. The voltage change rate of section 2 is 0.22V / ms and the current jump value is 2.8A, both of which are greater than their respective thresholds and meet the conditions, and are recorded as valid abnormal features. Finally, an abnormal feature vector set consisting of six parameters, voltage range difference, voltage root mean square, current peak-to-peak value, interference duration, voltage change rate, and current jump value, is formed, as shown in Table 5.

[0139] Table 5: Abnormal feature extraction sample table

[0140]

[0141] As shown in Table 5, the data points in the second segment meet the simultaneous over-limit judgment of voltage change rate and current jump value and have been included in the final feature vector set.

[0142] The clustering parameter configuration submodule uses the Euclidean distance to calculate the distance between the center points of adjacent anomaly windows based on the timestamp distribution of the anomaly feature vector set. The mean of the statistical distance is used as the density distribution benchmark. The neighborhood radius is linearly mapped to the benchmark, and the minimum number of samples is adjusted to the reciprocal of the neighborhood radius mapping value to generate a clustering parameter group.

[0143] The clustering parameter configuration submodule receives the abnormal feature vector set output by the signal processing submodule. Based on the voltage fluctuation range and current peak-to-peak parameters corresponding to each abnormal segment, the dynamic neighborhood radius is jointly set according to the dual feature dimensions. First, the maximum voltage range of 3.1V and the minimum current peak-to-peak value of 1.9V are extracted from the feature set, and the range is 1.2V. At the same time, the maximum current peak-to-peak value of 7.2A and the minimum current peak-to-peak value of 5.8A are extracted, and the range is 1.4A. These two parameters are used as normalization calculation standards. The voltage range and current peak-to-peak value of each abnormal segment are normalized as follows. The normalized value is equal to the current value minus the minimum value and divided by the range. For example, if the voltage range of the first segment is 2.4V, its normalized value is (2.4-1.9) / 1.2=0.417, and the current peak-to-peak value of the first segment is 6.5A, and the normalized value is (6.5-5.8) / 1.4=0.5. Under the premise of setting the voltage weight and current weight to 0.5, the neighborhood radius is (0.5×0.417×1.2)+(0.5×0.5×1.4)=(0.25+0.35)=0.60, which is the local neighborhood radius of the first segment. The neighborhood radiuses of the second and third segments are calculated in this way to be 1.3 and 0.75 respectively. Then all local neighborhood radii are averaged and aggregated to obtain the final global neighborhood radius of (0.60+1.30+0.75) / 3=0.883, which is used to judge the distance between samples during density clustering. The reciprocal of the neighborhood radius is rounded off as the minimum sample number input, that is, 1 / 0.883≈1.13. After rounding, the minimum sample number is 1. However, in order to avoid isolated points from forming erroneous core nodes, the lower limit of the minimum sample number is forced to be set to 2. Finally, the neighborhood radius is set to 0.883 and the minimum sample number is 2. This is output as the clustering parameter group to the density clustering execution submodule as the basis for density judgment input, ensuring that the clustering calculation takes into account both the sample space density adaptation and the feature quantity distribution stability.

[0144] The density clustering execution submodule traverses the Euclidean distance of the voltage range and current peak-to-peak value in the abnormal feature vector set according to the neighborhood radius and the minimum number of samples of the clustering parameter group, identifies the core points that meet the requirement that the number of samples within the neighborhood radius exceeds the minimum number of samples, assigns the boundary points whose distance from the core points is less than the neighborhood radius to the corresponding clusters, removes isolated points that do not meet the neighborhood density conditions, and outputs the classification result load category label.

[0145] The density clustering execution submodule receives the clustering parameter group, sets the neighborhood radius to 0.883, the minimum number of samples to 2, and traverses each sample point in the abnormal feature vector set in turn. The two-dimensional feature space is used to form the Euclidean distance coordinate system by the voltage extreme difference and the current peak-to-peak value. For example, the abnormal segment 1 vector is (2.4, 6.5), segment 2 is (3.1, 7.2), and segment 3 is (1.9, 5.8). First, starting from segment 1, the Euclidean distance between segment 1 and segment 2 is calculated as follows: Continue to calculate the distance between segment 1 and segment 3 Segment 3 is in the neighborhood of segment 1. Segment 2 is not in its neighborhood because the distance is 0.99, which is greater than the neighborhood radius. The number of samples in the neighborhood of segment 1 is 1, which does not meet the minimum number of samples 2. It is not marked as a core point for the time being. Continue to judge segment 2. The distance between segment 2 and segment 3 is The distance between segment 3 and segment 1 is 0.86, which is less than the neighborhood radius. Segment 1 is the only adjacent point in the neighborhood of segment 3. The number of samples in the neighborhood of segment 3 is 1, which does not meet the minimum sample number threshold of 2. Therefore, all three do not meet the core point condition. However, segment 1 and segment 3 are neighbors of each other and have a bidirectional connection. According to the definition of density reachability, segment 1 and segment 3 are classified into the same cluster. Segment 2 is marked as a noise point because it has no other adjacent sample points. The final output cluster label is that segment 1 and segment 3 are classified into cluster 1, and segment 2 is not clustered. It is determined to be an isolated point and removed, forming the final clustering structure label array [1, -1, 1], where "1" represents belonging to the cluster and "-1" represents the isolated point is not classified.

[0146] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. An electric energy meter with a wireless communication module, characterized in that: The electric energy meter comprises: The parameter acquisition module is used to collect the voltage, current, and power factor of the single-phase circuit through the voltage transformer and current transformer, call the STM32F103 chip to perform analog-to-digital conversion on the voltage and current, identify the active power, analyze the voltage fluctuation, integrate it into an electric energy parameter set, and transmit it to the communication optimization module; The communication optimization module is used to call the LoRa protocol to configure the center frequency, set the spreading factor based on the SX1280 radio frequency chip, perform a wavelet packet decomposition algorithm on the voltage, current, and active power fields of the electric energy parameter set, dynamically adjust the number of decomposition layers and quantization thresholds according to the real-time load rate to generate compressed communication data, and transmit it to the interference analysis module; An interference analysis module is configured to parse the compressed communication data, extract the voltage fluctuation field, perform mutation detection based on a sliding window algorithm, and generate an instantaneous interference flag when the voltage fluctuation exceeds an interference determination threshold, and transmit the flag to the fluctuation assessment module; The fluctuation assessment response module is used to input the instantaneous interference mark into the Kalman filter algorithm for processing to obtain the voltage fluctuation amount, detect the dynamic fluctuation intensity of the voltage fluctuation amount based on the sliding window, generate a fluctuation abnormality signal through the dynamic threshold update mechanism, and transmit it to the load classification module.

2. The electric energy meter with a wireless communication module according to claim 1, characterized in that: The physical layer protocol of the LoRa protocol adopts CSS modulation mode; The decomposition layer number adjustment rule is set according to the load rate change trend. When the load rate is detected to be increasing, the decomposition layer number is increased, and when the load rate is decreasing, the decomposition layer number is reduced. By dynamically matching the decomposition layer number with the load rate, the signal decomposition accuracy can be adjusted in time when the load rate changes. The bit error rate is reduced by more than 30% in the load scenario. The interference judgment threshold is calculated based on the mean and standard deviation of historical voltage fluctuations in the same period; The dynamic threshold setting generates a baseline value based on the historical fluctuation data of the same time period in the past 24 hours, and adjusts the baseline value by percentage based on the real-time grid load rate. For every 10% increase in the grid load rate, the baseline value is adjusted up by 5%, and for every 10% decrease in the grid load rate, the baseline value is adjusted down by 5%. The electric energy parameter set includes voltage fluctuation rate, active power factor, and single-phase current effective value; the compressed communication data includes wavelet packet decomposition coefficient, decomposition layer number identifier, and quantization threshold parameter; the instantaneous interference mark includes disturbance detection time point, voltage deviation amplitude, and mutation level number; the fluctuation abnormal signal includes fluctuation intensity index, dynamic threshold level, and voltage stability judgment value.

3. The electric energy meter with a wireless communication module according to claim 1, characterized in that: The parameter acquisition module includes: The signal acquisition submodule collects the voltage signal of the voltage transformer and the current signal of the current transformer, detects the signal amplitude range, filters the high-frequency interference component through the signal conditioning circuit, calibrates the signal phase deviation, and generates a mutual inductance signal group; The conversion and calculation submodule calls the ADC unit of the STM32F103 chip, performs synchronous sampling and analog-to-digital conversion based on the mutual inductance signal group, aligns the discrete voltage values and the discrete current values in time series, calculates the total energy within the cycle, obtains the active power value, extracts the fundamental component to calculate the power factor value, and generates an electric energy calculation data set; The fluctuation integration submodule calculates the absolute value of the voltage difference between adjacent sampling points based on the voltage discrete value sequence in the electric energy calculation data set using a sliding window method, counts the proportion of times the absolute value of the difference in the window exceeds a set fluctuation threshold, generates a voltage fluctuation rate value, and integrates the active power value, power factor value and voltage fluctuation rate value in the electric energy calculation data set to obtain an electric energy parameter set.

4. The electric energy meter with wireless communication module according to claim 3, characterized in that: The communication optimization module includes: The frequency band configuration submodule calls the active power value of the electric energy parameter set, parses the difference between the step frequency of the SX1280 chip and the internal frequency reference, compares the difference with the set offset tolerance range, filters out frequency configuration items whose offset exceeds the tolerance, obtains the frequency register items that meet the center frequency setting conditions, and obtains the frequency configuration reference value; The frequency configuration reference value is the center frequency reference of the chip after calibration; The spread spectrum configuration submodule calls the frequency configuration reference value, detects the chip spreading factor configuration segment, extracts the frequency band extension value and code rate impact interval associated with the spreading factor, calculates the code rate response variation amplitude of the spreading parameter under the current frequency conditions, filters the spreading factor items, and generates a bandwidth matching parameter set; The data compression submodule calls the spreading factor parameter item in the bandwidth matching parameter set to obtain time series data consisting of voltage, current and active power, extracts fluctuation segments to calculate the quantized value of characteristic coefficients, sets the number of layers and quantization threshold intervals of wavelet packet decomposition according to the load interval level, decomposes and extracts the effective coefficients of the target frequency band, and generates compressed communication data; The quantization threshold is a dynamic boundary value for screening effective frequency band coefficients.

5. The electric energy meter with wireless communication module according to claim 4, characterized in that: The characteristic coefficient quantization value adopts the formula: Among them, λ k Represents the quantized value of the characteristic coefficient corresponding to the current load level k, M k represents the total number of data fragments under load level k, w k,j represents the coefficient of the wavelet packet decomposition subband of the jth data segment under load level k, D k,j represents the instantaneous signal fluctuation amplitude value of the jth data segment under load level k, represents the arithmetic mean of the signal fluctuation amplitude values of all data segments under load level k, R k Represents the difference between the maximum and minimum signal fluctuation amplitude values in all data segments under load level k.

6. The electric energy meter with a wireless communication module according to claim 4, characterized in that: The interference analysis module includes: a voltage identification submodule, which extracts the voltage time series from the compressed communication data, divides the voltage observation segments into equal time intervals, compares the voltage fluctuation differences corresponding to the observation segments with a voltage fluctuation identification threshold, records the indexes of the observation segments whose differences are greater than the threshold, and generates abnormal voltage observation segments; The fluctuation detection submodule calls the abnormal voltage observation section, sets the sliding window width and step size, calculates the voltage increment change value within the sliding window, compares the increment value with the fluctuation detection threshold, selects the window segment index whose fluctuation amplitude exceeds the detection threshold, and generates the sudden fluctuation time interval; The voltage increment change value quantifies the intensity of short-term voltage fluctuations to determine whether there is a valid mutation; The interference mark submodule obtains the corresponding voltage value change sequence according to the mutation fluctuation time interval, counts the number of continuous voltage mutations in the window, compares the number with the mutation frequency threshold, records the start and end time range of the mutation segment that meets the continuous mutation condition, and generates an instantaneous interference mark.

7. The electric energy meter with wireless communication module according to claim 6, characterized in that: The fluctuation assessment response module includes: The interference signal processing submodule processes the voltage input sequence data based on the instantaneous interference mark input Kalman filter algorithm, sets the state space model parameters, calculates the prediction error to obtain the correction gain, updates the voltage state estimate update value, extracts the state estimate difference between time nodes, and generates the time series voltage fluctuation amount; The fluctuation monitoring submodule calls the time-series voltage fluctuation quantity, divides the fluctuation sequence into fixed time intervals, sets the start and end indexes of the sliding window, compares the difference between the maximum and minimum values of the segment, calculates the segment fluctuation amplitude characteristic value, and integrates it to obtain the voltage fluctuation intensity value; The threshold update judgment submodule sets the dynamic response threshold range according to the voltage fluctuation intensity value, compares the difference between the element and the upper threshold limit, marks the event point position where the difference is greater than zero, establishes an event status identification list synchronized with the voltage sequence time index, and obtains the fluctuation abnormality signal; The dynamic response threshold senses the system status and environmental noise in real time and adjusts the abnormality determination boundary.

8. The electric energy meter with wireless communication module according to claim 7, characterized in that: The voltage state estimation update value adopts the formula: in, Represents the updated value of the voltage state estimate at the nth sampling time point, in volts, x n Represents the estimated voltage state value predicted at the nth time point, in volts, K n represents the correction gain calculated at the nth time point, z n Represents the actual voltage measurement value collected at the nth time point, in volts.

9. The electric energy meter with a wireless communication module according to claim 1, characterized in that: The electric energy meter also includes a load classification module: A load classification module is used to obtain the abnormal fluctuation signal and transient interference mark, call the DBSCAN clustering algorithm to identify the load type, perform density cluster analysis on the voltage and current based on the preset neighborhood radius and minimum sample number, and output the classification result load category label; The load category label includes resistive load type, inductive load type, and capacitive load type.

10. The electric energy meter with wireless communication module according to claim 9, characterized in that: The load classification module includes: The signal processing submodule calls the abnormal fluctuation signal and transient interference mark, extracts the range and root mean square value of the voltage mark interval, obtains the peak value and duration of the current transient interference, differentially calculates the voltage change rate and current jump value of adjacent sampling points, compares the change rate with the interference threshold, screens the continuous intervals where the voltage change rate exceeds the limit and the current jump value simultaneously exceeds the limit, and generates an abnormal feature vector set; The interference threshold is determined based on the voltage change rate and the current jump amount synchronously exceeding the limit; The clustering parameter configuration submodule uses the Euclidean distance to calculate the distance between the center points of adjacent abnormal windows based on the timestamp distribution of the abnormal feature vector set, and uses the statistical mean of the distance as the density distribution reference. The neighborhood radius is linearly mapped to the reference, and the minimum number of samples is adjusted to the reciprocal of the neighborhood radius mapping value to generate a clustering parameter group. The density clustering execution submodule traverses the Euclidean distance of the voltage extreme difference and the current peak-to-peak value in the abnormal feature vector set according to the neighborhood radius and the minimum number of samples of the clustering parameter group, identifies the core points that meet the requirement that the number of samples within the neighborhood radius exceeds the minimum number of samples, assigns the boundary points whose distance from the core points is less than the neighborhood radius to the corresponding clusters, removes isolated points that do not meet the neighborhood density conditions, and outputs the classification result load category label.

Citation Information

Cited By

  • Fuzzy test method and system based on program control flow

    CN120686799A

  • Communication data transmission method and system for intelligent electric energy meter and concentrator

    CN120730203A

  • Intelligent codling moth monitoring system based on multi-source trapping data fusion

    CN120951226A

  • High-order sliding mode compound control method for speed regulation of motor of electric forklift

    CN120973096A

  • A high-order sliding mode compound control method for speed regulation of an electric forklift motor

    CN120973096B