Inferior load detection method, micro-control unit and device
By detecting frame difference and sliding window exponent in the power grid to determine the surge current, the problem of identifying poor loads in the power grid is solved, achieving fast and accurate detection of poor loads and saving hardware and storage resources.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU HIKFIRE TECH LTD
- Filing Date
- 2025-12-19
- Publication Date
- 2026-04-21
AI Technical Summary
In the power grid, how can we effectively identify and detect poor-quality loads to prevent high voltage from breaking down the air and causing electric sparks or inrush currents that could damage other loads?
By detecting the frame difference between the current frame data and the existing data in the power grid, the sliding window index is determined. The historical frame difference within the sliding window is combined to determine whether there is a power-on surge current. When a power-on surge current exists, the poor load category is detected. The existing data is updated using the sliding window index, reducing storage requirements and computational load.
It enables rapid and accurate identification of poor-quality workloads on low-computing-power devices, saving hardware resources and storage space, and is suitable for low-cost application scenarios.
Smart Images

Figure CN121899518A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power grids, and more particularly to a method, microcontroller unit, and device for detecting poor loads. Background Technology
[0002] Electrical equipment connected to the power grid at a standard voltage (e.g., 220V) on the user side is called a load. When a poor-quality load is connected to the power grid, it may generate high voltage, break down the air and create an electric spark that could cause an electrical fire, or cause an inrush current in the circuit that could damage other loads. Therefore, identifying poor-quality loads when they are connected to the power grid has become an urgent problem to be solved. Summary of the Invention
[0003] This application provides a method, microcontroller unit, and device for detecting poor-quality loads, in order to solve the problem of how to detect poor-quality loads connected to the power grid.
[0004] In a first aspect, embodiments of this application provide a method for detecting poor-quality loads, including: When the load on the power grid changes, the frame difference between the current frame data and existing data of the power grid is determined. The sliding window index corresponding to the current frame is determined based on the frame difference of the current frame; By combining the frame difference between the current frame and the historical frames within the sliding window, it is determined whether a power-on surge current exists: If there is no power-on surge current, update the existing data based on the sliding window index corresponding to the current frame; If a power-on surge current exists, determine whether to perform a poor load category detection on the power-on surge current based on the frame difference of the current frame.
[0005] Secondly, embodiments of this application provide a microcontroller unit (MCU), including: The MCU stores binary code, which is executed by the MCU to implement the above method.
[0006] Thirdly, embodiments of this application provide a poor load detection device, comprising: The difference detection module is used to determine the frame difference between the current frame data and existing data of the power grid. The sliding window index determination module is used to determine the sliding window index corresponding to the current frame based on the frame difference of the current frame; The load identification module is used to determine whether there is a power-on surge current by combining the frame difference between the current frame and the historical frames within the sliding window. If there is no power-on surge current, update the existing data based on the sliding window index corresponding to the current frame; If a power-on surge current exists, determine whether to perform a poor load category detection on the power-on surge current based on the frame difference of the current frame.
[0007] In this embodiment, under the condition of instantaneous load change in the power grid, the corresponding sliding window index is determined based on the frame difference of the current frame. The presence of power-on surge current is determined by combining the frame difference of the current frame and the historical frames within the sliding window, thereby inferring whether the newly added load is a poor-quality load. For the case where there is no power-on surge current, the existing data is updated based on the sliding window index, which allows only the updated data to be retained in the existing data, without the need to retain multiple frames of existing data, thus reducing storage requirements. In addition, the computational workload of updating the existing data based on the sliding window index is small, and the processing speed is also faster. For the case where there is power-on surge current, the poor-quality load category can be detected by combining the frame difference of the current frame without the need for additional hardware. Therefore, it does not consume extra space resources or occupy hardware resources, saving usage costs and making it more suitable for application scenarios of low-computing-power devices. Attached Figure Description
[0008] Figure 1 This is a schematic diagram of the inferior load detection method provided in the embodiments of this application; Figure 2 This is a schematic diagram illustrating the updating of existing data as provided in an embodiment of this application. Figure 3 This is a schematic diagram of the method for detecting poor load provided in the embodiments of this application; Figure 4 A schematic diagram illustrating the first-order and second-order difference variations of the load characteristics provided in an embodiment of this application; Figure 5 This is a schematic diagram illustrating the storage of single-frame data acquisition data; Figure 6 This is a schematic diagram illustrating the storage of data collected using the sliding window index method in this embodiment of the application; Figure 7 This is a schematic diagram illustrating the extraction of load features using a sliding window exponent method. Figure 8 This is a schematic diagram illustrating the extraction of load features using a single frame method; Figure 9 This is a schematic diagram illustrating the use of a dynamic sliding window index to collect load characteristics in an embodiment of this application. Detailed Implementation
[0009] The present application will be described in detail below with reference to the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present application. Any structural, methodological, or functional modifications made by those skilled in the art based on these embodiments are included within the protection scope of the present application.
[0010] The AC frequency in a power grid is typically 50Hz. Therefore, power grid current, voltage, and other data also exhibit periodicity. The power grid characteristics collected within one cycle can be called a data frame. A data frame in the power grid can be obtained by overlaying various information such as current, active power, reactive power, and apparent power from multiple loads. If no new load is connected, the power grid data characteristics contain noise and minor fluctuations. As time progresses, if a new load is connected, the load characteristics may change significantly.
[0011] This application provides a method for detecting poor load, which may include: S101: When the load on the power grid changes, determine the frame difference between the current frame data and existing data of the power grid. S102: Determine the sliding window index corresponding to the current frame based on the frame difference of the current frame; S103: Combine the frame difference of the current frame with the frame difference of the historical frames within the sliding window to determine whether there is a surge current. S104: If there is no power-on surge current, update the existing data based on the sliding window index corresponding to the current frame; S105: If there is a power-on surge current, determine whether to perform a poor load category detection on the power-on surge current based on the frame difference of the current frame.
[0012] The aforementioned current frame data can be a single frame from the current period. Existing data can be historical frame data stored in the cache.
[0013] For example, S101 can be implemented in the following way: The data difference and / or waveform difference between the current frame data and the existing data are used as the frame difference of the current frame.
[0014] For example, current frame data and existing data include at least one of the following: current waveform, RMS current value, voltage waveform, RMS voltage value, reactive power, apparent power, power factor, and active power. Existing data includes historical data stored in the microcontroller unit (MCU).
[0015] When the current frame data and existing data are current waveforms and / or voltage waveforms, the waveform difference between the current frame data and existing data can be used as the frame difference. For example, when both the current frame data and existing data contain current waveforms and voltage waveforms, the position of the maximum value or the waveform phase calculation result can be used as the frame difference corresponding to the current frame.
[0016] When the current frame data and the existing data are at least one of the following: current RMS value, voltage RMS value, reactive power, apparent power, power factor, and active power, the data difference between the current frame data and the existing data can be used as the frame difference.
[0017] For example, after each calculation of the frame difference between the current frame and the existing data, the frame difference can be stored in a cached frame difference queue.
[0018] In an optional embodiment of this application, it is assumed that the window size is 3, see [link to relevant documentation]. Figure 2 As shown, the maximum capacity of the frame difference queue for historical frames within the sliding window is 3.
[0019] For the first frame of data, it can be directly stored in the cache as existing data 1. For example, the existing data and the frame difference can be stored in different blocks of the same cache.
[0020] For the second frame of data, the average of the second frame and the first frame can be used as existing data 2, which overwrites existing data 1. Then, subtracting the first frame from the second frame data yields the frame difference for the second frame.
[0021] For the third frame of data, the product of the third frame of data and twice the existing data can be divided by 3 to obtain the existing data 3. The existing data 3 is then used to overwrite the existing data 2. Subtracting the second frame of data from the third frame of data yields the frame difference value corresponding to the third frame.
[0022] For the fourth frame data, the third frame data can be subtracted from the fourth frame data to obtain the frame difference value corresponding to the fourth frame. Using the frame difference value as the horizontal axis, the corresponding sliding window index can be found. Combining the found sliding window index, the exponential average sliding window method is used to calculate the existing data 4.
[0023] Here, you can refer to the following formula. Existing data 4 = Fourth frame * α + Existing data 3 * (1-α) Among them, existing data 4 represents the existing data corresponding to the fourth frame data, and existing data 3 represents the existing data corresponding to the third frame data (extracted from the cache). For the fifth frame data, the fourth frame data can be subtracted from the fifth frame data to obtain the frame difference value corresponding to the fifth frame. Using the frame difference value corresponding to the fifth frame as the horizontal axis, the corresponding sliding window index can be found. Combining the found sliding window index, the existing data 5 can be calculated using the exponential average sliding window method.
[0024] Existing data 5 = Fifth frame * α + Existing data 4 * (1-α) For example, the correspondence between the sliding window index and the frame difference can be shown below.
[0025] Based on the frame difference of the current frame, a sliding window index mapping is performed using a checkmark function. Combined with the critical threshold and parameter reference value, the sliding window index of the current frame is obtained.
[0026] α =b1 / (|x / x0|) + b2 * (|x / x0|) 2 Where α represents the sliding window exponent of the current frame, x represents the frame difference of the current frame, x0 represents the critical threshold, b1 represents the first reference value, which can be 2, and b2 represents the second reference value, which can be 1.
[0027] After mapping the sliding window index of the current frame, the sliding window index of the current frame can be stored in the cache and retrieved for use when the existing data is updated.
[0028] Thus, when the frame difference of the current frame is smaller than the critical threshold, the further the frame difference of the current frame is from the critical threshold, the closer the current frame data is to noise, and the smaller the impact on the existing data after calculation using the corresponding sliding window exponent; when the frame difference of the current frame is larger than the critical threshold, the further the frame difference is from the critical threshold, the closer the current frame data is to valid data, and the greater the impact on the existing data after calculation using the corresponding sliding window exponent.
[0029] If the number of frame differences in the frame difference queue reaches the maximum capacity of the frame difference queue, the first frame difference in the frame difference queue is replaced with the frame difference of the new current frame.
[0030] For example, assuming the current frame difference queue has a capacity limit of 3, after calculating the frame difference corresponding to the fifth frame, the frame difference corresponding to the second frame can be replaced with the frame difference corresponding to the fifth frame.
[0031] In an optional embodiment of this application, considering the noise impact in the current frame data and the temporal continuity and periodicity of the load characteristics, the sliding window exponent can be calculated using the frame difference of multiple frames to avoid the impact of random noise, improve the signal-to-noise ratio, and highlight the characteristics of the load features.
[0032] For example, a sliding window approach can be used to acquire each frame of data. Assuming the current frame interpolation queue has a maximum capacity of 3, step 103 above can also be implemented in the following way: Calculate the first-order difference between the frame difference of the current frame and the frame difference of the previous frame in the frame difference queue. The second-order difference is obtained by subtracting twice the frame difference of the previous frame from the sum of the frame difference of the current frame and the frame difference of the frame before that in the frame difference queue. By combining the first-order and second-order differences, the fluctuation level of the current frame is obtained, and the presence of power-on surge current is determined based on the fluctuation level.
[0033] For example, the first-order and second-order differences described above can be obtained using the following formulas. d1(i) = Δt2 – Δt1 d2(i) = Δt3 – 2Δt2 + Δt1 Where Δt1 represents the frame difference corresponding to the frame two frames ago, Δt2 represents the frame difference corresponding to the previous frame, and Δt3 represents the frame difference corresponding to the current frame. d1(i) represents the first-order difference, and d2(i) represents the second-order difference.
[0034] See Figure 2 As shown, multiple sliding window data of the power grid are obtained according to the sliding window method, and the first-order difference and second-order difference of each sliding window data are calculated. The changes in the first-order difference and second-order difference of the sliding window data show obvious fluctuations.
[0035] By combining the first-order and second-order differences, the fluctuation level of the current frame is obtained. Based on the fluctuation level, it is determined whether there is a power-on surge current, including: Based on the absolute value of the first-order difference, the oscillation peak of the current frame, and the directional gain of the current frame, the fluctuation degree of the current frame is obtained. If the fluctuation level of the current frame is greater than the fluctuation threshold, it is determined that there is a power-on surge current in the current frame; If the fluctuation level of the current frame is less than the fluctuation threshold, it is determined that there is no power-on surge current in the current frame.
[0036] For example, d1(i) is the first-order difference of the current sliding window data, d2(i) is the second-order difference of the current sliding window data, and S(i) can be the characteristic detection index of the load characteristics in the power grid. Here, the load characteristics can refer to the effective value of the current. The accuracy of detecting the surge current based on the effective value of the current is higher.
[0037] H(i) = 1 exp( |d2(i)| / ε2) H(i) represents the oscillation spike of the i-th frame of data, d2(i) represents the second difference of the current sliding window data, exp represents the natural exponential function, and ε2 represents the scaling factor, where |d2(i)| When ε2, H(i)→1, indicating that a spike or oscillation has been captured; when |d2(i)| When ε2, H(i)→0, indicating that the fluctuation level is extremely low and no spikes or oscillations of the i-th frame of data are captured.
[0038] G(i) = 1 + α · sign(d1(i)·d2(i)) · min(|d1(i)|, |d2(i)|) G(i) represents the directional gain of the i-th frame of data, α represents the sliding window exponent of the current frame, d1(i) is the first-order difference of the current sliding window data, d2(i) is the second-order difference of the current sliding window data, and sign represents the positive or negative sign of the waveform. When d1(i) and d2(i) have the same sign, the power grid data fluctuation exhibits power-increasing oscillation. When d1(i) and d2(i) have opposite signs, the power grid data fluctuation exhibits power-reducing overshoot. Therefore, G(i) can provide the directional gain between oscillation and overshoot.
[0039] S(i) = |d1(i)| · H(i) · G(i) Where S(i) represents the fluctuation level of the i-th frame data, d1(i) is the first-order difference of the current sliding window data, i represents the frame number, H(i) represents the oscillation peak of the i-th frame data, and G(i) represents the directional gain of the i-th frame data.
[0040] If S(i)>τ, then it is marked that the poor load is connected to the power grid starting from this frame, where τ represents the fluctuation threshold.
[0041] For example, after determining that there is a surge current, the existing data is copied as background data, and the frame difference of the current frame is used to determine whether to identify the poor load category.
[0042] The process for identifying inferior load categories may include, but is not limited to, the following: Using the sliding window index of the current frame, the existing data is updated based on the data of the current frame and the existing data by adopting an exponential average sliding window method to obtain the updated foreground data; The difference between the updated foreground data and the background data is used as the feature detection index for the current frame; The poor load category corresponding to the power-on surge current is obtained based on the feature detection index of the current frame.
[0043] See Figure 3 As shown, Step 301: Input a frame of data.
[0044] For example, this step can retrieve existing data xt-1 from the cache; Step 302: Obtain the frame difference Δt between the current frame data xt and the existing data xt-1.
[0045] Step 303: Dynamically change the sliding window index.
[0046] This step 303 can be achieved by storing the current frame's sliding window index in the cache, replacing the already stored sliding window index.
[0047] Step 304: Detect whether there is a power-on surge current by combining the frame difference: If there is a power-on surge current, proceed to step 306; if there is no power-on surge current, proceed to step 305.
[0048] Step 305: Update the existing data based on the current frame data and the sliding window index.
[0049] Based on the current frame data xt and the existing data, update the existing data according to the following exponential average formula, combined with the sliding window exponent.
[0050] EMA t =α*P t +(1-α)*EMA t-1 Among them, EMA t It is the updated existing data, representing the exponential average (EMA) of the current frame. t-1 This represents the previous frame of data, and α represents the sliding window exponent, where 0 < α < 1. The value of the sliding window exponent can be found by referring to... Figure 4 As shown. α can be obtained based on the checkmark function, for example, according to the following formula.
[0051] α =b1 / (|x / x0|) + b2 * (|x / x0|) 2 Where α represents the sliding window exponent of the current frame, x represents the frame difference of the current frame, x0 represents the critical threshold, b1 represents the first reference value, which can be 2, and b2 represents the second reference value, which can be 1.
[0052] Step 306: Update the existing data xt by combining the sliding window index.
[0053] The update process can refer to the above formula for the average index. First, read the sliding window index of the current frame from the cache, and then update the existing data in combination with the sliding window index.
[0054] Step 307: Determine whether the frame difference of the current frame exceeds the critical threshold. If yes, proceed to step 308; otherwise, proceed to step 306. Step 308: Update the existing data based on the current frame data and the sliding window index, and then execute step 309; Step 309: Use the updated existing data xt as the foreground data.
[0055] Step 310: Remove background data from the foreground data to obtain the extracted feature detection index.
[0056] Step 311: Detect the category of poor-quality load based on feature detection indicators.
[0057] Step 312: Wait for the next frame of data to be input.
[0058] For example, step 311 above can be performed as follows: The feature detection metrics of the current frame can be input into a low-cost neural network stored on the MCU; The low-cost neural network is used to identify the poor-quality load category, wherein the low-cost neural network is a binary file that is trained on a central processing unit (CPU) and parsed by an MCU using a dataset calibrated with poor-quality loads and normal loads.
[0059] For example, after extracting the feature detection index Mt of the current frame, the extracted feature detection index can be input into a three-layer convolutional neural network, and the classification of poor-quality load can be determined based on the three-layer convolutional neural network.
[0060] Figure 5 The characteristic changes and their differences at the instant a poor-quality load category (flammable and hazardous load, such as electric vehicle batteries) is inserted into a circuit.
[0061] For example, during training, a three-layer convolutional neural network can be trained on a CPU using a training set calibrated with poor-quality and normal loads. After training, the three-layer convolutional neural network is converted into a binary file. This binary file extracts only the parameter information and network structure information of the three-layer convolutional neural network. The binary file is then deployed to an MCU. In this way, the MCU can parse the binary file based on the network structure information to obtain the binary code of the three-layer convolutional neural network that can run on the MCU. When applied, the input of this binary code is the load feature, and the output is the load type. The load type can indicate whether the load feature is classified as a normal load or a poor-quality load.
[0062] See Figure 6 As shown, assume the window size is 3.
[0063] Save the data for frame number 1, save the data for frame number 2, and the existing data is blank.
[0064] When saving data for frame number 3, the window reaches its maximum capacity. The average of the three frames is then used as the current data 1. When saving the data of frame number 4, discard the data of frame number 1, and calculate the average value of the data of frame numbers 2, 3, and 4 as the existing data 2.
[0065] When saving the data of frame number 5, discard the data of frame number 2, and calculate the average value of the data of frames number 3, 4, and 5 as the existing data 3. Figure 5 The data contains instances where existing data is averaged over time, making it impossible to accurately detect fluctuations.
[0066] Figure 2 The examples in the middle are compared to Figure 6 In other words, due to Figure 2 It can automatically trigger the differentiation between foreground and background data, eliminating the need to store them separately and further saving storage space. Moreover, by combining the sliding window index to update existing data, it can avoid the problem of inaccurate fluctuation detection caused by meanization.
[0067] Figure 7 The diagram illustrates the use of kettle-like features: the feature detection index is obtained by subtracting the previous frame's data from the current frame's data. The noise level of this feature detection index ranges from a maximum of 6000 to a minimum of -6000. Such high data noise makes it difficult to identify.
[0068] See Figure 8 As shown, using Figure 2 The corresponding sliding window index method is used to extract feature detection metrics, and Figure 7 compared to, Figure 8 It greatly reduces noise and consumes less space resources, such as Figure 2 As shown, compared to Figure 6 In other words, Figure 2 Since it does not increase the consumption of space resources, the solution of this application embodiment reduces noise and improves the recognition accuracy while ensuring the storage of one frame of existing data, thus avoiding excessive consumption of space resources.
[0069] See Figure 9 As shown in the embodiments of this application, the ability to extract feature information can be greatly improved by dynamically adjusting the sliding window index, and feature mutations can be better highlighted.
[0070] In this embodiment, under the condition of instantaneous load change in the power grid, the corresponding sliding window index is determined based on the frame difference of the current frame. The presence of power-on surge current is determined by combining the frame difference of the current frame and the historical frames within the sliding window, thereby inferring whether the newly added load is a poor-quality load. For the case where there is no power-on surge current, the existing data is updated based on the sliding window index, which allows only the updated data to be retained in the existing data, without the need to retain multiple frames of existing data, thus reducing storage requirements. In addition, the computational workload of updating the existing data based on the sliding window index is small, and the processing speed is also faster. For the case where there is power-on surge current, the poor-quality load category can be detected by combining the fluctuation level of the current frame, without the need for additional hardware participation. Therefore, it does not consume extra space resources or occupy hardware resources, saving usage costs and making it more suitable for application scenarios of low computing power devices.
[0071] Based on the same inventive concept, this application also provides a microcontroller unit (MCU), characterized in that it includes: The MCU stores binary code, which is executed by the MCU to implement the aforementioned method for detecting poor load.
[0072] This application provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described poor load detection method.
[0073] This application provides a poor load detection device, including: The difference detection module is used to determine the frame difference between the current frame data and existing data of the power grid. The sliding window index determination module is used to determine the sliding window index corresponding to the current frame based on the frame difference of the current frame; The load identification module is used to determine whether there is a power-on surge current by combining the frame difference between the current frame and the historical frames within the sliding window. If there is no power-on surge current, update the existing data based on the sliding window index corresponding to the current frame; If a power-on surge current exists, determine whether to perform a poor load category detection on the power-on surge current based on the frame difference of the current frame.
[0074] In an optional embodiment of this application, the aforementioned defective load detection device may further include a display screen to display the detected defective load.
[0075] The aforementioned memory can be random access memory, read-only memory, non-volatile, programmable ROM, erasable PROM, electrically erasable memory, flash memory, optical memory, and registers, etc. The processor can be a general-purpose processor, which is a processor that performs specific steps and / or operations by reading and executing computer programs stored in the memory. The general-purpose processor may use the memory during the execution of these steps and / or operations. The general-purpose processor can be a central processing unit, ASIC, and FPGA, etc. In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or by a combination of hardware and software modules in the processor.
[0076] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a solid-state drive (SSD), etc.
[0077] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0078] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The above descriptions are merely preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A method for detecting substandard loads, characterized in that, The method includes: When the load on the power grid changes, the frame difference between the current frame data and existing data of the power grid is determined. The sliding window index corresponding to the current frame is determined based on the frame difference of the current frame; By combining the frame difference value of the current frame with the frame difference values of historical frames within the sliding window, it is determined whether an inrush current exists: If there is no power-on surge current, update the existing data based on the sliding window index corresponding to the current frame; If a power-on surge current exists, the frame difference of the current frame is used to determine whether to perform a poor load category detection on the power-on surge current.
2. The method as described in claim 1, characterized in that, Determining the frame difference between the current frame data and existing data of the power grid includes: The current frame data and existing data include at least one of the following: current waveform, current RMS value, voltage waveform, voltage RMS value, reactive power, apparent power, power factor, and active power. The existing data includes historical data stored in the microcontroller MCU. The data difference and / or waveform difference between the current frame data and the existing data are used as the frame difference of the current frame.
3. The method as described in claim 1, characterized in that, After determining the frame difference between the current frame data and existing data of the power grid, the method further includes: Cache the frame difference of the current frame to the frame difference queue; If the number of frame differences in the frame difference queue reaches the upper limit of the frame difference queue's capacity, the first frame difference in the frame difference queue is replaced with the frame difference of the new current frame.
4. The method as described in claim 3, characterized in that, By combining the frame difference of the current frame with the frame difference of historical frames within the sliding window, it is determined whether a power-on surge current exists, including: If the maximum capacity of the frame difference queue for historical frames within the sliding window is 3, Calculate the first-order difference between the frame difference of the current frame and the frame difference of the previous frame in the frame difference queue. The second-order difference is obtained by subtracting twice the frame difference of the previous frame from the sum of the frame difference of the current frame and the frame difference of the frame before that in the frame difference queue. By combining the first-order and second-order differences, the fluctuation level of the current frame is obtained, and the presence of power-on surge current is determined based on the fluctuation level.
5. The method as described in claim 4, characterized in that, By combining the first-order and second-order differences, the fluctuation level of the current frame is obtained. Based on the fluctuation level, it is determined whether there is a power-on surge current, including: Based on the absolute value of the first-order difference, the oscillation peak of the current frame, and the directional gain of the current frame, the fluctuation degree of the current frame is obtained. If the fluctuation level of the current frame is greater than the fluctuation threshold, it is determined that there is a power-on surge current in the current frame; If the fluctuation level of the current frame is less than the fluctuation threshold, it is determined that there is no power-on surge current in the current frame.
6. The method as described in claim 1, characterized in that, Determining whether to perform a poor load category detection on the power-on surge current based on the frame difference of the current frame includes: Copy the existing data as background data; Combining the sliding window exponent of the current frame, an exponential average sliding window method is used to update the existing data based on the data of the current frame and the existing data to obtain the updated foreground data; The difference between the updated foreground data and the background data is used as the feature detection index for the current frame; If the feature detection index of the current frame exceeds the critical threshold, the inferior load category corresponding to the power-on surge current is detected based on the feature detection index of the current frame. If the feature detection index of the current frame does not exceed the critical threshold, then the inferior load category corresponding to the power-on surge current will not be detected.
7. The method as described in claim 6, characterized in that, Based on the feature detection index of the current frame, the poor load category corresponding to the power-on surge current is detected, including: The feature detection index of the current frame is input into a low-cost neural network stored on the microcontroller unit (MCU); The low-cost neural network is used to identify the poor-quality load category, wherein the low-cost neural network is a binary file that is trained on a central processing unit (CPU) and parsed by an MCU using a dataset calibrated with poor-quality loads and normal loads.
8. The method as described in claim 1, characterized in that, The sliding window index corresponding to the current frame is determined based on the frame difference of the current frame, including... By combining the frame difference of the current frame, the sliding window index is mapped using the checkmark function to obtain the sliding window index of the current frame; Store the sliding window index of the current frame into the cache.
9. A microcontroller unit (MCU), characterized in that, include: The MCU stores binary code, which is executed by the MCU to implement the method as described in any one of claims 1 to 8.
10. A substandard load detection device, characterized in that, include: The difference detection module is used to determine the frame difference between the current frame data and existing data of the power grid. The sliding window index determination module is used to determine the sliding window index corresponding to the current frame based on the frame difference of the current frame; The load identification module is used to determine whether there is a power-on surge current by combining the frame difference between the current frame and the historical frames within the sliding window. If there is no power-on surge current, update the existing data based on the sliding window index corresponding to the current frame; If a power-on surge current exists, determine whether to perform a poor load category detection on the power-on surge current based on the frame difference of the current frame.