Solar panel dynamic matching energy storage charging and discharging control method and system

By acquiring transient current waveform data from the DC side of the photovoltaic array, and utilizing short-time Fourier transform and graph neural network models, the hardware complexity and response lag issues of switching charging and discharging strategies in photovoltaic energy storage systems are solved, enabling fast and flexible charging and discharging control.

CN123121891APending Publication Date: 2026-11-17广州茂宏新能源有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611617187.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-19
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

The charging and discharging strategy switching of existing photovoltaic energy storage systems relies on external light sensors, resulting in high hardware complexity and insufficient flexibility in strategy switching. In particular, when light intensity fluctuates frequently, it is easy to miss the opportunity or experience frequent jitters, and the charging and discharging commands lag behind changes in light intensity.

Method used

By acquiring transient current waveform data from the DC side of the photovoltaic array, a spectral response fingerprint is generated using a high-bandwidth current sensing circuit and short-time Fourier transform. An offline mapping sample library is constructed and a graph neural network model is trained. This model is then deployed on an embedded MCU for edge inference, directly generating PWM control signals to adjust the charging and discharging strategy.

Benefits of technology

It reduces system hardware complexity, improves the ability to identify rapid changes in illumination, reduces frequent policy jitter and missed switching opportunities, and improves the response speed and consistency of the charging and discharging strategy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123121891A_ABST
    Figure CN123121891A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of intelligent control of photovoltaic energy storage systems, and provides a kind of solar panel dynamic matching energy storage charge-discharge control method and system.The core technical scheme includes: obtaining the current transient waveform data of photovoltaic array DC side output end;Spectral response fingerprint is generated by short-time Fourier transform processing;Based on the controlled light disturbance experiment, an offline mapping sample library is constructed;The graph neural network model is trained and quantized using the offline mapping sample library, and an edge inference unit is deployed on the embedded MCU;The real-time spectral response fingerprint is input into the edge inference unit, and the strategy action probability and priority ranking result are output;The IGBT drive chip adjusts the output PWM duty cycle or switches the control mode, and executes the immediate load reduction, maintenance, cut-in constant current charging or start-up pre-compensation charge-discharge strategy action.This scheme improves the response speed of charge-discharge strategy switching and the adaptability to light mutation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent control technology for photovoltaic energy storage systems, and in particular to a method and system for dynamic matching of solar panels for energy storage charging and discharging control. Background Technology

[0002] Currently, the switching of charging and discharging strategies in photovoltaic energy storage systems is usually achieved by real-time monitoring and trend prediction of the external light intensity of solar panels. Common approaches include fixed threshold judgment, dynamic threshold switching in sliding intervals, machine learning prediction models based on light intensity or output power time series, and multi-sensor fusion models that integrate light intensity, temperature, and environmental information. Some solutions also improve the responsiveness of strategy switching by using cloud data analysis or adding edge computing units.

[0003] However, the current photovoltaic energy storage system still has the following problems in switching charging and discharging strategies: On the one hand, strategy switching relies on independent light intensity sensors to collect environmental data. The configuration and periodic calibration of photometric devices increase hardware complexity, and calibration drift can also lead to inaccurate strategy switching. On the other hand, the criteria are mostly scalar quantities such as light intensity or output power and rely on empirical thresholds. In the case of frequent fluctuations in light such as cloud cover or instantaneous shadows, if the threshold is too wide, the opportunity for strategy switching will be missed, and if the threshold is too tight, the strategy will fluctuate frequently. Moreover, environmental data acquisition, multi-source data synchronization and decision reasoning require multi-level signal transmission, and charging and discharging commands lag behind changes in light intensity. Summary of the Invention

[0004] This application provides a method and system for dynamic matching of energy storage charging and discharging of solar panels, which aims to solve one of the problems or problems of the prior art mentioned in the background.

[0005] This application provides a method for dynamically matching the energy storage charging and discharging control of solar panels, specifically including: Acquire transient current waveform data collected by a high-bandwidth current sensing circuit connected to the DC-side output of the photovoltaic array at the moment of sudden change in light intensity.

[0006] The transient current waveform data is subjected to short-time Fourier transform processing to generate a spectral response fingerprint containing energy distribution information of a preset frequency band.

[0007] An offline mapping sample library is constructed based on typical spectral response fingerprints and their corresponding optimal charge / discharge mode labels acquired through controlled illumination perturbation experiments.

[0008] The graph neural network model is trained using the offline mapping sample library, and the trained graph neural network model is quantized and compressed to obtain an edge inference unit deployed on an embedded MCU.

[0009] The real-time spectral response fingerprint is input into the edge inference unit for inference calculation, so as to output the probability and priority ranking of the strategy action under the current working condition.

[0010] Based on the probability and priority ranking of the strategy actions, a PWM control signal is generated. The IGBT driver chip adjusts the output PWM duty cycle or switches the control mode to execute charging and discharging strategy actions such as immediate load reduction, maintenance, switching to constant current charging, or initiating pre-compensation.

[0011] This application also provides a solar panel dynamic matching energy storage charging and discharging control system, including: The transient current acquisition module for sudden changes in illumination is used to acquire transient current waveform data collected by a high-bandwidth current sensing circuit connected to the DC side output of the photovoltaic array at the moment of sudden change in illumination.

[0012] The short-time Fourier spectral fingerprint generation module is used to perform short-time Fourier transform processing on the current transient waveform data to generate a spectral response fingerprint containing energy distribution information of a preset frequency band.

[0013] The offline mapping sample library construction module is used to construct an offline mapping sample library based on typical spectral response fingerprints and their corresponding optimal charge and discharge mode labels collected from controlled illumination perturbation experiments.

[0014] The edge inference unit construction module is used to train a graph neural network model using the offline mapping sample library, and to quantize and compress the trained graph neural network model to obtain an edge inference unit deployed on an embedded MCU.

[0015] The real-time inference and strategy ranking module is used to input the real-time spectral response fingerprint into the edge inference unit for inference calculation, so as to output the strategy action probability and priority ranking result under the current working condition.

[0016] The PWM control and strategy execution module is used to generate a PWM control signal based on the probability and priority ranking of the strategy action. The IGBT driver chip adjusts the output PWM duty cycle or switches the control mode to execute charging and discharging strategy actions such as immediate load reduction, maintenance, switching to constant current charging, or initiating pre-compensation.

[0017] The energy storage charging and discharging control method and system for dynamic matching of solar panels provided in this application have the following beneficial effects: By implementing this embodiment, the transient current waveform generated by the solar panel itself at the moment of sudden change in light intensity is used as the basis for operating condition sensing, eliminating the need for configuration and calibration of independent light intensity sensors and external environmental data, thus reducing system hardware complexity and maintenance costs. By performing short-time Fourier transform processing on the transient current waveform data to obtain a spectral response fingerprint, the electrical signal fluctuations caused by changes in light intensity are converted into frequency domain energy distribution characteristics, enhancing the ability to identify rapid changes in light intensity such as cloud cover and instantaneous shadows.

[0018] Based on this, an offline mapping sample library is constructed using typical spectral response fingerprints and their corresponding optimal charge / discharge mode labels collected from controlled illumination perturbation experiments. This transforms the basis for policy decision-making from empirical thresholds to experimentally calibrated mapping relationships, reducing frequent policy jitter and missed switching opportunities caused by improper threshold settings. The offline mapping sample library is used to train and quantize compressed graph neural network models. The quantized and compressed edge inference units are then deployed on embedded MCUs, reducing the amount of data processing required for cloud communication and large-scale online training of historical data.

[0019] Furthermore, the real-time spectral response fingerprint is directly inferred by the edge inference unit, which outputs the probability and priority ranking of the strategy action. The results are then used by the IGBT driver chip to directly adjust the output PWM duty cycle or switch the control mode, which shortens the signal transmission link from the occurrence of light change to strategy execution and improves the response speed and execution consistency of the charging and discharging strategy.

[0020] The entire solution utilizes a collaborative approach across the entire chain, including current transient waveform self-sensing, frequency domain feature extraction, offline sample library mapping, and edge inference direct drive, enabling strategy switching to be completed locally. This eliminates the reliance on external light sensors, cloud data analysis, and empirical threshold criteria, thereby solving the technical problems in existing photovoltaic energy storage systems where strategy switching depends on external light measurement devices, criteria adaptability is insufficient, and charging / discharging commands lag behind changes in light intensity. Attached Figure Description

[0021] Figure 1 This is the main flowchart of a solar panel dynamic matching energy storage charging and discharging control method; Figure 2 This is a sub-flowchart of a solar panel dynamic matching energy storage charging and discharging control method; Figure 3 This is another sub-flowchart of a method for dynamically matching the energy storage charge and discharge control of solar panels. Detailed Implementation

[0022] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0023] The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0024] like Figure 1 As shown, this application provides a method for dynamically matching the energy storage charging and discharging control of solar panels, specifically including: S1: Acquire transient current waveform data collected by a high-bandwidth current sensing circuit connected to the DC-side output of the photovoltaic array at the moment of sudden change in light intensity.

[0025] S2: Perform short-time Fourier transform processing on the transient current waveform data to generate a spectral response fingerprint containing energy distribution information of a preset frequency band.

[0026] S3: Based on the typical spectral response fingerprints and their corresponding optimal charge / discharge mode labels collected by controlled illumination perturbation experiments, an offline mapping sample library is constructed.

[0027] S4: Train a graph neural network model using the offline mapping sample library, and quantize and compress the trained graph neural network model to obtain an edge inference unit deployed in an embedded MCU; S5: Input the real-time spectral response fingerprint into the edge inference unit for inference calculation, and output the probability and priority ranking results of the strategy action under the current working condition; S6: Generate a PWM control signal based on the probability and priority ranking of the strategy actions, and adjust the output PWM duty cycle or switch the control mode through the IGBT driver chip to execute the charging and discharging strategy actions of immediate load reduction, maintenance, switching to constant current charging, or starting pre-compensation.

[0028] Step S1: Acquire transient current waveform data collected by a high-bandwidth current sensing circuit connected to the DC-side output of the photovoltaic array at the moment of sudden change in light intensity. This transient current waveform data characterizes the transient current response of the solar panel to sudden changes in light intensity. Specifically, this includes: S1.1: Based on the electrical connection characteristics of the DC side output terminal of the photovoltaic array, the high bandwidth Hall effect current sensor in the high bandwidth current sensing circuit is configured as the primary sensing unit to perform non-contact magnetic induction coupling on the original analog current signal flowing through the DC bus to generate a primary induced voltage signal with a wide dynamic range and isolation from high voltage interference. A high-bandwidth Hall effect current sensor is configured as the primary sensing unit. The high-bandwidth Hall effect current sensor adopts the closed-loop magnetic balance principle. Its primary winding is connected in series to the DC bus of the photovoltaic array, and the secondary coil maintains zero magnetic flux through compensation current to ensure linear response capability to current changes.

[0029] Non-contact magnetic induction coupling is performed on the original analog current signal flowing through the DC bus. The leakage magnetic field is concentrated by a high permeability magnetic core, and the magnetic field strength generated by the large current is linearly converted into the magnetic induction intensity on the surface of the Hall element, generating a Hall voltage signal proportional to the primary current, thereby achieving electrical isolation between the high-voltage side and the low-voltage control circuit.

[0030] The Hall voltage signal is subjected to impedance transformation and preliminary amplification to eliminate signal attenuation caused by load effect, so that the output voltage is in the linear operating region without saturation cutoff when the current jumps significantly, thereby generating the primary induced voltage signal.

[0031] The response time and bandwidth of the high-bandwidth Hall effect current sensor are determined based on the rate of current change caused by sudden changes in illumination. The response time is controlled within 1 microsecond, and the bandwidth covers more than 100kHz, so that the primary induced voltage signal retains the microsecond-level current fluctuation details caused by sudden changes in illumination.

[0032] S1.2: The primary induced voltage signal is subjected to adaptive impedance matching and amplitude amplification using a low-noise programmable gain amplifier to eliminate signal mismatch loss between the sensor output impedance and the back-end acquisition circuit, and to generate a standardized analog current waveform with optimized signal-to-noise ratio. The primary induced voltage signal is received; the amplitude of the primary induced voltage signal varies over a wide range with the light intensity, and its output impedance does not match that of the subsequent acquisition circuit, so impedance matching and amplitude conditioning need to be completed before analog-to-digital conversion.

[0033] A low-noise programmable gain amplifier is configured as the core of signal conditioning. A feedback resistor network is connected in parallel at the input of the low-noise programmable gain amplifier to establish an input impedance that is conjugate matched with the output impedance of the high-bandwidth Hall effect current sensor, thereby eliminating signal reflection and amplitude attenuation caused by impedance mismatch.

[0034] Peak detection processing is performed on the primary induced voltage signal to obtain signal peak prediction data; the internal feedback resistor ratio of the low-noise programmable gain amplifier is adjusted according to a preset gain lookup table to perform adaptive gain switching, so that the weak light illumination change signal is fully amplified without saturation clipping; the preset gain lookup table is pre-established according to the correspondence between the signal amplitude range and the amplification factor under different illumination conditions.

[0035] The signal after gain adjustment is still a bipolar AC fluctuation signal. It is superimposed on half of the reference voltage to perform DC bias level shifting processing, so that the overall signal potential is raised to the center of the linear operating range of the single power supply system; the reference voltage is determined based on the power supply voltage of the DC side of the photovoltaic array.

[0036] The peak-to-peak amplitude of the signal after level shifting is calculated, and the gain coefficient is finely adjusted through a closed-loop feedback mechanism to control the maximum swing of the signal between 85% and 95% of the full-scale range of the subsequent analog-to-digital converter, thereby generating the standardized analog current waveform.

[0037] S1.3: The standardized analog current waveform is subjected to high-frequency noise suppression processing based on the anti-aliasing Butterworth active filter to filter out switching ripple interference and electromagnetic compatibility noise above the Nyquist frequency, and generate a pure band-limited analog current signal. The standardized analog current waveform is received; the amplitude of the standardized analog current waveform has been adapted to the linear operating range of the subsequent analog-to-digital conversion, but it still contains ripple interference and electromagnetic compatibility noise introduced by the switching action of the photovoltaic inverter, and the frequency band needs to be limited before the analog-to-digital conversion.

[0038] A fourth-order Butterworth active low-pass filter is configured. The cutoff frequency of the fourth-order Butterworth active low-pass filter is determined according to the Nyquist sampling theorem and the sampling frequency of the subsequent analog-to-digital conversion, and is taken as half of the sampling frequency.

[0039] The fourth-order Butterworth active low-pass filter is composed of two cascaded operational amplifiers with a Sallen-Key topology. The pole locations are determined by a resistor and capacitor network to ensure the maximum flat amplitude response characteristics within the passband. The gain-bandwidth product of the operational amplifiers is selected according to a preset value to ensure phase linearity within the passband.

[0040] Attenuation processing is performed on switching ripple interference and electromagnetic compatibility noise above the cutoff frequency, with a suppression ratio of 80dB per decade; effective signal components in the 10Hz to 500Hz frequency band are retained, and DC bias drift and high-frequency quantization noise are eliminated.

[0041] The filtered signal is output as the band-limited analog current signal. The band-limited analog current signal contains only the effective frequency band components that characterize the transient current response to sudden changes in illumination, and its phase linearity meets the time-frequency positioning requirements of the subsequent short-time Fourier transform processing.

[0042] S1.4: A synchronous sample-and-hold circuit is used in conjunction with a 16-bit high-speed analog-to-digital converter to perform discretization and quantization operations on the band-limited analog current signal. The analog quantity in the continuous time domain is converted into a digital current sequence in the discrete time domain at a sampling frequency of not less than 10 kHz, generating the original digital current data packet. Receive the band-limited analog current signal; configure the trigger logic of the synchronous sample-and-hold circuit to synchronize the trigger logic with the PWM carrier signal on the DC side of the photovoltaic array, so that the sampling time avoids the transient interval of the switching action, and is synchronized with the internal timer to ensure the uniformity of the sampling period.

[0043] At the instant the sampling window opens, the synchronous sample-and-hold circuit captures the instantaneous voltage amplitude of the band-limited analog current signal and holds the amplitude until the analog-to-digital conversion ends, so as to avoid aperture error caused by dynamic changes in the signal.

[0044] The 16-bit high-speed analog-to-digital converter is activated to perform successive approximation or pipelined quantization operations, mapping the held analog voltage value to a 16-bit binary digital code. The 16-bit resolution provides 65,536 quantization levels, ensuring that microampere-level current fluctuations are not overwhelmed by quantization noise.

[0045] The sampling clock frequency of the 16-bit high-speed analog-to-digital converter is set. The sampling clock frequency is predetermined based on the upper limit frequency of the effective signal band and the conversion rate of the 16-bit high-speed analog-to-digital converter, and is set to be no less than 10 kHz.

[0046] The quantized discrete digital codes are packaged according to time sequence and timestamps are added to form the original digital current data packet.

[0047] S1.5: Perform transmission and queuing organization processing on the original digital current data packet, construct a current transient waveform data queue in time order, generate the current transient waveform data, and use the current transient waveform data as the input object for subsequent short-time Fourier transform processing. The system receives the raw digital current data packet; it then moves the raw digital current data packet to the data buffer via the direct memory access channel of the embedded microcontroller, enabling data acquisition and subsequent processing to be performed in parallel.

[0048] The original digital current data packets in the data buffer are sorted and spliced ​​according to the timestamps, and the continuity of the timestamps is verified. Missing data packets caused by transmission interruption are removed, and the current transient waveform data queue is constructed in chronological order.

[0049] The current transient waveform data queue is output as the current transient waveform data. The current transient waveform data retains the current transient trajectory at the moment of sudden change in illumination, which can be read by subsequent short-time Fourier transform processing.

[0050] Step S2: Perform short-time Fourier transform processing on the transient current waveform data to generate a spectral response fingerprint containing energy distribution information of a preset frequency band. Specifically, this includes: S2.1: Perform Hamming window function windowing truncation processing on the current transient waveform data to generate a time-domain segmented current signal sequence with smooth spectral leakage characteristics. The system receives the transient current waveform data generated in the preceding steps. The transient current waveform data is stored in the data buffer of the embedded microcontroller in the form of a discrete time series and serves as the input object for frequency domain analysis.

[0051] Based on the assumption of local stationarity of the signal by the short-time Fourier transform, the length of the sliding time window is set to N points, with N corresponding to a time span of 20 milliseconds, in order to capture the transient characteristics at the beginning of the illumination change and maintain frequency resolution.

[0052] Construct the sequence of Hamming window function coefficients, and calculate the window coefficient corresponding to the nth sampling point according to the following formula: in, For the first The Hamming window function coefficients corresponding to each sampling point; This is the sampling point index, with a value range from 0 to N. 1; The length of the sliding time window.

[0053] The transient current waveform data is multiplied point by point with the Hamming window function coefficient sequence to suppress spectral leakage caused by non-periodic truncation at both ends of the signal, thereby generating the windowed time-domain segmented current signal sequence.

[0054] Boundary checks and zero-padding are performed on the time-domain segmented current signal sequence. If the current data length is less than N points, zeros are added to the end to make the sequence length of each data segment consistent.

[0055] S2.2: Perform a discrete Fourier transform operation based on the time-domain segmented current signal sequence to generate an original complex spectrum data set containing amplitude and phase information across the entire frequency band. The original complex spectrum data set completely preserves the frequency domain response details at the instant of sudden change in illumination.

[0056] The time-domain segmented current signal sequence is received, and the length of the time-domain segmented current signal sequence is aligned to an integer power of 2 as input data for the discrete Fourier transform.

[0057] The fundamental frequency resolution is determined based on the sampling frequency and the number of data points. Orthogonal basis vectors of sine and cosine are constructed for frequency domain mapping.

[0058] Perform point-by-point complex multiplication on the segmented current signal sequence in the time domain, and use a butterfly arithmetic structure to decompose the discrete Fourier transform of the long sequence into a combination of short sequence transforms. Calculate the complex spectral components at each frequency point according to the following formula: in, For the first Complex spectral values ​​at each frequency point; For the first The time-domain current amplitude of each sampling point is taken from the time-domain segmented current signal sequence; The number of sampling points is equal to the length of the sliding time window; This is a frequency point index, with values ​​ranging from 0 to N. 1; It is the imaginary unit.

[0059] The real and imaginary parts of the complex spectral components are separated. The real part represents the projection correlation of the signal with the cosine basis, and the imaginary part represents the projection correlation of the signal with the sine basis. Together, they constitute the frequency domain phase information.

[0060] Traverse the indexes of each frequency point, retain the complex spectral components of each frequency point from the DC component to the Nyquist frequency, and form the original complex spectral data set.

[0061] S2.3: Perform modulus square calculation and logarithmic transformation on the original complex spectrum data set to generate a power spectral density distribution vector characterizing the energy intensity of each frequency component. Receive the original complex spectrum data set, perform conjugate multiplication on the complex spectrum components at each frequency point, and calculate the power spectral density value at the k-th frequency point according to the following formula: in, For the first Power spectral density values ​​at each frequency point; For the first The complex spectral components at each frequency point are taken from the original complex spectral data set; and These are the real and imaginary parts of the complex spectral components, respectively. For frequency point index.

[0062] The power spectral density values ​​at each frequency point are arranged in order of frequency index to construct the power spectral density distribution vector.

[0063] S2.4: Perform frequency band truncation processing on the power spectral density distribution vector using a preset 10Hz to 500Hz bandpass filter mask to generate an effective frequency band energy spectrum map that only contains the energy distribution information of the target sensitive frequency band. Receive the power spectral density distribution vector, construct the 10Hz to 500Hz bandpass filter mask, wherein the 10Hz to 500Hz bandpass filter mask has a value of 1 in the target frequency band index interval and a value of 0 in the non-target frequency band index interval; calculate the effective frequency band energy spectrum according to the following formula: in, The effective frequency band energy spectrum; The power spectral density distribution vector; This refers to the 10Hz to 500Hz bandpass filter mask; This is an element-wise multiplication operation.

[0064] After the element-by-element multiplication operation, the low-frequency drift noise component below 10Hz and the high-frequency quantization noise component above 500Hz are set to zero, retaining the energy distribution data in the frequency band from 10Hz to 500Hz.

[0065] The extracted energy distribution data is output as the effective frequency band energy spectrum, which only contains energy distribution information within the target sensitive frequency band.

[0066] S2.5: Perform normalized vector mapping processing based on the effective frequency band energy spectrum to generate a standardized real-time spectral response fingerprint. The standardized real-time spectral response fingerprint is used to match the nonlinear mapping relationship stored in the offline mapping sample library. The effective frequency band energy spectrum is received, which includes the power spectral density values ​​of each discrete frequency point in the frequency band from 10 Hz to 500 Hz; the vector magnitude is calculated for the power spectral density values ​​of each frequency point in the effective frequency band energy spectrum to obtain the total energy scalar of the spectral response signal in the current sampling window, which is used as a normalized reference value.

[0067] Based on the normalized reference value, a division operation is performed on the power spectral density value at each frequency point in the effective frequency band energy spectrum to generate a dimensionless relative energy distribution vector, thereby eliminating amplitude fluctuations caused by differences in absolute illumination intensity.

[0068] The relative energy distribution vector is normalized using the L2 norm so that its Euclidean norm is equal to 1, thereby generating a normalized sequence of characteristic values.

[0069] The standardized feature numerical sequence is subjected to logarithmic transformation to convert the linear power value into a decibel scale and compress the dynamic range to highlight the weak illumination perturbation features. The logarithmically transformed numerical sequence is reorganized into a one-dimensional fixed-length feature tensor to generate the standardized real-time spectral response fingerprint. The standardized real-time spectral response fingerprint only reflects the spectral morphology features and is not sensitive to illumination intensity, and is used by the edge inference unit to match the offline mapping sample library.

[0070] For example, the effective frequency band energy spectrum contains 10 frequency points, and the sum of the power spectral density values ​​of each frequency point is 2.5 A² / Hz. The relative energy distribution vector is obtained by the division operation. The L2 norm of the relative energy distribution vector is 0.35. After the L2 norm normalization process, a 10-dimensional normalized real-time spectral response fingerprint is generated.

[0071] like Figure 2 As shown, step S3: Based on the typical spectral response fingerprints and their corresponding optimal charge / discharge mode labels collected from the controlled illumination perturbation experiment, an offline mapping sample library is constructed. Specifically, this includes: S3.1: Based on a programmable LED array light source, a controlled illumination perturbation experiment is performed. Step, ramp, and pulse illumination change excitations are applied to the photovoltaic array to construct a simulated illumination change environment that includes cloud passing conditions and tree shadow swaying conditions, and an illumination perturbation test sequence with condition labels is obtained.

[0072] A multi-channel programmable LED array light source is configured as the excitation source. The light intensity adjustment range of the programmable LED array light source covers 100W / m² to 1000W / m², and the light source response time is in the microsecond range.

[0073] The illumination excitation waveform parameters are defined by the host computer control software. These parameters include the amplitude and duration of the step change, the slope of the ramp change, and the frequency and duty cycle of the pulse change. A standard test case set covering typical meteorological conditions is constructed.

[0074] The photovoltaic array is placed within the uniform illumination area of ​​the programmable LED array light source, so that the light spot covers the component surface of the photovoltaic array.

[0075] The reference irradiance meter is connected to monitor the actual incident light intensity in real time, and the monitored light intensity is used as the reference true value of the light disturbance intensity. Based on the reference true value and the target light intensity value set in the standard test case set, deviation comparison processing is performed, and light disturbance segments whose excitation output deviation exceeds the preset allowable range are marked. The reference irradiance meter is only used for the reference calibration of the controlled light disturbance experiment and does not participate in the field operation.

[0076] According to the standard test case set, excitation commands are sent to the LED driver controller in sequence to respectively stimulate step-type light change to simulate cloud cover and removal, slope-type light change to simulate linear change of sunlight intensity, and pulse-type light fluctuation to simulate leaf swaying.

[0077] Simultaneously, light intensity time series data and corresponding timestamps are recorded each time light excitation is applied, and working condition labels are added to each segment of the light change process to form a raw dataset of light perturbation with time series markers and working condition labels.

[0078] The original dataset of illumination disturbances is cleaned and segmented to remove abnormal data segments caused by unstable equipment startup, ambient background light interference, and excitation output deviations exceeding the preset allowable range. Standard illumination disturbance segments with complete rising edges, falling edges, and steady-state intervals are retained to obtain the illumination disturbance test sequence with operating condition labels.

[0079] S3.2: The transient current waveform data under the illumination disturbance test sequence is synchronously acquired using a high-bandwidth current sensing circuit, and the transient current waveform data is processed by short-time Fourier transform to extract the energy distribution information in the frequency band from 10Hz to 500Hz and generate a standardized spectral response fingerprint.

[0080] The system receives the illumination disturbance test sequence and synchronously triggers the data acquisition of the high-bandwidth current sensing circuit according to the operating condition label in the illumination disturbance test sequence. The high-bandwidth current sensing circuit acquires the current signal at the DC output terminal of the photovoltaic array with a 16-bit quantization precision and a sampling frequency of 10 kHz to obtain a discrete digital current sequence.

[0081] The discrete digital current sequence is subjected to timestamp alignment processing to match the corresponding illumination excitation time of each frame of current data, and the operating condition label is attached to each frame of data to generate the transient current waveform data.

[0082] The short-time Fourier transform processing is performed on the transient current waveform data. The short-time Fourier transform processing includes Hamming window function windowing truncation processing, discrete Fourier transform processing, power spectral density calculation processing, 10Hz to 500Hz frequency band truncation processing, and normalized vector mapping processing.

[0083] After the short-time Fourier transform processing, the energy distribution information of the current transient waveform data in the frequency band of 10Hz to 500Hz is extracted to generate the standardized spectral response fingerprint, which corresponds one-to-one with the operating condition label.

[0084] S3.3: Based on the principle of maximizing system efficiency, perform charge and discharge strategy action calibration and marking processing on the spectral response fingerprint. Mark the optimal action among the four types of charge and discharge strategy actions: immediate load reduction, maintenance, switching to constant current charging, and starting pre-compensation. Generate the optimal charge and discharge mode label bound to each spectral response fingerprint.

[0085] The standardized spectral response fingerprint and its corresponding operating condition label are received; the standardized spectral response fingerprint characterizes the frequency domain energy distribution characteristics of the photovoltaic array under the corresponding illumination disturbance operating condition.

[0086] Based on the principle of maximizing system efficiency, a multi-objective evaluation function is constructed, which includes conversion efficiency, battery health status, and bus voltage stability, to evaluate the merits of each charging and discharging strategy. The evaluation weights of each evaluation index in the multi-objective evaluation function are pre-set according to the degree of influence of each evaluation index on system efficiency.

[0087] For each set of standardized spectral response fingerprints, the system transient response under four types of charge and discharge strategies—immediate load reduction, maintenance, switching to constant current charging, and initiating pre-compensation—is simulated in parallel. The total energy captured and the ratio of energy loss for each charge and discharge strategy within a preset time window are calculated.

[0088] Combining the range constraints of the battery state of charge, the action with the highest comprehensive score is selected from the four types of charging and discharging strategy actions and marked as the optimal charging and discharging mode label; the preset time window and the range constraints of the battery state of charge are determined according to the operational safety requirements of the photovoltaic energy storage system.

[0089] The marking results under extreme conditions are verified by a pre-set expert rule engine to correct marking deviations caused by local shading or temperature changes. The expert rule engine is pre-built according to the corresponding rules between extreme conditions and charging / discharging strategy actions in historical operating data.

[0090] A unique mapping relationship is established between the verified optimal charge / discharge mode label and the corresponding standardized spectral response fingerprint to form a training sample pair with the operating condition label and the optimal charge / discharge mode label, which serves as the input sample for constructing the offline mapping sample library.

[0091] S3.4: Using the spectral response fingerprint as the input key and the optimal charge / discharge mode label as the output target value, establish a nonlinear mapping relationship between the spectral response fingerprint and the optimal charge / discharge mode to generate the offline mapping sample library.

[0092] The standardized spectral response fingerprint and the corresponding optimal charge / discharge mode label are received, and a structured data mapping pair is constructed. The standardized spectral response fingerprint is defined as a high-dimensional vector in the input feature space, and the optimal charge / discharge mode label is mapped as a discrete control command code.

[0093] A mathematical model of the nonlinear mapping relationship is established, and a multidimensional tensor storage structure is used to record the correlation weights between fingerprint features and control decisions.

[0094] By calculating the cosine similarity between fingerprint vectors, the feature difference between the standardized spectral response fingerprints under different operating conditions is quantified; the probability density function of the feature distribution is fitted using the kernel density estimation method to determine the decision boundary of various charging and discharging strategies.

[0095] The parameters and policy priority rules corresponding to the decision boundary are encapsulated into a key-value pair data structure, and a consistency check is performed on the nonlinear mapping relationship to remove abnormal samples that have logical conflicts or confidence levels lower than a preset confidence threshold. The preset confidence threshold is pre-set according to the label confidence level of the training sample pairs.

[0096] The verified mapping relationships are serialized and stored in a non-volatile storage area to generate the offline mapping sample library; the offline mapping sample library uses the standardized spectral response fingerprint as the key and the optimal charge / discharge mode label and the corresponding strategy priority as the value.

[0097] like Figure 3 As shown, step S4: Train a graph neural network model using the offline mapping sample library, and quantize and compress the trained graph neural network model to obtain an edge inference unit deployed on an embedded MCU. Specifically, this includes: S4.1: Construct a graph neural network model based on the spectral response fingerprints and their corresponding optimal charge / discharge mode labels in the offline mapping sample library.

[0098] The graph neural network model includes an input node layer, a hidden feature extraction node layer, and an output decision node layer. The input node layer, the hidden feature extraction node layer, and the output decision node layer are connected in sequence to form a forward propagation link. The input node layer and the hidden feature extraction node layer, as well as the hidden feature extraction node layer and the output decision node layer, are all connected by connecting edges, and node features are passed layer by layer along the connecting edges. The standardized spectral response fingerprint data and corresponding optimal charge / discharge mode labels from the offline mapping sample library are read as the input data source for constructing the input node layer. The node dimension of the input node layer is defined based on the number of frequency points in the spectral response fingerprint. The energy value corresponding to each frequency point is mapped to an input node in the input node layer, ensuring a one-to-one correspondence between the node features of the input node layer and the frequency domain components of the spectral response fingerprint.

[0099] Based on the frequency domain correlation between each frequency point in the spectral response fingerprint, the adjacency relationship is established for each input node in the input node layer. The connection edge is constructed between the input node layer and the hidden layer feature extraction node layer using a fully connected connection method or a sparse connection method. The edge weight of each connection edge is determined according to the adjacency relationship. The edge weight is initialized to a random value that conforms to a Gaussian distribution to break the symmetry between nodes.

[0100] The hidden layer feature extraction node layer performs neighborhood aggregation processing on the node features of each input node based on the adjacency relationship, and extracts the nonlinear coupling correlation features between energy distributions in different frequency bands.

[0101] The output decision node layer contains four neurons, which correspond to four types of charging and discharging strategy actions: immediate load reduction, maintenance, switching to constant current charging, and initiating pre-compensation. The high-dimensional features output by the hidden layer feature extraction node layer are mapped to a normalized probability distribution through the Softmax activation function.

[0102] Define the node state update rules for the graph neural network model during the forward propagation process, introduce a graph convolution operator to perform aggregation processing on the node features of the neighboring nodes of each node, and calculate the hidden state of the i-th node in the l-th layer according to the following formula: in, For the first Layer The hidden state of each node; It is a non-linear activation function; For nodes With nodes The adjacency matrix elements corresponding to the adjacency relationships between them; For the first The learnable weight matrix of the layer, whose transpose acts on the first layer. The hidden state of the layer; For the first Layer The hidden state of each node; For the first Layer bias terms; For nodes The set of neighboring nodes; This is the layer index for the node layer.

[0103] Initialize the training hyperparameters of the graph neural network model, including the learning rate decay strategy and batch size, to obtain the basic computational architecture of the graph neural network model.

[0104] S4.2: Using the graph neural network model, perform forward propagation calculation and backward error iterative training on the offline mapping sample library. By minimizing the loss function between the predicted policy action probability and the optimal charging / discharging mode label, update the weight parameters and node bias of each connection edge in the graph neural network model until convergence, and obtain the initial training model.

[0105] The standardized spectral response fingerprint data and corresponding optimal charge / discharge mode labels from the offline mapping sample library are used to construct a training sample pair set. Zero-mean normalization is performed on the spectral response fingerprints in the training sample pair set, and the global mean obtained from the offline mapping sample library is subtracted and divided by the corresponding standard deviation. The processed training sample pair set is divided into multiple batches according to the batch size, and the edge weights of each connection edge and the bias of each node in the graph neural network model are initialized.

[0106] The spectral response fingerprint of the current batch is input into the input node layer, and forward propagation calculation is performed according to the node state update rule. The hidden layer feature extraction node layer performs neighborhood aggregation and nonlinear transformation processing on the node features of each input node to generate hidden layer feature representation.

[0107] The hidden layer feature representation is passed to the output decision node layer to calculate the original score values ​​of the four types of charging and discharging strategy actions, and then normalized into a probability distribution vector by the Softmax activation function.

[0108] Based on the probability distribution vector and the optimal charging / discharging mode label, the training loss value of the graph neural network model is calculated using the cross-entropy loss formula; the cross-entropy loss formula is specifically as follows: in, This represents the training loss value of the graph neural network model. The number of samples in the current batch is determined by the batch size; This represents the number of categories of charging / discharging strategy actions, with a value of 4. The first in the current batch The sample belongs to the first The actual label value of the class is obtained by encoding the optimal charge / discharge mode label; The graph neural network model predicts that the b-th sample belongs to the first... The probability value of a class is provided by the probability distribution vector output by the Softmax activation function; For sample indexes within a batch; Index for strategy action categories.

[0109] Backpropagation is performed on the training loss value based on the chain rule to calculate the gradient of the training loss value with respect to each edge weight and each bias, and the edge weight and the bias are updated according to the gradient.

[0110] The forward propagation calculation and the back propagation calculation are executed iteratively, and the learning rate is adjusted according to the learning rate decay strategy until the training loss value converges to the preset loss threshold or reaches the preset maximum training rounds, thus obtaining the initial training model.

[0111] S4.3: Perform floating-point to fixed-point quantization compression on the initial training model, mapping the floating-point weight parameters and node biases in the initial training model to low-bit-width integer values, and combine pruning to remove redundant connection edges and insensitive nodes in the initial training model to generate a quantized compressed model.

[0112] The initial training model obtained from the previous step is received, and the floating-point edge weights of each connection edge and the bias of each node in the initial training model are extracted as input objects for quantization and compression processing.

[0113] Sensitivity analysis is performed on the edge weights of each connection edge in the initial training model. Based on the offline mapping sample library, the contribution of each edge weight to the gradient of the training loss value is calculated, and a weight importance score vector is generated to identify redundant connection edges and insensitive nodes.

[0114] Based on a preset pruning threshold, the weights of connections with importance scores lower than the preset pruning threshold are reset to zero, and the corresponding nodes are removed to reconstruct the sparse topology of the graph neural network model; the preset pruning threshold is preset according to the balance requirements between the number of parameters and inference accuracy of the quantization compression model.

[0115] Statistical distribution analysis is performed on the remaining weight parameters after pruning to determine the dynamic quantization range of the remaining weight parameters, and the 32-bit floating-point value is mapped to an 8-bit integer value based on the asymmetric linear quantization method.

[0116] Based on the dynamic quantization range, the scaling factor is calculated using the scaling factor calculation formula; the scaling factor calculation formula is specifically as follows: in, This is the scaling factor; This represents the maximum value of the remaining weight parameters after pruning. This represents the minimum value of the remaining weight parameters after pruning. The quantization level for an 8-bit integer value.

[0117] The zero-point offset is calculated based on the minimum value of the scaling factor and the remaining weight parameter, using the zero-point offset calculation formula. The specific zero-point offset calculation formula is as follows: in, This is the zero-point offset; The minimum value of the remaining weight parameters after pruning, and the value in the scaling factor calculation formula. For the same parameter; The scaling factor; This is the rounding operation.

[0118] Using the scaling factor and the zero-point offset, a fixed-point transformation is performed on the remaining weight parameters after pruning and the offset to generate a low-bit-width integer weight matrix.

[0119] The quantization compression model is deployed in an embedded MCU simulation environment. The spectral response fingerprint used for testing is input into the quantization compression model to verify the inference accuracy loss of the quantization compression model. When the inference accuracy loss is lower than a preset accuracy loss threshold, the quantization compression model is determined to meet the deployment requirements of the embedded MCU. The preset accuracy loss threshold is preset according to the accuracy requirements of the policy action classification.

[0120] S4.4: Compile and burn the quantization compression model into the firmware storage area of ​​the embedded MCU to instantiate the edge inference unit and configure the runtime environment of the edge inference unit.

[0121] The quantization compression model is received and converted into a model binary file, which contains integer weight parameters, bias values, and network topology definitions.

[0122] The integer weight parameters and biases in the model binary file are stored in the non-volatile storage area of ​​the embedded MCU, and the intermediate variables of the inference process are stored in the random access storage area of ​​the embedded MCU to adapt to the storage resources of the embedded MCU.

[0123] The model binary file is compiled and burned into the firmware storage area of ​​the embedded MCU, and then the edge inference unit is instantiated after running.

[0124] Configure the runtime environment of the edge inference unit: The timer of the embedded MCU generates a hardware interrupt signal with a preset sampling period, and establishes a trigger connection between the hardware interrupt signal and the inference task of the edge inference unit, so that the edge inference unit automatically wakes up and performs inference calculations according to the preset sampling period; the preset sampling period is 5 milliseconds.

[0125] The edge inference unit is configured with a dual buffer and a direct memory access channel. After the direct memory access channel completes the writing of the current frame spectral response fingerprint data, it switches the buffer pointer so that the edge inference unit can read the previous frame data for inference calculation, thereby realizing the parallel execution of data acquisition and inference calculation.

[0126] The inference time verification is performed on the instantiated edge inference unit. The spectral response fingerprint for testing is input into the edge inference unit to measure the time of a single inference. When the time of a single inference is lower than a preset inference time threshold, the edge inference unit is determined to be deployed successfully. The preset inference time threshold is determined according to the preset sampling period.

[0127] Step S5: Input the real-time spectral response fingerprint into the edge inference unit for inference calculation, and output the policy action probability and priority ranking result under the current working condition. Specifically, this includes: S5.1: Input the real-time spectral response fingerprint into the edge inference unit, load the real-time spectral response fingerprint into the edge inference unit based on the memory mapping mechanism of the embedded MCU, and perform fixed-point format conversion and input normalization processing according to the quantization parameters of the quantization compression model to generate a normalized input tensor.

[0128] The system receives the real-time generated spectral response fingerprint, which is a frequency domain feature vector containing energy distribution information in the 10Hz to 500Hz frequency band. Based on the memory management unit of the embedded MCU, the system allocates an input tensor storage area for the spectral response fingerprint, and establishes a mapping relationship between the input tensor storage area and the direct memory access channel.

[0129] Zero-mean normalization is performed on the spectral response fingerprint, subtracting the global mean obtained from the offline mapping sample library and dividing by the corresponding standard deviation; then, according to the input scaling factor and input zero offset obtained from the calibration spectral response fingerprint samples, the normalized floating-point value is converted into an 8-bit integer value to match the input data type of the graph neural network model.

[0130] The converted fixed-point values ​​are transferred to the input tensor storage area through the direct memory access channel, so that the data transfer and the computation processing of the embedded MCU are executed in parallel.

[0131] Based on the node dimension of the input node layer, the transported fixed-point values ​​are organized into node feature vectors corresponding to each input node, so that the energy value corresponding to each frequency point is mapped to an input node, thereby generating the standardized input tensor.

[0132] The global mean and standard deviation are statistically obtained from the offline mapping sample library during the model training phase and remain consistent during the inference phase, so that the numerical distribution of the standardized input tensor is consistent with the input distribution during the training of the graph neural network model.

[0133] S5.2: Perform multi-layer graph convolution and neighborhood aggregation on the standardized input tensor to extract the nonlinear coupling correlation features between energy distributions of different frequency bands in the standardized input tensor and generate hidden layer feature representations.

[0134] The normalized input tensor, which contains preprocessed spectral response fingerprint frequency domain feature data, is received and used as the initial node state during inference of the graph neural network model.

[0135] Based on the node dimension of the input node layer and the adjacency relationship, a node feature matrix and an adjacency matrix are constructed, and the adjacency matrix represents the coupling relationship between energy distributions in different frequency bands.

[0136] Perform the first layer graph convolution operation, and according to the node state update rule, use the learnable weight matrix to perform weighted aggregation on the node features of the current node and its first-order neighbor nodes, extract local spectral texture features, and generate the first layer hidden state.

[0137] A nonlinear transformation is performed on the first layer of hidden states to enhance the graph neural network model's ability to fit nonlinear responses caused by sudden changes in illumination.

[0138] The second layer of graph convolution operation is performed to expand the receptive field according to the node state update rule to capture global spectral dependencies. High-frequency transient fluctuation information and low-frequency steady-state trend information are fused to generate the hidden layer feature representation.

[0139] Normalization is performed on the hidden layer feature representation to keep the data distribution of the intermediate layers of the graph neural network model stable.

[0140] S5.3: The output decision node layer built into the edge inference unit performs linear mapping and Softmax normalization calculation on the hidden layer feature representation to generate the original probability distribution vectors of the four types of policy actions.

[0141] The hidden layer feature representation is received, and the weight matrix of the output decision node layer is invoked to perform a linear transformation operation on the hidden layer feature representation, mapping the high-dimensional features to a low-dimensional space containing four discrete control actions.

[0142] In the linear transformation operation, the bias vector of the output decision node layer is introduced to generate the original score vectors of the four types of charging and discharging strategy actions. Each value in the original score vector represents the relative confidence of the corresponding charging and discharging strategy action.

[0143] The original score vector is subjected to Softmax normalization to obtain the original probability distribution vector; the Softmax normalization calculation specifically involves: in, For the first The output probability of a charge / discharge strategy action; For the first The original score of the charge / discharge strategy action in the original score vector; For the first The original score of the charge / discharge strategy action in the original score vector; and A category index for charging and discharging strategy actions; This represents the number of categories of charging / discharging strategy actions, with a value of 4. It is a natural constant.

[0144] After the Softmax normalization calculation, the sum of all probability values ​​in the original probability distribution vector is 1, and each probability value corresponds to one of the four types of charging and discharging strategy actions: immediate load reduction, maintenance, switching to constant current charging, and initiating pre-compensation.

[0145] S5.4: Based on the preset action priority adjudication logic and preset probability threshold, perform descending sorting and threshold filtering on each probability value in the original probability distribution vector to generate the strategy action probability and priority ranking result.

[0146] The original probability distribution vector is received, and the four types of charging and discharging strategy actions—immediate load reduction, maintenance, switching to constant current charging, and initiating pre-compensation—are sorted in descending order according to the magnitude of each probability value to generate an ordered strategy queue.

[0147] Each probability value in the ordered policy queue is compared with the preset probability threshold, and charging / discharging policy actions with probability values ​​lower than the preset probability threshold are eliminated; the preset probability threshold is determined based on the confidence level distribution of the optimal charging / discharging mode labels under various working conditions in the offline mapping sample library.

[0148] The filtered and retained charging and discharging strategy actions and their probability values ​​are arranged in order of priority to generate the probability and priority ranking results of the strategy actions; the charging and discharging strategy action ranked first in the probability and priority ranking results is used as the charging and discharging strategy action to be executed in this simulation cycle.

[0149] Step S6: Generate a PWM control signal based on the probability and priority ranking of the strategy actions. The IGBT driver chip adjusts the output PWM duty cycle or switches the control mode to execute immediate load reduction, maintenance, constant current charging, or pre-compensation charging / discharging strategy actions. Specifically, this includes: S6.1: Obtain the probability and priority ranking results of the strategy action, perform table lookup processing based on the pulse width modulation mapping table, and generate a target PWM duty cycle reference value or a target control mode switching instruction. The target PWM duty cycle reference value or the target control mode switching instruction is used as the initial adjustment parameter of the power converter. The probability and priority ranking results of the strategy actions are received. The probability and priority ranking results of the strategy actions include the probability values ​​and ranking indexes of four types of charging and discharging strategy actions: immediate load reduction, maintenance, switching to constant current charging, and starting pre-compensation.

[0150] The sorted index is parsed, and the charging / discharging strategy action with the highest probability value is extracted as the primary key value for table lookup.

[0151] The pre-stored pulse width modulation mapping table is retrieved based on the primary key value. The pulse width modulation mapping table records the correspondence between each charge and discharge strategy action identifier and PWM reference parameters, and is pre-established according to the slope characteristics of each charge and discharge strategy action on the maximum power point tracking curve of the photovoltaic array.

[0152] If the charging / discharging strategy with the highest probability value is to immediately reduce load or switch to constant current charging, then the corresponding target duty cycle correction coefficient is read from the pulse width modulation mapping table; if the charging / discharging strategy with the highest probability value is to start pre-compensation, then the voltage feedforward compensation amount and the current ramp rise rate limit value are read from the pulse width modulation mapping table; if the charging / discharging strategy with the highest probability value is to maintain, then the zero correction instruction is read and the PWM duty cycle of the previous control cycle is kept unchanged.

[0153] The real-time feedback value of the DC bus voltage is collected. If the charging / discharging strategy with the highest probability value is to immediately reduce load or switch to constant current charging, the target duty cycle correction coefficient and the real-time feedback value of the DC bus voltage are linearly superimposed to generate the target PWM duty cycle reference value. The linear superposition operation is specifically as follows: in, The target PWM duty cycle reference value; The PWM duty cycle reference value is the value of the previous control cycle; K is the target duty cycle correction coefficient, which is provided by the pulse width modulation mapping table. This is the rated reference value of the DC bus voltage; This is the real-time feedback value of the DC bus voltage. If the charging / discharging strategy with the highest probability value is to initiate pre-compensation, the voltage feedforward compensation amount is superimposed on the target PWM duty cycle reference value, and the current ramp-up rate limit value is used to limit the inductor current ramp-up rate during the pre-compensation phase.

[0154] If the table lookup process generates the target control mode switching instruction, a state machine transition signal is generated, triggering the control logic of the power converter to perform state transition and lock the new control loop parameters, thereby generating the target control mode switching instruction.

[0155] S6.2: Receive the target PWM duty cycle reference value or the target control mode switching command, perform dead time insertion processing and timing safety verification processing on the target PWM duty cycle reference value or the target control mode switching command, and generate a safety drive pulse sequence containing anti-shoot-through protection logic. The target PWM duty cycle reference value or the target control mode switching command is received as input parameters for dead time insertion processing.

[0156] The minimum safe dead time corresponding to the current power converter topology is read. The minimum safe dead time is determined based on the difference between the turn-off delay time and the turn-on delay time of the IGBT power switch.

[0157] Boundary constraint verification is performed on the target PWM duty cycle reference value to determine whether the target PWM duty cycle reference value exceeds the maximum allowable duty cycle range. If it does, the target PWM duty cycle reference value is clamped to the safe limit value.

[0158] A low-level gap with a duration equal to the minimum safe dead time is inserted between the rising and falling edges of the PWM pulse signal to isolate the drive signals of the upper and lower bridge arms in time.

[0159] The two complementary output PWM signals are subjected to bilateral edge symmetrical delay processing, so that the next stage switch is allowed to turn on only after the previous stage switch is completely turned off.

[0160] The PWM signal after the dead time insertion process is subjected to a logic interlock check to verify that the two PWM signals are not simultaneously high at the same time. If a conflict is detected, the output is pulled low and a fault interrupt is triggered to generate the safety drive pulse sequence containing anti-shoot-through protection logic.

[0161] S6.3: Input the safety drive pulse sequence into the isolated input port of the IGBT driver chip, and perform level conversion and current amplification processing on the safety drive pulse sequence based on the gate charge fast injection mechanism to generate the gate drive voltage waveform. The safety drive pulse sequence is received and input into the isolation input port of the IGBT driver chip. Electrical isolation between the control-side low-voltage circuit and the power-side high-voltage circuit is achieved through photoelectric conversion.

[0162] The isolated signal is amplified by push-pull amplification. During the rising edge of the pulse, gate charge is injected into the gate-emitter capacitance of the IGBT power switch through a low-impedance path to accelerate the establishment of the gate voltage.

[0163] During the falling edge of the pulse, the IGBT switches to a high current absorption mode to extract residual charge from the gate, causing the IGBT power switch to turn off quickly and generating the gate drive voltage waveform.

[0164] The amplitude of the gate drive voltage waveform is clamped at the +15V turn-on level. Between the 8V turn-off levels, the false turn-on caused by the Miller capacitance effect is suppressed by the negative bias voltage.

[0165] S6.4: Apply the gate drive voltage waveform to the gate of the IGBT power switch in the main circuit of the energy storage converter, perform high-frequency switching action to adjust the conduction time or reconfigure the circuit connection state, and output the corrected DC bus voltage or charging and discharging current. The gate drive voltage waveform is received and applied to the gate-emitter port of the IGBT power switch, causing the IGBT power switch to switch between the cutoff region and the saturation region.

[0166] Based on the probability and priority ranking of the aforementioned strategy actions, the switching control mode is determined by the charging / discharging strategy action ranked first: if it is to switch to constant current charging, the lower bridge arm switch of the boost circuit is controlled to perform chopping; if it is to immediately reduce load or maintain load, the upper bridge arm switch of the buck circuit is controlled to perform chopping.

[0167] The energy storage and release rhythm of the inductor is adjusted by regulating the ratio of the on-time to the off-time of the IGBT power switch. The ratio of the on-time to the off-time is determined according to the following formula: ,in The target PWM duty cycle reference value; The conduction time of the IGBT power switch; The switching cycle.

[0168] By reconstructing the circuit connection state through the high-frequency switching action, the direction and magnitude of energy flow on the DC bus side are changed, and the corrected DC bus voltage or charging and discharging current is output, so that the output power of the photovoltaic array matches the accepting capacity of the energy storage battery.

[0169] Monitor the inductor current ripple and bus voltage transient response, and fine-tune the duty cycle of the next switching cycle through a closed-loop feedback mechanism to suppress voltage overshoot or sag caused by load changes.

[0170] S6.5: Monitor the transient response trajectory of the corrected DC bus voltage or charging / discharging current, and calculate and verify the time interval from the moment of sudden change in illumination to the moment when the corrected DC bus voltage or charging / discharging current stabilizes based on the closed-loop delay statistical model, to confirm that the dynamic response time of the control loop is less than 3 milliseconds. The transient sampling sequence of the corrected DC bus voltage or charging / discharging current is collected. The sampling frequency of the transient sampling sequence is higher than the sampling frequency corresponding to the preset sampling period to meet the time resolution requirement of the dynamic response time. The timestamp of the moment when the light change is triggered is read simultaneously to construct a multi-dimensional state monitoring dataset containing voltage fluctuation trajectory, current response curve and time reference.

[0171] A sliding window variance analysis is performed on the multidimensional state monitoring dataset to calculate the standard deviation of voltage and current over the most recent 10 sampling periods, and the standard deviation is compared with a convergence threshold. The convergence threshold is set to 0.5% of the rated value, and the 10 sampling periods are determined based on the sampling frequency of the transient sampling sequence.

[0172] Based on the closed-loop delay statistical model, the dynamic response time is calculated according to the following formula: ,in, The dynamic response time; The moment when the standard deviation of the voltage and current first falls below the convergence threshold; The trigger time for the sudden change in illumination is provided by the timestamp.

[0173] The dynamic response time is compared with a 3-millisecond threshold: if the dynamic response time is less than 3 milliseconds, a dynamic response compliance flag is generated; if the dynamic response time is greater than or equal to 3 milliseconds, an abnormal delay flag is generated, and the current spectral response fingerprint is recorded for subsequent updates of the offline mapping sample library.

[0174] Step S7: Monitor the system stability after executing the charge / discharge strategy. If temperature drift or component aging-induced feature deviation is detected, update the offline mapping sample library based on the new spectral response fingerprint. Specifically, this includes: S7.1: Obtain system stability state data and new real-time spectral response fingerprint after executing the charging and discharging strategy. The system stability state data includes voltage fluctuation rate and temperature change rate. The instantaneous DC bus voltage sequence and the photovoltaic module temperature reading are simultaneously acquired through the voltage sampling channel of the embedded MCU and the component temperature sampling channel of the photovoltaic energy storage system.

[0175] The voltage fluctuation rate is generated by performing a sliding window standard deviation calculation on the instantaneous DC bus voltage value sequence; the sliding window standard deviation calculation is specifically as follows: in, The voltage fluctuation rate; The number of voltage sampling points within the sliding window; For the first in the sliding window The voltage values ​​at each sampling point are taken from the instantaneous value sequence of the DC bus voltage; The average voltage value within the sliding window.

[0176] Perform a first-order difference operation on the temperature reading to calculate the slope of the temperature change per unit time, and generate the temperature change rate.

[0177] The high-bandwidth current sensing circuit is activated to collect transient current waveform data at the DC-side output of the photovoltaic array under the current operating conditions, and the timestamp of the transient current waveform data is aligned with the timestamp of the system stability state data.

[0178] The short-time Fourier transform processing is performed on the transient current waveform data to extract the energy distribution information in the frequency band from 10Hz to 500Hz, and the new real-time spectral response fingerprint is generated.

[0179] The voltage fluctuation rate, the temperature change rate, and the new real-time spectral response fingerprint are combined to generate a multidimensional state dataset.

[0180] S7.2: Perform multidimensional deviation calculation processing on the system stability state data and the new real-time spectral response fingerprint to generate a net feature deviation index. The net feature deviation index quantifies the distribution difference between the new real-time spectral response fingerprint and the benchmark spectral response fingerprint in the offline mapping sample library. The temperature change rate is extracted from the system stability state data for subsequent temperature compensation; frequency domain energy distribution analysis is performed on the new real-time spectral response fingerprint to calculate the spectral centroid and spectral entropy of the new real-time spectral response fingerprint in the frequency band from 10 Hz to 500 Hz.

[0181] The reference spectral response fingerprint under standard operating conditions is retrieved from the offline mapping sample library, and the reference spectral centroid and reference spectral entropy of the reference spectral response fingerprint are calculated as a reference benchmark for deviation measurement.

[0182] The feature deviation of the new real-time spectral response fingerprint relative to the reference spectral response fingerprint is calculated using the following formula: in, The deviation of the feature; and These are the spectral centroid and spectral entropy of the new real-time spectral response fingerprint, respectively. and These are the reference spectral centroid and reference spectral entropy of the reference spectral response fingerprint, respectively.

[0183] A temperature compensation coefficient is determined based on the temperature change rate, and a weighted correction is performed on the characteristic deviation to generate the net characteristic deviation index; the temperature compensation coefficient is pre-calibrated according to the correlation between the temperature change rate and the characteristic deviation.

[0184] S7.3: Compare the net feature deviation index with the dynamic judgment threshold. If the net feature deviation index is greater than the dynamic judgment threshold, trigger the sample library update instruction. The sample library update instruction serves as a control signal to start the offline mapping sample library update process. Based on the cumulative operating time of the photovoltaic energy storage system and the fluctuation standard deviation of the recent new real-time spectral response fingerprint, the dynamic judgment threshold is calculated according to the following formula: in, The dynamic determination threshold; The basic static threshold is preset according to the deviation distribution of the benchmark spectral response fingerprint in the offline mapping sample library; The environmental sensitivity coefficient is pre-calibrated based on the correspondence between historical temperature drift rate and deviation. This represents the standard deviation of the fluctuation of the newly described real-time spectral response fingerprint. This refers to the cumulative operating time of the photovoltaic energy storage system. The normalized time constant is preset according to the designed operating life of the photovoltaic energy storage system.

[0185] The net feature deviation index is compared with the dynamic judgment threshold: if the net feature deviation index is less than or equal to the dynamic judgment threshold, the system is determined to be within the normal aging or slight temperature drift range, and the offline mapping sample library is maintained unchanged.

[0186] If the net feature deviation index is greater than the dynamic judgment threshold, it is determined that there is an abnormal deviation caused by temperature drift or component aging, triggering the sample library update instruction.

[0187] The triggered sample library update command is subjected to de-jitter processing. If the net feature deviation index is greater than the dynamic judgment threshold in multiple consecutive sampling periods, the sample library update command is confirmed to be validly triggered.

[0188] Generate the sample library update instruction, which includes a timestamp, deviation type identifier, and confidence level.

[0189] S7.4: Use the sample library update command to retrieve the new real-time spectral response fingerprint, perform incremental learning processing to fuse the data of the offline mapping sample library, and generate an updated offline mapping sample library. In response to the sample library update command, the new real-time spectral response fingerprint that triggers the deviation determination is extracted from the data buffer.

[0190] Based on the timestamp, retrieve the stability status log during the execution of the charging and discharging strategy, extract the voltage fluctuation rate, the temperature change rate, and the actual energy conversion efficiency index, and construct a multi-dimensional operating environment context.

[0191] Calculate the Mahalanobis distance between the new real-time spectral response fingerprint and the center of the same type of working condition cluster in the offline mapping sample library, quantify the distribution offset in the feature space, and generate the distance attenuation coefficient.

[0192] Incremental K-means clustering is used to map the new real-time spectral response fingerprint to the nearest operating condition cluster: if the Euclidean distance between the new real-time spectral response fingerprint and the center of the operating condition cluster is less than a preset convergence threshold, the center vector and covariance matrix of the operating condition cluster are updated; if the Euclidean distance is greater than or equal to the preset convergence threshold, a new independent operating condition cluster is created and an operating condition cluster identifier is assigned; the preset convergence threshold is preset according to the distribution density of operating condition clusters in the offline mapping sample library.

[0193] Combining the distance attenuation coefficient and the actual energy conversion efficiency index, a sliding window weighted average process is used to correct the probability distribution of the optimal charging and discharging mode label within the corresponding operating condition cluster, thereby increasing the weight of charging and discharging strategy actions with high energy conversion efficiency; the charging and discharging strategy action with the highest probability distribution after correction is determined as the updated optimal charging and discharging mode label for the corresponding operating condition cluster.

[0194] The corrected operating condition clusters and their optimal charge / discharge mode label probability distributions are written back to the offline mapping sample library to generate the updated offline mapping sample library.

[0195] S7.5: Based on the updated offline mapping sample library, perform fine-tuning retraining on the edge inference unit deployed in the embedded MCU to generate an optimized edge inference unit. The standardized spectral response fingerprints and their corresponding updated optimal charge / discharge mode labels in the updated offline mapping sample library are used as fine-tuning training samples to construct fine-tuning training batches.

[0196] Using the current model parameters of the edge inference unit as initial values, the connection edge weight parameters and the bias of each node of the graph neural network model are fine-tuned and updated according to the cross-entropy loss calculation formula and the backpropagation calculation, and the quantization compression process is performed after the fine-tuning update.

[0197] The fine-tuned, updated, and quantized compressed model parameters are burned into the firmware storage area of ​​the embedded MCU, replacing the original model parameters, and generating the optimized edge inference unit.

[0198] For those skilled in the art, various other corresponding changes and modifications can be made based on the technical solutions and concepts described above, and all such changes and modifications should fall within the protection scope of the claims of this invention.

[0199] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains. The terms “first,” “second,” “third,” and similar terms used in this patent application specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an” or “a” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising” or “including” and similar terms mean that the elements or objects preceding “comprising” or “including” encompass the elements or objects listed following “comprising” or “including” and their equivalents, and do not exclude other elements or objects. The “multiple” mentioned in the embodiments of this application refers to two or more. A and / or B indicate three possibilities: A; B; and A and B.

[0200] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for dynamically matching energy storage charging and discharging control of solar panels, characterized in that, include: Acquire transient current waveform data collected by a high-bandwidth current sensing circuit connected to the DC-side output of the photovoltaic array at the moment of sudden change in light intensity; The transient current waveform data is subjected to short-time Fourier transform processing to generate a spectral response fingerprint containing energy distribution information of a preset frequency band; An offline mapping sample library was constructed based on typical spectral response fingerprints and their corresponding optimal charge / discharge mode labels acquired from controlled illumination perturbation experiments. The graph neural network model is trained using the offline mapping sample library, and the trained graph neural network model is quantized and compressed to obtain an edge inference unit deployed in an embedded MCU. The real-time spectral response fingerprint is input into the edge inference unit for inference calculation, so as to output the probability and priority ranking of the strategy action under the current working condition; Based on the probability and priority ranking of the strategy actions, a PWM control signal is generated. The IGBT driver chip adjusts the output PWM duty cycle or switches the control mode to execute charging and discharging strategy actions such as immediate load reduction, maintenance, switching to constant current charging, or initiating pre-compensation.

2. The method for dynamic matching of solar panels for energy storage charging and discharging control according to claim 1, characterized in that, The offline mapping sample library is constructed based on the typical spectral response fingerprints and their corresponding optimal charge / discharge mode labels acquired through controlled illumination perturbation experiments, including: Based on a programmable LED array light source, a controlled illumination perturbation experiment was performed. Step, ramp, and pulse illumination change excitations were applied to the photovoltaic array to construct a simulated illumination change environment that included cloud passing conditions and tree shadow swaying conditions, and an illumination perturbation test sequence with condition labels was obtained. The transient current waveform data under the illumination disturbance test sequence is synchronously acquired using a high-bandwidth current sensing circuit, and short-time Fourier transform processing is performed on the transient current waveform data to extract energy distribution information in the frequency band from 10Hz to 500Hz, generating a standardized spectral response fingerprint. Based on the principle of maximizing system efficiency, the spectral response fingerprint is calibrated and marked with charging and discharging strategy actions. Among the four types of charging and discharging strategy actions, namely immediate load reduction, maintenance, switching to constant current charging, and starting pre-compensation, the optimal action is marked, and the optimal charging and discharging mode label is generated and bound to each spectral response fingerprint. Using the spectral response fingerprint as the input key and the optimal charge / discharge mode label as the output target value, a nonlinear mapping relationship between the spectral response fingerprint and the optimal charge / discharge mode is established to generate the offline mapping sample library.

3. The method for dynamic matching of solar panels for energy storage charging and discharging control according to claim 2, characterized in that, The controlled illumination perturbation experiment based on a programmable LED array light source applies step, ramp, and pulse illumination change excitations to the photovoltaic array, constructing a simulated illumination abrupt change environment including cloud passing conditions and tree shadow swaying conditions, and obtaining illumination perturbation test sequences labeled with conditions, including: A multi-channel programmable LED array light source is configured as the excitation source, and the light excitation waveform parameters are defined through the host computer control software to construct a standard test case set covering typical meteorological conditions. The photovoltaic array is placed within the uniform illumination area of ​​the programmable LED array light source, so that the light spot covers the component surface of the photovoltaic array; According to the standard test case set, excitation commands are sent to the LED driver controller in sequence to excite step-type light change to simulate cloud cover and removal, slope-type light change to simulate linear change of solar intensity, and pulse-type light fluctuation to simulate leaf swaying. Simultaneously, the light intensity time series data and corresponding timestamps are recorded, and working condition labels are added to each light change process to obtain the original dataset of light disturbance. The original dataset of illumination disturbances is cleaned and segmented to remove abnormal data segments caused by unstable equipment startup, ambient background light interference, and excitation output deviations exceeding the preset allowable range. Standard illumination disturbance segments with complete rising edges, falling edges, and steady-state intervals are retained to obtain the illumination disturbance test sequence with operating condition labels.

4. The method for dynamic matching of solar panels for energy storage charging and discharging control according to claim 3, characterized in that, The parameters of the illumination excitation waveform include the amplitude and duration of the step change, the slope of the ramp change, and the frequency and duty cycle of the pulse change.

5. The method for dynamic matching of solar panels for energy storage charging and discharging control according to claim 1, characterized in that, The step of training a graph neural network model using the offline mapping sample library and then quantizing and compressing the trained graph neural network model to obtain an edge inference unit deployed on an embedded MCU includes: A graph neural network model is constructed based on the spectral response fingerprints and their corresponding optimal charge / discharge mode labels in the offline mapping sample library. The graph neural network model is used to perform forward propagation calculation and backward error iterative training on the offline mapping sample library. By minimizing the loss function between the predicted policy action probability and the optimal charging and discharging mode label, the weight parameters and node bias of each connection edge in the graph neural network model are updated until convergence, and the initial training model is obtained. The initial training model is subjected to floating-point to fixed-point quantization compression processing, which maps the floating-point weight parameters and node biases in the initial training model to low-bit-width integer values. Combined with pruning processing, redundant connection edges and insensitive nodes in the initial training model are removed to generate a quantized compressed model. The quantization compression model is compiled and burned into the firmware storage area of ​​the embedded MCU to instantiate the edge inference unit and configure the runtime environment of the edge inference unit.

6. The method for dynamic matching of solar panels for energy storage charging and discharging control according to claim 5, characterized in that, The graph neural network model includes an input node layer, a hidden feature extraction node layer, and an output decision node layer. The input node layer, the hidden feature extraction node layer, and the output decision node layer are connected in sequence to form a forward propagation link. The input node layer and the hidden feature extraction node layer, as well as the hidden feature extraction node layer and the output decision node layer, are all connected by connecting edges to establish an adjacency relationship.

7. The method for dynamic matching of solar panels for energy storage charging and discharging control according to claim 5, characterized in that, The process of performing floating-point to fixed-point quantization compression on the initial training model maps the floating-point weight parameters and node biases in the initial training model to low-bit-width integer values, and combines this with pruning to remove redundant connections and insensitive nodes from the initial training model, generating a quantized compressed model, including: Receive the initial training model and extract the floating-point edge weights of each connection edge and the bias of each node in the initial training model; Sensitivity analysis is performed on the edge weights of each connection edge in the initial training model. Based on the offline mapping sample library, the contribution of each edge weight to the gradient of the training loss value is calculated, and a weight importance score vector is generated. Based on a preset pruning threshold, the weights of connection edges with importance scores lower than the preset pruning threshold are reset to zero, and the corresponding nodes are removed to reconstruct the sparse topology of the graph neural network model. Perform statistical distribution analysis on the remaining weight parameters after pruning to determine the dynamic quantization range of the remaining weight parameters; calculate the scaling factor based on the scaling factor calculation formula according to the dynamic quantization range. The zero-point offset is calculated based on the minimum value of the scaling factor and the remaining weight parameter, using the zero-point offset calculation formula. Using the scaling factor and the zero-point offset, a fixed-point transformation is performed on the remaining weight parameters after pruning and the offset to generate a low-bit-width integer weight matrix, thus obtaining the quantization compression model.

8. The method for dynamic matching of solar panels for energy storage charging and discharging control according to claim 6, characterized in that, The step of inputting the real-time spectral response fingerprint into the edge inference unit for inference calculation, and outputting the probability and priority ranking results of the policy actions under the current operating condition, includes: The real-time spectral response fingerprint is input into the edge inference unit. Based on the memory mapping mechanism of the embedded MCU, the real-time spectral response fingerprint is loaded into the edge inference unit. Fixed-point format conversion and input normalization processing are performed according to the quantization parameters of the quantization compression model to generate a normalized input tensor. Multi-layer graph convolution and neighborhood aggregation are performed on the standardized input tensor to extract the nonlinear coupling correlation features between energy distributions of different frequency bands in the standardized input tensor and generate hidden layer feature representations. The output decision node layer built into the edge inference unit performs linear mapping and Softmax normalization calculation on the hidden layer feature representation to generate the original probability distribution vectors of four types of policy actions. Based on the preset action priority adjudication logic and preset probability threshold, the probability values ​​in the original probability distribution vector are sorted in descending order and threshold filtering is performed to generate the probability and priority ranking results of the policy actions.

9. The method for dynamic matching of solar panels for energy storage charging and discharging control according to claim 1, characterized in that, Also includes: The system stability status is monitored after the charging and discharging strategy is executed. If temperature drift or feature deviation caused by component aging is detected, the offline mapping sample library is updated based on the new spectral response fingerprint.

10. A solar panel dynamic matching energy storage charging and discharging control system, characterized in that, include: The transient current acquisition module for sudden changes in illumination is used to acquire transient current waveform data collected by a high-bandwidth current sensing circuit connected to the DC side output terminal of the photovoltaic array at the moment of sudden change in illumination. The short-time Fourier spectral fingerprint generation module is used to perform short-time Fourier transform processing on the current transient waveform data to generate a spectral response fingerprint containing energy distribution information of a preset frequency band. The offline mapping sample library construction module is used to construct an offline mapping sample library based on typical spectral response fingerprints and their corresponding optimal charge and discharge mode labels collected by controlled illumination perturbation experiments. The edge inference unit construction module is used to train a graph neural network model using the offline mapping sample library, and to quantize and compress the trained graph neural network model to obtain an edge inference unit deployed on an embedded MCU. The real-time inference and strategy ranking module is used to input the real-time spectral response fingerprint into the edge inference unit for inference calculation, so as to output the strategy action probability and priority ranking result under the current working condition; The PWM control and strategy execution module is used to generate a PWM control signal based on the probability and priority ranking of the strategy action. The IGBT driver chip adjusts the output PWM duty cycle or switches the control mode to execute charging and discharging strategy actions such as immediate load reduction, maintenance, switching to constant current charging, or initiating pre-compensation.