Feeder terminal-oriented state-aware mixed-precision quantization inference method and system
Patent Information
- Application Number
- CN202611232697.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-09-25
AI Technical Summary
[0016]本发明公开了面向馈线终端的状态感知混合精度量化推理方法及系统,从校准样本中建立可以识别在线状态的判别规则,同时从校准样本中得到的基础量化损失与锐度风险共同获得风险约束,在算力、温度、内存、通信和推理时延的资源约束和风险约束下结合当前在线状态得到位宽配置,量化在线状态参数,完成混合精度前向推理,依据校验获得校验状态,根据校验状态执行回落、闭锁、上传和样本回流。FTU能够在正常运行状态下采用低位宽快速推理,降低计算量、内存访问、功耗和温升;在扰动或故障状态下,根据小波暂态特征触发精度提升,并根据层风险表只提升关键层位宽,从而提高接地故障、短路故障、故障区段和开关异常识别的可靠性。
Smart Images

Figure CN122819518A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of data processing and state awareness, and more specifically, to a state-aware hybrid precision quantization inference method and system for feeder terminals. Background Technology
[0002] Feeder Terminal Units (FTUs) are typically deployed at field equipment such as 10kV feeder pole-mounted switches, ring main units, sectionalizing switches, tie switches, or circuit breakers. They are responsible for collecting information such as three-phase voltage, three-phase current, zero-sequence voltage, zero-sequence current, switch position, energy storage status of switch operating mechanisms, protection actions, reclosing status, SOE events, and communication status. They also cooperate with the distribution master station or feeder automation system to complete tasks such as fault detection, fault location, fault isolation, and restoration of power supply to non-faulty sections.
[0003] As feeder automation evolves from traditional threshold judgment to edge intelligent judgment, the FTU side needs to run target reasoning models such as fault type identification, ground fault analysis, short circuit fault identification, fault section auxiliary location, switch status abnormality identification, reclosing result judgment, and FA action auxiliary judgment.
[0004] Quantization methods can compress neural network weights and activation values from floating-point numbers into low-bit integers, which is an important means of deploying intelligent recognition models on the FTU side. Quantization inference on the FTU cannot simply pursue a fixed low bit count; it needs to address the following three issues: First, has the current feeder state transitioned from stable operation to a disturbance or fault transient state, thus requiring improved inference accuracy? Second, if improved accuracy is needed, which layers in the neural network should be improved? Third, given FTU resource constraints and control safety considerations, to what extent should the accuracy be improved, when should it be reduced back, and when should the control output be latched? Summary of the Invention
[0005] In view of the above problems, the purpose of this invention is to provide a state-aware hybrid precision quantization inference method and system for feeder terminals, which can more effectively and accurately use FTU to complete quantization inference.
[0006] The first aspect of this invention provides a state-aware hybrid precision quantization inference method for feeder terminals, comprising: When offline, collect raw samples and establish calibration samples with status and business within a unified time window; Based on the calibration sample, a first state feature is calculated according to the discrete wavelet transform decomposition result, and a second state feature is collected from the calibration sample. The first state feature and the second state feature constitute a state feature vector. The state feature vector is trained to establish a state discrimination rule. Based on calibration samples in different states, a layer-by-layer, bit-by-bit width basic quantization loss test is performed to obtain the basic quantization loss; The sharpness score is obtained by observing the maximum increase in the loss function before and after the perturbation on the calibration samples of the corresponding state, combined with the basic quantization loss and the preset layer importance label K. i Generate a layer risk table in offline mode; Collect online samples in the online state, and combine them with the state discrimination rules to output the current online state and the confidence level of the online state; Based on the layer risk table in the offline state, the layer risk table in the current online state is obtained according to the current online state, forming risk constraints. The resource state in the online samples is collected to obtain resource constraints. According to the risk constraints and the resource constraints, the hybrid precision decision-maker selects the bit width in each network layer and generates the bit width configuration. Based on the bit width configuration, the quantization parameters or quantization operators corresponding to the bit width of each network layer are obtained, thereby completing mixed precision forward inference, performing model confidence verification, electrical and topology verification, and obtaining the verification status. If the verification status is normal, the high-width layer will be reverted to the low-width configuration; otherwise, it will enter the latching state and upload samples for backflow.
[0007] In this solution, during offline operation, the process of collecting offline raw samples and establishing calibration samples with status and service information in a window includes: When offline, feeder operation data is collected based on FTU local historical records, distribution master station historical database, fault waveform files, SOE event records and manual review records to obtain the original sample set, where FTU is the feeder terminal. Based on the original sample set, the voltage, current, zero-sequence quantity, SOE event and resource status data of different sampling periods are aligned according to a unified timestamp, and missing values, out-of-limit abnormal values and communication interruption segments are removed to obtain an updated sample set; Based on the updated sample set, an input window X is constructed according to a fixed-length window or an event-triggered window. Based on protection actions, waveform characteristics, SOE sequence, master station fault handling records, and manual verification results, each input window X is appended with a feeder status m, which includes at least normal operation status, disturbance status, and fault / protection action status; the preset target inference model needs to output the service result y including fault type, fault section, grounding / short circuit type, switch anomaly category, reclosing result, or FA action; The obtained and processed data is organized into D. cal ={X, m, y}, to obtain calibration sample D cal .
[0008] In this scheme, based on the calibration samples, a first state feature is calculated according to the discrete wavelet transform decomposition result, and a second state feature is collected from the calibration samples. The first state feature and the second state feature constitute a state feature vector. The state feature vector is trained to establish state discrimination rules, including: Based on the input window X, the rated voltage, current transformer ratio, zero-sequence transformer ratio and FTU sampling period are normalized in terms of dimensions. Perform a j-level discrete wavelet transform on the continuous time-series signal in the calibration sample to decompose it into a low-frequency approximate component A. j and high-frequency detail components D1, D2, ..., D j Where j represents the preset transformation layer number, and the transformation formula is: X→{A j D1, D2, ..., D j}; The high-frequency energy proportion E is calculated based on the discrete wavelet transform decomposition results. ℎ Energy entropy H w Detail coefficient peak P d Zero-sequence high-frequency energy E0, interphase high-frequency energy difference D p Transient duration T d Phase current sudden change ΔI and the sequence characteristics of switching events S soe The first state feature is obtained, and based on the first state feature when offline, the second state feature when offline is combined to form a state feature vector F. s The second state characteristics include voltage drop amplitude, zero-sequence duration, and reclosing interval; Based on the feeder state m, the state feature vector F s By performing threshold statistics, rule learning, or training a lightweight classifier, the state discrimination rule G is obtained.
[0009] In this scheme, the basic quantization loss is obtained by performing layer-by-layer, bit-by-bit width basic quantization loss tests based on calibration samples in different states, including: Based on the preset target inference model, the network layers of the preset target inference model are divided into Layer1 to Layer2. n And set a candidate bit width set B={b1, b2, ..., b} for each layer. k}, where n is the number of preset model network layers, b is the candidate bit width, and k is the number of preset candidate bit widths per layer; based on the candidate bit width set, the supported weight bit width and activation bit width combinations are determined according to the processor, NPU or quantization inference framework mounted on the feeder terminal; Based on the feeder state m, the calibration sample D calThe samples are divided into a normal sample subset, a disturbance sample subset, and a fault / protection action sample subset. Based on the calibration sample corresponding to each feeder state m, the Layer is fixed. i Other network layers besides i, where i is the preset network layer number. i For the preset target reasoning model of the i-th layer, we obtain Layer i Given an inner candidate bit width b, perform forward inference and record the loss function increment, accuracy decrease, classification confidence change, fault segment consistency change, protection action consistency change, and output feature difference to obtain the basic quantization loss Q of the i-th layer under the feeder state m and the candidate bit width b. i (b, m).
[0010] In this scheme, the maximum increase in the loss function before and after the perturbation is observed on the calibration samples based on the corresponding state to obtain a sharpness score, which is then combined with the basic quantization loss and the preset layer importance label K. i Generate a layer risk table in offline mode, including: Based on the aforementioned fundamental quantization loss Q i (b, m), for Layer i Apply a perturbation in the same direction as the low-bit-width quantization error; Based on the calibration samples corresponding to the feed state m, the maximum increase in the loss function before and after the perturbation is observed to obtain the sharpness score of the i-th layer under the feed state m and the candidate bit width b. i (b, m); Based on the aforementioned fundamental quantization loss Q i (b, m), the sharpness score Sharp i (b, m) and the preset layer importance marker K i The process involves fusing data to generate a layer risk table R for the i-th layer in offline mode, under the feeder state m and the candidate bit width b. i (b, m), the layer risk table R i (b, m) are normalized according to the feeder state m and then fixed to the FTU local or edge management platform.
[0011] In this scheme, the collection of online samples in the online state, combined with the state discrimination rule, outputs the current online state and the online state confidence level, including: When the FTU is running online, based on the establishment of the input window X, the online sample is obtained according to the collected real-time electrical quantities, SOE events, and resource status, and the real-time input window X is created. t The real-time input window X t The data fields, time alignment, and normalization methods are the same as those of the calibration sample D in offline mode.cal Maintain consistency; The real-time input window X based on the online sample t The first state feature in online time is calculated based on discrete wavelet transform decomposition, and combined with the second state feature in online time, the real-time input window X is then analyzed. t Processing to obtain the real-time input window X t The state feature vector F s (X t ); The real-time input window X t The state feature vector F s (X t Input the state discrimination rule G to obtain the rule score G. m (F s (X t Then determine the current online status m of the FTU. t and online status confidence level c m .
[0012] In this scheme, the layer risk table based on the offline state is used to obtain the layer risk table under the current online state, forming risk constraints. Resource states in the online samples are collected to obtain resource constraints. Based on the risk constraints and resource constraints, the mixed-precision decision-maker selects the bit width at each network layer and generates a bit width configuration, including: Based on the current online status m t From the layer risk table in the offline state, query the online candidate bit width for each network layer to obtain the i-th layer in the current online state m. t Layer risk table R under candidate bit width b i (b, m) t ); Based on the hierarchical risk list of the current online status, risk constraints are obtained; Based on the online samples, the resource status is collected, including CPU / NPU utilization, memory utilization, chip temperature, communication queue, backup power status, and target inference latency, and resource constraints are generated. Given the risk constraints and resource constraints, the hybrid precision decision maker selects the bit width at each network layer, i.e., the candidate bit width b of the i-th layer. i Get the real-time input window X t The following bit width configuration B t .
[0013] In this scheme, based on the bit width configuration, the quantization parameters or quantization operators corresponding to the bit width of each network layer are obtained, thereby completing mixed-precision forward inference, performing model confidence verification, electrical and topology verification, and obtaining the verification status, including: Based on the bit width configuration B t For each network layer, the corresponding bit-width quantization parameters or quantization operators are called. B is configured according to the bit width. t The FTU completes mixed-precision forward inference by calling quantization parameters or quantization operators, and outputs fault type, fault section, ground / short circuit category, switch abnormality category, reclosing result or FA action auxiliary judgment result; Based on FTU, perform the model confidence check to examine the output confidence of the preset target inference model, the consistency of continuous window results, and the online state confidence c. m If the fault category or segment result of adjacent windows changes frequently, or the confidence of the model output is lower than the preset threshold, then this inference will be marked as a result to be reviewed. Based on the FTU, the electrical and topology verification is performed to further check the phase voltage / phase current correspondence, the continuity of zero-sequence current and zero-sequence voltage, the consistency of protection start-up and SOE sequence, the consistency of upstream and downstream FTU current direction, and the topology consistency between switch position and fault section. Based on the performance of the model confidence check and the electrical and topology checks, the FTU obtains the check status using mixed-precision forward inference.
[0014] In this solution, if the verification status is normal, the high-width layer is reverted to the low-width configuration; otherwise, it enters a latching state and uploads samples for reflow, including: Based on the fact that the verification status is normal, and the number of consecutive preset windows of multi-scale high-frequency features is below the fallback threshold, and the current online status m t When the system returns to normal operating range, the FTU will gradually reduce the high-width layer to the low-width configuration. Based on the abnormal verification status, or when key measurements are missing, SOE sequence is abnormal, communication is abnormal, terminal temperature is too high, backup power is insufficient, inference confidence is insufficient, resource usage exceeds the threshold, or the control permission flag is in a prohibited control state, the FTU enters a safety lockout state; the conditions for entering the prohibited control state are low model confidence, inconsistent continuous window results, or significant conflicts between inference results and electrical physical relationships, feeder topology, or SOE timing. Based on samples that are locked, in low-confidence states, or have been manually verified as incorrect, the FTU or edge management platform returns them to the sample library as samples to be verified. After manual or main station verification, they are added to the calibration sample D. calThis will allow for the updating of the state discrimination rule G and the layer risk table R in subsequent versions; Through fallback, latching, uploading, and sample return, the online inference results are returned to the offline calibration entry point.
[0015] A second aspect of the present invention provides a state-aware hybrid precision quantization inference system for feeder terminals, comprising: The data acquisition and preprocessing module is used to collect raw samples and establish calibration samples with status and business within a unified time window when offline. The multi-scale state discrimination module is used to perform the discrete wavelet transform decomposition, calculate the first state feature, collect the second state feature from the calibration sample, the first state feature and the second state feature constitute the state feature vector, the state feature vector is trained to establish state discrimination rules, collect online samples in the online state, and combine the state discrimination rules to output the current online state and the online state confidence. The basic quantization loss test module is used to perform layer-by-layer, bit-by-bit width basic quantization loss tests on calibration samples in different states to obtain the basic quantization loss. The sharpness and layer risk table generation module is used to observe the maximum increase in the loss function before and after perturbation on calibration samples in the corresponding state, obtain a sharpness score, and combine it with the basic quantization loss and the preset layer importance label K. i Generate a layer risk table in offline mode; The parameter configuration module is used to determine parameters based on sample distribution, cost of misjudgment, FTU equipment capabilities, and feeder automation operation time limits. The resource status monitoring module provides information on CPU / NPU utilization, memory, temperature, communication queue, and backup power. The hybrid precision decision module is used to obtain the layer risk table under the current online state based on the layer risk table under the offline state and the current online state, form risk constraints, collect the resource state in the online samples to obtain resource constraints, and select the bit width at each network layer based on the risk constraints and the resource constraints to generate the bit width configuration. The system comprises a quantization inference execution module, a control permission verification module, and a fallback latching and sample reflow module. The quantization inference execution module is used to obtain the quantization parameters or quantization operators corresponding to the bit width of each network layer according to the bit width configuration, thereby completing mixed precision forward inference. The control permission verification module is used to generate a control permission flag. The fallback latching and sample reflow module is used to operate according to the verification status. Under normal conditions, it falls back the high bit width layer to the low bit width configuration. Under abnormal conditions, it enters the latching state and uploads samples for reflow.
[0016] This invention discloses a state-aware hybrid precision quantization inference method and system for feeder terminals. It establishes discrimination rules for identifying online states from calibration samples, and simultaneously obtains risk constraints from the basic quantization loss and sharpness risk derived from the calibration samples. Under resource and risk constraints related to computing power, temperature, memory, communication, and inference latency, it combines the current online state to obtain the bit width configuration, quantizes the online state parameters, completes hybrid precision forward inference, obtains the verification state based on the verification, and performs fallback, latching, uploading, and sample reflow based on the verification state. The FTU can use low bit width for fast inference under normal operating conditions, reducing computational load, memory access, power consumption, and temperature rise. Under disturbance or fault conditions, it triggers precision enhancement based on wavelet transient characteristics and only enhances the bit width of critical layers according to the layer risk table, thereby improving the reliability of ground fault, short circuit fault, fault section, and switch anomaly identification. Attached Figure Description
[0017] Figure 1 A flowchart of the state-aware hybrid precision quantization inference method for feeder terminals provided by the present invention is shown. Figure 2 This diagram illustrates the feeder / FTU state discrimination based on wavelet multi-scale features provided by the present invention. Figure 3 A block diagram of the state-aware hybrid precision quantization inference system for feeder terminals provided by the present invention is shown. Detailed Implementation
[0018] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0019] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0020] Figure 1 A flowchart of the state-aware hybrid precision quantization inference method for feeder terminals provided by the present invention is shown.
[0021] like Figure 1 As shown, this invention discloses a state-aware hybrid precision quantization inference method for feeder terminals, including: S101, when offline, collect raw samples and establish calibration samples with status and business within a unified time window; S102, based on the calibration sample, calculate the first state feature according to the discrete wavelet transform decomposition result, collect the second state feature in the calibration sample, the first state feature and the second state feature constitute the state feature vector, and the state feature vector is trained to establish the state discrimination rule. S103, based on calibration samples in different states, performs layer-by-layer bit-by-bit width basic quantization loss test to obtain basic quantization loss; S104. Based on the calibration samples of the corresponding state, observe the maximum increase in the loss function before and after the perturbation to obtain a sharpness score, which is then combined with the basic quantization loss and the preset layer importance label K. i Generate a layer risk table in offline mode; S105: Collect online samples in the online state, combine them with the state discrimination rules, and output the current online state and the confidence level of the online state; S106, Based on the layer risk table in the offline state, the layer risk table in the current online state is obtained according to the current online state, forming risk constraints. The resource state in the online samples is collected to obtain resource constraints. According to the risk constraints and resource constraints, the hybrid precision decision-maker selects the bit width in each network layer and generates the bit width configuration. S107, based on the bit width configuration, obtains the quantization parameters or quantization operators corresponding to the bit width of each network layer, thereby completing mixed precision forward inference, performing model confidence verification, electrical and topology verification, and obtaining the verification status; S108, if the verification status is normal, the high-width layer will be reverted to the low-width configuration; otherwise, the system will enter the latching state and upload the sample for reflow.
[0022] According to an embodiment of the present invention, firstly, in the offline stage: the original sample set is obtained from the historical database, time-aligned, and an input window is established to obtain calibration samples with feeder status and business results. Based on the calibration samples, discrete wavelet transform decomposition is used to process the calibration samples, and the first state feature is calculated using the results. At the same time, the second state feature in the calibration samples is collected. The first state feature and the second state feature constitute a state feature vector. In the feeder status, the state feature vector is trained to establish state discrimination rules. The preset target inference model is divided, and a candidate bit width set is obtained for each layer. At the same time, the calibration samples are divided according to the feeder status. Forward inference is performed and the differences are recorded to obtain the basic quantization loss. A perturbation is applied to the preset target inference model layer. Based on the calibration samples in the feeder status, the maximum increase of the loss function before and after the perturbation is observed to obtain a sharpness score. The basic quantization loss is combined to generate a layer risk table. Then, in the online phase: online samples are obtained, a real-time input window is created, the state feature vector of the online phase is input into the state discrimination rule, the rule score is obtained, and the current online state and online state confidence are determined; based on the current online state, a hierarchical risk list under the current online state is obtained to form risk constraints, resource states in online samples are collected to obtain resource constraints, and bit width configuration under the real-time input window is obtained according to the two constraints; based on the bit width configuration, parameters are quantized, mixed precision forward inference is completed, and the verification state is output according to the model confidence verification and electrical and topology verification to generate a control permission flag.
[0023] Finally, based on the verification status, fallback, latching, uploading, and sample reflow are performed; through fallback, latching, uploading, and sample reflow, the online inference results are returned to the offline calibration entry point.
[0024] According to an embodiment of the present invention, when offline, collecting offline raw samples and establishing calibration samples with window status and services includes: When offline, feeder operation data is collected based on FTU local historical records, distribution master station historical database, fault waveform files, SOE event records and manual review records to obtain the original sample set, where FTU is the feeder terminal. Based on the original sample set, the voltage, current, zero-sequence quantity, SOE event and resource status data of different sampling periods are aligned according to a unified timestamp, and missing values, out-of-limit values and communication interruption segments are removed to obtain an updated sample set; Based on the updated sample set, construct the input window X according to a fixed-length window or an event-triggered window; Based on protection actions, waveform characteristics, SOE sequence, master station fault handling records, and manual verification results, each input window X is appended with a feeder status m. The feeder status m includes at least normal operation status, disturbance status, and fault / protection action status. The preset target inference model needs to output the following service results y: fault type, fault section, grounding / short circuit type, switch anomaly category, reclosing result, or FA action. The obtained and processed data is organized into D. cal ={X, m, y}, to obtain calibration sample D cal .
[0025] It should be noted that each sample in the original sample set established in the offline phase includes at least three-phase voltage, three-phase current, zero-sequence voltage, zero-sequence current, frequency, switch position, protection start / action signal, reclosing status, remote signaling change time, communication quality, terminal CPU / NPU utilization, temperature, power supply / backup power supply status, and target inference task label.
[0026] Synchronizing and quality-screening the original sample set is to ensure that each subsequent window corresponds to a specific feeder operation process.
[0027] Based on the updated sample set, an input window X is constructed, ensuring that each window simultaneously contains electrical quantity sequences, switching event sequences, and resource status sequences. For fault recording samples, several sampling points are extracted before and after the protection start-up or SOE change moment; for normal operation samples, continuous input windows X are extracted according to a fixed step size to ensure that normal, disturbance, and fault samples all participate in subsequent comparisons.
[0028] Based on the feeder state m of the unified input window X and the business result y that the preset target inference model needs to output, the calibration sample D is obtained. cal ={X, m, y}, providing a reference for the processing of online samples.
[0029] According to an embodiment of the present invention, based on calibration samples, a first state feature is calculated according to the discrete wavelet transform decomposition result, and a second state feature is collected from the calibration samples. The first state feature and the second state feature constitute a state feature vector. The state feature vector is trained to establish a state discrimination rule, including: Based on the input window X, the rated voltage, current transformer ratio, zero-sequence transformer ratio and FTU sampling period are normalized in terms of dimensions. Perform a j-level discrete wavelet transform on the continuous time-series signal in the calibration sample to decompose it into a low-frequency approximate component A. j and high-frequency detail components D1, D2, ..., D j Where j represents the preset transformation layer number, and the transformation formula is: X→{A j D1, D2, ..., D j}; The high-frequency energy proportion E is calculated based on the discrete wavelet transform decomposition results. ℎ Energy entropy H w Detail coefficient peak P d Zero-sequence high-frequency energy E0, interphase high-frequency energy difference D p Transient duration T d Phase current sudden change ΔI and the sequence characteristics of switching events S soe The first state feature is obtained, and based on the first state feature at offline time, the second state feature at offline time is combined to form the state feature vector F. s The second state characteristics include voltage drop amplitude, zero-sequence duration, and reclosing interval; Based on the feeder state m, threshold statistics, rule learning, or lightweight classifier training are performed on the state feature vector Fs to obtain the state discrimination rule G.
[0030] It should be noted that the purpose of normalization in the input window X is to ensure that the three-phase voltage, three-phase current, zero-sequence quantity, and SOE event are on the same time axis.
[0031] First state characteristic: High-frequency energy proportion E ℎ = Total energy of high-frequency details in discrete wavelets ÷ Total energy of the waveform across the entire frequency band; the greater the transient impact of the fault, the higher E. ℎ The higher the value, the better the distinction between normal load and short-circuit ground fault; Energy entropy H w The entropy of the energy distribution in each frequency band is the information entropy. The more chaotic the waveform disturbance (intermittent grounding, lightning strikes), the greater the entropy value, which characterizes the waveform complexity; the peak value P of the detail coefficient. d The maximum amplitude of the wavelet high-frequency detail coefficients directly reflects the impact intensity of the fault current; the zero-sequence high-frequency energy E0 is the total energy of the zero-sequence current 3I0 wavelet high-frequency components, a core distinguishing indicator for single-phase grounding faults, and this value is close to 0 during phase-to-phase short circuits; the phase-to-phase high-frequency energy difference D... p A / B / C are the average of the pairwise high-frequency energy differences between the three phases, used to identify asymmetrical faults (single-phase grounding, two-phase short circuit) and symmetrical three-phase short circuits; transient duration T d The continuous sampling duration of wavelet high-frequency components exceeding the threshold corresponds to the number of cycles in the transient fault period; the phase current mutation ΔI is the difference between the fundamental current before and after the fault, characterizing the magnitude of the steady-state short-circuit current; the switching event sequence characteristic S soe SOE time-stamped encoding features: record the timing intervals of fault initiation, protection action, switch opening, reclosing, and fault isolation, and digitize them into timing sequence features.
[0032] Second-state characteristic: Voltage sag amplitude The percentage drop in voltage of the faulted phase is used to distinguish the severity of the short circuit; the duration of the zero-sequence quantity is also considered. The total duration of zero-sequence voltage / current exceeding limits is used to distinguish between permanent and transient grounding faults; reclosing bay. To protect the time difference between tripping and reclosing, the action logic of FA is reflected.
[0033] All normalized features are concatenated horizontally in a fixed order to form a one-dimensional vector: .
[0034] The preset number of transformation layers j can be set by those skilled in the art according to actual needs.
[0035] According to an embodiment of the present invention, based on calibration samples in different states, a layer-by-layer bit-by-bit width fundamental quantization loss test is performed to obtain the fundamental quantization loss, including: Based on the pre-defined target inference model, the network layers of the pre-defined target inference model are divided into Layer 1 to Layer 2. nAnd set a candidate bit width set B={b1, b2, ..., b} for each layer. k}, where n is the number of preset model network layers, b is the candidate bit width, and k is the number of preset candidate bit widths per layer; based on the candidate bit width set, the supported weight bit width and activation bit width combinations are determined according to the processor, NPU or quantization inference framework on the feeder terminal; Based on the feeder state m, the calibration sample D cal The samples are divided into a normal sample subset, a disturbance sample subset, and a fault / protection action sample subset. Based on the calibration sample corresponding to each feeder state m, fix the Layer i Other network layers besides i, where i is the preset network layer number. i For the preset target reasoning model of the i-th layer, we obtain Layer i Given an inner candidate bit width b, perform forward inference and record the loss function increment, accuracy decrease, classification confidence change, fault segment consistency change, protection action consistency change, and output feature difference to obtain the basic quantization loss Q of the i-th layer under feeder state m and candidate bit width b. i (b, m).
[0036] It should be noted that the preset target inference model is a temporal neural network, multimodal network, or lightweight Transformer network used for fault type identification, fault section analysis, switch status anomaly identification, or FA action-assisted judgment. The calibration samples are divided according to the feeder state, so that the quantization effect of the same network layer in different states can be tested separately, instead of just obtaining an average sensitivity.
[0037] Calculate the fundamental quantization loss Q of the i-th layer under feed state m and candidate bit width b. i (b, m), its formula is: ; in, This represents the increase in loss before and after quantization. Indicates the decrease in recognition accuracy. This indicates the output features of the previous layer before quantization. This represents the output features of the quantized layer. This represents a measure of feature difference. This indicates the degree of decrease in fault section, protection action, or SOE consistency, representing weight ,represent weight ,represent weight , weight All are determined by the cost of FTU operational misjudgment and the statistical results of calibration samples. For example, if the error rate is increased during a fault / protection operation... and The corresponding weights cause a decrease in the consistency of fault sections, protection actions, and SOE, affecting Q. i The influence of (b, m) is greater.
[0038] The preset number of model layers n, the preset number of candidate bit widths k per layer, and the preset number of network layers i are all set by those skilled in the art according to actual needs.
[0039] According to an embodiment of the present invention, the sharpness score is obtained by observing the maximum increase of the loss function before and after the perturbation on the calibration samples of the corresponding state, and combining the basic quantization loss and the preset layer importance label K. i Generate a layer risk table in offline mode, including: Based on the fundamental quantization loss Q i (b, m), for Layer i Apply a perturbation in the same direction as the low-bit-width quantization error; Based on the calibration samples corresponding to feeder state m, the maximum increase in the loss function before and after the perturbation is observed, and the sharpness score of the i-th layer under feeder state m and candidate bit width b is obtained. i (b, m); Based on the fundamental quantization loss Q i (b, m), Sharpness score i (b, m) and the preset layer importance marker K i Fusion is performed to generate the layer risk table R of the i-th layer in offline state under feeder state m and candidate bit width b. i (b, m), the layer risk table R i (b, m) are normalized according to the feeder state m and then fixed to the FTU local or edge management platform.
[0040] It should be noted that the sharpness rating is Sharp. i (b, m) can be obtained by weighting one or more of the following: maximum loss increment, gradient norm, Hessian trace approximation, and cosine distance between features before and after quantization, resulting in the sharpness scoring formula: ; in, This represents the maximum incremental loss. It is the gradient norm; This is an approximation of the Hessian trace. To quantize the cosine distance between the output features of the preceding and following layers; representing weight ,represent weight ,represent weight ,represent weight All settings are configured by those skilled in the art based on actual needs.
[0041] In practical implementation, the Hessian trace approximation can be obtained through finite difference, Hutchinson trace estimation, or gradient norm approximation. When offline computational resources are limited, only the maximum loss increment and feature cosine distance can be used as simplified sharpness indices. This sharpness calculation is completed offline, and there is no need to recalculate the Hessian or gradient during the online inference stage. Simultaneously, a layer importance label K is set. i It is used to identify key FTU service layers such as the input transient feature extraction layer, the zero-sequence / phase current fusion layer, the timing attention layer, the fault section output layer, and the control suggestion output layer.
[0042] Based on the fundamental quantization loss Q i (b, m), Sharpness score i (b, m) and the preset layer importance marker K i Fusion, generating layer risk table R i (b, m). Its generation layer risk table formula is: ; in, The relative impact of adjusting the basic quantization loss and sharpness risk can be determined based on the validation error distribution on the three types of samples: normal, perturbation, and fault. Used to enhance the protection of critical layers in FTU operations, the layer risk can be determined based on layer type, layer location, and output mission security level. Layer Risk Table R i After (b, m) is generated, it is normalized according to the feeder state m and then fixed to the FTU local or edge management platform.
[0043] According to an embodiment of the present invention, online samples in the online state are collected, and combined with state discrimination rules, the current online state and the confidence level of the online state are output, including: When the FTU is running online, based on the establishment of input window X, online samples are obtained by collecting real-time electrical quantities, SOE events, and resource status, and a real-time input window X is created. t The real-time input window X t The data fields, time alignment, and normalization methods are the same as those of the calibration sample D in offline mode. cal Maintain consistency; Real-time input window X based on online samples t Based on the discrete wavelet transform decomposition, the online first-state features are calculated, and combined with the online second-state features, the real-time input window X is analyzed.t Processing to obtain the real-time input window X t The state feature vector F s (X t ); Real-time input window X t The state feature vector F s (X t Input the state discrimination rule G, and obtain the rule score G. m (F s (X t Then determine the current online status m of the FTU. t and online status confidence level c m .
[0044] It should be noted that online samples are collected using the collected calibration samples as templates to ensure that the online status identification is consistent with the status definition of the offline layer risk table.
[0045] Real-time input window X t The state feature vector F s (X t If key measurements are missing or the SOE event sequence is incomplete in the real-time window, a data confidence flag is generated simultaneously for verification. If the G output is in normal operating condition, it indicates that the current feeder is mainly changing with a low-frequency load trend; if the G output is in a disturbance state, it indicates that the zero-sequence quantity, high-frequency transient components, or SOE abnormal sequence is beginning to increase; if the G output is in a fault / protection action state, it indicates that high-frequency transient characteristics appear continuously, protection signals are activated, or abnormal characteristics reach the fault threshold. Score G according to the rules m (F s (X t Determine the current online status of the FTU. t and online status confidence level c m The formula is: ; ; In the formula, M represents the set of candidate feeder states, and G... m (F s (X t )) represents the rule satisfaction, classification probability, or feature matching degree given by the state discrimination rule G for the candidate feeder state m. This indicates that the input window X will be displayed in real time. t The state feature vector F s (X t Input state discrimination rule G, state discrimination rule G for candidate current online state m tThe given rule score (the rule score can be expressed as rule satisfaction, classification probability, or feature matching degree); m t For the state category with the highest score, c m G represents the state confidence level corresponding to the highest score. m (F s (X t The calculation of )) is existing technology and will not be elaborated here.
[0046] To prevent the state from repeatedly jumping around the threshold, continuous window confirmation and hysteresis thresholds are set: a more sensitive trigger threshold is used when entering a disturbance or fault state, and a stricter recovery threshold is used when exiting a high-precision state. The current online state m is only confirmed when multiple consecutive windows meet the entry conditions. t Only then does it switch to a disturbance or fault state; the current online state m only remains active when multiple consecutive windows meet the recovery conditions. t It then returned to normal.
[0047] According to an embodiment of the present invention, based on the layer risk table in the offline state, a layer risk table in the current online state is obtained according to the current online state to form risk constraints. Resource states in online samples are collected to obtain resource constraints. Based on the risk constraints and resource constraints, a mixed-precision decision-maker selects the bit width at each network layer to generate a bit width configuration, including: Based on the current online status m t Query the online candidate bit width for each network layer from the offline layer risk table to obtain the current online state m of the i-th layer. t Layer risk table R under candidate bit width b i (b, m) t ); Based on the hierarchical risk list of the current online status, risk constraints are obtained; Based on online samples, resource status is collected, including CPU / NPU utilization, memory utilization, chip temperature, communication queue, backup power status, and target inference latency, and resource constraints are generated. Under risk and resource constraints, the hybrid precision decision maker selects the bit width at each network layer, i.e., the candidate bit width b of the i-th layer. i Get the real-time input window X t The following bit width configuration B t .
[0048] It should be noted that during the query process, if the current online status is m t In a normal state, a relatively large number of low-bandwidth layers are acceptable; if the current online state is m t If the state is disturbed or faulty, the risk value corresponding to the high-sharpness layer and the business-critical layer will increase.
[0049] Resource constraints are used to limit the number of high-width layers to prevent inference timeouts or terminal overheating caused by increasing the accuracy of the entire model during fault transients.
[0050] Based on risk and resource constraints, a bit-width configuration B is formed. t ={b1, b2, ..., b n}, so that min∑c i (b i To minimize this, the following are the formulas related to constrained optimization: ; ; c i (b i ) indicates that the i-th layer uses a bit width of b i The computational cost at that time; the objective function min∑c i (b i ) represents the cost of minimizing the cumulative precision loss corresponding to the quantization bit width of each layer of the network; st represents the constraint conditions, and the above formula has 4 constraint conditions; This represents the total risk accumulated across all layers of the entire target reasoning model; This represents the total risk threshold allowed under the current state; Indicates the use of bit-width configuration B t At that time, the time taken for a single inference by the model (inference delay); This indicates the maximum allowed inference latency for the hardware terminal; This indicates the real-time chip temperature of the current hardware terminal; This indicates the highest temperature threshold that allows the hardware to operate safely. This represents a comprehensive set of resource constraints other than latency and temperature, including one or more of the following: CPU / NPU utilization, memory utilization, communication queue length, backup power margin, and quantization operator support states. This indicates the corresponding resource limit. Under normal operating conditions... With a more relaxed approach, the FTU can utilize lower bit widths more frequently; under perturbation conditions... Tighten the layer, prioritizing the enhancement of high-sharpness layers and multi-source feature fusion layers to medium-high bandwidth; during fault / protection operation states. The most stringent approach is to prioritize high bit width in the input transient feature extraction layer, fusion layer, and output layer to reduce the risk of misjudging fault types and fault segments.
[0051] , , and It can be determined by the FTU equipment capabilities, the feeder automation operation time limit, and the status risk level. For example, (Normal) The higher quantile of the risk distribution of a normal sample can be taken. (Perturbation) Take the median quantile value. (Fault) Take the lower quantile value; Determined based on the maximum allowable inference delay according to fault assessment or FA-assisted judgment; Determined based on the terminal chip's rated temperature and on-site operating margin; Determined based on the operating boundaries of the FTU processor, NPU, memory, communication queue, and backup power supply.
[0052] In practical implementation, the hybrid precision decision maker can first generate an initial configuration based on the lowest bit width, and then sort the network layers according to the risk reduction per unit computational cost, prioritizing the increase of the bit width of high-yield layers until the risk threshold is met or the resource limit is reached. If the FTU temperature is too high, the backup power supply is insufficient, or the communication task is congested, the number of high-bit-width layers will be limited while ensuring control safety.
[0053] According to embodiments of the present invention, based on bit-width configuration, quantization parameters or quantization operators corresponding to the bit width of each network layer are obtained, thereby completing mixed-precision forward inference, performing model confidence verification, electrical and topology verification, and obtaining the verification status, including: Based on bit width configuration B t For each network layer, the corresponding bit-width quantization parameters or quantization operators are called. Configure B according to bit width t The FTU completes mixed-precision forward inference by calling quantization parameters or quantization operators, and outputs fault type, fault section, ground / short circuit category, switch abnormality category, reclosing result or FA action auxiliary judgment result; Based on FTU, perform model confidence verification to check the output confidence of the preset target inference model, the consistency of continuous window results, and the online state confidence. m If the fault category or segment result of adjacent windows changes frequently, or the confidence of the model output is lower than the preset threshold, then this inference will be marked as a result to be reviewed. Based on the FTU, perform electrical and topology verification, and further check the phase voltage / phase current correspondence, the continuity of zero-sequence current and zero-sequence voltage, the consistency of protection start-up and SOE sequence, the consistency of upstream and downstream FTU current direction, and the topology consistency of switch position and fault section. Based on the execution model confidence check and the execution electrical and topology checks, the FTU obtains the check status through mixed-precision forward inference.
[0054] It should be noted that during the parameter quantization process, different layers in the same preset target inference model can use different bit widths. For example, the low-risk intermediate layer uses a low bit width, the zero-sequence quantity and phase current fusion layer uses a medium bit width, and the transient feature extraction layer, output layer or high-sharpness layer uses a high bit width.
[0055] The result of the mixed-precision forward inference is first used as an auxiliary judgment variable and is not directly used as an executable command for opening, closing, fault isolation or power restoration.
[0056] During the model confidence verification process, the preset threshold is set by those skilled in the art according to actual needs.
[0057] Performing electrical and topology checks is used to prevent conflicts between neural network outputs and the physical relationships of power distribution.
[0058] The control permission flag is allowed to be set to the executable recommendation state only when the inference confidence, continuous window consistency, electrical constraints, feeder topology constraints, and SOE sequence verification all meet the preset conditions, and the FTU resource status does not exceed the safety threshold. If the model confidence is low, the continuous window results are inconsistent, or the inference results obviously conflict with the electrical physical relationship, feeder topology, or SOE timing, the control permission flag is set to the prohibited control state.
[0059] According to an embodiment of the present invention, if the verification status is normal, the high-width layer is reverted to the low-width configuration; otherwise, a latching state is entered and a sample is uploaded for reflow, including: Based on the normal verification status, and the number of consecutive preset windows of multi-scale high-frequency features being below the fallback threshold, and the current online status m t When the system returns to normal operating range, the FTU will gradually reduce the high-width layer to the low-width configuration. When the verification status is abnormal, or when key measurements are missing, SOE sequence is abnormal, communication is abnormal, terminal temperature is too high, backup power is insufficient, inference confidence is insufficient, resource usage exceeds the threshold, or the control permission flag is in a prohibited control state, the FTU enters a safety lockout state. The conditions for entering the prohibited control state are low model confidence, inconsistent continuous window results, or obvious conflicts between inference results and electrical physical relationships, feeder topology, or SOE timing. Samples in locked, low-confidence, or manually verified incorrect states are returned to the sample bank by the FTU or edge management platform as samples to be verified. After manual or main station verification, they are added to the calibration sample D. cal This will allow for updates to the state determination rule G and the layer risk table R in subsequent versions; Through fallback, latching, uploading, and sample return, the online inference results are returned to the offline calibration entry point.
[0060] It should be noted that when the verification status is normal, the fallback adopts a hysteresis mechanism, that is, different thresholds are used for entering high-precision mode and exiting high-precision mode to avoid the feeder status m repeatedly switching around the threshold.
[0061] In the locked state, the FTU can continue to upload alarms, status judgment results, layer width configuration, inference evidence chain, and raw window data, but will not automatically execute control actions such as opening, closing, unlocking, fault isolation, or power restoration. The output of the preset target inference model is only used as the basis for master station verification, manual confirmation, or subsequent sample feedback, and cannot be converted into switch control commands on its own.
[0062] Through the formation of a closed-loop iteration, it is shown that the present invention does not deploy a fixed quantization model all at once, but forms a closed loop between state awareness, risk constraints, inference verification and sample updates.
[0063] Figure 2 This diagram illustrates the feeder / FTU state discrimination based on wavelet multi-scale features provided by the present invention. like Figure 2 As shown, this invention provides a feeder / FTU state discrimination based on wavelet multi-scale features, including: Based on real-time input window X t Based on the online samples, the first state features are calculated according to the discrete wavelet transform decomposition results, and the real-time input window X is collected. t The second state feature in the online samples below, the first state feature and the second state feature constitute the state feature vector, including: Based on real-time input window X t The rated voltage, current transformer ratio, zero-sequence transformer ratio, and FTU sampling period are normalized in terms of dimensions. Perform a j-level discrete wavelet transform on the continuous time-series signal in the online samples to decompose it into a low-frequency approximate component A. j and high-frequency detail components D1, D2, ..., D j Where j represents the preset transformation layer number, and the transformation formula is: X t →{A j D1, D2, ..., D j}; The high-frequency energy proportion E is calculated based on the discrete wavelet transform decomposition results. ℎ Energy entropy H w Detail coefficient peak P d Zero-sequence high-frequency energy E0, interphase high-frequency energy difference D p Transient duration T d Phase current sudden change ΔI and the sequence characteristics of switching events S soe The first state feature is obtained, and based on the first state feature when online, the second state feature when online is combined to construct the state feature vector F. s (X t The second state characteristics include voltage drop amplitude, zero-sequence duration, and reclosing interval; Based on discrete wavelet transform decomposition and offline calibration samples, the offline state feature vector F can be obtained. s Based on the feeder state m and the state feature vector F s Threshold statistics, rule learning, or lightweight classifier training are performed to obtain the state discrimination rule G; during online execution, the real-time input window X is used. t The state feature vector F s (X t Input the state discrimination rule G, and obtain the rule score G. m (F s (X t Then determine the current online status m of the FTU. t and online status confidence level c m .
[0064] Figure 3 A block diagram of the state-aware hybrid precision quantization inference system for feeder terminals provided by the present invention is shown.
[0065] like Figure 3 As shown, a second aspect of the present invention provides a state-aware hybrid precision quantization inference system for feeder terminals, comprising: The data acquisition and preprocessing module is used to collect raw samples and establish calibration samples with status and business within a unified time window when offline. The multi-scale state discrimination module is used to perform discrete wavelet transform decomposition, collect the second state features in the calibration samples, the first state features and the second state features constitute the state feature vector, the state feature vector is trained to establish state discrimination rules, collect online samples in the online state, and combine the state discrimination rules to output the current online state and the online state confidence. The basic quantization loss test module is used to perform layer-by-layer, bit-by-bit width basic quantization loss tests on calibration samples in different states to obtain the basic quantization loss. The sharpness and layer risk table generation module is used to observe the maximum increase in the loss function before and after perturbation on calibration samples in the corresponding state, and obtain a sharpness score, which is combined with the basic quantization loss and the preset layer importance label K. i Generate a layer risk table in offline mode; The parameter configuration module is used to determine parameters based on sample distribution, cost of misjudgment, FTU equipment capabilities, and feeder automation operation time limits. The resource status monitoring module provides information on CPU / NPU utilization, memory, temperature, communication queue, and backup power. The hybrid precision decision module is used to obtain the layer risk table under the current online state based on the layer risk table under the offline state and the current online state, form risk constraints, collect the resource state in the online samples to obtain resource constraints, and select the bit width at each network layer based on the risk constraints and resource constraints to generate the bit width configuration. The system comprises a quantization inference execution module, a control permission verification module, and a fallback latching and sample reflow module. The quantization inference execution module is used to obtain the quantization parameters or quantization operators corresponding to the bit width of each network layer according to the bit width configuration, thereby completing mixed precision forward inference. The control permission verification module is used to generate control permission flags. The fallback latching and sample reflow module is used to operate according to the verification status. Under normal conditions, it falls back the high bit width layer to the low bit width configuration. Under abnormal conditions, it enters the latching state and uploads samples for reflow.
[0066] All information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals (including but not limited to signals transmitted between user terminals and other devices) involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the "FTU local historical records," "distribution master station historical database," "fault waveform recording files," "SOE event records," and "manual review records" involved in this disclosure were all obtained with full authorization.
[0067] This invention discloses a state-aware hybrid precision quantization inference method and system for feeder terminals. It establishes discrimination rules for identifying online states from calibration samples, and simultaneously obtains risk constraints from the basic quantization loss and sharpness risk derived from the calibration samples. Under resource and risk constraints related to computing power, temperature, memory, communication, and inference latency, it combines the current online state to obtain the bit width configuration, quantizes the online state parameters, completes hybrid precision forward inference, obtains the verification state based on the verification, and performs fallback, latching, uploading, and sample reflow based on the verification state. The FTU can use low bit width for fast inference under normal operating conditions, reducing computational load, memory access, power consumption, and temperature rise. Under disturbance or fault conditions, it triggers precision enhancement based on wavelet transient characteristics and only enhances the bit width of critical layers according to the layer risk table, thereby improving the reliability of ground fault, short circuit fault, fault section, and switch anomaly identification.
[0068] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0069] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0070] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0071] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0072] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
Claims
1. A state-aware hybrid precision quantization inference method for feeder terminals, characterized in that, include: When offline, collect raw samples and establish calibration samples with status and business within a unified time window; Based on the calibration sample, a first state feature is calculated according to the discrete wavelet transform decomposition result, and a second state feature is collected from the calibration sample. The first state feature and the second state feature constitute a state feature vector. The state feature vector is trained to establish a state discrimination rule. Based on calibration samples in different states, a layer-by-layer, bit-by-bit width basic quantization loss test is performed to obtain the basic quantization loss; The sharpness score is obtained by observing the maximum increase in the loss function before and after the perturbation on the calibration samples of the corresponding state, combined with the basic quantization loss and the preset layer importance label K. i Generate a layered risk table in offline mode; Collect online samples in the online state, and combine them with the state discrimination rules to output the current online state and the confidence level of the online state; Based on the layer risk table in the offline state, the layer risk table in the current online state is obtained according to the current online state, forming risk constraints. The resource state in the online samples is collected to obtain resource constraints. According to the risk constraints and the resource constraints, the hybrid precision decision-maker selects the bit width in each network layer and generates the bit width configuration. Based on the bit width configuration, the quantization parameters or quantization operators corresponding to the bit width of each network layer are obtained, thereby completing mixed precision forward inference, performing model confidence verification, electrical and topology verification, and obtaining the verification status. If the verification status is normal, the high-width layer will be reverted to the low-width configuration; otherwise, the system will enter a locked state and upload samples for backflow.
2. The state-aware hybrid precision quantization inference method for feeder terminals according to claim 1, characterized in that, During offline processing, raw offline samples are collected and a window of calibration samples with status and service information is established, including: When offline, feeder operation data is collected based on FTU local historical records, distribution master station historical database, fault waveform files, SOE event records and manual review records to obtain the original sample set, where FTU is the feeder terminal. Based on the original sample set, the voltage, current, zero-sequence quantity, SOE event and resource status data of different sampling periods are aligned according to a unified timestamp, and missing values, out-of-limit abnormal values and communication interruption segments are removed to obtain an updated sample set; Based on the updated sample set, an input window X is constructed according to a fixed-length window or an event-triggered window. Based on protection actions, waveform characteristics, SOE sequence, master station fault handling records, and manual verification results, each input window X is appended with a feeder status m, which includes at least normal operation status, disturbance status, and fault / protection action status; the preset target inference model needs to output the service result y including fault type, fault section, grounding / short circuit type, switch anomaly category, reclosing result, or FA action; The obtained and processed data is organized into D. cal ={X, m, y}, to obtain calibration sample D cal .
3. The state-aware hybrid precision quantization inference method for feeder terminals according to claim 2, characterized in that, Based on the calibration samples, a first state feature is calculated according to the discrete wavelet transform decomposition result, and a second state feature is collected from the calibration samples. The first state feature and the second state feature constitute a state feature vector. The state feature vector is trained to establish state discrimination rules, including: Based on the input window X, the rated voltage, current transformer ratio, zero-sequence transformer ratio and FTU sampling period are normalized in terms of dimensions. Perform a j-level discrete wavelet transform on the continuous time-series signal in the calibration sample to decompose it into a low-frequency approximate component A. j and high-frequency detail components D1, D2, ..., D j Where j represents the preset transformation layer number, and the transformation formula is: X→{A j ,D1,D2,…,D j }; The high-frequency energy proportion E is calculated based on the discrete wavelet transform decomposition results. ℎ Energy entropy H w Detail coefficient peak P d Zero-sequence high-frequency energy E0, interphase high-frequency energy difference D p Transient duration T d Phase current sudden change ΔI and the sequence characteristics of switching events S soe The first state feature is obtained, and based on the first state feature when offline, the second state feature when offline is combined to form a state feature vector F. s The second state characteristics include voltage drop amplitude, zero-sequence duration, and reclosing interval; Based on the feeder state m, the state feature vector F s By performing threshold statistics, rule learning, or training a lightweight classifier, the state discrimination rule G is obtained.
4. The state-aware hybrid precision quantization reasoning method for feeder terminals according to claim 3, characterized in that, The calibration samples based on different states are subjected to a layer-by-layer, bit-by-bit width fundamental quantization loss test to obtain the fundamental quantization loss, including: Based on the preset target inference model, the network layers of the preset target inference model are divided into Layer 1 to Layer 2. n And set a candidate bit width set B={b1, b2, ..., b} for each layer. k }, where n is the number of preset model network layers, b is the candidate bit width, and k is the number of preset candidate bit widths per layer; based on the candidate bit width set, the supported weight bit width and activation bit width combinations are determined according to the processor, NPU or quantization inference framework mounted on the feeder terminal; Based on the feeder state m, the calibration sample D cal The samples are divided into a normal sample subset, a disturbance sample subset, and a fault / protection action sample subset. Based on the calibration sample corresponding to each feeder state m, the Layer is fixed. i Other network layers besides i, where i is the preset network layer number. i For the preset target reasoning model of the i-th layer, we obtain Layer i Given an inner candidate bit width b, perform forward inference and record the loss function increment, accuracy decrease, classification confidence change, fault segment consistency change, protection action consistency change, and output feature difference to obtain the basic quantization loss Q of the i-th layer under the feeder state m and the candidate bit width b. i (b, m).
5. The state-aware hybrid precision quantization inference method for feeder terminals according to claim 4, characterized in that, The sharpness score is obtained by observing the maximum increase in the loss function before and after the perturbation on the calibration samples based on the corresponding state, and then combining the basic quantization loss with the preset layer importance label K. i Generate a layer risk table in offline mode, including: Based on the aforementioned fundamental quantization loss Q i (b, m), for Layer i Apply a perturbation in the same direction as the low-bit-width quantization error; Based on the calibration samples corresponding to the feed state m, the maximum increase in the loss function before and after the perturbation is observed to obtain the sharpness score of the i-th layer under the feed state m and the candidate bit width b. i (b, m); Based on the aforementioned fundamental quantization loss Q i (b, m), the sharpness score Sharp i (b, m) and the preset layer importance marker K i The process involves fusing data to generate a layer risk table R for the i-th layer in offline mode, under the feeder state m and the candidate bit width b. i (b, m), the layer risk table R i (b, m) are normalized according to the feeder state m and then fixed to the FTU local or edge management platform.
6. The state-aware hybrid precision quantization inference method for feeder terminals according to claim 5, characterized in that, The process of collecting online samples in the online state, combining them with the state discrimination rule, and outputting the current online state and online state confidence level includes: When the FTU is running online, based on the establishment of the input window X, the online sample is obtained according to the collected real-time electrical quantities, SOE events, and resource status, and the real-time input window X is created. t The real-time input window X t The data fields, time alignment, and normalization methods are the same as those of the calibration sample D in offline mode. cal Maintain consistency; The real-time input window X based on the online sample t The first state feature in online time is calculated based on discrete wavelet transform decomposition, and combined with the second state feature in online time, the real-time input window X is then analyzed. t Processing to obtain the real-time input window X t The state feature vector F s (X t ); The real-time input window X t The state feature vector F s (X t Input the state discrimination rule G to obtain the rule score G. m (F s (X t Then determine the current online status m of the FTU. t and online status confidence level c m .
7. The state-aware hybrid precision quantization inference method for feeder terminals according to claim 6, characterized in that, The layer risk table based on the offline state is used to obtain the layer risk table under the current online state, forming risk constraints. Resource states in the online samples are collected to obtain resource constraints. Based on the risk constraints and resource constraints, the mixed-precision decision-maker selects the bit width at each network layer and generates a bit width configuration, including: Based on the current online status m t From the layer risk table in the offline state, query the online candidate bit width for each network layer to obtain the i-th layer in the current online state m. t Layer risk table R under candidate bit width b i (b, m) t ); Based on the hierarchical risk list of the current online status, risk constraints are obtained; Based on the online samples, the resource status is collected, including CPU / NPU utilization, memory utilization, chip temperature, communication queue, backup power status, and target inference latency, and resource constraints are generated. Given the risk constraints and resource constraints, the hybrid precision decision maker selects the bit width at each network layer, i.e., the candidate bit width b of the i-th layer. i Get the real-time input window X t The following bit width configuration B t .
8. The state-aware hybrid precision quantization inference method for feeder terminals according to claim 7, characterized in that, Based on the bit width configuration, the quantization parameters or quantization operators corresponding to the bit width of each network layer are obtained, thereby completing mixed-precision forward inference, performing model confidence verification, electrical and topology verification, and obtaining the verification status, including: Based on the bit width configuration B t For each network layer, the corresponding bit-width quantization parameters or quantization operators are called. B is configured according to the bit width. t The FTU completes mixed-precision forward inference by calling quantization parameters or quantization operators, and outputs fault type, fault section, ground / short circuit category, switch abnormality category, reclosing result or FA action auxiliary judgment result; Based on FTU, perform the model confidence check to examine the output confidence of the preset target inference model, the consistency of continuous window results, and the online state confidence c. m If the fault category or segment result of adjacent windows changes frequently, or the confidence level of the model output is lower than the preset threshold, then this inference will be marked as a result to be reviewed. Based on the FTU, the electrical and topology verification is performed to further check the phase voltage / phase current correspondence, the continuity of zero-sequence current and zero-sequence voltage, the consistency of protection start-up and SOE sequence, the consistency of upstream and downstream FTU current direction, and the topology consistency between switch position and fault section. Based on the performance of the model confidence check and the electrical and topology checks, the FTU obtains the check status using mixed-precision forward inference.
9. The state-aware hybrid precision quantization inference method for feeder terminals according to claim 8, characterized in that, If the verification status is normal, the high-width layer will be reverted to the low-width configuration. Conversely, it enters a locked state and uploads samples for backflow, including: Based on the fact that the verification status is normal, and the number of consecutive preset windows of multi-scale high-frequency features is below the fallback threshold, and the current online status m t When the system returns to normal operating range, the FTU will gradually reduce the high-width layer to the low-width configuration. Based on the abnormal verification status, or when key measurements are missing, SOE sequence is abnormal, communication is abnormal, terminal temperature is too high, backup power is insufficient, inference confidence is insufficient, resource usage exceeds the threshold, or the control permission flag is in a prohibited control state, the FTU enters a safety lockout state; the conditions for entering the prohibited control state are low model confidence, inconsistent continuous window results, or significant conflicts between inference results and electrical physical relationships, feeder topology, or SOE timing. Based on samples that are locked, in low-confidence states, or have been manually verified as incorrect, the FTU or edge management platform returns them to the sample library as samples to be verified. After manual or main station verification, they are added to the calibration sample D. cal This will allow for the updating of the state discrimination rule G and the layer risk table R in subsequent versions; Through fallback, latching, uploading, and sample return, the online inference results are returned to the offline calibration entry point.
10. A state-aware hybrid precision quantization inference system for feeder terminals, used to implement the state-aware hybrid precision quantization inference method for feeder terminals as described in any one of claims 1-9, characterized in that, include: The data acquisition and preprocessing module is used to collect raw samples and establish calibration samples with status and business within a unified time window when offline. The multi-scale state discrimination module is used to perform the discrete wavelet transform decomposition, calculate the first state feature, collect the second state feature from the calibration sample, the first state feature and the second state feature constitute the state feature vector, the state feature vector is trained to establish state discrimination rules, collect online samples in the online state, and combine the state discrimination rules to output the current online state and the online state confidence. The basic quantization loss test module is used to perform layer-by-layer, bit-by-bit width basic quantization loss tests on calibration samples in different states to obtain the basic quantization loss. The sharpness and layer risk table generation module is used to observe the maximum increase in the loss function before and after perturbation on calibration samples in the corresponding state, obtain a sharpness score, and combine it with the basic quantization loss and the preset layer importance label K. i Generate a layered risk table in offline mode; The parameter configuration module is used to determine parameters based on sample distribution, cost of misjudgment, FTU equipment capabilities, and feeder automation operation time limits. The resource status monitoring module provides information on CPU / NPU utilization, memory, temperature, communication queue, and backup power. The hybrid precision decision module is used to obtain the layer risk table under the current online state based on the layer risk table under the offline state and the current online state, form risk constraints, collect the resource state in the online samples to obtain resource constraints, and select the bit width at each network layer based on the risk constraints and the resource constraints to generate the bit width configuration. The module includes a quantitative inference execution module, a control permission verification module, and a fallback latch and sample reflux module. The quantization inference execution module is used to obtain the quantization parameters or quantization operators corresponding to the bit width of each network layer according to the bit width configuration, thereby completing mixed precision forward inference; the control permission verification module is used to generate control permission flags; the fallback latching and sample reflow module is used to operate according to the verification status. When normal, the high bit width layer is fallback to the low bit width configuration. When abnormal, it enters the latching state and uploads samples for reflow.