Power switching method and system, electronic equipment and storage medium
By separating the baseline current and peak current of the power supply system, calculating their statistical characteristics, and using a deep learning model to generate a dynamic switching threshold, the problems of insufficient accuracy and reliability of power status monitoring in existing technologies are solved, and efficient and reliable power switching is achieved.
Patent Information
- Application Number
- CN202510997662.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-19
- Publication Date
- 2025-09-16
AI Technical Summary
Existing power supply detection methods have accuracy and reliability issues in complex and changing power supply environments, making it difficult to achieve accurate power supply status monitoring and fault warning.
By acquiring the target current data of the power system, separating the baseline current and peak current, and calculating their statistical characteristics such as the mean, standard deviation, and coefficient of variation, the system then generates a power switching trigger threshold based on a preset deep learning model and dynamically adjusts it based on environmental parameters.
It achieves refined monitoring of the power status, significantly improves the accuracy and reliability of power switching, reduces the probability of false triggering, and enhances the system's environmental adaptability and full life cycle reliability.
Smart Images

Figure CN120657936A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power electronics, and in particular to a power switching method, system, electronic device, and storage medium. Background Art
[0002] In power electronics, power management systems are crucial for ensuring stable equipment operation. Existing power detection methods typically use a fixed threshold to determine power status. This single threshold approach has limitations in complex and changing power supply environments, making it difficult to accurately monitor power status and provide fault warnings.
[0003] Due to the large differences in the current variation range under different load conditions, the setting of a fixed threshold often leads to false alarms or missed alarms. Especially in scenarios with large power fluctuations or frequent load changes, the accuracy and reliability of the fixed threshold method are significantly reduced.
[0004] Therefore, there is an urgent need for a new power status monitoring solution that can dynamically perceive the power supply environment, adaptively generate switching thresholds, and seamlessly switch. Summary of the Invention
[0005] In order to obtain a monitoring solution that dynamically senses the power supply environment, adaptively generates switching thresholds, and performs seamless switching, the present application provides a power switching method, system, electronic device, and storage medium.
[0006] In a first aspect of the present application, a method for power switching is provided, which adopts the following technical solution: Obtaining target current data of the power supply system, separating a baseline current and a peak current from the target current data, and calculating statistical characteristics of the baseline current and the peak current, the statistical characteristics including a mean of the baseline current, a standard deviation of the peak current, and a coefficient of variation of the peak current; According to the statistical characteristics, generating a power switching trigger threshold based on a preset deep learning model; The target current data is compared with the power switching trigger threshold, and when the target current data continuously exceeds the power switching trigger threshold for a preset time period, power switching is triggered.
[0007] By employing this technical solution, we can finely separate current baseline and peak characteristics, construct a multidimensional current fingerprint, combine deep learning to generate dynamic intelligent thresholds, and innovatively employ a two-dimensional "intensity-time" triggering mechanism to form a closed-loop control system. This approach can accurately distinguish normal current fluctuations from abnormal overload conditions, significantly reducing the probability of false triggering, significantly improving threshold adaptability, effectively filtering out transient pulse interference, and making power switching decisions more robust. The result is a new power supply status monitoring solution that dynamically senses the power supply environment, adaptively generates switching thresholds, and seamlessly switches.
[0008] Optionally, separating the baseline current and the peak current from the target current data and calculating statistical characteristics of the baseline current and the peak current specifically includes: generating a baseline current value at the target moment by weighted calculation based on a sampled value at the target moment and a baseline value at a moment before the target moment, and combining a plurality of the baseline current values in chronological order to form the baseline current; Using a historical data weighted exponential decay algorithm, weighted summing is performed on the current values of the baseline current in reverse chronological order to generate a mean value of the baseline current; Setting a high threshold and a low threshold according to the average value of the baseline current, and triggering a pulse event marker when the target current data sequentially exceeds the low threshold, reaches the high threshold, and finally falls below the low threshold; In the time interval marked by the pulse event, traverse and search for the current values of all sampling points, set the sampling point with the largest current value as the extreme value point, and determine the current amplitude corresponding to the extreme value point as the peak current; In a sliding window of a preset time length, collecting statistics on the amplitude distribution of the peak current, calculating the standard deviation of the peak current in the window based on the amplitude distribution, and dividing the standard deviation by the mean of the peak current in the window to generate a coefficient of variation; The statistical characteristic is generated by integrating the mean of the baseline current, the mean of the peak current, the standard deviation, and the coefficient of variation.
[0009] By adopting the above technical solutions, this current feature extraction scheme achieves dynamic baseline tracking through a recursive filtering algorithm, accurately captures the complete pulse waveform with a dual-threshold state machine, accurately locates the peak point using an inverse extreme value scanning technique, and introduces an exponential weighting algorithm to calculate time-varying statistics. Experimental verification shows that this scheme significantly reduces baseline estimation errors, greatly improves pulse resolution, and can still maintain highly accurate peak location performance in noisy environments. At the same time, the accuracy of statistical feature quantization achieves a qualitative leap. These innovations enable the system to have excellent real-time response capabilities and adaptability to complex waveforms, providing high-quality feature support for subsequent power switching decisions and significantly enhancing the effectiveness of predictive maintenance.
[0010] Optionally, generating a power switching trigger threshold based on a preset deep learning model according to the statistical characteristics specifically includes: constructing the statistical characteristics into a multi-dimensional input feature vector; By using the memory-enhanced neural network in the preset deep learning model, the network parameters are adjusted using the training data so that the multi-dimensional input feature vector, after being transformed by the nonlinear activation function, establishes a nonlinear mapping relationship with the power switching trigger threshold; generating the power switching trigger threshold according to the multi-dimensional input feature vector and the nonlinear mapping relationship; The power switching trigger threshold is modified according to environmental parameters.
[0011] By employing this technical solution, the baseline current dynamic characteristics and peak fluctuation indicators are fused into a multidimensional feature vector. Combined with a deep neural network with temporal memory, this method achieves adaptive generation of the power switching threshold. Compared to traditional fixed threshold methods, this approach offers the following advantages: First, by jointly learning historical data patterns and real-time fluctuation characteristics through a neural network, it significantly improves adaptability to complex operating conditions, overcoming the inaccurate threshold setting issues of traditional methods in dynamic environments. Second, by employing an attention-weighted multi-source feature fusion mechanism, it effectively distinguishes between real load changes and transient noise interference, enhancing decision-making robustness in high-interference scenarios.
[0012] Optionally, generating the power switching trigger threshold according to the multi-dimensional input feature vector and the nonlinear mapping relationship specifically includes: Integrating the multidimensional input feature vectors of the current moment and a first number of historical periods before the current moment and closest to the current moment to generate a feature matrix; Extracting the time series correlation features of the feature matrix, performing a convolution operation on the feature matrix, and extracting the fluctuation pattern features of the feature matrix; Inputting the extracted time series correlation features and fluctuation pattern features into a preset deep learning model, performing feature fusion using the nonlinear mapping relationship, and generating a base value threshold; The power switching trigger threshold is generated based on the base threshold value superimposed on the standard deviation of the baseline current.
[0013] By adopting the above technical solution, the multi-dimensional features of the current moment and historical cycles are integrated to construct a time series feature matrix. Combining the convolutional network's ability to extract local fluctuation features and the attention mechanism's advantage in modeling long-range time series correlations, the traditional threshold setting method's reliance on manual experience is broken through. The feature fusion layer is used to perform nonlinear mapping of the extracted time series correlation features and the fluctuation pattern features to generate a base value threshold that reflects the steady-state characteristics of the system. The real-time baseline fluctuation standard deviation is combined to perform dynamic boundary adjustment, forming a composite threshold generation mechanism that takes into account both steady-state accuracy and transient response.
[0014] Optionally, the modifying the power switching trigger threshold according to the environmental parameters specifically includes: Obtaining current environmental parameters, including ambient temperature, humidity, and vibration data; calculating an environmental risk score based on the environmental parameters; When the environmental risk score exceeds a preset threshold, adjusting the power switching trigger threshold; Adjust the parameters of the preset deep learning model according to the actual switching delay time of the power switching data in the preset historical database.
[0015] By adopting the above technical solution, specifically by real-time collection of ambient temperature, humidity and vibration data, the comprehensive impact of multi-dimensional environmental factors on the electrical performance and mechanical stability of the equipment is quantitatively evaluated. When the environmental risk score exceeds the preset safety threshold, the switching threshold margin is dynamically improved based on the correlation model of temperature-conductor resistivity and humidity-insulation degradation rate. For example, under high-temperature conditions, the threshold compensation coefficient is increased according to the temperature gradient to effectively suppress thermal overcurrent false triggering; at the same time, a historical switching delay database is established. By analyzing the deviation between the actual action time and the predicted value, the convolution kernel weights and attention allocation strategy in the deep learning model are reversely optimized, so that the threshold generation mechanism can continuously adapt to equipment aging and changes in load characteristics, significantly enhancing the environmental adaptability and full life cycle reliability of the power management system.
[0016] Optionally, calculating the environmental risk score based on the environmental parameters specifically includes: Normalizing the environmental parameters to obtain target environmental parameters; Based on the preset network model, the target environmental parameters are used as input, and the environmental risk probability is generated in combination with the equipment operation time and historical failure frequency; Outputting the environmental risk score according to the environmental risk probability and the preset risk level mapping table; By employing this technical solution, specifically based on multi-dimensional environmental parameters such as temperature, humidity, and vibration, and employing normalization processing and joint modeling techniques, this approach combines equipment operating status data to calculate environmental risk probabilities in real time. This approach then outputs a dynamic risk score using a pre-set risk level mapping model. When the score exceeds a safety threshold, the system automatically triggers a threshold compensation mechanism, synchronizing the historical equipment fault database with real-time operating parameters and dynamically adjusting the convolution kernel feature weights and attention allocation strategy within the deep learning model. This solution effectively overcomes the challenges of traditional methods, such as high sensitivity to environmental interference and rigid threshold settings, faced in complex operating conditions.
[0017] Optionally, comparing the target current data with the power switching trigger threshold, and triggering power switching when the target current data continuously exceeds the power switching trigger threshold for a preset time period, specifically includes: Calculating a weighted comprehensive value of the mean value of the baseline current and the mean value of the peak current; Calculating a target duration during which the weighted comprehensive value exceeds the power switching trigger threshold; When the target duration exceeds a first threshold, switching the power supply system to a first backup power supply; When the target duration exceeds a second threshold, switching the power supply system to a second backup power supply; The data of successful power switching is saved in the preset historical database.
[0018] By adopting the above technical solution, specifically by calculating the dynamic weighted comprehensive value of the baseline current average and the peak current average, the system load status is evaluated in real time. A hierarchical protection strategy is implemented in combination with preset duration thresholds: when the current exceeds the limit for a duration that reaches the first threshold, the system switches to the first backup power source. When the current continues to deteriorate beyond the second threshold, the second backup power source is activated, forming a progressive fault isolation mechanism that not only avoids false disconnections caused by transient interference but also ensures rapid protection in the event of severe overload. At the same time, by continuously recording the weighted comprehensive value, limit-exceeding duration, and switching results of power switching events in a historical database, closed-loop training data is provided for the deep learning model, dynamically optimizing the weighting coefficients and threshold parameters. This solution effectively solves the problem of frequent false operations or response delays caused by single threshold judgments in traditional methods.
[0019] In a second aspect of the present application, a power switching system is provided, comprising: a data acquisition and preprocessing module, configured to obtain target current data of the power supply system, separate a baseline current and a peak current from the target current data, and calculate statistical characteristics of the baseline current and the peak current, wherein the statistical characteristics include a mean of the baseline current, a standard deviation of the peak current, and a coefficient of variation of the peak current; A dynamic threshold generation module, configured to generate a power switching trigger threshold based on a preset deep learning model according to the statistical characteristics; The monitoring decision module is used to compare the target current data with the power switching trigger threshold, and trigger power switching when the target current data continuously exceeds the power switching trigger threshold for a preset time period.
[0020] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are both used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device performs any of the methods described above.
[0021] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions. When the instructions are executed, any one of the methods described above is executed.
[0022] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: Recursive filtering and a dual-threshold mechanism are used to precisely separate the current baseline and peak value, constructing multi-dimensional dynamic statistical features and enhancing the ability to analyze complex waveforms. Based on a deep neural network, the system integrates time series correlation and fluctuation pattern features to generate adaptive switching thresholds, improving operating adaptability compared to traditional methods. Dynamic compensation for environmental parameters and closed-loop optimization of historical data are combined to achieve intelligent correction of thresholds as the environment degrades and equipment ages, reducing false triggering rates under extreme operating conditions. A hierarchical triggering strategy is adopted, using a two-dimensional judgment mechanism based on "weighted comprehensive value-duration," to reduce transient interference false operations while ensuring millisecond-level response speeds, thereby improving system reliability and extending equipment life. This solution provides a highly robust and adaptive intelligent protection solution for power systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is a schematic diagram of a system architecture of an embodiment of a power switching method or system of the present application; Figure 2 This is a flow chart of a power switching method disclosed in an embodiment of the present application; Figure 3 This is a module diagram of a power switching system disclosed in an embodiment of the present application; Figure 4 This is a structural diagram of an electronic device disclosed in an embodiment of the present application.
[0024] Explanation of the accompanying drawings: 301, data acquisition and preprocessing module; 302, dynamic threshold generation module; 303, monitoring decision module; 401, processor; 402, communication bus; 403, user interface; 404, network interface; 405, memory. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0026] In the description of the embodiments of this application, words such as "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "for example" or "for instance" in the embodiments of this application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "for example" or "for instance" is intended to present the relevant concepts in a concrete manner.
[0027] In the description of the embodiments of the present application, the term "multiple" means two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0028] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. Network 104 is a medium for providing communication links between terminal devices 101, 102, 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0029] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as model training applications, video recognition applications, web browser applications, social platform software, etc.
[0030] Terminal devices 101, 102, and 103 can be hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices with display screens, including but not limited to smartphones, tablet computers, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3) players, MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) players, laptop computers, and desktop computers, etc. When terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software or software modules (for example, multiple software or software modules used to provide distributed services), or they can be implemented as a single software or software module. No specific limitation is made here.
[0031] When terminals 101, 102, and 103 are hardware, they may also be equipped with a video capture device. The video capture device may be any device capable of capturing video, such as a camera, a sensor, and the like. Users can use the video capture device on terminals 101, 102, and 103 to capture video.
[0032] The server 105 may be a server that provides various services, such as a background server that processes data displayed on the terminal devices 101, 102, and 103. The background server may analyze and process the received data, and may feed back the processing results (e.g., recognition results) to the terminal device.
[0033] It should be noted that a server can be either hardware or software. When a server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When a server is software, it can be implemented as multiple software programs or software modules (for example, multiple software programs or software modules used to provide distributed services), or as a single software program or software module. This is not specifically limited here.
[0034] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the above description is merely illustrative. Any number of terminal devices, networks, and servers may be used as needed. In particular, if target data does not need to be acquired remotely, the above system architecture may not include a network, but may instead include only terminal devices or servers.
[0035] This embodiment discloses a power switching method. Figure 2 This is a flow chart of a power switching method disclosed in an embodiment of the present application. Figure 2As shown, the method includes the following steps: S201. Obtain target current data of a power supply system, separate a baseline current and a peak current from the target current data, and calculate statistical characteristics of the baseline current and the peak current, wherein the statistical characteristics include a mean of the baseline current, a standard deviation of the peak current, and a coefficient of variation of the peak current; Specifically, in this embodiment, a Hall current sensor is deployed in the power supply line to collect the original current signal in real time at a microsecond sampling frequency, and preprocessed through a double-buffer queue mechanism and a digital filtering algorithm to eliminate high-frequency noise interference and obtain target current data. A recursive moving average filtering algorithm is then used to separate the baseline current. The algorithm sets a dynamic window length and updates the baseline value in real time by weighted averaging, which can both maintain baseline smoothness and quickly respond to current mutations. A dual-threshold detection mechanism is then constructed to capture pulse events. A marker is triggered when the current continuously exceeds the low threshold and reaches the high threshold before falling back. A reverse extreme value scan is performed within the pulse event interval, and the peak current is accurately located by comparing the amplitudes of neighboring sampling points. Finally, an exponentially weighted moving average algorithm is used to calculate the baseline mean, and a sliding window is used to statistically calculate the standard deviation and coefficient of variation of the peak current to generate a three-dimensional feature vector containing the mean, standard deviation, and coefficient of variation.
[0036] Optionally, separating the baseline current and the peak current from the target current data and calculating statistical characteristics of the baseline current and the peak current further includes: generating a baseline current value at the target moment by weighted calculation based on a sampled value at the target moment and a baseline value at a moment before the target moment, and combining a plurality of the baseline current values in chronological order to form the baseline current; Using a historical data weighted exponential decay algorithm, weighted summing is performed on the current values of the baseline current in reverse chronological order to generate a mean value of the baseline current; Setting a high threshold and a low threshold according to the average value of the baseline current, and triggering a pulse event marker when the target current data sequentially exceeds the low threshold, reaches the high threshold, and finally falls below the low threshold; In the time interval marked by the pulse event, traverse and search for the current values of all sampling points, set the sampling point with the largest current value as the extreme value point, and determine the current amplitude corresponding to the extreme value point as the peak current; In a sliding window of a preset time length, collecting statistics on the amplitude distribution of the peak current, calculating the standard deviation of the peak current in the window based on the amplitude distribution, and dividing the standard deviation by the mean of the peak current in the window to generate a coefficient of variation; The statistical characteristic is generated by integrating the mean of the baseline current, the mean of the peak current, the standard deviation, and the coefficient of variation.
[0037] Specifically, the baseline component of the target current is separated in real time through a recursive moving average filter. The specific recursive formula is: in is the current baseline value, is the current sampling current value, The filter coefficient is set to 0.85 to 0.95 to balance noise suppression and dynamic response speed. For example, in the scenario of rapid current fluctuation, a smaller (e.g. 0.85) to quickly track baseline changes, while a larger value is used in steady-state scenarios. (eg 0.93) Enhance the smoothing effect.
[0038] Furthermore, by maintaining a fixed-length historical baseline queue (such as saving the most recent 50 values), each baseline value is given an exponential decay weight in reverse chronological order (such as a decay factor of λ = 0.95, and the current weight is λ 0 = 1, the previous tick had λ¹ = 0.95, the two ticks had λ² = 0.9025, and so on). Multiplying all baseline values by their corresponding weights, summing them, and dividing by the sum of the weights yields the running mean. For example, if the current baseline queue is [10.0, 9.8, 9.5] in descending order, with weights of 1, 0.95, and 0.9025, the weighted sum is 10.0 × 1 + 9.8 × 0.95 + 9.5 × 0.9025 = 28.17 + 10.0 × 1 + 9.8 × 0.95 + 9.5 × 0.9025 = 27.88375. The sum of the weights is 1 + 0.95 + 0.9025 = 2.8525, resulting in a mean of 27.88375 / 2.8525 ≈ 9.773, reflecting the dominant influence of the recent baseline.
[0039] Furthermore, first, based on the dynamic mean calculated using a weighted exponential decay algorithm for historical data, high and low thresholds are set. Typically, the high threshold can be set to the mean plus a positive offset, while the low threshold can be set to the mean minus a negative offset. Alternatively, depending on the specific application scenario, the high and low thresholds can be set to fixed percentages or absolute values of the mean. For example, if the mean is 9.773A, the high threshold can be set to the mean plus 0.5A, i.e., 10.273A, and the low threshold can be set to the mean minus 0.5A, i.e., 9.273A. Next, the target current data is continuously monitored and checked to see if it meets the trigger conditions for a pulse event. The trigger conditions for a pulse event typically include three steps: first, the target current data must sequentially exceed the low threshold; then, it must reach or exceed the high threshold; and finally, it must fall back below the low threshold. To implement this logic, a state machine can be maintained to track whether the current data has exceeded the low threshold, reached the high threshold, and other states. For example, assume the current target current data sequence is [9.3A, 9.6A, 10.1A, 9.8A, 9.1A], with the upper threshold set to 10.273A and the lower threshold set to 9.273A. When the current data is detected at 9.3A, because it is greater than the lower threshold of 9.273A, the state machine records "lower threshold exceeded." Subsequently, the current data rises to 10.1A, exceeding the previous value of the upper threshold of 10.273A but not reaching the upper threshold. The state machine maintains "lower threshold exceeded" and waits for the upper threshold to be reached. When the current data reaches 10.3A, exceeding the upper threshold of 10.273A, the state machine updates the state to "high threshold reached." Finally, when the current data falls back to 9.1A, falling below the lower threshold of 9.273A, the state machine detects that all three conditions—"lower threshold exceeded," "high threshold reached," and "falling below"—are met, triggering a pulse event marker.
[0040] Furthermore, the start and end time range of the pulse event is first clarified, for example, the pulse is marked from t s Start to t e End. From t e From the moment, check the target current data point by point in reverse time (i.e. in the past direction). (where k is from t e Decrease to t s ), compare its amplitude relationship with the adjacent N sampling points before and after (N is a preset number, such as N=2 means comparing the current point with the 2 points before and after). If there is a sampling point satisfy > , > ,…, > and > ,…, > , then determine I P is the local maximum point. Continue to traverse forward. If this extreme point is the first point that meets the conditions in the pulse interval, then its corresponding amplitude I P This is the peak current of the pulse event. For example, in the sampling sequence [9.0, 9.2, 9.5, 9.3, 8.8], if N=1, then I P =9.5 is selected because it is larger than both the preceding and following adjacent points. This method ensures that the peak current accurately corresponds to the highest point of the pulse waveform by searching for local extreme values.
[0041] Furthermore, first, it is necessary to clarify the time length of the sliding window, for example, set it to 10 seconds, and determine the number of data points that can be accommodated in the window based on the sampling frequency of the system (such as 100Hz), that is, 10 seconds × 100Hz = 1000 sampling points. Subsequently, a queue data structure is used to dynamically manage the peak current data. Whenever a new peak current value enters the window, if the queue length exceeds the preset capacity (1000 points), the oldest data point at the head of the queue is automatically removed to ensure that the queue always contains the peak current value in the latest time window. Next, a statistical analysis of the peak current amplitude distribution is performed. Traverse all peak current values in the window and calculate their arithmetic mean μ. The formula is , where Ipi represents the i-th peak current value in the window, and n is the total number of data points. This step aims to obtain the central trend of the peak current in the window. Then, the standard deviation σ of the peak current is calculated to quantify its degree of dispersion. The standard deviation is obtained by calculating the square of the difference between each peak current value and the mean μ, summing these square values and dividing by the total number of data points (or the total number minus 1, depending on the sample or overall scenario), and finally taking the square root. Finally, the coefficient of variation CV is generated to quantify the relative fluctuation of the peak current amplitude in a dimensionless manner. The coefficient of variation is obtained by dividing the standard deviation σ by the mean μ, that is, For example, if the peak current sequence in the window is [12.0A, 12.5A, 11.8A, 13.2A, 12.7A], the mean μ = 12.44A, the standard deviation σ = 0.55A, and the coefficient of variation CV ≈ 4.42%, indicating that the peak current amplitude fluctuates by about 4.42% relative to the mean.
[0042] Furthermore, by taking the weighted average integration mean (μ), standard deviation (σ) and coefficient of variation (CV), weights can be allocated according to scenario requirements (e.g., μ accounts for 50%, σ accounts for 30%, and CV accounts for 20% in precision manufacturing). After standardization, the weighted sum is calculated to generate an integrated result such as "the current pulse runs around 12.44A, and the comprehensive fluctuation characteristic score is 6.48 (including 0.55A absolute fluctuation and 4.42% relative stability)", thereby realizing the targeted optimization expression of multi-dimensional statistical characteristics.
[0043] S202: Generate a power switching trigger threshold based on a preset deep learning model according to the statistical characteristics; Specifically, statistical characteristics (including the mean and standard deviation of the baseline current, and the mean, standard deviation, and coefficient of variation of the peak current) are input into a pre-set deep learning model. For example, a time series model such as an LSTM or GRU is used to process the statistical sequence. The output layer uses a fully connected layer to generate the trigger threshold. The model is trained using historical data to learn the mapping between statistical characteristics and power switching requirements, and outputs the power switching trigger threshold in real time. This threshold is used to determine whether the current power state requires switching, ensuring stable system operation under different operating conditions.
[0044] Optionally, generating a power switching trigger threshold based on a preset deep learning model according to the statistical characteristics specifically includes: constructing the statistical characteristics into a multi-dimensional input feature vector; By using the memory-enhanced neural network in the preset deep learning model, the network parameters are adjusted using the training data so that the multi-dimensional input feature vector, after being transformed by the nonlinear activation function, establishes a nonlinear mapping relationship with the power switching trigger threshold; generating the power switching trigger threshold according to the multi-dimensional input feature vector and the nonlinear mapping relationship; The power switching trigger threshold is modified according to environmental parameters.
[0045] Specifically, the statistical characteristics obtained in step S201 are first extracted from the statistical results of each time window, and the weighted mean, standard deviation, and coefficient of variation are used as core feature dimensions. The three are then standardized (such as using Z-score standardization to eliminate dimensionality effects), and finally concatenated in a preset order to form a three-dimensional feature vector. For example, if a window is calculated to have μ = 12.44A (50% weight after weighting), σ = 0.55A (30% weight after weighting), and CV = 4.42% (20% weight after weighting), it may be converted into a vector [0.85, -0.32, 1.17] after standardization. This vector can be used as the input unit of the deep learning model for subsequent nonlinear mapping learning with the power switching threshold.
[0046] Furthermore, in the memory-enhanced neural network, the nonlinear mapping relationship between the multidimensional input feature vector and the power switching trigger threshold is realized through a series of function transformations and parameter adjustment processes. For example, in the smart grid system, suppose we need to decide when to switch the power supply based on the change in current. The multidimensional input feature vector may include the mean (μ), standard deviation (σ) and coefficient of variation (CV) of the current. First, these feature vectors pass through the input layer and are passed to the hidden layer equipped with a nonlinear activation function (such as ReLU). The ReLU function performs a nonlinear transformation on the input data, such as setting negative values to zero and keeping positive values unchanged, thereby introducing nonlinear factors, enabling the network to learn and represent complex nonlinear relationships. Then, the neurons in the hidden layer further transform the input data through a linear combination of weights and biases. These weights and biases are trainable parameters of the network. During the training process, the network uses the backpropagation algorithm and the gradient descent optimizer (such as Adam) according to the loss function (such as mean square error) between the predicted threshold and the true threshold. To minimize loss, these parameters are adjusted. Simultaneously, in memory-enhanced neural networks (such as LSTMs), gating mechanisms (input gate, forget gate, and output gate) control the flow of information and the updating of memory cells. These gating mechanisms, through activation functions such as the sigmoid function, dynamically determine which information should be retained, updated, or forgotten based on the current input feature vector (such as μ, σ, and CV of the current) and historical state. This enables the network to remember important historical information, such as the current fluctuation pattern, and dynamically adjust the threshold based on the current input feature vector, thereby enhancing the network's temporal dependence. Finally, after nonlinear transformations in multiple hidden layers and processing by the memory-enhancing mechanism, the network outputs the final nonlinear mapping result through the output layer, i.e., the power switching trigger threshold. This threshold is generated based on the input feature vector and the nonlinear mapping relationship. It reflects the complex relationship between input features (such as μ, σ, and CV of the current) and the power switching trigger condition. For example, when the current mean increases and the fluctuation decreases, the threshold may exhibit an asymmetric exponential decay response.
[0047] Furthermore, in the power switching system, in order to accurately generate the power switching trigger threshold, the system first collects multi-dimensional input feature vectors in real time through a high-precision sensor network, covering key parameters such as the effective value of the main power voltage (V_rms, such as measured by the AD736 chip), current harmonic content (THD_I, based on FFT analysis), frequency deviation (Δf, monitored by a digital phase-locked loop), load power factor (PF, obtained by a power factor meter) and ambient temperature (T_amb, detected by an NTC thermistor); then, the collected raw data is filtered through a Butterworth low-pass filter (cut-off frequency 100Hz) to eliminate high-frequency noise and normalized to the [0,1] range through the minimum-maximum normalization method to ensure data quality; then, a pre-trained deep neural network model is used to establish a non-linear regression model through the ReLU function. Linear mapping relationship, the model adopts a four-layer fully connected structure (5 nodes in the input layer, 16 / 8 nodes in the hidden layer, and 1 node in the output layer). It is trained based on a historical data set containing 10,000 groups of samples. The Adam optimization algorithm (learning rate 0.001) and the MSE loss function are used during training, and convergence is achieved after 200 rounds of iterations. Finally, in real-time operation, the system inputs the preprocessed feature vector into the DNN (deep neural network) model, and the model dynamically outputs the optimal switching threshold based on the current power status. For example, when V_rms=195V, THD_I=12%, Δf=+2.5Hz, PF=0.9, and Tamb=35℃ are detected, the model outputs a threshold of 29 seconds. Compared with a fixed threshold (such as 30 seconds), the switching can be triggered earlier, thereby significantly improving the accuracy and timeliness of power switching.
[0048] Furthermore, the system monitors environmental parameters such as ambient temperature, humidity, altitude, and electromagnetic interference in real time through environmental sensors, and inputs these parameters into the threshold correction module as correction factors. The correction module dynamically adjusts the power switching trigger threshold based on a mapping relationship table of preset environmental parameters and threshold correction amounts, or by using intelligent algorithms such as fuzzy logic and neural networks. For example, in a high-temperature environment, the heat dissipation performance of the power supply system will decrease, which may cause the power supply module to enter the protection state prematurely. At this time, the system can appropriately increase the switching trigger threshold to avoid false switching caused by a short-term temperature increase. Similarly, in high-altitude areas, the system will also adjust the threshold accordingly due to the reduced heat dissipation efficiency caused by the thin air. Through this mechanism of real-time correction based on environmental parameters, the present invention ensures the stability and reliability of the power switching system under different environmental conditions, further expanding its scope of application.
[0049] Optionally, generating the power switching trigger threshold according to the multi-dimensional input feature vector and the nonlinear mapping relationship specifically includes: Integrating the multidimensional input feature vectors of the current moment and a first number of historical periods before the current moment and closest to the current moment to generate a feature matrix; Extracting the time series correlation features of the feature matrix, performing a convolution operation on the feature matrix, and extracting the fluctuation pattern features of the feature matrix; Inputting the extracted time series correlation features and fluctuation pattern features into a preset deep learning model, performing feature fusion using the nonlinear mapping relationship, and generating a base value threshold; The power switching trigger threshold is generated based on the base threshold value superimposed on the standard deviation of the baseline current.
[0050] Specifically, to achieve dynamic generation of the power switching trigger threshold, the system first needs to construct a feature matrix containing timing information. Specifically, taking the current moment as the benchmark, the system traces back to the first number of historical cycles (for example, the first five cycles). The multi-dimensional input feature vectors collected in each cycle include parameters such as the effective value of the main power supply voltage, current harmonic content, frequency deviation, load power factor, and ambient temperature. Assuming the sampling period is 1 second, the number of rows in the feature matrix is 6 (current moment + 5 historical cycles), and the number of columns is the dimension of the feature vector (for example, 5 dimensions). For example, the feature vector at the current moment t is a combination of the effective value of voltage, current harmonic content, frequency deviation, load power factor, and ambient temperature, and the feature vectors at historical moments t-1 to t-5 are analogous. The feature matrix finally generated integrates the time-series evolution information of the power supply state, providing a basis for subsequent feature extraction.
[0051] Furthermore, to capture the temporal correlation features and fluctuation patterns in the feature matrix, the system uses a one-dimensional convolutional neural network for processing. First, a convolution kernel is designed to extract local temporal patterns. For example, three convolution kernels of size 3 rows and 5 columns are used (the height corresponds to 3 consecutive moments, and the width covers all 5 feature dimensions), with a step size of 1. After the convolution operation, nonlinearity is introduced through an activation function, and a pooling layer is used to reduce the data dimension. For example, after the input feature matrix passes through the convolution layer, the output feature map has a size of 4 rows, 1 column, and 3 channels (the time dimension is compressed to 4, and the number of channels is 3). This process can extract complex fluctuation patterns such as "the effective value of the voltage decreases for 3 consecutive seconds and the harmonic content increases synchronously," providing a dynamic basis for threshold generation.
[0052] Furthermore, the temporal correlation features and fluctuation pattern features output by the convolutional layer are input into a pre-set deep learning model (such as a hybrid model of a long short-term memory network and a fully connected network) to achieve feature fusion and generate a base threshold. Specifically, the long short-term memory network layer processes the temporal correlation features to capture long-term dependencies (such as the cumulative impact of rising ambient temperature on power supply stability). The fully connected network then fuses the fluctuation pattern features with the long short-term memory network output to generate a base threshold through nonlinear mapping. During model training, supervised learning is performed using the temporal feature matrix and the corresponding optimal threshold labels from the historical dataset. The optimization algorithm is adaptive moment estimation, and the learning rate is set to 0.0001. For example, when the input feature matrix indicates periodic fluctuations in the voltage RMS value and a gradually increasing harmonic content, the model outputs a base threshold of 28 seconds, 2 seconds shorter than the static threshold, to proactively address potential instability.
[0053] Furthermore, to enhance the adaptability of the threshold to dynamic loads, the system makes corrections based on the base threshold superimposed on the standard deviation of the baseline current. First, the degree of fluctuation of the baseline current over the historical period is calculated. For example, the baseline current data for the most recent 100 cycles is taken and its standard deviation is calculated. Subsequently, the base threshold and the standard deviation are superimposed proportionally, and the proportional coefficient is dynamically adjusted based on the load type (e.g., a smaller coefficient for resistive loads and a larger coefficient for inductive loads). For example, when the base threshold is 28 seconds and the current standard deviation is 2, the final threshold may be 28 seconds plus 0.8 times the standard deviation, or 29.6 seconds. This method enables the threshold to adapt to load fluctuation characteristics, further improving the accuracy of power switching.
[0054] Optionally, the modifying the power switching trigger threshold according to the environmental parameters specifically includes: Obtaining current environmental parameters, including ambient temperature, humidity, and vibration data; calculating an environmental risk score based on the environmental parameters; When the environmental risk score exceeds a preset threshold, adjusting the power switching trigger threshold; Adjust the parameters of the preset deep learning model according to the actual switching delay time of the power switching data in the preset historical database.
[0055] Specifically, an ambient temperature sensor (such as the MF52 series NTC thermistor) detects a temperature of 40°C near the device's heat dissipation vent; a relative humidity sensor (such as the HIH-4000 capacitive sensor) detects 75% humidity inside the device; and a triaxial accelerometer (such as the ADXL345) captures a vibration acceleration of 0.3g (0.2g on the X-axis, 0.1g on the Y-axis, and 0.0g on the Z-axis) on the device's casing. This data is synchronously transmitted to the main control unit via the I2C bus at a 1-second cycle. After being processed through a median filter (window size 5) and a sliding average filter (window size 10), the resulting stable environmental parameter readings are: temperature 40°C, humidity 75% RH, and vibration 0.3g.
[0056] The system further calculates a risk score based on the collected environmental parameters. For example, a temperature of 40°C is considered high risk (5 points), a humidity of 75% RH is considered medium risk (2 points), and a vibration of 0.3g is considered medium risk (3 points). Based on the preset weights (temperature 0.4, humidity 0.3, and vibration 0.3), the overall risk score is: the temperature score multiplied by the weight of 0.4, the humidity score multiplied by the weight of 0.3, and the vibration score multiplied by the weight of 0.3. (5 × 0.4 = 2.0, 2 × 0.3 = 0.6, and 3 × 0.3 = 0.9, for a total of 3.5 points. This score indicates a medium risk in the current environment and requires close attention to power supply stability.
[0057] Furthermore, if the system's preset risk threshold is 4 points, and the current score of 3.5 points does not exceed the threshold, the threshold will not be adjusted. If, during subsequent monitoring, environmental parameters change (for example, the temperature rises to 42°C, the humidity rises to 80% RH, or the vibration increases to 0.6g), the recalculated risk score may become: 42°C corresponds to a high risk of 5 points, 80% RH corresponds to a high risk of 4 points, and 0.6g corresponds to a high risk of 6 points. The combined score is 5 × 0.4 = 2.0, 4 × 0.3 = 1.2, and 6 × 0.3 = 1.8, for a total of 5.0 points. At this point, the score exceeds the threshold, triggering the threshold adjustment mechanism. According to the risk level mapping rules, a score of 5 qualifies as a Level 1 alert, and the threshold is shortened by 10%. If the original threshold was 30 seconds, the adjusted threshold will be 27 seconds, allowing for proactive response to power instability caused by environmental deterioration.
[0058] Furthermore, the system regularly extracts power switching event records from the historical database to optimize the model. For example, one record shows a trigger time of 10:15:00 on April 20, 2025, ambient temperature of 40°C, humidity of 75% ± 5% RH, vibration of 0.3g, a threshold of 27 seconds, and an actual switching delay of 620 milliseconds (exceeding the preset target of 500 milliseconds). The system statistically determined that under similar environmental conditions (temperature of 40°C ± 2°C, humidity of 75% ± 5% RH, and vibration of 0.3g ± 0.1g), 3 out of 10 switching events had delays exceeding 500 milliseconds, accounting for 30% of the total, triggering the optimization process. The system then uses incremental learning techniques to input data from this scenario into a deep learning model (such as an LSTM-FCN hybrid model). Local parameter updates are performed with a small learning rate, focusing on correcting the convolution kernel parameters related to the temperature and humidity inputs. After optimization, the model reduced the average latency from 620 milliseconds to 480 milliseconds in 10 switching tests under the same scenario, meeting system requirements. The updated model parameters are deployed to the production environment to improve the timeliness of future power switching.
[0059] Optionally, calculating an environmental risk score based on the environmental parameters may include: Normalizing the environmental parameters to obtain target environmental parameters; Based on the preset network model, the target environmental parameters are used as input, and the environmental risk probability is generated in combination with the equipment operation time and historical failure frequency; Outputting the environmental risk score according to the environmental risk probability and the preset risk level mapping table; Specifically, based on historical data or equipment specifications, determine the reasonable range for each parameter. For example, the normal operating range for temperature is -20°C to 80°C, humidity is 0% RH to 100% RH, and vibration is 0g to 1g. The original value of each parameter is mapped to a range of 0 to 1. For example, the normalized value for a temperature of 40°C is (40−(−20)) / (80−(−20))=0.6, the normalized value for a humidity of 75% RH is 75 / 100=0.75, and the normalized value for a vibration of 0.3g is 0.3 / 1=0.3. Parameters outside the preset range are treated as boundary values. For example, a temperature of 90°C is normalized to 1.0, and a vibration of -0.1g is normalized to 0.0, ensuring input data stability.
[0060] Furthermore, the model architecture utilizes a hybrid model of a long short-term memory (LSTM) network and a fully connected network (FCN). The LSTM layer captures temporal dependencies on device operating time, such as the increased risk of failure due to aging after prolonged operation. The FCN layer integrates normalized environmental parameters (such as temperature, humidity, and vibration) with historical failure rates to comprehensively assess the static impact of the current environment on power supply stability. Input data construction: The processed target environmental parameters (such as temperature 0.6, humidity 0.75, and vibration 0.3), device operating time (such as 3000 hours of operation, normalized to 0.5), and historical failure rates (such as 3 failures of the same type in the past 24 hours, normalized to 0.6) are combined into an input vector. For example, the input features might be represented as [0.6, 0.75, 0.3, 0.5, 0.6]. The model performs a weighted summation of the input data using weights learned during training and introduces nonlinearity by applying a nonlinear activation function (such as ReLU). For example, the LSTM layer might capture patterns in the correlation between operating time and ambient temperature (e.g., prolonged high-temperature operation accelerates component aging), while the FCN layer integrates all features to generate a risk probability value between 0 and 1. For example, if the input features are [0.6, 0.75, 0.3, 0.5, 0.6], the model might calculate a risk probability of 0.82, indicating an 82% probability that the power system will fail due to environmental factors in the current environment.
[0061] Furthermore, risk probability is divided into four levels: low risk (0% ≤ probability < 30%, score 1), medium risk (30% ≤ probability < 60%, score 3), high risk (60% ≤ probability < 90%, score 6), and extremely high risk (90% ≤ probability ≤ 100%, score 9). The risk probability output by the model determines the corresponding range and assigns a corresponding score. For example, a probability of 25% corresponds to a score of 1, a probability of 50% corresponds to a score of 3, a probability of 75% corresponds to a score of 6, and a probability of 95% corresponds to a score of 9. The system regularly updates the mapping table based on actual failure data. For example, if historical data shows that the actual failure rate reaches 70% when the score is 6, the high risk range may be adjusted to 60% ≤ probability < 80% to optimize the sensitivity of the score.
[0062] S203 : Compare the target current data with the power switching trigger threshold, and trigger power switching when the target current data continuously exceeds the power switching trigger threshold for a preset time period.
[0063] Specifically, the target current data collected in real time is compared with the generated power switching trigger threshold; when the target current data continuously exceeds the power switching trigger threshold, the timing starts; when the duration of exceeding the threshold reaches a preset time (for example, 5 seconds), the power switching operation is triggered, and the power supply is switched to the designated backup power supply to ensure stable operation of the system.
[0064] Optionally, comparing the target current data with the power switching trigger threshold, and triggering power switching when the target current data continuously exceeds the power switching trigger threshold for a preset time period, specifically includes: Calculating a weighted comprehensive value of the mean value of the baseline current and the mean value of the peak current; Calculating a target duration during which the weighted comprehensive value exceeds the power switching trigger threshold; When the target duration exceeds a first threshold, switching the power supply system to a first backup power supply; When the target duration exceeds a second threshold, switching the power supply system to a second backup power supply; The data of successful power switching is saved in the preset historical database.
[0065] Specifically, the baseline current and peak current are collected in real time, and the baseline current mean and peak current mean are calculated respectively; the weight coefficients w1 and w2 are set according to the system requirements (for example, w1=0.6, w2=0.4), and the weighted comprehensive value is calculated using the formula weighted comprehensive value = w1×baseline current mean + w2×peak current mean. The weighted comprehensive value comprehensively reflects the current status of the system.
[0066] Furthermore, the weighted composite value is compared with a dynamic threshold (e.g., 13.5A) generated by the deep learning model. If the value is detected to be less than 13.5A, no timing is triggered. However, if the composite value jumps to 14.1A at a certain moment, exceeding the threshold, a high-precision timer is started. For example, a hardware timer is used to detect state persistence with a 10ms period. If the composite value remains above the threshold for 30 consecutive periods (300ms), the target duration is determined to be 300ms. If the value falls below the threshold even once during the timing process (e.g., due to transient interference), the timer is immediately reset to avoid false positives.
[0067] Furthermore, when the target duration exceeds a first threshold (e.g., 300ms), a rapid switching mechanism is triggered. For example, in a smart factory scenario, the system immediately controls a solid-state relay to disconnect the main power supply line and simultaneously closes the electronic switch of the primary backup power supply (e.g., an uninterruptible power supply (UPS)). The switching process utilizes zero-current detection technology, performing opening and closing operations at the AC zero-crossing point, with a measured switching time of ≤5ms. After the switching is complete, the system verifies the match between the backup power supply output voltage and the load requirements using a voltage differential comparison circuit. If the deviation exceeds ±2%, a secondary calibration is initiated.
[0068] Furthermore, if the target duration continues to accumulate and exceeds a second threshold (e.g., 5 seconds), the system is severely overloaded. At this point, the control module sends a start command to the secondary backup power source (e.g., a diesel generator) and simultaneously activates the pre-synchronization detection circuit. For example, in a microgrid system, after the generator starts, its output voltage and frequency are continuously monitored. When the phase difference with the residual voltage of the main grid is less than 3°, the capacitor bank is quickly connected to the grid via thyristors. A dual-threshold hysteresis control strategy is employed in this phase. If the combined value falls below the threshold for 200ms, the switching process is stopped and the main power supply is restored.
[0069] Furthermore, after each successful switchover, the system encapsulates key parameters into data packets and writes them to a historical database. For example, a switchover event record includes fields such as a timestamp, a weighted composite value sequence [14.1, 14.3, 14.6], an actual switchover delay of 4.8ms, and an ambient temperature of 45°C. This data is compressed and stored in the time series database, and abnormal events (such as excessive vibration during a switchover) are flagged. A feature analysis report is automatically generated weekly to optimize the deep learning model's attention mechanism parameters, ensuring that subsequent threshold generation is more tailored to actual operating conditions.
[0070] This embodiment also discloses a power switching system. Figure 3 This is a module diagram of a power switching system disclosed in an embodiment of the present application. Figure 3 As shown, the system includes: A data acquisition and preprocessing module 301 is configured to obtain target current data of the power supply system, separate a baseline current and a peak current from the target current data, and calculate statistical characteristics of the baseline current and the peak current, wherein the statistical characteristics include a mean of the baseline current, a standard deviation of the peak current, and a coefficient of variation of the peak current; A dynamic threshold generation module 302 is configured to generate a power switching trigger threshold based on a preset deep learning model according to the statistical characteristics; The monitoring decision module 303 is configured to compare the target current data with the power switching trigger threshold, and trigger power switching when the target current data continuously exceeds the power switching trigger threshold for a preset time period.
[0071] Optionally, the data acquisition and preprocessing module 301 is specifically configured to: generating a baseline current value at the target moment by weighted calculation based on a sampled value at the target moment and a baseline value at a moment before the target moment, and combining a plurality of the baseline current values in chronological order to form the baseline current; Using a historical data weighted exponential decay algorithm, weighted summing is performed on the current values of the baseline current in reverse chronological order to generate a mean value of the baseline current; Setting a high threshold and a low threshold according to the average value of the baseline current, and triggering a pulse event marker when the target current data sequentially exceeds the low threshold, reaches the high threshold, and finally falls below the low threshold; In the time interval marked by the pulse event, traverse and search for the current values of all sampling points, set the sampling point with the largest current value as the extreme value point, and determine the current amplitude corresponding to the extreme value point as the peak current; In a sliding window of a preset time length, collecting statistics on the amplitude distribution of the peak current, calculating the standard deviation of the peak current in the window based on the amplitude distribution, and dividing the standard deviation by the mean of the peak current in the window to generate a coefficient of variation; The statistical characteristic is generated by integrating the mean of the baseline current, the mean of the peak current, the standard deviation, and the coefficient of variation.
[0072] The statistical property is generated by integrating the mean, the standard deviation, and the coefficient of variation.
[0073] Optionally, the dynamic threshold generation module 302 is specifically configured to: constructing the statistical characteristics into a multi-dimensional input feature vector; By using the memory-enhanced neural network in the preset deep learning model, the network parameters are adjusted using the training data so that the multi-dimensional input feature vector, after being transformed by the nonlinear activation function, establishes a nonlinear mapping relationship with the power switching trigger threshold; generating the power switching trigger threshold according to the multi-dimensional input feature vector and the nonlinear mapping relationship; The power switching trigger threshold is modified according to the parameters.
[0074] Optionally, the dynamic threshold generation module 302 is specifically configured to: Integrating the multidimensional input feature vectors of the current moment and a first number of historical periods before the current moment and closest to the current moment to generate a feature matrix; Extracting the time series correlation features of the feature matrix, performing a convolution operation on the feature matrix, and extracting the fluctuation pattern features therein.
[0075] The extracted time series correlation features and fluctuation pattern features are input into the preset deep learning model, and the established nonlinear mapping relationship is used to perform feature fusion to generate a base value threshold.
[0076] The power switching trigger threshold is generated based on the base threshold value superimposed on the standard deviation of the baseline current.
[0077] Optionally, the dynamic threshold generation module 302 is specifically configured to: Obtaining current environmental parameters, including ambient temperature, humidity, and vibration data; calculating an environmental risk score based on the environmental parameters; When the environmental risk score exceeds a preset threshold, adjusting the power switching trigger threshold; Adjust the parameters of the preset deep learning model according to the actual switching delay time of the power switching data in the preset historical database.
[0078] Optionally, the dynamic threshold generation module 302 is specifically configured to: Normalizing the environmental parameters to obtain target environmental parameters; Based on the preset network model, the target environmental parameters are used as input, and the environmental risk probability is generated in combination with the equipment operation time and historical failure frequency; Outputting the environmental risk score according to the environmental risk probability and the preset risk level mapping table; Optionally, the monitoring decision module 303 is specifically configured to: Calculating a weighted comprehensive value of the mean value of the baseline current and the mean value of the peak current; Calculating a target duration during which the weighted comprehensive value exceeds the power switching trigger threshold; When the target duration exceeds a first threshold, switching the power supply system to a first backup power supply; When the target duration exceeds a second threshold, switching the power supply system to a second backup power supply; The data of successful power switching is saved in the preset historical database.
[0079] It should be noted that the above embodiments provide devices that implement their functions using only the division of the above functional modules as examples. In actual 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 device and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0080] This embodiment also discloses an electronic device, referring to Figure 4 The electronic device may include: at least one processor 401 , at least one communication bus 402 , a user interface 403 , a network interface 404 , and at least one memory 405 .
[0081] The communication bus 402 is used to implement the connection and communication between these components.
[0082] The user interface 403 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 403 may also include a standard wired interface and a wireless interface.
[0083] The network interface 404 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0084] Processor 401 may include one or more processing cores. Using various interfaces and circuits, processor 401 connects to various components within the server. It executes instructions, programs, code sets, or instruction sets stored in memory 405, as well as accesses data stored in memory 405, to perform various server functions and process data. Optionally, processor 401 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). Processor 401 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing content displayed on the display screen; and the modem handles wireless communications. It is understood that the modem may also be implemented independently of the processor 401 and implemented as a separate chip.
[0085] Memory 405 may include random access memory (RAM) or read-only memory (ROM). Optionally, memory 405 may include non-transitory computer-readable storage medium. Memory 405 may be used to store instructions, programs, code, code sets, or instruction sets. Memory 405 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, sound playback function, image playback function, etc.), instructions for implementing the aforementioned method embodiments, etc.; the data storage area may store data related to the aforementioned method embodiments, etc. Memory 405 may also optionally be at least one storage device located remotely from the aforementioned processor 401. As shown in the figure, memory 405, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a power switching application.
[0086] exist Figure 4 In the electronic device shown, the user interface 403 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 401 can be used to call a power switching application stored in the memory 405. When executed by one or more processors 401, the electronic device executes one or more methods in the above embodiments.
[0087] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for this application.
[0088] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0089] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely schematic, such as the division of units, which is only a logical function division. 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. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interface, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0090] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0091] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0092] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of this application, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory 405 and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the method of this application. The aforementioned memory 405 includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a magnetic disk, or an optical disk.
[0093] The above is only an exemplary embodiment of the present disclosure and cannot be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification, those skilled in the art will easily think of other embodiments of the present disclosure. This application is intended to cover any variations, uses or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field that are not recorded in the present disclosure. The description and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A power switching method, characterized in that: Applied to a control center, the method includes: Obtaining target current data of the power supply system, separating a baseline current and a peak current from the target current data, and calculating statistical characteristics of the baseline current and the peak current, the statistical characteristics including a mean of the baseline current, a standard deviation of the peak current, and a coefficient of variation of the peak current; According to the statistical characteristics, generating a power switching trigger threshold based on a preset deep learning model; The target current data is compared with the power switching trigger threshold, and when the target current data continuously exceeds the power switching trigger threshold for a preset time period, power switching is triggered.
2. The method according to claim 1, characterized in that The separating of the baseline current and the peak current from the target current data and calculating the statistical characteristics of the baseline current and the peak current further comprises: generating a baseline current value at the target moment by weighted calculation based on a sampled value at the target moment and a baseline value at a moment before the target moment, and combining a plurality of the baseline current values in chronological order to form the baseline current; Using a historical data weighted exponential decay algorithm, weighted summing is performed on the current values of the baseline current in reverse chronological order to generate a mean value of the baseline current; Setting a high threshold and a low threshold according to the average value of the baseline current, and triggering a pulse event marker when the target current data sequentially exceeds the low threshold, reaches the high threshold, and finally falls below the low threshold; In the time interval marked by the pulse event, traverse and search for the current values of all sampling points, set the sampling point with the largest current value as the extreme value point, and determine the current amplitude corresponding to the extreme value point as the peak current; In a sliding window of a preset time length, collecting statistics on the amplitude distribution of the peak current, calculating the standard deviation of the peak current in the window based on the amplitude distribution, and dividing the standard deviation by the mean of the peak current in the window to generate a coefficient of variation; The statistical characteristic is generated by integrating the mean of the baseline current, the mean of the peak current, the standard deviation, and the coefficient of variation.
3. The method according to claim 1, characterized in that Generating a power switching trigger threshold based on a preset deep learning model according to the statistical characteristics further includes: constructing the statistical characteristics into a multi-dimensional input feature vector; By using the memory-enhanced neural network in the preset deep learning model, the network parameters are adjusted using the training data so that the multi-dimensional input feature vector, after being transformed by the nonlinear activation function, establishes a nonlinear mapping relationship with the power switching trigger threshold; generating the power switching trigger threshold according to the multi-dimensional input feature vector and the nonlinear mapping relationship; The power switching trigger threshold is modified according to environmental parameters.
4. The method according to claim 3, characterized in that Generating the power switching trigger threshold according to the multi-dimensional input feature vector and the nonlinear mapping relationship further includes: Integrating the multidimensional input feature vectors of the current moment and a first number of historical periods before the current moment and closest to the current moment to generate a feature matrix; Extracting the time series correlation features of the feature matrix, performing a convolution operation on the feature matrix, and extracting the fluctuation pattern features of the feature matrix; Inputting the extracted time series correlation features and fluctuation pattern features into the preset deep learning model, performing feature fusion using the nonlinear mapping relationship, and generating a base value threshold; The power switching trigger threshold is generated based on the base threshold value superimposed on the standard deviation of the baseline current.
5. The method according to claim 3, characterized in that The modifying of the power switching trigger threshold according to the environmental parameters further includes: Obtaining current environmental parameters, including ambient temperature, humidity, and vibration data; calculating an environmental risk score based on the environmental parameters; When the environmental risk score exceeds a preset threshold, adjusting the power switching trigger threshold; Adjust the parameters of the preset deep learning model according to the actual switching delay time of the power switching data in the preset historical database.
6. The method according to claim 5, characterized in that Calculating the environmental risk score based on the environmental parameters further includes: Normalizing the environmental parameters to obtain target environmental parameters; Based on the preset network model, the target environmental parameters are used as input, and the environmental risk probability is generated in combination with the equipment operation time and historical failure frequency; The environmental risk score is output according to the mapping table between the environmental risk probability and the preset risk level.
7. The method according to claim 5, characterized in that The comparing the target current data with the power switching trigger threshold, and triggering the power switching when the target current data continuously exceeds the power switching trigger threshold for a preset time period, further comprises: Calculating a weighted comprehensive value of the mean value of the baseline current and the mean value of the peak current; Calculating a target duration during which the weighted comprehensive value exceeds the power switching trigger threshold; When the target duration exceeds a first threshold, switching the power supply system to a first backup power supply; When the target duration exceeds a second threshold, switching the power supply system to a second backup power supply; The data of successful power switching is saved in the preset historical database.
8. A power switching system, characterized in that: Specifically include: a data acquisition and preprocessing module, configured to obtain target current data of the power supply system, separate a baseline current and a peak current from the target current data, and calculate statistical characteristics of the baseline current and the peak current, wherein the statistical characteristics include a mean of the baseline current, a standard deviation of the peak current, and a coefficient of variation of the peak current; A dynamic threshold generation module, configured to generate a power switching trigger threshold based on a preset deep learning model according to the statistical characteristics; The monitoring decision module is used to compare the target current data with the power switching trigger threshold, and trigger power switching when the target current data continuously exceeds the power switching trigger threshold for a preset time period.
9. An electronic device, characterized in that: The electronic device comprises a processor, a memory, a user interface and a network interface, wherein the memory is used to store instructions, the user interface and the network interface are both used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is executed.