Power supply detection and circuit switching method and system based on UPS alternative circuit

CN120896313APending Publication Date: 2025-11-04SUZHOU GAOPENG PHOTOELECTRIC TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511003538.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-11-04

Smart Images

  • Figure CN120896313A_ABST
    Figure CN120896313A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of power supply automatic control, and discloses a power supply detection and circuit switching method and system based on a UPS alternative circuit, and the system comprises a commercial power monitoring module, an electric energy quality analysis module, a fault diagnosis module, a switching decision module, and a circuit switching module. The method comprises the following steps of: firstly, acquiring a mains supply voltage waveform and load current data, analyzing the voltage data to obtain an electric energy quality parameter, establishing a model to calculate a health degree score, performing time sequence correlation analysis and diagnosis on a fault source by combining the score and the current data, then deciding whether to trigger a switching signal according to the fault source, and finally controlling a circuit module to execute power supply switching. According to the invention, by accurately distinguishing the fault source, error switching caused by the state change of the load is effectively avoided, advanced strategies such as synchronous takeover can be selected according to the mode that the electric energy quality is reduced, and the reliability and stability of power supply switching are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power supply automatic control technology, and in particular to a power supply detection and circuit switching method and system based on a UPS replacement circuit. Background Technology

[0002] With the increasing sophistication and widespread use of modern electronic devices, extremely high demands are placed on the stability and continuity of power supply quality. To prevent equipment damage or data loss caused by power quality problems such as voltage drops, surges, interruptions, or harmonic pollution in the mains power grid, backup power supply systems such as uninterruptible power supplies (UPS) or automatic transfer switches (ATS) have been widely used.

[0003] Existing backup power systems typically employ a threshold-based monitoring and switching mechanism. These systems continuously monitor key parameters such as voltage amplitude and frequency at the mains input. Once any parameter is detected to exceed a preset normal range, the control logic immediately triggers a switching action, switching the load from mains power to backup power such as batteries.

[0004] However, this traditional switching mechanism has inherent limitations. Its diagnostic logic is relatively simplistic, relying solely on isolated judgments of power quality parameters without delving into the root causes of parameter anomalies. This makes it impossible for the system to effectively distinguish between external grid quality deterioration and changes in circuit characteristics caused by changes in the state of internal load equipment. This diagnostic ambiguity often leads to unnecessary switching actions during normal load start-up and shutdown—i.e., erroneous switching—accelerating the aging of components such as switching relays and causing unnecessary energy consumption of backup power. Furthermore, its switching execution strategy is often fixed, lacking the intelligence to dynamically select the optimal switching method based on the urgency of power quality events, thus resulting in deficiencies in switching smoothness and adaptability.

[0005] Therefore, this invention proposes a power supply detection and circuit switching method and system based on a UPS replacement circuit to address the shortcomings of the prior art. Summary of the Invention

[0006] The purpose of this invention is to provide a power supply detection and circuit switching method and system based on UPS replacement circuits. This solves the problem that the power supply switching method mainly relies on judging the static thresholds of voltage and current. This method is prone to misjudgment or response delay when facing complex power quality problems. At the same time, when the fault originates from the load side, the existing method cannot effectively distinguish it, which may lead to unnecessary power switching actions.

[0007] To achieve the above objectives, this invention provides a power supply detection and circuit switching method and system based on UPS alternative circuits, which can quantitatively assess power quality and diagnose fault sources by combining the timing correlation of voltage and current, thereby achieving more accurate and timely power supply switching.

[0008] The first aspect of this invention provides a power supply detection and circuit switching method based on a UPS replacement circuit, the method comprising the following steps: S1. Collect voltage waveform data of mains power input and load current data flowing to load equipment; S2. Analyze the collected voltage waveform data to obtain multiple power quality parameters, and calculate a quantitative power quality health score based on the power quality health model established by the multiple power quality parameters. S3. Based on the calculated power quality health score and the collected load current data, perform voltage and current time series correlation analysis to diagnose the fault source of the power supply status. S4. Based on the diagnosed fault source, decide whether to trigger a first switching signal for switching from the mains power input to battery power. S5. In response to the triggered first switching signal, the control circuit switching module performs a power supply switch.

[0009] As a preferred technical solution, the steps for acquiring the voltage waveform data and the load current data are as follows: The mains input is discretized and sampled using an analog-to-digital converter to obtain the voltage waveform data. Simultaneously, the instantaneous current flowing through the load device is collected using a Hall effect current sensor to obtain the load current data.

[0010] As a preferred technical solution, the steps for obtaining the plurality of power quality parameters are as follows: The voltage waveform data is processed by Fast Fourier Transform (FFT), and the effective voltage value, grid frequency, and total harmonic distortion (THD) are extracted from the FFT results.

[0011] As a preferred technical solution, the power quality health model is calculated using the effective voltage value, the grid frequency, and the total harmonic distortion as inputs. These three parameters are weighted by preset weighting coefficients and then summed to obtain the power quality health score. The calculation formula is as follows: GHS = w v ·S v (V rms )+w f ·S f (f ac )+w thd·S thd (THD); Where: GHS is the Power Quality Health Score; V rms f is the effective value of the voltage. ac The power grid frequency is represented by THD, which stands for Total Harmonic Distortion. v w f w thd These are preset weighting coefficients corresponding to the effective voltage value, grid frequency, and total harmonic distortion, respectively; S v S f S thd This is a normalized scoring function that maps the effective voltage value, grid frequency, and total harmonic distortion to the standard scoring interval, respectively.

[0012] As a preferred technical solution, the steps of performing voltage-current timing correlation analysis to diagnose fault sources in the power supply state specifically include: Analyze the trends of the power quality health score and load current data within a preset time window; if the power quality health score decreases and the trend of the load current data has a preset correlation with the trend of the power quality health score, then the fault source is diagnosed as a grid-side fault; if the power quality health score remains stable and the load current data is lower than a preset current threshold, then the fault source is diagnosed as a load-side fault.

[0013] As a preferred technical solution, the step of making a decision based on the diagnosed fault source specifically includes: if the diagnosed fault source is a grid-side fault, then triggering the first switching signal; if the diagnosed fault source is a load-side fault, then suppressing the triggering of the first switching signal.

[0014] As a preferred technical solution, after triggering the first switching signal, the method further includes: Based on the decline pattern of the power quality health score, a switching strategy is selected. If the decline pattern of the power quality health score is a slow and continuous decline, a synchronous takeover strategy is selected; if the decline pattern of the power quality health score is a sudden and sharp drop, an asynchronous fast switching strategy is selected.

[0015] The specific synchronous takeover strategy is as follows: Start the inverter on the battery side, and synchronize the frequency and phase of the inverter's output AC power with the voltage waveform of the mains input through a phase-locked loop circuit; after synchronization is completed, control the inverter to be connected in parallel with the mains input to jointly power the load equipment; after parallel power supply, disconnect the mains input.

[0016] A second aspect of the present invention provides a power supply detection and circuit switching system based on a UPS replacement circuit, the system comprising: The mains power monitoring module is used to collect voltage waveform data of the mains power input and load current data flowing to the load device; The power quality analysis module is connected to the mains power monitoring module. The power quality analysis module is used to analyze the collected voltage waveform data to obtain multiple power quality parameters, and calculate a quantitative power quality health score based on the power quality health model established by the multiple power quality parameters. The fault diagnosis module is connected to the mains power monitoring module and the power quality analysis module. The fault diagnosis module is used to perform voltage and current time series correlation analysis based on the calculated power quality health score and the collected load current data in order to diagnose the fault source of the power supply status. A switching decision module is connected to the fault diagnosis module. The switching decision module is used to decide whether to generate a first switching signal for switching from the mains power input to battery power supply based on the diagnosed fault source. A circuit switching module is connected to the switching decision module, and the circuit switching module is used to perform power supply switching in response to the first switching signal.

[0017] In summary, the present invention has at least one of the following beneficial technical effects: 1. This invention establishes a power quality health model that comprehensively and quantitatively evaluates multiple power quality parameters, such as effective voltage, grid frequency, and total harmonic distortion. This model can identify slow deterioration or complex distortions in power quality that cannot be detected by simple voltage threshold judgments. It moves beyond a binary judgment of "power on" or "power off" to a deeper analysis of power quality, enabling early warning and response to potential power supply risks, thus improving the accuracy and foresight of power supply detection.

[0018] 2. This invention introduces voltage-current time-series correlation analysis. By analyzing the dynamic relationship between power quality health scores and load current data over time, it can effectively distinguish whether the fault source originates from the grid side or the load side. When a load-side fault is diagnosed, the system can suppress unnecessary power switching actions, avoiding system misjudgments and incorrect switching caused by the load's own start-up, shutdown, or disconnection. This enhances the operational stability of the entire power supply system and reduces unnecessary energy consumption by the battery.

[0019] 3. This invention can adaptively select the optimal switching strategy based on the specific decline pattern of the power quality health score. For scenarios with a slow decline in power quality, a synchronous takeover strategy is adopted; for scenarios with a sudden drop in power quality, an asynchronous fast switching strategy is adopted. This adaptive decision-making mechanism enables the system to achieve a balance between the smoothness of switching and the speed of response according to different fault urgency levels, thus optimizing the overall performance of the power supply switching process.

[0020] 4. The synchronous takeover switching strategy proposed in this invention first synchronizes the voltage waveform of the battery inverter output with that of the mains input in terms of frequency and phase through a phase-locked loop circuit, and then disconnects the mains power after parallel power supply. This process realizes the switching logic of parallel connection first and then disconnection, fundamentally eliminating the power interruption gap inherent in traditional switching methods, ensuring seamless connection of the switching process, providing high-quality continuous power supply to sensitive downstream load equipment, and effectively avoiding the impact of switching disturbances on the equipment. Attached Figure Description

[0021] Figure 1 This is a functional block diagram of the power supply detection and circuit switching system of the present invention; Figure 2 This is a flowchart of the power supply detection and circuit switching method of the present invention; Figure 3 This is a schematic diagram of voltage and current timing correlation analysis for fault source diagnosis in this invention; Figure 4 This is a timing diagram of the synchronous takeover and switching strategy of the present invention.

[0022] Among them, 10 is the mains power monitoring module; 20 is the power quality analysis module; 30 is the fault diagnosis module; 40 is the switching decision module; and 50 is the circuit switching module. Detailed Implementation

[0023] The following is in conjunction with the appendix Figure 1 - Appendix Figure 4 The present invention will be further described in detail below.

[0024] See attached document Figure 1 , Figure 1 This is a functional block diagram of a power supply detection and circuit switching system according to an embodiment of the present invention. The system includes: The mains power monitoring module 10, power quality analysis module 20, fault diagnosis module 30, switching decision module 40, and circuit switching module 50 are included.

[0025] The mains power monitoring module 10 is used to collect data and send it to the power quality analysis module 20 and the fault diagnosis module 30 respectively.

[0026] The analysis results of the power quality analysis module 20 are sent to the fault diagnosis module 30.

[0027] The fault diagnosis module 30 sends the diagnosis results to the switching decision module 40. The switching decision module 40 generates a switching signal based on the diagnosis results and sends it to the circuit switching module 50, which then performs the final power supply switching action.

[0028] See attached document Figure 2 , Figure 2 This is a flowchart of a power supply detection and circuit switching method according to an embodiment of the present invention. The method provided by the present invention may include the following steps: S1. Collect voltage waveform data of mains power input and load current data flowing to load equipment; S2. Analyze the collected voltage waveform data to obtain multiple power quality parameters, and calculate the quantitative power quality health score based on the power quality health model established by the multiple power quality parameters. S3. Based on the calculated power quality health score and the collected load current data, perform voltage and current time series correlation analysis to diagnose the fault sources in the power supply status. S4. Based on the diagnosed fault source, decide whether to trigger a first switching signal for switching from AC power input to battery power supply; S5. In response to the triggered first switching signal, the control circuit switching module performs power supply switching.

[0029] In a specific embodiment of the present invention, the overall workflow of the system executing the above method is as follows: First, the mains power monitoring module 10 executes step S1 to continuously collect the voltage waveform data of the mains power and the current data of the load.

[0030] Subsequently, after receiving the voltage waveform data, the power quality analysis module 20 executes the first half of step S2, which involves analyzing the voltage waveform data and extracting multiple power quality parameters. Based on these parameters, the power quality analysis module 20 further executes the second half of step S2, calculating a quantitative score using the built-in power quality health model.

[0031] Next, the fault diagnosis module 30 receives load current data from the mains monitoring module 10 and power quality health score from the power quality analysis module 20, and performs step S3 based on these two sets of data to perform correlation analysis to diagnose the fault source.

[0032] After receiving the fault source diagnosis result output by the fault diagnosis module 30, the switching decision module 40 executes step S4 to decide whether to generate the first switching signal.

[0033] Finally, after receiving the first switching signal from the switching decision module 40, the circuit switching module 50 executes step S5 to complete the power supply switch from mains power to battery. Through the coordinated work of the above modules, a complete power supply detection and switching processing closed loop is formed.

[0034] The following will be about Figure 1 The specific modules of the power supply detection and circuit switching system shown are described in detail.

[0035] See attached document Figure 1 The mains power monitoring module 10 is used for data acquisition. This module includes a voltage sensing unit and a current sensing unit. The voltage sensing unit steps down the mains input through a high-impedance voltage divider circuit, and then discretizes the sampled voltage using an analog-to-digital converter (ADC) at a preset sampling frequency to obtain digitized voltage waveform data. The current sensing unit uses a Hall effect current sensor, which is connected in series in the power supply circuit between the mains power and the load device to measure the instantaneous current flowing to the load device in real time, thereby obtaining load current data. The mains power monitoring module 10 outputs the acquired voltage waveform data to the power quality analysis module 20 and the load current data to the fault diagnosis module 30.

[0036] The power quality analysis module 20 is connected to the mains power monitoring module 10 and is used to quantitatively assess power quality. This module can be implemented using a microcontroller (MCU) or a digital signal processor (DSP). After receiving voltage waveform data, the module performs a Fast Fourier Transform (FFT) process over a preset data frame length, extracting the effective voltage value (V) from the spectrum of the transform result. rms ), grid frequency (f ac The module extracts three power quality parameters: total harmonic distortion (THD), total harmonic distortion (THD), and total harmonic distortion (THD). Then, based on a pre-defined power quality health model formula, the module performs a weighted sum of the three extracted parameters to calculate a quantified power quality health score (GHS). This module outputs the calculated GHS score to the fault diagnosis module 30 as a continuous data stream.

[0037] See attached document Figure 1 and attached Figure 3 The fault diagnosis module 30 is connected to both the mains power monitoring module 10 and the power quality analysis module 20, and is used to diagnose fault sources in the power supply status. This module synchronously analyzes the changing trends of the power quality health score data stream and the load current data stream within a preset time window. For example... Figure 3As shown, if the module detects a downward trend in the GHS score, and the trend of the load current I shows a preset correlation with the trend of the GHS score (e.g., the current also fluctuates abnormally or decreases), the module diagnoses the fault source as a grid-side fault. Conversely, if the GHS score remains stable within the normal range, but the load current suddenly drops below a preset low current threshold, the module diagnoses the fault source as a load-side fault. The module outputs the final diagnosis result (i.e., the identification of grid-side fault or load-side fault) to the switching decision module 40.

[0038] The switching decision module 40 is connected to the fault diagnosis module 30 and is used to make switching decisions based on the diagnostic results. When the received diagnostic result is a grid-side fault, the module confirms that a power switching is required and generates a first switching signal. When the received diagnostic result is a load-side fault, the module suppresses the generation of the first switching signal, and the system maintains mains power supply. After determining to generate the first switching signal, the module further analyzes the specific decline pattern of the GHS score: if the GHS score is slowly and continuously declining, a synchronous takeover strategy instruction is added to the generated first switching signal. If the GHS score drops sharply and instantaneously, an instruction for an asynchronous fast switching strategy will be added.

[0039] This module outputs a first switching signal containing the strategy instruction to the circuit switching module 50.

[0040] See attached document Figure 1 and attached Figure 4 The circuit switching module 50 is connected to the switching decision module 40 and is used to execute specific power supply switching actions. This module includes a switch on the mains input side, a battery, an inverter, a switch on the inverter output side, and a phase-locked loop (PLL) control circuit. When it receives a first switching signal containing a synchronous takeover strategy instruction, the module first starts the inverter and, through the PLL circuit, makes the AC power output of the inverter (V... inv It accurately tracks the voltage waveform of the mains input in both frequency and phase (V). grid ),like Figure 4 As shown in time period t1. After synchronization is achieved (at time t2), the module closes the switch on the inverter output side, allowing the mains power to supply power to the inverter in parallel. Then, it immediately disconnects the switch on the mains input side, completing a seamless switchover. When a signal containing an asynchronous fast switching strategy instruction is received, the module immediately disconnects the mains input side switch and then closes the inverter output side switch, performing a fast but briefly interrupted switchover.

[0041] The following will refer to the appendix. Figure 2 The specific steps of the power supply detection and circuit switching method in the embodiments of the present invention are described in detail.

[0042] In step S1, the system performs data acquisition of mains power input and load current.

[0043] This step is by Figure 1 The mains power monitoring module 10 shown performs this function. The core task of the mains power monitoring module 10 is to convert the measured physical electrical signal into a precisely synchronized digital data stream that can be used for subsequent digital processing.

[0044] In one specific embodiment, for the acquisition of voltage waveform data, the voltage sensing unit of the mains monitoring module 10 is first connected to the mains input terminal through a high-impedance precision voltage divider network. This voltage divider network linearly and proportionally reduces the voltage amplitude to a safe low voltage range, such as 0-5V, suitable for subsequent circuit processing. The purpose of using a high-impedance network is to produce only a minimal load effect on the mains power grid, thereby ensuring the accuracy and high fidelity of the measurement.

[0045] The analog voltage signal, after being conditioned by a voltage divider network, is input to the channel of an analog-to-digital converter (ADC). The ADC periodically samples and quantizes the analog signal at a preset sampling frequency. This sampling frequency follows the Nyquist sampling theorem and needs to be much higher than twice the fundamental frequency of the power grid (e.g., 50Hz or 60Hz). In a preferred embodiment, this frequency is set to several kilohertz (kHz) to tens of kilohertz to ensure not only the fundamental voltage waveform can be reconstructed without distortion, but also accurate capture of higher harmonic components, which are crucial for power quality analysis. Each sampling and quantization operation generates a digital sample representing the instantaneous voltage value at that moment. These discrete digital sample sequences, arranged in chronological order, together constitute the voltage waveform data.

[0046] Meanwhile, to acquire load current data, the current sensing unit of the mains monitoring module 10 deploys a Hall effect current sensor in the mains mains circuit, i.e., along the power supply path from the power input terminal to the downstream load device. This type of sensor enables through-hole measurement without disconnecting the main circuit and provides complete electrical isolation between the input and measurement circuits, enhancing the overall system's safety and anti-interference capabilities. The sensor outputs a weak voltage or current signal that is linearly proportional to the instantaneous current flowing through the conductor.

[0047] The signal is also fed into an ADC for digitization. To ensure a strict timing correspondence between the voltage and current data, the ADC used for voltage sampling and the ADC used for current sampling are driven by a common sampling clock signal; alternatively, in a more integrated solution, a single ADC chip with multiple synchronous sampling channels is used to simultaneously sample the conditioned voltage signal and the signal from the current sensor. In this way, the system can generate a load current sample corresponding to the voltage sample at each sampling moment, thus forming the load current data.

[0048] After data acquisition, the mains power monitoring module 10 transmits structured data frames containing voltage waveform data and corresponding load current data over a certain time period (e.g., several power grid cycles) to the power quality analysis module 20 and the fault diagnosis module 30, respectively. This step is executed continuously and periodically, providing real-time, high-resolution input data for subsequent analysis, diagnosis, and decision-making steps of the entire system.

[0049] In step S2, the system analyzes the collected voltage waveform data and calculates a quantified power quality health score. This step is performed by... Figure 1 The power quality analysis module 20 shown is executed, and its internal processing can be broken down into two stages: parameter extraction and health score calculation.

[0050] During the parameter extraction stage, the power quality analysis module 20 first preprocesses a frame of voltage waveform data received from the mains monitoring module 10. In one embodiment, to reduce spectral leakage caused by subsequent Fourier transforms, a window function (e.g., a Hanning window or a flat-top window) can be applied to the data frame first. Then, the module performs a Fast Fourier Transform (FFT) algorithm on the windowed data to convert the time-domain voltage signal into a frequency-domain spectral representation, which clearly reveals the amplitude and frequency information of the fundamental component and each harmonic component contained in the signal.

[0051] Based on this spectrum, the module begins to extract specific power quality parameters. First, by searching the frequency point with the largest amplitude in the spectrum, the fundamental frequency (f) of the power grid is determined. ac Secondly, by calculating the square root of the sum of the squares of the amplitudes of the fundamental component and each harmonic component, the effective voltage value (V) is obtained. rms Finally, the total harmonic distortion (THD) is obtained by calculating the ratio of the sum of the effective values ​​of all harmonic components above the fundamental frequency to the effective value of the fundamental component.

[0052] During the health score calculation phase, the power quality analysis module 20 will extract the effective voltage value (V). rms ), grid frequency (f acThe total harmonic distortion (THD) and other parameters are used as inputs and substituted into a pre-defined power quality health model (GHS) formula for calculation. The formula is: GHS = w v ·S v (V rms )+w f ·S f (f ac )+w thd ·S thd (THD); In this formula, S v S f S thd These are three normalized scoring functions. Each function maps a physical parameter value to a standardized scoring range (e.g., 0 to 1). For example, S... v (V rms The function is designed to: when the effective value of the input voltage V rms When V is within the center value of the normal range specified by the national standard, its output is 1; when V rms When shifting towards the upper or lower limits of the normal range, its output value smoothly decreases from 1 to 0. Similarly, S f (f ac ) function and S thd The (THD) function also converts its respective input parameters into standardized scores based on the standard limits for grid frequency and total harmonic distortion.

[0053] w v w f w thd These are preset weighting coefficients corresponding to the three parameters mentioned above, and their sum is 1. These coefficients are pre-configured based on the different sensitivities of various power quality indicators to different application scenarios, reflecting the relative importance of each parameter in the comprehensive evaluation.

[0054] Through this formula, the module integrates multiple power quality parameters into a single, quantifiable Power Quality Health Score (GHS). This score provides a clear and comprehensive reflection of the current state of the mains power supply. After calculation, the power quality analysis module 20 sends this GHS score to the fault diagnosis module 30 in real time for subsequent fault source diagnosis steps.

[0055] In step S3, the system performs voltage-current time-series correlation analysis based on the calculated power quality health score and the collected load current data to diagnose the fault sources in the power supply status. This step is... Figure 1 The fault diagnosis module 30 shown is executed.

[0056] See attached document Figure 1 and attached Figure 3 The function of the fault diagnosis module 30 is to jointly analyze the GHS score data stream from the power quality analysis module 20 and the load current data stream from the mains power monitoring module 10, which are two independent but synchronous data sources, thereby inferring the root cause of the system state change.

[0057] In one specific embodiment, the fault diagnosis module 30 continuously caches and processes sample sequences of GHS scores and load currents within a preset, sliding analysis time window. The module executes diagnostic logic by analyzing the changing trends and interrelationships of these two sequences within this time window.

[0058] The diagnostic logic specifically includes the following two situations: The first scenario involves diagnosing a fault on the power grid side. For example... Figure 3 As shown, when the fault diagnosis module 30 detects a significant downward trend in the GHS score sequence within its analysis time window (e.g., the score value continuously drops and crosses a preset warning threshold), the module simultaneously checks the load current sequence. If the trend of load current change has a preset correlation with the downward trend of the GHS score, such as abnormal fluctuations in the load current, synchronous decrease, or abnormal waveforms related to voltage distortion, the module determines that the deterioration of power quality and the abnormal load current are from the same source, and the source lies in the power grid supply quality itself. Under this condition, the module diagnoses the fault source as a grid-side fault.

[0059] The second scenario involves diagnosing load-side faults. When the fault diagnosis module 30 monitors that the GHS score sequence remains stable within its analysis time window, and the score value is within a preset healthy range, this indicates that the power quality at the mains input is acceptable. However, if the module simultaneously detects that the effective value of the load current suddenly and significantly drops below a preset low current threshold (significantly lower than the current during normal load operation), the module determines that the power quality itself is not the problem, and the drastic change in current is caused by a change in the state of the load device itself (e.g., the device is shut down, enters standby mode, or disconnects from the circuit). Under this condition, the module diagnoses the fault source as a load-side fault.

[0060] After completing the above analysis and judgment, the fault diagnosis module 30 outputs the final diagnosis result, clearly identifying the grid-side fault or load-side fault, signal or data packet to the switching decision module 40, providing a basis for the next switching decision.

[0061] In step S4, the system makes a switching decision and selects an appropriate switching strategy based on the diagnosed fault source. This step is performed by... Figure 1The switching decision module 40 shown is executed. As a logical decision center, the core function of this module is to accurately interpret the conclusions of the upstream diagnostic module and generate clear, structured instructions that the downstream execution module can understand and execute.

[0062] After receiving the diagnosis result from the fault diagnosis module 30, the decision-making logic of the switching decision module 40 is triggered and proceeds in two levels.

[0063] First-level decision-making: fault source identification and determination of switching necessity.

[0064] When the switching decision module 40 receives a diagnostic result indicating a load-side fault, the module determines that the current Power Quality Health (GHS) score is within the normal range, and the abnormal change in load current originates from the behavior of the load equipment itself. In this case, activating the backup power supply is unnecessary and inappropriate. Therefore, the module will actively suppress the generation of the first switching signal, and the system will maintain the existing mains power supply state. This decision avoids erroneous switching caused by normal load start-up, shutdown, or removal, reducing wear and tear on components such as switching relays and unnecessary consumption of the battery.

[0065] When the switching decision module 40 receives a diagnostic result indicating a grid-side fault, the module determines that the mains power quality has deteriorated and it is necessary to switch to the battery to ensure the normal operation of the load equipment. At this point, the module confirms the necessity of the switch and immediately proceeds to the second-level decision-making stage.

[0066] Second-level decision: Adaptive switching strategy selection.

[0067] After determining that a switchover is necessary, the switchover decision module 40 will further analyze the specific decline pattern of the GHS score that led to this decision in order to select the optimal switchover execution strategy. In a specific embodiment, the module performs pattern determination by analyzing a recent GHS historical data sequence cached internally.

[0068] This judgment can be based on the following conditions: If the module calculates that the absolute value of the rate of change (i.e., time gradient) of the GHS score in the historical data series is less than a preset slow change threshold, this indicates that the power quality is undergoing a slow, continuous degradation process (e.g., gradual voltage drop or gradual harmonic increase). For this non-sudden scenario with a warning time, the module selects a synchronous takeover strategy. The goal of this strategy is to maintain absolute continuity of power supply to the load during the switching process.

[0069] Conversely, if the absolute value of the rate of change of the GHS score is greater than or equal to the slow change threshold, or if the GHS score drops directly and crosses a preset severe fault threshold within a very short time interval (e.g., one to two calculation cycles), this indicates that the mains power is experiencing a momentary, severe fault (e.g., a grid short circuit, lightning strike, or complete power outage). In this emergency, the module will select an asynchronous fast switching strategy. This strategy prioritizes disconnecting the load from the faulty grid as quickly as possible, allowing for a brief power interruption of milliseconds in exchange for rapid protection of the load.

[0070] After completing the above two-level decision-making process, the switching decision module 40 encapsulates the final decision result into a structured first switching signal. This signal is not a simple binary trigger level, but a data packet or encoded signal containing explicit execution instructions. For example, this signal may contain a main switching flag (set to "1" to indicate execution of the switch) and a strategy selection subfield (e.g., "01" for synchronous-takeover strategy, and "10" for asynchronous fast switching strategy). Subsequently, the module sends this first switching signal containing precise execution instructions to the circuit switching module 50.

[0071] In step S5, the system responds to the triggered first switching signal and performs a power supply switch. This step is performed by... Figure 1 The circuit switching module 50 shown executes the control of the power supply path change based on the specific strategy instructions received from the switching decision module 40.

[0072] See attached document Figure 1 and attached Figure 4 The circuit switching module 50 executes the corresponding operation sequence according to the strategy instructions contained in the first switching signal.

[0073] If the received instruction is a synchronous-takeover strategy, the module will execute a make-before-break seamless switching process. First, the module starts the inverter connected to the battery and activates its internal phase-locked loop (PLL) control circuit. This PLL circuit uses the real-time mains voltage waveform (VL) provided by the mains monitoring module 10. grid () is the reference signal. Figure 4 During the time period t1 shown, the phase-locked loop circuit continuously adjusts the inverter's output frequency and phase until the AC voltage waveform (V) output by the inverter is obtained. inv The waveform of the mains voltage is within the preset synchronization tolerance range in terms of frequency, phase and amplitude.

[0074] At time t2, once the system confirms that the synchronization condition has been met, the circuit switching module 50 immediately closes the switch located between the inverter output and the load. This action connects the inverter and the mains input in parallel to the load, providing power to the load together for a very short time. Immediately afterwards, within a predetermined small delay after the parallel connection is completed, the module immediately disconnects the switch between the mains input and the load. At this point, the mains input is completely isolated, and the power supply responsibility is seamlessly and uninterruptedly transferred to the battery-powered inverter, thus completing the synchronous takeover of the load.

[0075] If the received instruction is an asynchronous fast switching strategy, the module executes a break-before-make fast switching procedure. In this case, response speed takes precedence over seamless switching. Upon receiving the signal, the circuit switching module 50 immediately and unconditionally disconnects the switch between the mains input and the load, thereby isolating the load from the grid experiencing a severe fault in the shortest possible time. This disconnection causes a power interruption in milliseconds. Almost simultaneously or immediately afterward, the module closes the switch between the inverter output and the load, allowing the inverter to begin supplying power to the load. This process ensures that the load can be protected as quickly as possible in the event of a catastrophic mains power failure.

[0076] By executing one of the two switching strategies described above, the circuit switching module 50 finally completes the switch from mains power input to battery power supply, ensuring the continuous operation of the load equipment.

[0077] See attached document Figure 1 The method of the present invention also includes a process of automatically switching back to mains power supply when mains power is restored after switching to battery power. This process ensures that the system can return to its optimal operating state after the external power supply conditions improve.

[0078] In one specific embodiment, even after the circuit switching module 50 has performed a switch, allowing the load to be powered by the battery and inverter, the system does not cease monitoring the mains input. The mains monitoring module 10 continuously collects voltage waveform data at the mains input, even when the switch on the mains input side is in the off state. Similarly, the power quality analysis module 20 continuously receives this data and calculates the current GHS score at the mains input in real time based on the Power Quality Health (GHS) model.

[0079] During this stage, the switching decision module 40 is responsible for determining whether the mains power has been stably restored. To this end, the module internally sets a GHS restoration threshold and a stabilization duration timer. The switching decision module 40 continuously compares the mains GHS score calculated by the power quality analysis module 20 with this GHS restoration threshold.

[0080] When the module detects that the mains power GHS score exceeds the recovery threshold for the first time, it starts a stabilization duration timer. If the mains power GHS score remains above the recovery threshold without dropping again for the duration set by the timer (e.g., several seconds to several minutes), the switching decision module 40 determines that the mains power has achieved a stable and reliable recovery. This timer mechanism is designed to avoid frequent switching between the two power supply modes (i.e., power jitter) caused by the short and unstable recovery of the mains power after a fault.

[0081] Once the mains power is confirmed to be stable and restored, the switching decision module 40 will generate and send a second switching signal, namely the back-switching signal, to the circuit switching module 50.

[0082] Upon receiving the cut-back signal, the circuit switching module 50 executes a synchronous cut-back operation similar to the synchronous takeover strategy. Since the inverter is currently supplying power to the load, its output voltage waveform is stable. The module first ensures that the restored mains voltage waveform is synchronized with the output voltage waveform of the running inverter. After confirming synchronization, the module closes the switch between the mains input and the load, briefly connecting the mains and the inverter in parallel. Subsequently, the module immediately disconnects the switch between the inverter output and the load, stopping the inverter's operation.

[0083] Through this process, the power supply responsibility is seamlessly switched from the battery back to the AC power input. The load equipment does not feel any power interruption during the entire switchback process, and the system returns to its normal AC power supply mode.

[0084] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A power supply detection and circuit switching method based on a UPS replacement circuit, characterized in that, The method includes the following steps: S1. Collect voltage waveform data of mains power input and load current data flowing to load equipment; S2. Analyze the collected voltage waveform data to obtain multiple power quality parameters, and calculate a quantitative power quality health score based on the power quality health model established by the multiple power quality parameters. S3. Based on the calculated power quality health score and the collected load current data, perform voltage and current time series correlation analysis to diagnose the fault source of the power supply status. S4. Based on the diagnosed fault source, decide whether to trigger a first switching signal for switching from the mains power input to battery power. S5. In response to the triggered first switching signal, the control circuit switching module performs a power supply switch.

2. The power supply detection and circuit switching method based on a UPS replacement circuit according to claim 1, characterized in that, Step S1, which involves collecting voltage waveform data from the mains input and load current data flowing to the load device, includes: The mains input is discretized and sampled using an analog-to-digital converter to obtain the voltage waveform data. Simultaneously, the instantaneous current flowing through the load device is collected using a Hall effect current sensor to obtain the load current data.

3. The power supply detection and circuit switching method based on a UPS replacement circuit according to claim 1, characterized in that, In step S2, the steps of analyzing the collected voltage waveform data to obtain multiple power quality parameters, and calculating a quantified power quality health score based on a power quality health model established according to these multiple power quality parameters, include: The voltage waveform data is processed by Fast Fourier Transform (FFT), and the effective voltage value, grid frequency, and total harmonic distortion (THD) are extracted from the FFT results.

4. The power supply detection and circuit switching method based on a UPS replacement circuit according to claim 3, characterized in that, The power quality health model is calculated using the effective voltage value, grid frequency, and total harmonic distortion as inputs. The calculation formula for the power quality health model is as follows: GHS=w v ·S v (V rms )+w f ·S f (f ac )+w thd ·S thd (THD); Where: GHS is the Power Quality Health Score; V rms f is the effective value of the voltage. ac The power grid frequency is represented by THD, which stands for Total Harmonic Distortion. v w f w thd These are preset weighting coefficients corresponding to the effective voltage value, grid frequency, and total harmonic distortion, respectively; S v S f S thd This is a normalized scoring function that maps the effective voltage value, grid frequency, and total harmonic distortion to the standard scoring interval, respectively.

5. The power supply detection and circuit switching method based on a UPS replacement circuit according to claim 1, characterized in that, Step S3, which involves performing voltage-current time-series correlation analysis based on the calculated power quality health score and the collected load current data to diagnose the fault sources in the power supply status, includes the following steps: Analyze the changing trends of the power quality health score and load current data within a preset time window; If the power quality health score decreases, and the trend of the load current data has a preset correlation with the trend of the power quality health score, then the fault source is diagnosed as a grid-side fault. If the power quality health score remains stable, and the load current data is lower than the preset current threshold, then the fault source is diagnosed as a load-side fault.

6. The power supply detection and circuit switching method based on a UPS replacement circuit according to claim 5, characterized in that, Step S4, based on the diagnosed fault source, includes the following steps: Determining whether to trigger a first switching signal for switching from AC power input to battery power supply. If the diagnosed fault source is a grid-side fault, then the first switching signal is triggered; If the diagnosed fault source is a load-side fault, then the triggering of the first switching signal is suppressed.

7. The power supply detection and circuit switching method based on a UPS replacement circuit according to claim 6, characterized in that, After triggering the first switching signal and before step S5, the method further includes: Based on the decline pattern of the power quality health score, select a switching strategy; If the power quality health score declines slowly and continuously, then a synchronous takeover strategy is selected. If the power quality health score declines in a sudden and sharp drop, then an asynchronous fast switching strategy is selected.

8. The power supply detection and circuit switching method based on a UPS replacement circuit according to claim 7, characterized in that, The synchronous takeover strategy specifically includes: Start the inverter on the battery side and synchronize the frequency and phase of the inverter's output AC power with the voltage waveform of the mains input through a phase-locked loop circuit; After synchronization is completed, the inverter is controlled to be connected in parallel with the mains input to jointly supply power to the load device; After parallel power supply, disconnect the mains power input.

9. The power supply detection and circuit switching method based on a UPS replacement circuit according to claim 1, characterized in that, After performing the power supply switch, the method further includes: Continuously monitor the power quality health score of the mains power input; When the power quality health score recovers to or exceeds the preset health threshold and remains stable for a preset time, a second switching signal is triggered; In response to the second switching signal, the power supply to the load device is switched from the battery to the AC power input.

10. A power supply detection and circuit switching system based on a UPS replacement circuit, applied to the method described in any one of claims 1-9, characterized in that, The system includes: The mains power monitoring module is used to collect voltage waveform data of the mains power input and load current data flowing to the load device; The power quality analysis module is used to analyze the collected voltage waveform data to obtain multiple power quality parameters, and to calculate a quantitative power quality health score based on the power quality health model established by the multiple power quality parameters. The fault diagnosis module is used to perform voltage and current time series correlation analysis based on the calculated power quality health score and the collected load current data in order to diagnose the fault source of the power supply status. The switching decision module is used to decide whether to generate a first switching signal for switching from the mains power input to battery power supply based on the diagnosed fault source. The circuit switching module is used to perform power supply switching in response to the first switching signal.

Citation Information

Patent Citations

  • Device for controlling and transmitting electric energy and circuit control method

    CN118739861A

  • Uninterruptible-power-operation maintenance and power protection method and integrated device

    CN118801558A

  • Automatic UPS (Uninterrupted Power Supply) system control method

    CN119134623A

  • Power supply switching control optimization method and system

    CN120049599A

  • Data mining method and system serving micro-grid control system

    CN120104663A