Intelligent distributed protection inrush identification method and device based on AI inference middleware, storage medium and electronic device

CN122801149APending Publication Date: 2026-09-22ZHUHAI WANLIDA ELECTRICAL AUTOMATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611274579.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-21
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

第一类是单一二次谐波制动法,通过提取电流波形的二次谐波分量,当二次谐波含量比超过整定阈值时闭锁保护,该方法计算简单但在变压器铁芯未深度饱和的低饱和度涌流场景下二次谐波含量不足,误报率较高

Benefits of technology

[0016]本申请一些实施例提供的技术方案带来的有益效果至少包括:构建二次谐波含量比、暂态能量变化相对值、波形对称性指数三路传统特征提取与轻量化神经网络模型推理并行执行的融合判决机制,并将四路结果按差异化权重进行加权多数投票,综合判断涌流与故障状态,有效提升辨识准确率、降低误报率。在AI推理中间件中设置任务调度单元和异构算力协同单元,根据CPU和NPU的实时负载状态动态选择推理任务的执行硬件,在保证推理精度的同时将推理时延控制在预设阈值内,满足保护的实时性要求。通过模型更新中间件从远端平台获取更新后的神经网络模型文件,配合模型安全校验中间件执行完整性校验和来源合法性验证,实现终端不停电情况下的模型在线安全迭代。通过数据采集服务、数据存储中间件与AI推理中间件的分层架构设计,以标准化接口实现采样数据与推理引擎的解耦,使采样数据能够被推理模块独立访问,为端侧AI应用扩展提供可复用的基础设施。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122801149A_ABST
    Figure CN122801149A_ABST
Patent Text Reader

Abstract

The application discloses an intelligent distributed protection inrush current identification method and device based on AI inference middleware, a storage medium and an electronic device, relates to the technical field of smart grid distribution network automation, and comprises the following steps: collecting three-phase current sampling data according to a preset sampling density through a data collection service and writing the three-phase current sampling data into a data storage middleware; reading three-phase current waveform data of N continuous cycles when a current peak value exceeds an overcurrent starting threshold value; performing multi-path feature extraction and compressed neural network model inference; performing weighted majority vote decision on three-path traditional feature extraction results and AI inference results according to respective preset weights, outputting an inrush current or fault state and performing corresponding protection actions; and realizing remote safe updating of the neural network model through a model updating middleware and a model safety checking middleware. The application effectively reduces the inrush current false alarm rate, guarantees the online iteration capability of the algorithm and the real-time performance of the protection actions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart grid distribution network automation technology, and in particular to a smart distributed protection inrush current identification method, device, storage medium, and electronic device based on AI inference middleware. Background Technology

[0002] In intelligent distributed protection scenarios, when faults such as phase-to-phase short circuits and single-phase grounding occur in the distribution network, the distribution automation terminal needs to complete fault judgment and trigger protection actions within milliseconds. However, there are many non-faulty operating conditions in the distribution network that cause sudden current changes, among which inrush current is the most typical source of interference. The inrush current generated when a transformer is switched on can reach 6 to 8 times the rated current and the peak duration can reach tens of milliseconds; the peak inrush current when a capacitor bank is switched on can reach 10 to 20 times the rated current; and the inrush current amplitude when a motor starts can reach 5 to 7 times the rated current. The amplitude of these inrush currents highly overlaps with the actual fault current, making them very easy for traditional protection algorithms to misjudge as faults, leading to malfunctioning protection and seriously affecting the reliability of the distribution network power supply.

[0003] Currently, the inrush current identification methods widely used in distribution automation terminals mainly fall into the following categories. The first category is the single second harmonic restraint method, which extracts the second harmonic component of the current waveform and blocks protection when the second harmonic content exceeds a set threshold. This method is simple to calculate, but in low-saturation inrush current scenarios where the transformer core is not deeply saturated, the second harmonic content is insufficient, resulting in a high false alarm rate. The second category is the waveform recognition method, which performs morphological analysis on the sampled current waveform and makes judgments based on features such as discontinuity angle and waveform symmetry. However, this method requires extremely high sampling accuracy and is difficult to adapt to scenarios with multiple inrush currents superimposed in complex power grid topologies. The third category is the fixed threshold current discrimination method, which sets a fixed current amplitude threshold; currents below the threshold are considered inrush currents. However, this method fails under high-amplitude inrush currents and cannot distinguish between current fluctuations caused by slight overloads and actual fault currents. The fourth category is logical judgment based on expert rules, which combines multiple preset conditional rules for discrimination. However, these rules require manual tuning, have poor adaptability, and the rule base is difficult to maintain after the integration of new distribution networks with distributed power sources and energy storage.

[0004] However, the aforementioned existing technologies still have the following drawbacks. First, the accuracy of single-feature discrimination is insufficient. Existing methods generally rely on a single feature, which has weak identification capabilities for low-saturation, superimposed, and short-term inrush currents. Performance degrades significantly under complex power grid conditions, failing to meet the reliability requirements of new distribution networks. Second, the algorithm is embedded in the terminal firmware. Each optimization requires recompilation, downloading, and a power outage for upgrades, resulting in a long cycle and high risk. With the continuous changes in power grid conditions such as new energy access and energy storage grid connection, the adaptability of the embedded algorithm continuously decreases, making it unable to dynamically adjust to the characteristics of the field. Third, the CPU resources in the distribution terminal are evenly occupied by data acquisition, communication, and protection logic, failing to provide dedicated, efficient computing power scheduling for computationally intensive tasks such as inrush current identification, leading to significant uncertainty in identification computation latency. Fourth, if machine learning models are introduced, the model files in the traditional firmware mode cannot be verified for integrity, posing a risk of tampering and failing to meet the network security protection requirements of the power system. Fifth, the acquisition and inference functions are tightly coupled in the same program. Sampling accuracy, sampling frequency, and data format cannot be independently accessed by the inference module through a standard interface, restricting the introduction of edge AI technology in distribution terminals. Summary of the Invention

[0005] To address the aforementioned issues, this application provides an intelligent distributed protection inrush current identification method, device, storage medium, and electronic device based on AI inference middleware, which effectively reduces the false alarm rate of inrush current and ensures the online iteration capability of the algorithm and the real-time performance of protection actions.

[0006] In a first aspect, embodiments of this application provide an intelligent distributed protection inrush current identification method based on AI inference middleware, applied to a power distribution terminal equipped with an embedded IoT operating system, the method comprising: The three-phase current sampling data of the power distribution line is collected by the data acquisition service at a preset sampling density, the sampling data is written into the data storage middleware, and a data ready event is published through the message bus. When the detected current peak exceeds the preset overcurrent start threshold, the three-phase current waveform data of N consecutive power frequency cycles are read through the data storage middleware; N is an integer not less than 2. Perform multi-path feature extraction to obtain multiple traditional feature binary labels; call the inference interface of the AI ​​inference middleware to obtain AI inference binary labels; The AI ​​inference middleware selects the hardware to execute the inference task based on the real-time load status of the currently available computing resources. Based on multiple traditional binary feature flags and AI inference results, the inrush state or fault state is determined according to a preset fusion strategy, and corresponding protection actions are executed. The updated neural network model file is obtained from the remote platform through the model update middleware, and the model security verification middleware is called to perform integrity verification and source legality verification on the model file.

[0007] In one possible implementation, the AI ​​inference middleware includes a heterogeneous computing power collaboration unit. The AI ​​inference middleware selects the hardware to execute the inference task based on the real-time load status of currently available computing resources, including: When the current utilization of the neural network processor is lower than the first utilization threshold, the inference task is scheduled to be executed by the neural network processor. When the current utilization of the neural network processor is not lower than the first utilization threshold, the inference task is scheduled to be executed by the central processing unit. When the current utilization rates of both the neural network processor and the central processing unit are not lower than their respective utilization thresholds, the AI ​​inference process is skipped, and a weighted summation decision is made solely based on the first binary flag, the second binary flag, and the third binary flag.

[0008] In one possible implementation, the multiple traditional feature binary labels include three traditional feature binary labels with equal weights, and the weight of the AI ​​inference binary label is greater than the weight of the three traditional feature binary labels; the preset fusion strategy is weighted summation.

[0009] In one possible implementation, multi-path conventional feature extraction includes: The frequency domain transformation is performed on the three-phase current waveform data, and the ratio of the second harmonic content to the fundamental frequency content is extracted as the first feature. When the first feature is greater than the first threshold, the corresponding binary flag is output as an effective state. The relative value of transient energy change before and after the current change is calculated as the second feature. When the rate of change of the second feature meets the preset transient energy change rate criterion, the corresponding binary flag is output as the valid state. The morphological parameters of the positive and negative half-cycles of the current waveform are compared to obtain the waveform symmetry index as the third feature. When the deviation of the third feature from 1 is greater than the third threshold, the corresponding binary flag is output as an effective state.

[0010] In one possible implementation, the compression method of the neural network model includes: The trained floating-point neural network model is subjected to INT8 symmetric quantization with a quantization bit width of 8 bits, and the precision loss caused by quantization does not exceed 1%. The quantized neural network model is subjected to structured pruning, and the convolutional channels with the smallest weight norm are removed layer by layer.

[0011] In one possible implementation, the model security verification middleware performs integrity verification and source legitimacy verification on the model file, including: The hash digest of the model file is encrypted using a preset asymmetric encryption algorithm private key to generate a signature file, which is then distributed along with the model file. During verification, the signature file is decrypted using the corresponding public key to obtain the first digest, and the hash of the received model file is calculated to obtain the second digest. The verification is deemed successful when the first digest and the second digest are consistent.

[0012] In one possible implementation, the training dataset of the neural network model contains multiple labeled samples. The labeled samples cover historical waveform data of the distribution network for multiple inrush current and fault scenarios, including transformer no-load closing, transformer on-load switching, capacitor bank switching, motor starting, single-phase ground fault, phase-to-phase short circuit, and three-phase short circuit. Each labeled sample is labeled with an inrush current category label or a fault category label.

[0013] Secondly, embodiments of this application provide an intelligent distributed protection inrush current identification device based on AI inference middleware, applied to a power distribution terminal equipped with an embedded IoT operating system. The device includes: a data acquisition module, a reading module, an extraction module, a selection module, a judgment module, and an execution module, wherein: The acquisition module is used to collect three-phase current sampling data of the power distribution line according to a preset sampling density through the data acquisition service, write the sampling data into the data storage middleware, and publish the data ready event through the message bus. The reading module is used to read three-phase current waveform data of N consecutive power frequency cycles through the data storage middleware when the detected current peak exceeds the preset overcurrent start threshold; N is an integer not less than 2. The extraction module is used to perform multi-path feature extraction to obtain multiple traditional feature binary labels; and calls the inference interface of the AI ​​inference middleware to obtain AI inference binary labels. The selection module is used by the AI ​​inference middleware to select the hardware to execute the inference task based on the real-time load status of the currently available computing resources. The determination module is used to determine the inrush state or fault state according to a preset fusion strategy based on multiple traditional feature binary flags and AI inference results, and to execute the corresponding protection actions. The execution module is used to obtain the updated neural network model file from the remote platform through the model update middleware, and call the model security verification middleware to perform integrity verification and source legality verification on the model file.

[0014] Thirdly, embodiments of this application provide a computer storage medium storing multiple instructions adapted for loading by a processor and executing the steps of the above-described method.

[0015] Fourthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being adapted to be loaded by the processor and to execute the steps of the above-described method.

[0016] The beneficial effects of the technical solutions provided in some embodiments of this application include at least the following: A fusion decision mechanism is constructed that combines traditional feature extraction (second harmonic content ratio, relative value of transient energy change, and waveform symmetry index) with lightweight neural network model inference, and the results from the four paths are weighted by majority voting based on differentiated weights to comprehensively judge the inrush and fault states, effectively improving identification accuracy and reducing false alarm rate. A task scheduling unit and a heterogeneous computing power collaboration unit are set up in the AI ​​inference middleware to dynamically select the execution hardware for the inference task based on the real-time load status of the CPU and NPU, ensuring inference accuracy while controlling inference latency within a preset threshold to meet the real-time requirements of protection. The updated neural network model file is obtained from the remote platform through the model update middleware, and integrity verification and source legitimacy verification are performed in conjunction with the model security verification middleware to achieve online secure iteration of the model without power interruption. Through a layered architecture design of data acquisition service, data storage middleware, and AI inference middleware, standardized interfaces are used to decouple sampled data from the inference engine, enabling the inference module to access sampled data independently and providing a reusable infrastructure for the expansion of edge AI applications. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 An exemplary system architecture diagram of the intelligent distributed protection inrush current identification method based on AI inference middleware provided in the embodiments of this application; Figure 2 A flowchart illustrating the intelligent distributed protection inrush current identification method based on AI inference middleware provided in this application embodiment; Figure 3 A logic block diagram of the inrush identification method provided in the embodiments of this application; Figure 4 A logic block diagram for parallel extraction of three features and weighted majority voting criteria provided in the embodiments of this application; Figure 5 A full lifecycle management diagram of the inrush identification model provided in this application embodiment; Figure 6 A structural block diagram of an intelligent distributed protection inrush current identification device based on AI inference middleware provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0019] To make the features and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] In the following description, when referring to the accompanying drawings, the same numbers in different drawings denote the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0021] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances. Furthermore, in the description of this application, unless otherwise stated, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.

[0022] As mentioned earlier, existing inrush current identification methods in distribution automation terminals generally suffer from the following technical defects: single-feature-based discrimination methods have weak identification capabilities for low-saturation, superimposed, and short-term inrush currents, resulting in a high false alarm rate; traditional protection algorithms are fixed in the terminal firmware, requiring power outages for each optimization, making them unable to adapt to the dynamic changes in new distribution network conditions; terminal CPU resources are evenly occupied by acquisition, communication, and protection logic, lacking a heterogeneous computing power scheduling mechanism for computationally intensive tasks such as inrush current identification, leading to significant uncertainty in identification latency; when introducing machine learning models, the model files cannot be verified for integrity in the traditional firmware mode, posing a security risk of tampering; the acquisition function and inference function are tightly coupled, and the sampled data cannot be independently accessed by the inference module through a standard interface, restricting the introduction of edge AI technology.

[0023] In view of this, this application provides an intelligent distributed protection inrush current identification method, device, storage medium, and electronic device based on AI inference middleware. This invention aims to improve the accuracy of inrush and fault identification and significantly reduce the false alarm rate of inrush by constructing a fusion decision mechanism that integrates multi-path traditional feature extraction and neural network model inference. This mechanism uses a weighted majority vote to combine three traditional features—second harmonic content ratio, relative value of transient energy change, and waveform symmetry index—with AI inference results. Through the coordinated operation of the model update middleware and model security verification middleware, remote and secure updates of the neural network model are achieved, allowing the terminal to iterate online without power interruption. By setting up a task scheduling unit and a heterogeneous computing power collaboration unit in the AI ​​inference middleware, inference tasks are dynamically scheduled according to the real-time load status of the CPU and NPU, ensuring that the inference latency meets the real-time requirements of protection actions. The model security verification middleware performs integrity verification and source legitimacy verification on the model file, ensuring the security and reliability of the model during transmission and loading. Simultaneously, through a standardized layered architecture of data acquisition service, data storage middleware, and AI inference middleware, the sampling data and inference engine are decoupled, providing a reusable foundation for expanding edge-side AI capabilities. The technical solution of this application is described in detail below with reference to the accompanying drawings.

[0024] Please see Figure 1 , Figure 1 An exemplary system architecture diagram of the intelligent distributed protection inrush current identification method based on AI inference middleware provided in the embodiments of this application.

[0025] like Figure 1As shown, the system architecture, from bottom to top, includes a hardware layer, a hardware dynamic library layer, a hardware service layer, a common middleware layer, and an industry middleware layer, with event-driven communication between the layers achieved through an MQTT message bus. The hardware layer comprises a data acquisition module, a security chip, an NPU / CPU, Ethernet, and switching equipment, providing underlying physical resources and computational support. The hardware dynamic library layer (HAL abstract library) includes a data acquisition chip driver dynamic library and a security chip driver dynamic library. The data acquisition chip driver dynamic library provides a standard southbound acquisition interface (such as acmodule_read()) for high-precision three-phase current / voltage sampling, while the security chip driver dynamic library provides a southbound interface for cryptographic operations, which can be called by upper-layer security verification services. The hardware service layer includes a data acquisition management service and a security chip service. The data acquisition management service pushes sampled data to the data center middleware in real time via an MQTT northbound interface and publishes a SAMPLE_READY event to the message bus after sampling is complete. The security chip service provides signature verification and hash calculation interfaces. The common middleware layer includes data center middleware, unified AI core computing engine middleware, model OTA service middleware, model verification service middleware, model optimization and compression middleware, and computing power dynamic measurement middleware. The data center middleware provides a unified telemetry data dictionary and event dictionary for storing raw sampling data and FFT decomposition results. The unified AI core computing engine middleware includes a task scheduling unit and a heterogeneous computing power collaboration unit for managing the computing power allocation and execution scheduling of inference tasks. The model OTA service middleware is responsible for remote acquisition and version management of model files. The model verification service middleware is responsible for verifying the integrity and legality of model files. The model optimization and compression middleware is used to quantize and prune the floating-point models trained in the cloud to adapt them to the terminal computing power constraints. The computing power dynamic measurement middleware is used to monitor performance indicators such as inference latency and NPU utilization in real time. The industry middleware layer includes a surge detection industry middleware, which is the core innovative component of this application. This middleware subscribes to the SAMPLE_READY event, reads sampled data from the data center middleware, performs parallel execution of three-way traditional feature extraction and CNN model inference, and outputs a comprehensive surge / fault judgment result. The judgment event is then published via the MQTT bus for use by the distributed protection state machine. Furthermore, the cloud platform (including model training, version management, and OTA delivery functions) communicates with the terminal-side model OTA service middleware via HTTPS or MQTT protocols to achieve secure remote delivery and updates of model files.

[0026] Please see Figure 2 , Figure 2 This is a flowchart illustrating the intelligent distributed protection inrush current identification method based on AI inference middleware provided in an embodiment of this application. Figure 2 As shown, the intelligent distributed protection inrush current identification method based on AI inference middleware can include at least: S201. Collect three-phase current sampling data of the power distribution line according to the preset sampling density through the data acquisition service, write the sampling data into the data storage middleware, and publish the data ready event through the message bus.

[0027] Specifically, after the distribution automation terminal is powered on and initialized, the data acquisition service runs continuously as a resident background process. This data acquisition service drives the cross-acquisition module through the standard southbound acquisition interface exposed by the cross-acquisition chip in the hardware dynamic library layer. The internal circuit of the cross-acquisition module includes an analog-to-digital converter (ADC) and a sample-and-hold circuit. Its front end uses voltage transformers (PTs) and current transformers (CTs) to proportionally transform the high voltage and large current of the primary side of the distribution line into low-amplitude analog signals. Under the control of the sampling clock, the ADC quantizes the analog signal at a preset sampling density. The preset sampling density can be flexibly configured. In this embodiment, it is preferred to sample 160 points within each power frequency cycle (20 milliseconds), with a sampling interval of 0.125 milliseconds. Each phase of the three-phase current is sampled independently, with an output accuracy of 0.2 class and a phase angle accuracy better than 0.5°, thereby completely preserving the harmonic components and transient details in the current waveform, providing high-fidelity raw data for subsequent frequency domain analysis and transient energy calculation. After completing the sampling of three-phase current for each cycle, the sampling management service immediately writes the sampled data, in a predetermined format including fields such as sampled value array, sample sequence number, timestamp, and channel identifier, into the telemetry data dictionary of the data storage middleware. This data storage middleware provides a standardized data access interface for upper-layer applications within the common middleware layer. Internally, it maintains a pre-allocated memory pool, managing the sampled data in a circular buffer manner. This means that each time new cycle data is written, the oldest cycle data is overwritten, ensuring that the complete waveforms of the most recent several cycles are always preserved. Simultaneously, the sampling management service publishes a SAMPLE_READY event to all consumers subscribed to the data readiness event via the MQTT message bus. The message body of this event carries the storage location index of the sampled data in the data storage middleware, the cycle sequence number, the precise timestamp, the data type identifier, and the sampled data checksum, allowing subscribers to confirm the validity and completeness of the data source. MQTT is a lightweight publish / subscribe messaging protocol suitable for resource-constrained power distribution terminal equipment. Using this protocol as a message bus enables event-driven, loosely coupled communication between data producers (transfer management services) and data consumers (inrush flow identification industry middleware), avoiding the unnecessary CPU usage and latency jitter caused by periodically checking data readiness in traditional polling methods. At this point, the data acquisition service completes a full closed loop from physical quantity acquisition to digital domain storage and event notification. Subsequent inrush flow identification processes only need to subscribe to the SAMPLE_READY event to be triggered the moment data is ready, thus decoupling the sampling and inference processes.

[0028] S202. When the detected current peak exceeds the preset overcurrent start threshold, the three-phase current waveform data of N consecutive power frequency cycles are read through the data storage middleware.

[0029] Specifically, please refer to Figure 3 , Figure 3 A logic block diagram of the inrush identification method provided in the embodiments of this application is shown below. Figure 3 As shown, the surge current identification industry middleware, acting as a subscriber to the SAMPLE_READY event, first reads the latest cycle of three-phase current sampling data from the telemetry data dictionary of the data storage middleware using the storage location index carried in the event message body, and then obtains the maximum value of the three-phase current peak value by traversing the 160 sampling points within that cycle. Then the Compared with a preset overcurrent start threshold, this embodiment preferably uses the following: ,in For the rated current, if ≤ If the current waveform is determined to be a normal load fluctuation, the data for that cycle is discarded directly, and the subsequent surge current identification process is not triggered. The system then waits for the SAMPLE_READY event of the next cycle. If an abnormal sudden change in current is detected, the inrush current identification process is immediately initiated. After initiation, the inrush current identification middleware reads three-phase current waveform data for N consecutive power frequency cycles from the circular buffer of the data storage middleware. In this embodiment, N is preferably 3, meaning it reads the most recent 3 cycles, totaling 480 sampling points. The reason for selecting 3 cycles is that in the distribution network, the transient processes of most inrush currents and faults fully exhibit their typical characteristics within 3 cycles (60 milliseconds). The second harmonic characteristics of transformer excitation inrush current are most pronounced in the first few cycles after closing the circuit breaker, and the symmetry characteristics of fault current also stabilize within the first few cycles. Too few values ​​(e.g., 1 cycle) will result in insufficient waveform information, while too many values ​​will increase the computational load and delay the protection action time. The value of N is not limited to 3. In practical applications, it can be flexibly adjusted in the configuration file according to line parameters and terminal computing resources. For example, for long lines or complex lines containing distributed power sources, it can be configured to 4 or 5 cycles to capture a more complete transient process. The read operation is completed by calling the standard read interface of the data storage middleware. This interface supports specifying the starting cycle number and the read length, and the returned data format is a three-dimensional array: phase sequence (A / B / C) × cycle number (1~N) × sampling point (1~160), ensuring that the subsequent feature extraction module obtains a regular input data format. This embodiment achieves efficient flow of sampled data from generation to consumption through the above-mentioned three-level data acquisition mechanism of "event triggering + overcurrent filtering + batch reading". It avoids CPU idle waiting and filters out a large amount of normal data that does not need to be analyzed, providing deterministic data input for subsequent computationally intensive feature extraction and AI inference.

[0030] S203. Perform multi-path feature extraction to obtain multiple traditional feature binary labels; call the inference interface of the AI ​​inference middleware to obtain AI inference binary labels.

[0031] Specifically, by extracting features in parallel from three different physical dimensions, the properties of the current waveform are comprehensively characterized from three perspectives: frequency domain, time domain energy, and waveform morphology. Please refer to [link / reference]. Figure 4 , Figure 4 The logic block diagram for the parallel extraction of three features and the weighted majority voting criterion provided in the embodiments of this application is as follows: Figure 4 As shown in this embodiment, after successfully reading three consecutive cycles of three-phase current waveform data, the surge current identification industry middleware immediately starts three independent calculation threads or coroutines to perform the following feature extraction operations.

[0032] Specifically, the first feature is the second harmonic content ratio (HR), which is extracted by performing a Fast Fourier Transform (FFT) on the waveform data of each phase of the three-phase current. FFT is an efficient algorithm for calculating the Discrete Fourier Transform, which decomposes the time-domain signal into a superposition of sinusoidal components of different frequencies to obtain the amplitude and phase information of each frequency component. In this embodiment, for 160 sampling points of each phase current, the FFT operation yields the amplitudes of 160 frequency points from the DC component to the highest frequency component. The fundamental component amplitude... Amplitude corresponding to 50Hz frequency point, second harmonic component amplitude The amplitude corresponding to the 100Hz frequency point is then used to calculate the second harmonic content ratio. The HR value reflects the degree of distortion of the current waveform. Inrush current, due to the nonlinearity of the transformer core magnetization curve, exhibits severe waveform distortion and a high second harmonic content; while symmetrical fault current has relatively less waveform distortion and a lower second harmonic content. In this embodiment, HR is compared with a first threshold η1. Preferably, η1 = 0.15, or 15%. If HR > η1, the first binary flag F1 = 1 is set to an active state; otherwise, F1 = 0 is set to an inactive state.

[0033] The second feature is the transient energy ratio (ER), which is extracted as follows: transient energy reflects the overall amplitude level of the current waveform within one cycle. In this embodiment, the first transient energy is calculated by taking the sampling data of the cycle immediately preceding the abrupt change, i.e., the complete cycle immediately before the current peak exceeds the overcurrent initiation threshold. The second transient energy is calculated by taking the sampled data of the current cycle that triggers the overcurrent one cycle after the mutation. Then calculate the relative value of transient energy change. The physical meaning is as follows: In inrush current scenarios, the current suddenly and significantly increases from the normal load level, causing a violent jump in transient energy, a significant increase in the ER value, and a nonlinear rate of change characteristic; while in fault scenarios, although the current amplitude also increases significantly, its waveform periodicity is relatively stable, and the degree of ER jump and rate of change are different from those of inrush current. In this embodiment, the decision basis for the second feature is the rate of change characteristic of ER. The difference between the current cycle ER value and the previous cycle ER value is calculated and compared with the preset transient energy change rate criterion. When the rate of change of ER meets the preset transient energy change rate criterion, the second binary flag F2 is set to the valid state; otherwise, it is set to the invalid state.

[0034] The third feature is the waveform symmetry index (SI), which is extracted by integrating the positive and negative half-cycles of the current waveform separately. Specifically, within a complete cycle, the amplitudes of all sampling points with positive instantaneous current values ​​are summed. The absolute values ​​of the amplitudes of all sampling points with negative instantaneous current values ​​are summed to obtain the result. Then calculate the waveform symmetry index. The physical principle is as follows: the essence of transformer inrush current is that the iron core enters a unidirectional saturation state at the moment of closing because the magnetic flux cannot change abruptly, resulting in a severe asymmetry between the positive and negative half-cycles of the excitation current, and the SI value deviates significantly from 1; while for symmetrical faults (such as three-phase short circuits), the current waveform basically maintains symmetry between the positive and negative half-cycles, and the SI value is close to 1. In this embodiment, |SI-1| is calculated and compared with the third threshold η3. In this embodiment, η3 is preferably 0.3. If |SI-1|>η3, the third binary flag F3 is set to the valid state; otherwise, it is set to the invalid state. In another implementation, the three-way feature extraction can also be executed serially, but parallel execution can make full use of the computing resources of multi-core CPUs, greatly compressing the total time of feature extraction. For protection applications that need to complete the decision within the same cycle, parallel extraction has a significant real-time advantage.

[0035] Furthermore, a neural network model is used to automatically extract high-dimensional abstract features from the original waveform that are difficult for human experts to define explicitly, in order to compensate for the insufficient discriminative power of traditional manually designed features in certain edge scenarios. In this embodiment, while the three-way feature extraction is initiated, the surge recognition industry middleware calls the inference interface of the AI ​​inference middleware in parallel. Here, "compressed neural network model" refers to a lightweight model that has been optimized and processed by the compression middleware. The AI ​​inference middleware is the upper-layer service interface of the unified AI core computing engine middleware in the public middleware layer, which internally manages the loading, caching, and inference execution of the neural network model. When calling the inference interface, the tensor format of the input data needs to be passed in, that is, a three-dimensional floating-point array with dimensions [3,160,3], corresponding to 3 cycles, 160 sampling points, and A / B / C phases, or [3,3,160]. This embodiment preferably adopts the channel post-format [3,160,3], which is compatible with the input format of the convolutional neural network. Upon receiving an inference request, the AI ​​inference middleware feeds the input data into the loaded neural network model to perform forward propagation computation. This neural network model is preferably a lightweight convolutional neural network (CNN), which uses depthwise separable convolutions instead of standard convolutions to reduce the number of parameters and computational cost. The specific structure includes: an input layer that receives a sampling matrix of [3, 160, 3]; four sequentially connected depthwise separable convolutional blocks, each containing a depthwise convolutional layer and a pointwise convolutional layer, with a stride of 1 and ReLU activation; a global average pooling layer that compresses the feature maps output from the four convolutional layers into a one-dimensional feature vector; and a fully connected layer that maps the one-dimensional feature vector to a two-dimensional output, which is finally processed by a Softmax activation function to output a two-dimensional probability vector. .in This represents the probability value that the input waveform belongs to the inrush state. The probability values ​​represent the state of failure, and their sum is 1. After inference, the AI ​​inference middleware returns a two-dimensional probability vector to the surge flow recognition industry middleware. (Comparison of surge flow recognition industry middleware) and The size, if If the fourth flag F4 is set to the valid state, then the flag is set to the invalid state.

[0036] Furthermore, in the specific deployment of neural network models, since power distribution terminals typically only have tens of megabytes of RAM and several megabytes of Flash storage space, they cannot accommodate standard floating-point CNN models (which can typically reach several MB to tens of MB). Therefore, the model must be compressed before deployment. The "compressed neural network model" described in this embodiment is compressed by model optimization and compression middleware in a cloud or offline environment and then sent to the terminal along with the model file. Specifically, a floating-point precision CNN model is first trained on a cloud training platform using a large amount of labeled historical waveform data of the power distribution network (for example, trained using the TensorFlow or PyTorch framework, with model parameters of 32-bit floating-point numbers and a file size of approximately 1.2 MB). Then, the following compression operations are performed sequentially: First, INT8 symmetric quantization is performed, mapping the model's weights and activation values ​​from 32-bit floating-point numbers to 8-bit integers. The quantization bit width is 8 bits. Symmetric quantization means that the quantization zero point is fixed at 0, that is, the range of quantized integers is symmetric about 0, such as [-128, 127]. This method is simple to implement and computationally efficient. Meanwhile, the accuracy loss caused by quantization was verified using a calibration dataset to ensure that the accuracy loss did not exceed 1% (i.e., the accuracy of the quantized model on the validation set was not less than 99% of the original floating-point model). The second step involved structured pruning using L1 norm channel pruning. For each convolutional layer, the L1 norm of each convolutional kernel in that layer was calculated (i.e., the sum of the absolute values ​​of all weights within the convolutional kernel). Then, the convolutional channels with the smallest norm were removed layer by layer, sorted from smallest to largest L1 norm value. The L1 norm reflects the importance of the convolutional kernel to the output features; the smaller the norm, the closer the weights are to zero, the smaller the contribution to the final output, and the smaller the impact on model accuracy after removal. In this embodiment, the smallest 30% of the convolutional channels with the smallest norm are removed layer by layer. After the above quantization and pruning, the model file size was compressed from approximately 1.2MB to approximately 180KB, perfectly fitting the storage constraints of the power distribution terminal. The compressed model showed an inference speed improvement of approximately 3 to 5 times compared to the floating-point model, while maintaining an accuracy of over 98%. In alternative implementations, model compression can also employ 8-bit asymmetric quantization (quantization zeros not equal to 0) or 16-bit half-precision quantization, and the pruning ratio can be adjusted between 20% and 40%. However, this embodiment preferably uses a combination of INT8 symmetric quantization and 30% pruning, achieving the maximum compression ratio while minimizing precision loss. The specific operation process of structured pruning is as follows: First, load the trained floating-point model, calculate the L1 norm (i.e., the sum of the absolute values ​​of all values ​​within the convolutional kernel) of each convolutional layer, sort them by norm value from smallest to largest, set all weights of the 30% of convolutional kernels with the smallest norm to zero, and freeze these channels so they will not participate in gradient updates in subsequent fine-tuning. After pruning, the total number of model parameters is reduced by 30%, and the corresponding multiplication and accumulation operations are also reduced by about 30%.Fine-tuning training is then performed, with a small number of iterations on a subset of the original training data to allow the model to readjust to the pruned structure and recover the accuracy lost during pruning. After pruning and fine-tuning, INT8 quantization is performed, calculating the dynamic range (minimum to maximum) of the weights and activation values ​​for each layer, determining the quantization parameters, and then executing the quantization operation. The final output model file is in .tflite or .tmfile format, with a file size of approximately 180KB, satisfying the ≤200KB constraint. This embodiment achieves an optimal balance between model accuracy and inference speed under the constraint of terminal computing power by setting the specific quantization parameters and pruning ratios described above.

[0037] Furthermore, when training the CNN model in the cloud, the training dataset used contained no fewer than 100,000 labeled samples. All samples were derived from historical waveform data collected by fault recording devices at the distribution network site. The sampling rate of the waveform data was 160 points per cycle (consistent with the terminal acquisition configuration), and the duration of each sample was 3 power frequency cycles (60 milliseconds). The dataset covered no fewer than 15 specific inrush current and fault scenarios, including at least: transformer no-load closing inrush current, transformer on-load switching inrush current, capacitor bank switching inrush current, motor starting inrush current, single-phase ground fault, two-phase-to-phase short circuit fault, two-phase-to-ground short circuit fault, and three-phase short circuit fault. Each labeled sample was independently labeled by at least two power professionals with more than three years of experience in relay protection. The labeling content was either "inrush current" or "fault" category. When the labeling results of the two individuals were inconsistent, a third senior expert made the final decision. The labeling was based on cross-validation of multiple sources of evidence, including fault waveform recordings, protection action logs, and on-site inspection records, to ensure the accuracy of the labeling. During training, 80% of the dataset is used as the training set, 10% as the validation set, and 10% as the test set. Cross-validation is used to evaluate model performance, and the model is only allowed to be deployed if its recognition accuracy on the test set is ≥98%. This embodiment ensures that the neural network model has sufficient generalization ability to cope with various types of inrush current and fault waveforms in the power distribution network by specifying the size of the training dataset and the scene coverage requirements.

[0038] S204. The AI ​​inference middleware selects the hardware to execute the inference task based on the real-time load status of the currently available computing resources.

[0039] Specifically, the embedded platform of a power distribution terminal typically integrates a general-purpose central processing unit (CPU) and a neural network processor (NPU) optimized for matrix multiplication and convolution operations. The CPU excels at logic control and branch-intensive tasks, while the NPU excels at high-throughput tensor operations. However, the NPU is not always available; it may be occupied by other AI inference tasks (such as image processing and speech recognition, where multiple AI applications may be deployed simultaneously in the power distribution terminal). If all inference tasks consistently use the same hardware, task queuing may occur when the NPU is busy, causing inference latency to exceed the allowable range of the protection device. Therefore, this embodiment sets up a task scheduling unit and a heterogeneous computing power collaboration unit within the AI ​​inference middleware to achieve deterministic latency scheduling of inference tasks. The task scheduling unit creates and maintains a priority queue during the initialization of the AI ​​inference middleware, where each inference task is assigned a priority label. The priority of the surge recognition inference task is set to "real-time high priority," higher than other non-critical AI tasks. When the inference request in S204 reaches the AI ​​inference middleware, the task scheduling unit first encapsulates the inference task into a task control block (containing fields such as input data pointer, output buffer pointer, callback function, task priority, and task creation timestamp), and inserts it at the head of the priority queue. Subsequently, the task scheduling unit retrieves the highest-priority task from the queue and submits it to the heterogeneous computing power collaboration unit. The heterogeneous computing power collaboration unit acts as a hardware selection decision-maker, obtaining a list of available computing resources (including the number of CPU cores, the presence and model of the NPU, etc.) by reading the device tree or hardware abstraction layer enumeration information during system startup.

[0040] Furthermore, upon receiving the inference task submitted by the task scheduling unit, the heterogeneous computing power collaboration unit executes the following decision-making process: First, it reads the current utilization rate of the NPU through system calls or driver interfaces provided by the operating system. If the NPU utilization rate is lower than the first utilization rate threshold (preferably 80% in this embodiment), it is determined that the NPU is idle, and the inference task is scheduled to be executed on the NPU. At this time, the inference latency is approximately 0.15ms / cycle. If the NPU utilization rate is not lower than 80%, it is determined that the NPU is busy, and the inference task is scheduled to be executed on the CPU. At this time, the inference latency is approximately 0.4ms / cycle. Based on engineering experience, 80% is selected as the first utilization rate threshold. When the NPU utilization rate is lower than 80%, adding a new inference task will not cause queuing, and the response latency is the execution latency of a single inference. When the NPU utilization rate exceeds 80%, if tasks continue to be allocated to the NPU, new tasks may need to wait for the currently executing task to complete, resulting in queuing delays that are unpredictable. While CPU inference is slower, it has deterministic execution time (no queuing issues, as inference tasks run on the CPU as dedicated threads), guaranteeing the worst-case latency limit. Furthermore, if both NPU and CPU utilization are above their respective thresholds (i.e., a "double-busy" state), the heterogeneous computing power collaboration unit returns a "resource unavailable" signal to the task scheduling unit. The task scheduling unit skips this AI inference step according to a preset strategy, making a decision based solely on the first binary flag F1, the second binary flag F2, and the third binary flag F3 of the three features in S203, and records this skip event and reports it through the log service. This "double-busy skip" strategy is a safety fallback mechanism. When all computing resources are saturated, forcibly scheduling inference tasks would lead to unpredictable delays, which is worse than directly making decisions based on the three features, because the computational load of feature extraction is much smaller than that of CNN inference, ensuring timely decisions even when computing resources are scarce. Through these strategies, this embodiment strictly controls inference latency within a preset latency threshold. This latency requirement is determined by comprehensively considering the action time margin of the protection device (usually requiring no more than 40ms from the occurrence of a fault to the protection exit) and communication latency (approximately 10-20ms for communication between intelligent distributed protection terminals). Inrush current identification, as a prerequisite for protection interlocking, should not have a computational latency exceeding 1ms; otherwise, it will encroach on the execution time of other protection logic. Simultaneously, a dynamic computing power measurement middleware monitors performance indicators such as inference latency and NPU utilization in real time. When the inference latency exceeds the 0.5ms alarm threshold, a performance alarm is triggered and reported to the cloud. This embodiment achieves an ultra-low latency of approximately 0.15ms for inrush current identification inference when the NPU is idle, and a predictable latency of approximately 0.4ms is ensured by the CPU even when the NPU is busy. In the worst case, skipping AI ensures that the decision is not blocked, fully meeting the real-time requirements of protection.

[0041] S205. Based on multiple traditional feature binary flags and AI inference results, determine the inrush state or fault state according to the preset fusion strategy, and execute the corresponding protection action.

[0042] Specifically, the four features come from different physical or statistical dimensions, and their reliability and importance vary, therefore they should not be treated with equal weight. Specifically, after obtaining the first binary flag F1, the second binary flag F2, the third binary flag F3, and the fourth binary flag F4 (all four are Boolean variables, with a value of 1 in the valid state and 0 in the invalid state), the surge recognition industry middleware performs a weighted majority voting calculation. The preset weight configuration is: weight w1=1 for the first binary flag F1, weight w2=1 for the second binary flag F2, weight w3=1 for the third binary flag F3, and weight w4=2 for the fourth binary flag F4. That is, the weight of the three features is 1, and the weight of the AI ​​inference feature is 2. The total weight is 1+1+1+2=5. Then, the weighted decision score is calculated. When Score ≥ When this occurs, it is determined to be a surge state; among which, To preset the weight threshold, this embodiment preferably uses... =3, which is 60% of the total weight of 5) When Score < When the condition is determined to be faulty, the above weight configuration is based on a comparison of different weight combinations using a grid search method on the validation set. The validation set contains no fewer than 5000 labeled inrush and fault waveform samples. The grid search traversed all combinations of w1, w2, w3 ∈ {0.5, 1, 1.5} and w4 ∈ {1, 1.5, 2, 2.5}, with the optimization objective of minimizing the overall false alarm rate without affecting protection sensitivity. Ultimately, the overall false alarm rate was minimized when w4 = 2. Preset weight thresholds are used. =3 is determined by maximizing the F1-score based on the receiver operating characteristic (ROC) curve under the constraint that the false alarm rate does not exceed 2%. By plotting ROC curves under different thresholds, the F1-score corresponding to each threshold is calculated, and the threshold corresponding to the maximum F1-score is selected as the optimal threshold. The optimal threshold is calculated to be 3.

[0043] It should be noted that the preset weight threshold in this embodiment... The parameters can be adjusted online through the cloud orchestration strategy engine middleware. After the adjustment result is verified by the SM2 signature of the security service middleware, it is atomically written into the parameter dictionary of the data storage middleware. The terminal can complete the parameter switching online without power interruption.

[0044] S206. Obtain the updated neural network model file from the remote platform through the model update middleware, and call the model security verification middleware to perform integrity verification and source legality verification on the model file.

[0045] Specifically, please refer to Figure 5 , Figure 5 The full lifecycle management diagram of the inrush identification model provided in the embodiments of this application is as follows: Figure 5 As shown, the model update middleware initiates a version query request to the remote platform upon startup. The middleware periodically sends this request when the terminal starts and after each surge identification decision. It also supports receiving model update commands proactively issued by the remote platform; these two triggering methods coexist to ensure timely model updates. This request is sent via HTTPS and includes the terminal's device ID and the currently loaded model version number. Upon receiving the request, the remote platform compares the terminal's current version with the latest version released by the platform. If they match, the update process is not triggered; if the latest version is higher than the terminal's current version, the platform returns a model update notification, including the new version number, file size, and download URL. Upon receiving the update notification, the model update middleware retrieves the model file package (in .tflite or .tmfile format, with a file size not exceeding 200KB) from the download URL via HTTPS. To address unstable wireless communication networks, such as those used in power distribution terminals deployed outdoors or underground where wireless signals are weak, HTTPS downloads support resumeable interruptions. This means that if the network is interrupted during the download, the model update middleware records the number of bytes downloaded and resumes the download from the point of interruption once the network is restored. This avoids the need to re-download the entire file, preventing wasted bandwidth and indefinitely extended update times due to repeated download failures. After the download is complete, the model update middleware obtains the complete model file and its accompanying metadata (including signature information). Subsequently, the model update middleware calls the verification interface (VerifyModel interface) of the model security verification middleware, passing in the model file path and metadata. The model security verification middleware then performs double security verification on the model file.

[0046] Optionally, security verification employs a dual verification mechanism combining asymmetric encryption and hash verification. Before distributing the model file, the cloud platform first calculates a hash digest of the complete model file content. The hash algorithm used is the SM3 cryptographic hash algorithm, yielding a digest H. Subsequently, the hash digest H is digitally signed using a pre-installed power-specific SM2 private key paired with the terminal, generating a signature file. The cloud then packages the model file, signature file, and public key certificate (containing the corresponding SM2 public key) into a model file package for distribution. After receiving the model file package, the model security verification middleware on the terminal side executes the following verification process: First, it parses the file package, separating the model file, signature file, and public key certificate; second, it decrypts the signature file using the SM2 public key in the public key certificate to obtain the first digest A; third, it calculates the SM3 hash of the received complete model file content to obtain the second digest B; fourth, it compares the first digest A with the second digest B. If they are completely identical, the signature verification is deemed successful, proving the legitimate origin of the model file, because only a legitimate cloud provider holding the corresponding private key can generate a valid signature, and the content has not been tampered with during transmission; if they are inconsistent, the verification is deemed to have failed. If the verification fails, the model security verification middleware records the failure event and returns a failure status to the upper layer. This embodiment uses SM2 asymmetric signature to verify the legitimacy of the origin and SM3 hash to verify the integrity. The dual verification covers the entire security link from cloud issuance to terminal loading of the model file. The model security verification middleware performs the complete dual verification process described above every time the AI ​​inference middleware initializes and loads the model, and every time the model is updated over OTA, to ensure that the running model and the model to be updated are both verified.

[0047] Furthermore, after successful verification, the model security verification middleware returns a "verification passed" status code, and the model update middleware immediately executes the model replacement operation: First, the new model file is written to a temporary location in the trusted storage area, such as / storage / models / new / . During the writing process, each sector is verified to ensure that the data is written to the Flash memory intact. After the writing is complete, the model loading path is switched from the old version directory to the new version directory in an atomic operation. An atomic operation means that the path switch is an indivisible instruction; either the switch succeeds and the new model takes effect, or the switch fails and the path remains unchanged, with no intermediate state. If the switch succeeds, the global model version number is updated and the model loading thread of the AI ​​inference middleware is restarted, so that the new model takes effect in the next round of inference. If the switch fails, for example, due to a Flash verification error or insufficient storage space during the writing process, the model update middleware automatically performs a rollback operation after catching the exception, deleting the new model file in the temporary location and keeping the path in the old version directory, ensuring that the terminal always has a usable model. When verification fails, the model security verification middleware returns a "verification failed" status code and the reason for the failure. The model update middleware refuses to load the new model, deletes the downloaded model file, maintains the currently loaded old model, and reports the update failure event to the operation and maintenance platform via the MQTT message bus. The entire update process runs online throughout the terminal. The surge recognition industry middleware continuously subscribes to the SAMPLE_READY event and performs surge discrimination, ensuring that the distributed protection function is unaffected. This is thanks to the fact that the loading and unloading of model files are managed by the instance dynamic management unit of the AI ​​inference middleware. This unit maintains handles to two model instances (the currently running instance and the instance to be switched). The path switching operation simply switches the target of the inference interface call from the old instance handle to the new instance handle, with a switching latency in the microsecond range and without involving firmware restart or system reset. This embodiment, through the specific verification algorithm and process described above, provides a complete technical solution for the secure management of edge AI models, effectively solving the security defects of traditional firmware mode where the source and integrity of model files cannot be verified.

[0048] This application provides an intelligent distributed protection inrush current identification method based on AI inference middleware. It constructs a fusion decision mechanism that combines traditional feature extraction (HR, ER, and SI) with lightweight CNN model inference in parallel execution. Differential weights are used for weighted majority voting, which fully leverages the complementary advantages of different feature dimensions. This significantly reduces the false alarm rate of inrush current from 15%~20% in existing technologies to below 2%. Furthermore, even if AI inference is skipped due to insufficient computing power, the three traditional features can still independently complete the decision under the multi-feature fusion architecture, effectively solving the technical problem of insufficient discrimination accuracy of single features in low-saturation, superimposed inrush current scenarios. By setting up a task scheduling unit and a heterogeneous computing power collaboration unit within the AI ​​inference middleware, inference tasks are dynamically scheduled according to the real-time load of the NPU / CPU (inference latency is approximately 0.15ms / cycle when the NPU is idle, and approximately 0.4ms when scheduled to the CPU when the NPU is busy). (With a cycle count of 0.5ms / cycle, skipping AI during busy periods to ensure decisions are not blocked), the end-to-end inference latency is controlled within 0.5ms / cycle, effectively solving the technical problem of high uncertainty in recognition latency caused by the average occupation of CPU resources in traditional software implementations. Through the SM2 / SM3 national cryptographic dual verification mechanism of the model update middleware and the model security verification middleware, remote secure updates and atomic replacements of model files are achieved. The terminal can complete model iteration upgrades without power interruption, effectively solving the technical problem of traditional algorithms being fixed in firmware and unable to be dynamically updated online. Simultaneously, the dual guarantee of SM2 digital signature and SM3 hash integrity verification effectively solves the security flaw of the end-side AI model being unable to verify the source legality and content integrity. Furthermore, through the standardized layered architecture design of the data acquisition service, data storage middleware, and AI inference middleware, complete decoupling of sampled data and the inference engine is achieved, providing a reusable technical foundation for subsequent expansion into other end-side AI applications such as precise fault location and equipment health assessment. In summary, the above embodiments of this application effectively improve the accuracy of inrush current identification and the security of model management while ensuring the real-time performance of protection actions, and are suitable for distributed protection scenarios in smart distribution networks.

[0049] Please see Figure 6 , Figure 6 This is a structural block diagram of an intelligent distributed protection inrush current identification device based on AI inference middleware provided in an embodiment of this application. Figure 6 As shown: The intelligent distributed protection inrush current identification device 600 based on AI inference middleware includes: a data acquisition module 610, a reading module 620, an extraction module 630, a selection module 640, a judgment module 650, and an execution module 660, wherein: The acquisition module 610 is used to acquire three-phase current sampling data of the power distribution line according to a preset sampling density through the data acquisition service, write the sampling data into the data storage middleware, and publish the data ready event through the message bus. The reading module 620 is used to read three-phase current waveform data of N consecutive power frequency cycles through the data storage middleware when the detected current peak exceeds the preset overcurrent start threshold; N is an integer not less than 2. The extraction module 630 is used to perform multi-path feature extraction to obtain multiple traditional feature binary labels; and to call the inference interface of the AI ​​inference middleware to obtain AI inference binary labels. Select module 640 is used by the AI ​​inference middleware to select the hardware to execute the inference task based on the real-time load status of the currently available computing resources. The determination module 650 is used to determine the inrush state or fault state according to a preset fusion strategy based on multiple traditional feature binary flags and AI inference results, and to execute the corresponding protection actions. The execution module 660 is used to obtain the updated neural network model file from the remote platform through the model update middleware, and call the model security verification middleware to perform integrity verification and source legality verification on the model file.

[0050] It should be noted that the AI-based inference middleware-based intelligent distributed protection inrush current identification device provided in the above embodiments is only illustrated by the division of the above functional modules when executing the AI-based inference middleware-based intelligent distributed protection inrush current identification method. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the AI-based inrush current identification device and the AI-based inference middleware-based intelligent distributed protection inrush current identification method embodiments provided in the above embodiments belong to the same concept, and the implementation process is detailed in the method embodiments, which will not be repeated here.

[0051] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0052] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device 700 may include: at least one processor 701, at least one network interface 704, a user interface 703, a memory 705, and at least one communication bus 702.

[0053] The communication bus 702 is used to enable communication between these components.

[0054] The user interface 703 may include a display screen, and the optional user interface 703 may include a standard wired interface or a wireless interface.

[0055] The network interface 704 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0056] The processor 701 may include one or more processing cores. The processor 701 connects to various parts within the electronic device 700 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 705, and by calling data stored in the memory 705. Optionally, the processor 701 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 701 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 701 and may be implemented as a separate chip.

[0057] The memory 705 may include random access memory (RAM) or read-only memory. Optionally, the memory 705 may include a non-transitory computer-readable storage medium. The memory 705 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 705 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 705 may also be at least one storage device located remotely from the aforementioned processor 701. Figure 7As shown, the memory 705, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an intelligent distributed protection surge current identification application based on AI inference middleware.

[0058] exist Figure 7 In the illustrated electronic device 700, the user interface 703 is mainly used to provide an input interface for the user and to acquire user input data; while the processor 701 can be used to call the intelligent distributed protection inrush current identification application based on AI inference middleware stored in the memory 705, and specifically perform the following operations: The three-phase current sampling data of the power distribution line is collected by the data acquisition service at a preset sampling density, the sampling data is written into the data storage middleware, and a data ready event is published through the message bus. When the detected current peak exceeds the preset overcurrent start threshold, the three-phase current waveform data of N consecutive power frequency cycles are read through the data storage middleware; N is an integer not less than 2. Perform multi-path feature extraction to obtain multiple traditional feature binary labels; call the inference interface of the AI ​​inference middleware to obtain AI inference binary labels; The AI ​​inference middleware selects the hardware to execute the inference task based on the real-time load status of the currently available computing resources. Based on multiple traditional binary feature flags and AI inference results, the inrush state or fault state is determined according to a preset fusion strategy, and corresponding protection actions are executed. The updated neural network model file is obtained from the remote platform through the model update middleware, and the model security verification middleware is called to perform integrity verification and source legality verification on the model file.

[0059] In one possible implementation, the AI ​​inference middleware includes a heterogeneous computing power collaboration unit. The processor 701 executes the AI ​​inference middleware to select the hardware to perform the inference task based on the real-time load status of the currently available computing resources, specifically for executing: When the current utilization of the neural network processor is lower than the first utilization threshold, the inference task is scheduled to be executed by the neural network processor. When the current utilization of the neural network processor is not lower than the first utilization threshold, the inference task is scheduled to be executed by the central processing unit. When the current utilization rates of both the neural network processor and the central processing unit are not lower than their respective utilization thresholds, the AI ​​inference process is skipped, and a weighted summation decision is made solely based on the first binary flag, the second binary flag, and the third binary flag.

[0060] In one possible implementation, the multiple traditional feature binary labels include three traditional feature binary labels with equal weights, and the weight of the AI ​​inference binary label is greater than the weight of the three traditional feature binary labels; the preset fusion strategy is weighted summation.

[0061] In one possible implementation, multi-path conventional feature extraction includes: The frequency domain transformation is performed on the three-phase current waveform data, and the ratio of the second harmonic content to the fundamental frequency content is extracted as the first feature. When the first feature is greater than the first threshold, the corresponding binary flag is output as an effective state. The relative value of transient energy change before and after the current change is calculated as the second feature. When the rate of change of the second feature meets the preset transient energy change rate criterion, the corresponding binary flag is output as the valid state. The morphological parameters of the positive and negative half-cycles of the current waveform are compared to obtain the waveform symmetry index as the third feature. When the deviation of the third feature from 1 is greater than the third threshold, the corresponding binary flag is output as an effective state.

[0062] In one possible implementation, the compression method of the neural network model includes: The trained floating-point neural network model is subjected to INT8 symmetric quantization with a quantization bit width of 8 bits, and the precision loss caused by quantization does not exceed 1%. The quantized neural network model is subjected to structured pruning, and the convolutional channels with the smallest weight norm are removed layer by layer.

[0063] In one possible implementation, the model security verification middleware performs integrity verification and source legitimacy verification on the model file, including: The hash digest of the model file is encrypted using a preset asymmetric encryption algorithm private key to generate a signature file, which is then distributed along with the model file. During verification, the signature file is decrypted using the corresponding public key to obtain the first digest, and the hash of the received model file is calculated to obtain the second digest. The verification is deemed successful when the first digest and the second digest are consistent.

[0064] In one possible implementation, the training dataset of the neural network model contains multiple labeled samples. The labeled samples cover historical waveform data of the distribution network for multiple inrush current and fault scenarios, including transformer no-load closing, transformer on-load switching, capacitor bank switching, motor starting, single-phase ground fault, phase-to-phase short circuit, and three-phase short circuit. Each labeled sample is labeled with an inrush current category label or a fault category label.

[0065] This application also provides a computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform the above-described instructions. Figure 2 One or more steps in the illustrated embodiment. If the constituent modules of the above-described intelligent distributed protection inrush current identification device based on AI inference middleware are implemented as software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium.

[0066] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as 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 through the computer-readable storage medium. 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 accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital versatile discs (DVDs)), or semiconductor media (e.g., solid-state drives (SSDs)).

[0067] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The aforementioned storage medium includes various media capable of storing program code, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. Unless otherwise specified, the technical features of this embodiment and its implementation schemes can be combined arbitrarily.

[0068] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. It will be apparent to those skilled in the art that various modifications can be made to these embodiments, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for intelligent distributed protection inrush current identification based on AI inference middleware, applied to a power distribution terminal equipped with an embedded IoT operating system, characterized in that, The method includes: The three-phase current sampling data of the power distribution line is collected by the data acquisition service at a preset sampling density, the sampling data is written into the data storage middleware, and a data ready event is published through the message bus. When the detected current peak exceeds the preset overcurrent start threshold, the three-phase current waveform data of N consecutive power frequency cycles are read through the data storage middleware; N is an integer not less than 2. Perform multi-path feature extraction to obtain multiple traditional feature binary labels; call the inference interface of the AI ​​inference middleware to obtain AI inference binary labels; The AI ​​inference middleware selects the hardware to execute the inference task based on the real-time load status of the currently available computing resources. Based on the multiple traditional feature binary flags and the AI ​​inference results, the inrush state or fault state is determined according to the preset fusion strategy, and the corresponding protection action is executed. The updated neural network model file is obtained from the remote platform through the model update middleware, and the model security verification middleware is called to perform integrity verification and source legality verification on the model file.

2. The intelligent distributed protection inrush current identification method based on AI inference middleware according to claim 1, characterized in that, The AI ​​inference middleware includes a heterogeneous computing power collaboration unit. The AI ​​inference middleware selects the hardware to execute the inference task based on the real-time load status of currently available computing resources, including: When the current utilization of the neural network processor is lower than a first utilization threshold, the inference task is scheduled to be executed by the neural network processor. When the current utilization rate of the neural network processor is not lower than the first utilization rate threshold, the inference task is scheduled to be executed by the central processing unit. When the current utilization rates of both the neural network processor and the central processing unit are not lower than their respective utilization thresholds, the AI ​​inference process is skipped, and a weighted summation decision is made solely based on the first binary flag, the second binary flag, and the third binary flag.

3. The intelligent distributed protection inrush current identification method based on AI inference middleware according to claim 1, characterized in that, The plurality of traditional feature binary labels include three traditional feature binary labels with equal weights, and the weight of the AI ​​inference binary label is greater than the weight of the three traditional feature binary labels; the preset fusion strategy is weighted summation.

4. The intelligent distributed protection inrush current identification method based on AI inference middleware according to claim 3, characterized in that, The multi-path traditional feature extraction includes: The three-phase current waveform data is subjected to frequency domain transformation, and the ratio of the second harmonic content to the fundamental frequency content is extracted as the first feature. When the first feature is greater than the first threshold, the corresponding binary flag is output as an effective state. The relative value of transient energy change before and after the current change is calculated as the second feature. When the rate of change of the second feature meets the preset transient energy change rate criterion, the corresponding binary flag is output as the valid state. The morphological parameters of the positive and negative half-cycles of the current waveform are compared to obtain the waveform symmetry index as the third feature. When the deviation of the third feature is greater than the third threshold, the corresponding binary flag is output as a valid state.

5. The intelligent distributed protection inrush current identification method based on AI inference middleware according to claim 1, characterized in that, The compression methods for the neural network model include: The trained floating-point neural network model is subjected to INT8 symmetric quantization with a quantization bit width of 8 bits, and the precision loss caused by quantization does not exceed 1%. The quantized neural network model is subjected to structured pruning, and the convolutional channels with the smallest weight norm are removed layer by layer.

6. The intelligent distributed protection inrush current identification method based on AI inference middleware according to claim 1, characterized in that, The model security verification middleware performs integrity verification and source legitimacy verification on the model file, including: The hash digest of the model file is encrypted using a preset asymmetric encryption algorithm private key to generate a signature file, and the signature file is sent out along with the model file. During verification, the signature file is decrypted using the corresponding public key to obtain a first digest, and the received model file is hashed to obtain a second digest. Verification is deemed successful when the first digest and the second digest are consistent.

7. The intelligent distributed protection inrush current identification method based on AI inference middleware according to claim 1, characterized in that, The training dataset of the neural network model contains multiple labeled samples. The labeled samples cover historical waveform data of the distribution network for multiple inrush current and fault scenarios, including transformer no-load closing, transformer on-load switching, capacitor bank switching, motor starting, single-phase ground fault, phase-to-phase short circuit, and three-phase short circuit. Each labeled sample is labeled with an inrush current category label or a fault category label.

8. An intelligent distributed protection inrush current identification device based on AI inference middleware, applied to a power distribution terminal equipped with an embedded IoT operating system, characterized in that, The device includes: The acquisition module is used to acquire three-phase current sampling data of the power distribution line according to a preset sampling density through the data acquisition service, write the sampling data into the data storage middleware, and publish the data ready event through the message bus. The reading module is used to read three-phase current waveform data of N consecutive power frequency cycles through the data storage middleware when the detected current peak exceeds the preset overcurrent start threshold; N is an integer not less than 2. The extraction module is used to perform multi-path feature extraction to obtain multiple traditional feature binary labels; and to call the inference interface of the AI ​​inference middleware to obtain AI inference binary labels. The selection module is used by the AI ​​inference middleware to select the hardware to execute the inference task based on the real-time load status of the currently available computing resources. The determination module is used to determine the inrush state or fault state according to the multiple traditional feature binary flags and the AI ​​inference results, and to execute the corresponding protection actions. The execution module is used to obtain the updated neural network model file from the remote platform through the model update middleware, and call the model security verification middleware to perform integrity verification and source legality verification on the model file.

9. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions adapted for loading by a processor and executing the steps of the method as described in any one of claims 1 to 7.

10. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method as described in any one of claims 1 to 7.