Multi-gun-head charging pile power distribution method, medium and system
By establishing a mathematical model containing error terms and the neural network model, the intelligent and dynamic power distribution of multi-gun charging piles is achieved, and the problem that power distribution strategies in the existing technology cannot adapt to complex scenarios is solved, and charging is improved Efficiency and user experience.
Patent Information
- Application Number
- CN202411669491.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-11-21
AI Technical Summary
The power distribution strategy of existing multi-gun charging piles cannot effectively adapt to complex charging scenarios and needs, resulting in inefficient utilization of charging resources, reduced user satisfaction and unbalanced grid load.
A multi-tip charging pile power allocation method is adopted to obtain the historical operating parameters of each gun head, and a mathematical model with multiple error terms is established, and fuse it with a neural network model with a multi-branch structure to form a hybrid model. The model obtains the optimal charging power distribution strategy through training and uses Lora technology for online fine-tuning to improve adaptability and accuracy.
The optimization of charging efficiency, protection of battery health and balancing of grid load are achieved, and the efficiency of user experience and charging resources are improved.
Smart Images

Figure CN119416651A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of charging piles, and in particular, relates to a power distribution method, medium and system for a multi-gun head charging pile. Background Art
[0002] With the rapid development of the electric vehicle industry, the construction and optimization of charging infrastructure has become an important issue. As an efficient charging solution, multi-gun charging piles have been widely used in public charging stations, parking lots, commercial areas and other places. This charging equipment can provide charging services for multiple electric vehicles at the same time, improving charging efficiency and site utilization.
[0003] However, the current power distribution strategy of multi-charger charging piles still has many shortcomings. The main application scenarios include: 1. Public charging stations: During peak hours, multiple electric vehicles are charged at the same time, which poses a challenge to the power distribution of charging piles.
[0004] 2. Commercial parking lot: Charging vehicles of different models and with different charging requirements at the same time requires a flexible power allocation strategy.
[0005] 3. Charging facilities in residential areas: When charging is carried out in batches at night, how to balance the grid load and user demand becomes a key issue.
[0006] 4. Long-distance charging stations: The demands for fast charging and long-term charging coexist, requiring charging piles to be able to intelligently allocate power.
[0007] The power allocation method in the prior art mainly has the following problems: 1. Simple preset allocation: Many charging piles use fixed power allocation strategies, such as equal allocation or allocation according to a preset ratio. This method cannot adapt to the charging characteristics of different models and the actual needs of users.
[0008] 2. Single parameter consideration: Some charging piles only consider single factors such as battery capacity or charging time to allocate power, ignoring important parameters such as charging efficiency and grid load.
[0009] 3. Static model: Most existing power allocation models are static models and cannot be dynamically adjusted according to real-time charging data and environmental changes.
[0010] 4. Lack of learning ability: Traditional methods lack adaptive learning capabilities and cannot optimize allocation strategies from historical data.
[0011] 5. Poor scale adaptability: Existing methods are difficult to flexibly adjust and expand for charging stations of different sizes.
[0012] 6. Ignoring environmental factors: rarely considering the impact of environmental factors such as temperature and humidity on charging efficiency.
[0013] 7. Insufficient consideration of grid load: When distributing power, insufficient consideration is given to the balance of grid load, which may lead to excessive pressure on local grids.
[0014] 8. Poor user experience: Unable to personalize allocation based on user charging preferences and urgency.
[0015] In summary, the existing technology has shortcomings in the power allocation of multi-gun charging piles, mainly because it is allocated through simple preset or fixed modes, which cannot adapt well to complex charging scenarios and needs. These problems have led to a series of problems such as inefficient utilization of charging resources, reduced user satisfaction, and unbalanced grid load. Therefore, an intelligent, dynamic, and comprehensive multi-gun charging pile power allocation method is urgently needed to improve charging efficiency, optimize resource utilization, enhance user experience, and protect grid stability. Summary of the invention
[0016] In view of this, the present invention provides a power distribution method, medium and system for a multi-gun charging pile, which can solve the technical problem that the prior art mainly distributes power to multi-gun charging piles through simple preset or fixed modes, and is unable to adapt well to complex charging scenarios and needs.
[0017] The present invention is achieved in that: A first aspect of the present invention provides a multi-charger charging pile power distribution method, which includes the following steps: S10, obtaining the historical operating parameters of each charging pile gun head; S20, establishing a mathematical model including a plurality of equations with error terms taking into account the operating parameters, including a charging power equation, a charging time equation, a battery capacity equation, a charging efficiency equation, and a grid load equation; S30, fitting the mathematical model according to the historical operating parameters to obtain a fitting model; S40, establishing a hybrid model, including a neural network model with a multi-branch structure and the mathematical model; S50, using the historical operating parameters to train the hybrid model to obtain a charging pile power allocation model, wherein the training input is the operating parameters and environmental parameters of each gun head, and the training output is the optimal charging power allocation of each gun head; S60, obtaining battery parameters, charging demand parameters, charging equipment parameters, real-time charging data, environmental parameters and power grid parameters of the charging pile in the current charging scenario, and inputting them into the charging pile power allocation model to obtain a power allocation vector; S70, adjusting the charging power of each gun head in real time according to the power allocation vector, and collecting the actual charging data of each gun head in real time during the charging process to calculate the power error; S80, based on the collected real-time data and prediction errors, a lightweight model is constructed using Lora technology to fine-tune the last three layers of the fully connected layer of the fusion subnetwork of the charging pile power allocation model in real time; S90. Regularly merge the fine-tuned lightweight model into the fusion sub-network to continuously improve the accuracy and adaptability of power allocation.
[0018] Among them, the operating parameters include battery parameters, charging demand parameters, charging equipment parameters, real-time charging data, environmental parameters, charging gun head power allocation parameters and power grid parameters; among them, battery parameters include battery capacity, remaining power, battery type, battery health status, battery internal resistance and battery temperature; charging demand parameters include the user-set target charging amount, expected charging time and charging priority of each charging gun head; charging equipment parameters include charging gun head type, charging protocol, maximum output power and charging gun head temperature; real-time charging data include current charging power, real-time charging voltage, real-time charging current, charging time and charging efficiency; environmental parameters include ambient temperature, ambient humidity and weather conditions; charging gun head power allocation parameters include current allocated power, maximum allocable power, minimum allocable power, power adjustment step and power adjustment frequency; the power grid parameters include voltage, current, harmonics, power factor, frequency and charging pile load.
[0019] Among them, the multi-branch structure neural network model includes a charging power equation error term subnetwork, a charging time equation error term subnetwork, a battery capacity equation error term subnetwork, a charging efficiency equation error term subnetwork, a power grid load equation error term subnetwork, an environmental parameter subnetwork, a charging gun head battery mutual response subnetwork and a fusion subnetwork.
[0020] The charging power equation error term subnetwork is used to predict the error of the charging power equation. The input is the battery parameters and the charging device parameters, and the output is the power error. The structure is a three-layer feedforward neural network, and each layer uses a ReLU activation function. The charging time equation error term subnetwork is used to predict the error of the charging time equation. The input is the charging demand parameter and the real-time charging data, and the output is the time error. The structure is an LSTM network, including two layers of LSTM units and one fully connected output layer. The battery capacity equation error term subnetwork is used to predict the error of the battery capacity equation. The input is battery parameters and real-time charging data, and the output is capacity error. The structure is a one-dimensional convolutional neural network, including two convolutional layers, one pooling layer and two fully connected layers. The charging efficiency equation error term subnetwork is used to predict the error of the charging efficiency equation. The input is charging equipment parameters, environmental parameters and real-time charging data, and the output is efficiency error. The structure is a residual network, including three residual blocks and a fully connected output layer. The grid load equation error term subnetwork is used to predict the error of the grid load equation. The input is grid parameters and real-time charging data, and the output is the charging pile load error. The structure is a time series prediction network, using GRU units and attention mechanism. The environmental parameter subnetwork is used to process the impact of the environment on charging. The input is the environmental parameter and the output is the environmental impact factor. The structure is a multi-layer perceptron, including three hidden layers, and each layer uses a Leaky ReLU activation function. The charging gun head battery mutual response sub-network is used to analyze the dynamic interaction relationship between the charging gun head and the battery. The input is the charging device parameters, battery parameters and real-time charging data, and the output is the charging efficiency and dynamic power adjustment vector. The structure is a bidirectional LSTM network combined with a self-attention mechanism, including two layers of bidirectional LSTM and a multi-head self-attention layer. The fusion subnetwork is used to integrate the outputs of each subnetwork. The input is the output of all subnetworks, and the output is the charging pile power allocation vector at the next moment. The structure is an encoder-decoder network based on Transformer, which includes a multi-layer self-attention mechanism and a feedforward neural network.
[0021] Specifically, the error term subnetwork structure of the charging power equation is a three-layer feedforward neural network, and each layer uses the ReLU activation function. The number of neurons in the input layer is determined according to the dimensions of the battery parameters and the charging device parameters, the number of neurons in the hidden layer is 32×n, where n is the number of gun heads of the charging pile, and the number of neurons in the output layer matches the power error dimension.
[0022] The charging time equation error term subnetwork structure is an LSTM network, which includes two layers of LSTM units and a fully connected output layer. The hidden state dimension of each layer of LSTM units is 64×n, where n is the number of charging pile gun heads. The number of neurons in the fully connected output layer matches the time error dimension.
[0023] The battery capacity equation error term subnetwork structure is a one-dimensional convolutional neural network, which includes two convolutional layers, one pooling layer, and two fully connected layers. The number of filters in the convolutional layer is 16×n and 32×n, respectively, and the number of neurons in the fully connected layer is 64×n and 32×n, respectively, where n is the number of charging pile heads. The number of neurons in the output layer matches the capacity error dimension.
[0024] The error term subnetwork structure of the charging efficiency equation is a residual network, which includes three residual blocks and a fully connected output layer. The number of convolutional layer filters in each residual block is 32×n, where n is the number of charging pile heads. The number of neurons in the fully connected output layer matches the efficiency error dimension.
[0025] The grid load equation error term subnetwork structure is a time series prediction network that uses GRU units and attention mechanisms. The hidden state dimension of the GRU layer is 64×n, and the dimension of the attention layer is 32×n, where n is the number of charging pile heads. The number of neurons in the output layer matches the dimension of the charging pile load error.
[0026] The environmental parameter subnetwork structure is a multi-layer perceptron, which contains three hidden layers, and each layer uses the Leaky ReLU activation function. The number of neurons in the three hidden layers is 32×n, 64×n, and 32×n, respectively, where n is the number of charging pile heads. The number of neurons in the output layer matches the dimension of the environmental influencing factors.
[0027] The charging gun head battery mutual response sub-network structure is a bidirectional LSTM network combined with a self-attention mechanism, including two layers of bidirectional LSTM and a multi-head self-attention layer. The hidden state dimension of each LSTM layer is 64×n, and the number of heads in the self-attention layer is 4×n, where n is the number of gun heads of the charging pile. The number of neurons in the output layer matches the total dimension of the charging efficiency and dynamic power adjustment vector.
[0028] The fusion sub-network structure is a Transformer-based encoder-decoder network, which contains a multi-layer self-attention mechanism and a feedforward neural network. The encoder and decoder each contain 4 layers, the number of self-attention heads in each layer is 8×n, and the hidden layer dimension of the feedforward neural network is 256×n, where n is the number of gun heads of the charging pile. To adapt to Lora fine-tuning, a low-rank adaptation matrix with a rank of 16 is introduced in the last three fully connected layers. These low-rank adaptation matrices allow the model parameters to be adjusted efficiently during the fine-tuning process without changing the original pre-trained weights. The number of neurons in the output layer matches the dimension of the charging pile power allocation vector at the next moment.
[0029] The number of neurons in the hidden layer of each sub-network is a variable parameter, which is used to adjust according to the number of gun heads of the charging pile and to adapt to charging piles of different sizes.
[0030] The structure of the hybrid model is as follows: each sub-network processes input data in parallel, and the output result is sent to the fusion sub-network. The output of the fusion sub-network is weighted averaged with the calculation result of the mathematical model to obtain the final power allocation result.
[0031] Furthermore, the data transmission relationship between the neural network and the mathematical model is specifically: the neural network predicts the error terms of each equation, and these error terms are input into the mathematical model as correction factors to improve the accuracy of the mathematical model.
[0032] The constraints of the mathematical model include charging efficiency constraints, time constraints, and grid load constraints.
[0033] Specifically, step S10 includes: obtaining the historical operation records of each charging gun head from the data acquisition system of the charging pile, including battery parameters, charging demand parameters, charging equipment parameters, real-time charging data, environmental parameters and power grid parameters, etc.; organizing the collected various parameter data into a structured data set to prepare for subsequent mathematical modeling and machine learning model training; performing preliminary statistical analysis and outlier detection on the data set to ensure the integrity and accuracy of the data.
[0034] Wherein, the step S20 includes: establishing a charging power equation, a charging time equation, a battery capacity equation, a charging efficiency equation and a power grid load equation, and introducing corresponding error terms in each equation; formulating a variety of parameter acquisition methods including experimental measurement, numerical calculation, historical data analysis, etc. for unknown parameters in each equation; establishing constraint conditions for the above-mentioned set of equations, including charging efficiency constraints, charging time constraints and power grid load constraints, to ensure that the charging process is carried out within a safe and reliable range.
[0035] Wherein, the step S30 includes: inputting various types of operating parameter data collected in step S10 into the mathematical model established in step S20 as the independent variables of the model; using numerical optimization algorithms such as nonlinear least squares method to iteratively solve the unknown parameters in the mathematical model to minimize the error between the model prediction output and the actual observation data; through repeated iterations, until the deviation between the model prediction value and the actual observation value is less than a preset threshold, it is considered that the model has fully fitted the historical data and the final fitting model is obtained; the accuracy and stability of the fitting model are verified, and if necessary, the model structure can be further optimized to improve the fitting effect.
[0036] Wherein, the step S40 includes: designing a neural network model with a multi-branch structure, including a charging power equation error term subnetwork, a charging time equation error term subnetwork, a battery capacity equation error term subnetwork, a charging efficiency equation error term subnetwork, a power grid load equation error term subnetwork, an environmental parameter subnetwork, a charging gun head battery mutual response subnetwork and a fusion subnetwork, etc.; for each subnetwork, a specific network structure design is given, including hyperparameters such as the number of layers, the number of neurons, and the activation function; the above-mentioned neural network model is integrated with the mathematical model obtained in step S30 to form a hybrid model including mathematical modeling and machine learning, so as to achieve a combination of the advantages of both parties.
[0037] Wherein, the step S50 includes: dividing the various types of operating parameter data collected in step S10 into a training set and a validation set; defining the training objective function of the hybrid model, which is usually to minimize the error of the charging power distribution of each gun head; using a gradient-based optimization algorithm to iteratively update the parameters of the hybrid model so that the objective function value on the training set continues to decrease; during the training process, regularly using the validation set to evaluate the generalization performance of the model, and adjusting the training hyperparameters according to the evaluation results until the performance index of the validation set reaches a preset convergence threshold.
[0038] Wherein, the step S60 includes: obtaining battery parameters, charging demand parameters, charging equipment parameters, real-time charging data, environmental parameters and power grid parameters of the current charging scene from the data acquisition system of the charging pile; inputting the above-obtained parameters into the charging pile power allocation model trained in step S50, and the model outputs the optimal charging power allocation vector of each charging gun head through forward calculation.
[0039] Among them, the step S70 includes: transmitting the power distribution vector output by step S60 to the power adjustment module of the charging pile, indicating the power that each charging gun head should output; the charging pile control system monitors the charging status of each gun head in real time, and adjusts the output power of the charging gun head according to the feedback real-time charging data to make it as close to the target power distribution as possible; at the same time, collecting the actual charging data of each gun head, calculating the error between the actual power distribution and the target distribution, and providing feedback data for subsequent model fine-tuning.
[0040] Among them, the step S80 includes: using the real-time charging data and power allocation error collected in step S70, using Lora technology to build a lightweight fine-tuning model, focusing on the last three fully connected layers of the fusion sub-network, and introducing a low-rank adaptation matrix for online learning optimization; at regular intervals, the parameters of the fine-tuned lightweight model are directly overwritten with the parameters of the corresponding layer of the fusion sub-network, thereby continuously improving the power allocation performance and adaptability of the entire hybrid model.
[0041] Furthermore, the charging power equation is specifically expressed as follows: ; In the formula, is the charging power at time t; is the energy of the battery at time t; is the charging efficiency at time t; is the charging current at time t; is the charging voltage at time t; is the charging time constant; is the partial derivative of power with respect to temperature; For ambient temperature changes; is the power error term.
[0042] Parameter acquisition method: It is calculated by real-time monitoring of the charging process, and the calculation formula is: ,in is the output power, is the input power.
[0043] and It is obtained through real-time measurement of the current and voltage sensors of the charging pile.
[0044] Obtained through experiments, including step 1: charging the battery at a constant current; step 2: recording the curve of battery voltage changing over time; step 3: fitting the curve to obtain the time constant .
[0045] It is obtained through experiments, including step 1: measuring the charging power at different temperatures; step 2: calculating the rate of change of power with temperature.
[0046] The charging time equation is specifically expressed as follows: ; In the formula, is the total charging time; is the initial charge; is the target power; The charging power when the charge is E; is the number of charging stages; and are the partial derivatives of charging time with respect to the current and voltage in the i-th stage respectively; and are the changes of current and voltage in stage i respectively; is the time error term.
[0047] Parameter acquisition method: and Obtained through data provided by the battery management system (BMS).
[0048] The function is obtained by experiment, including step 1: measuring the charging power at different power levels; step 2: fitting function.
[0049] and It is calculated by numerical differentiation method. The specific steps are as follows: in each charging stage, the current or voltage is slightly changed, the change of charging time is measured, and the partial derivative is calculated.
[0050] The battery capacity equation is specifically expressed as follows: ; In the formula, is the battery capacity after the Nth cycle; is the initial capacity; and is the attenuation coefficient; is the number of cycles; and is the power coefficient; is the charging current of the i-th cycle; is the activation energy; is the gas constant; is the temperature of the i-th cycle; is the capacity function in the frequency domain; is the angular frequency; is the time constant; is the capacity error term.
[0051] Parameter acquisition method: Obtained through battery specification parameters.
[0052] , , and It is obtained through experiments, including step 1: conducting a large number of cycle charge and discharge experiments; step 2: recording the capacity after each cycle; and step 3: fitting parameters using a nonlinear regression method.
[0053] Obtained through Arrhenius experiment, including step 1: measuring battery performance at different temperatures; step 2: plotting the relationship between ln(k) and 1 / T; step 3: calculating from the slope .
[0054] It is obtained through electrochemical impedance spectroscopy (EIS) testing. The specific steps are: applying AC signals of different frequencies to the battery, measuring the impedance response, and obtaining it through equivalent circuit fitting. function.
[0055] The charging efficiency equation is specifically expressed as follows: ; In the formula, is the charging efficiency at time t; For ideal charging efficiency; is the efficiency time constant; is the temperature influence coefficient; is the current temperature; is the optimal temperature; is the current influence coefficient; is the current; is the optimal current; is the partial derivative of efficiency with respect to state of charge (SoC); is the change amount of SoC; is the efficiency error term.
[0056] Parameter acquisition method: Obtained through battery specification parameters.
[0057] Obtained experimentally, including step 1: measuring the change of charging efficiency over time under constant conditions; step 2: fitting the curve to obtain the time constant .
[0058] and It is obtained by experimental means, including step 1: measuring the charging efficiency at different temperatures and currents; step 2: obtaining the coefficients using multiple regression analysis.
[0059] and It is obtained through optimization experiments. The specific steps are: measure the charging efficiency under different temperature and current combinations, and find the temperature and current corresponding to the highest efficiency point.
[0060] It is obtained through experiments, including step 1: measuring the charging efficiency under different SoCs; step 2: calculating the rate of change of efficiency with SoC.
[0061] The grid load equation is specifically expressed as follows: ; In the formula, is the total grid load at time t; is the basic load; is the number of charging piles; is the power of the i-th charging pile at time t; is the number of other dynamic loads; is the complex power of the jth dynamic load at time t; is the power factor angle of the jth dynamic load; is the frequency influence coefficient; is the grid frequency at time t; is the standard frequency; is the load error term.
[0062] Parameter acquisition method: Obtained through historical load data and load forecasting models.
[0063] Obtained through real-time power measurement of the charging pile.
[0064] and Obtained through real-time measurement by the power grid monitoring system.
[0065] It is obtained by experimental means, including step 1: measuring the grid load at different frequencies; step 2: analyzing the relationship between load and frequency; step 3: fitting to obtain .
[0066] Obtained through real-time measurement by a power grid frequency measurement device.
[0067] The charging efficiency constraint condition is specifically expressed as follows: ; ; In the formula, is the minimum allowable charging efficiency; is the maximum allowable charging efficiency; is the maximum allowable efficiency change rate.
[0068] Parameter acquisition method: and Determined by battery specifications and charging safety standards.
[0069] It is obtained through experiments, including step 1: conducting multiple charging experiments and recording efficiency changes; step 2: analyzing the safe range of efficiency changes; and step 3: determining the maximum allowable change rate.
[0070] The time constraint conditions are specifically expressed as follows: ; ; In the formula, is the minimum allowed charging time; is the maximum allowed charging time; Charge the energy you need.
[0071] Parameter acquisition method: and Determined by user settings and charging station operation strategy.
[0072] Obtained through user demand or data provided by the battery management system.
[0073] The grid load constraint condition is specifically expressed as follows: ; ; ; In the formula, is the maximum permissible grid load; is the maximum allowable load change rate; The maximum allowed power of the charging station.
[0074] Parameter acquisition method: Determined by grid capacity and safe operation standards.
[0075] Obtained through power grid stability analysis and historical data statistics.
[0076] Determined by charging station design specifications and power system capacity.
[0077] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the above-mentioned multi-gun head charging pile power distribution method.
[0078] A third aspect of the present invention provides a multi-gun charging pile power distribution system, characterized in that it includes the above-mentioned computer-readable storage medium.
[0079] Compared with the prior art, the beneficial effects of the multi-gun charging pile power distribution method, medium and system provided by the present invention are: 1) Comprehensively optimize multiple indicators such as charging efficiency, battery health and grid load. The mathematical modeling part describes the physical relationship between the battery, charging equipment, environment and grid during the charging process, and considers the impact of various factors on charging performance. At the same time, the neural network model, as an "error term corrector", can adaptively learn the complex dynamic characteristics of the actual charging process and improve the accuracy of the overall optimization.
[0080] 2) It has strong real-time and robustness. This method integrates the machine learning model with the mathematical model in real time, and uses Lora technology to efficiently fine-tune the core network layer, so that the entire system can continuously adapt to changes in charging scenarios and avoid performance degradation due to drastic changes in the environment or user needs.
[0081] 3) Maintain physical interpretability. Unlike the purely data-driven "black box" model, the hybrid modeling method of the present invention not only maintains the excellent performance of the machine learning model, but also retains the interpretability of the mathematical model. This helps to better understand the physical mechanism of the charging process and provides a basis for further optimizing the charging strategy.
[0082] 4) Intelligent coordination of charging pile power is achieved. This method not only takes into account the power distribution of each charging head within a single charging pile, but also incorporates the grid load factor into the optimization, which can achieve coordination between multiple charging piles and reduce the overall burden on the grid.
[0083] In general, the multi-gun charging pile power allocation method proposed in the present invention combines mathematical modeling with machine learning, and uses a data-driven approach to adaptively optimize the charging power allocation strategy on the basis of maintaining physical interpretability, thereby achieving comprehensive optimization of charging efficiency, battery health, and grid load. It solves the technical problem that the existing technology for multi-gun charging pile power allocation is mainly distributed through simple preset or fixed modes, and is unable to adapt well to complex charging scenarios and needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Figure 1 A flow chart of the method provided by the present invention. DETAILED DESCRIPTION
[0085] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0086] like Figure 1 As shown, it is a flow chart of a multi-gun charging pile power distribution method provided by the present invention, and the method comprises the following steps: S10, obtaining the historical operating parameters of each charging pile gun head; S20, establishing a mathematical model that includes multiple equations with error terms and takes into account operating parameters, including a charging power equation, a charging time equation, a battery capacity equation, a charging efficiency equation, and a grid load equation; S30, fitting the mathematical model according to the historical operating parameters to obtain a fitting model; S40, establishing a hybrid model, including a neural network model with a multi-branch structure and a mathematical model; S50, using historical operating parameters to train the hybrid model to obtain a charging pile power allocation model, wherein the training input is the operating parameters and environmental parameters of each gun head, and the training output is the optimal charging power allocation of each gun head; S60, obtaining battery parameters, charging demand parameters, charging equipment parameters, real-time charging data, environmental parameters, and power grid parameters of the charging pile in the current charging scenario, and inputting them into the charging pile power allocation model to obtain a power allocation vector; S70, adjusting the charging power of each gun head in real time according to the power allocation vector, and collecting the actual charging data of each gun head in real time during the charging process to calculate the power error; S80, based on the collected real-time data and prediction errors, a lightweight model is built using Lora technology to fine-tune the last three layers of the fully connected layer of the fusion sub-network of the charging pile power allocation model in real time; S90, regularly merges the fine-tuned lightweight model into the fusion sub-network to continuously improve the accuracy and adaptability of power allocation.
[0087] The specific implementation methods of the above steps are described in detail below: Step S10: Obtain the historical operating parameters of each charging station gun head The purpose of this step is to collect relevant parameter data of each charging pile gun head during historical operation, and provide basic input for subsequent mathematical modeling and machine learning model training. The specific implementation method includes: 1) Obtain the historical operation records of each charging gun head from the data acquisition system of the charging pile, including battery parameters (battery capacity, remaining power, battery type, battery health status, battery internal resistance, battery temperature), charging demand parameters (user-set target charging amount, expected charging time, charging priority), charging equipment parameters (charging gun head type, charging protocol, maximum output power, charging gun head temperature), real-time charging data (current charging power, real-time charging voltage, real-time charging current, charging time, charging efficiency), environmental parameters (ambient temperature, ambient humidity, weather conditions) and power grid parameters (voltage, current, harmonics, power factor, frequency, charging pile load), etc.
[0088] 2) Organize the collected parameter data into a structured data set to prepare for subsequent mathematical modeling and machine learning model training.
[0089] 3) Conduct preliminary statistical analysis and outlier detection on the data set to ensure the integrity and accuracy of the data.
[0090] Step S20: Establishing a mathematical model that takes into account the operating parameters and includes multiple error terms The purpose of this step is to establish a mathematical model containing multiple error terms based on the operating parameter data collected from step S10 to describe the relationship between the charging power, charging time, battery capacity, charging efficiency and grid load of the charging pile. The specific implementation includes: 1) Establish a charging power equation, consider the impact of battery parameters, charging equipment parameters and ambient temperature on charging power, and introduce a power error term : ; 2) Establish a charging time equation, consider the impact of charging demand parameters and real-time charging data on charging time, and introduce a time error term : ; 3) Establish a battery capacity equation, consider the impact of battery parameters, charge and discharge current, temperature and other factors on battery capacity, and introduce a capacity error term : ; 4) Establish a charging efficiency equation, consider the impact of charging equipment parameters, ambient temperature, and charging current on charging efficiency, and introduce an efficiency error term : ; 5) Establish the grid load equation, taking into account the impact of basic load, power of each charging pile, other dynamic loads and grid frequency on the total grid load, and introduce the load error term : ; 6) For the unknown parameters in the above equations, formulate corresponding parameter acquisition methods, including obtaining them through experimental measurement, numerical calculation, historical data analysis, etc. These parameters include: charging efficiency , Charging current and voltage , Charging time constant , partial derivative of temperature with respect to power , Power and , Charging power function , Capacity attenuation parameters , , , , and the optimal temperature and current wait.
[0091] 7) Establish the constraints of the above equations, including charging efficiency constraints, charging time constraints and grid load constraints. These constraints ensure that the charging process is carried out within a safe and reliable range.
[0092] Through the above steps, a mathematical model with multiple error terms is established, which can accurately describe the key characteristics of the charging pile during operation and take into account the impact of various practical factors on the charging process. This provides a basis for the subsequent hybrid model construction and power allocation optimization.
[0093] Step S30: Fit the mathematical model according to the historical operating parameters to obtain a fitting model The purpose of this step is to use the historical operating parameter data collected from step S10 to fit the mathematical model established in step S20 to obtain a more accurate and practical mathematical model. The specific implementation method includes: 1) Input the various operating parameter data collected in step S10 into the mathematical model established in step S20 as the independent variables of the model.
[0094] 2) Use numerical optimization algorithms such as nonlinear least squares method to iteratively solve the unknown parameters in the mathematical model to minimize the error between the model prediction output and the actual observed data.
[0095] 3) Through repeated iterations, until the deviation between the model prediction value and the actual observation value is less than the preset threshold (for example, 1%), it is considered that the model has fully fitted the historical data and the final fitting model is obtained.
[0096] 4) Verify the accuracy and stability of the fitting model, including evaluating the model performance on a new test data set and analyzing the changing trend of model parameters. If necessary, the model structure can be further optimized to improve the fitting effect.
[0097] Through this step, a mathematical model fitted with historical data is obtained, which can more accurately describe the actual operating characteristics of the charging pile and provide a reliable foundation for subsequent hybrid model construction and power distribution optimization.
[0098] Step S40: Establishing a hybrid model The purpose of this step is to construct a hybrid model that includes a mathematical model and a neural network model, using the powerful learning ability of the neural network to supplement the deficiencies of the mathematical model and improve the accuracy and robustness of the power allocation strategy. The specific implementation method includes: 1) Design a multi-branch neural network model, including: Charging power equation error term subnetwork, used to predict the error term of the charging power equation; Charging time equation error term subnetwork, used to predict the error term of the charging time equation; The battery capacity equation error term subnetwork is used to predict the error term of the battery capacity equation; The charging efficiency equation error term subnetwork is used to predict the error term of the charging efficiency equation; The grid load equation error term subnetwork is used to predict the error term of the grid load equation; Environmental parameter sub-network, used to deal with the impact of the environment on charging; The charging gun head battery mutual response sub-network is used to analyze the dynamic interaction relationship between the charging gun head and the battery; The fusion sub-network is used to integrate the outputs of each sub-network to obtain the final power allocation vector; 2) The specific structure design of each sub-network is as follows: Charging power equation error term subnetwork: three-layer feedforward neural network, each layer uses ReLU activation function. The number of input layer neurons is determined according to the dimensions of battery parameters and charging device parameters, the number of hidden layer neurons is 32×n, and the number of output layer neurons matches the power error dimension.
[0099] Charging time equation error term subnetwork: LSTM network, including two layers of LSTM units and one fully connected output layer. The hidden state dimension of each layer of LSTM units is 64×n, and the number of neurons in the fully connected output layer matches the time error dimension.
[0100] Battery capacity equation error term subnetwork: a one-dimensional convolutional neural network, consisting of two convolutional layers, one pooling layer, and two fully connected layers. The number of filters in the convolutional layer is 16×n and 32×n, respectively, the number of neurons in the fully connected layer is 64×n and 32×n, respectively, and the number of neurons in the output layer matches the capacity error dimension.
[0101] Charging efficiency equation error term subnetwork: residual network, including three residual blocks and a fully connected output layer. The number of convolutional layer filters in each residual block is 32×n, and the number of neurons in the fully connected output layer matches the efficiency error dimension.
[0102] Grid load equation error term subnetwork: Time series prediction network, using GRU units and attention mechanism. The hidden state dimension of the GRU layer is 64×n, the dimension of the attention layer is 32×n, and the number of neurons in the output layer matches the dimension of the charging pile load error.
[0103] Environmental parameter subnetwork: Multilayer perceptron, including three hidden layers, each layer uses Leaky ReLU activation function. The number of neurons in the three hidden layers is 32×n, 64×n and 32×n respectively, and the number of neurons in the output layer matches the dimension of environmental influencing factors.
[0104] Charging gun head battery mutual response sub-network: The bidirectional LSTM network is combined with the self-attention mechanism, which includes two layers of bidirectional LSTM and a multi-head self-attention layer. The hidden state dimension of each LSTM layer is 64×n, the number of heads in the self-attention layer is 4×n, and the number of neurons in the output layer matches the total dimension of the charging efficiency and dynamic power adjustment vector.
[0105] Fusion sub-network: Transformer-based encoder-decoder network, including multi-layer self-attention mechanism and feedforward neural network. The encoder and decoder each contain 4 layers, the number of self-attention heads in each layer is 8×n, and the hidden layer dimension of the feedforward neural network is 256×n. To adapt to Lora fine-tuning, a low-rank adaptation matrix with a rank of 16 is introduced in the last three fully connected layers. The number of neurons in the output layer matches the dimension of the charging pile power allocation vector at the next moment.
[0106] 3) The above neural network model is integrated with the mathematical model obtained in step S30 to form a hybrid model. The integration method is: each sub-network processes the input data in parallel, and the output result is sent to the fusion sub-network. The output of the fusion sub-network is weighted averaged with the calculation result of the mathematical model to obtain the final power allocation result.
[0107] 4) The function of the neural network sub-network is to predict the error terms of each equation. These error terms are input into the mathematical model as correction factors to improve the accuracy of the mathematical model.
[0108] By building such a hybrid model that integrates mathematical modeling and machine learning, we can fully utilize the advantages of both parties. While maintaining the interpretability of the physical model, we can also adaptively learn and optimize the power allocation strategy of the charging pile in a data-driven manner, thereby improving the overall performance and adaptability.
[0109] Step S50: Use historical operating parameters to train the hybrid model
[0110] The purpose of this step is to use the historical operating parameter data collected from step S10 to train the hybrid model constructed in step S40 so that it can accurately predict the optimal charging power distribution of each gun head. The specific implementation includes: 1) Divide the various operating parameter data collected in step S10 into a training set and a validation set, where the training set is used for model parameter optimization and the validation set is used for model performance evaluation.
[0111] 2) Define the training objective function of the hybrid model, which can usually be to minimize the error in the charging power distribution of each gun head.
[0112] 3) Use a gradient-based optimization algorithm, such as the Adam optimizer, to iteratively update the parameters of the hybrid model so that the objective function value on the training set continues to decrease.
[0113] 4) During the training process, the validation set is used regularly to evaluate the generalization performance of the model, such as charging power allocation error, charging time error, battery capacity prediction error and other indicators, and the training hyperparameters such as learning rate and batch size are adjusted according to the evaluation results.
[0114] 5) When the performance index of the validation set reaches the preset convergence threshold.
[0115] Step S60: Obtain the parameters of the current charging scenario and input them into the charging pile power allocation model The purpose of this step is to obtain various parameters of the current charging scene and input them into the charging pile power allocation model trained in step S50, so as to obtain the optimal power allocation of each charging gun head. The specific implementation method includes: 1) Obtain relevant parameters of the current charging scenario from the data acquisition system of the charging pile, including battery parameters (battery capacity, remaining power, battery type, battery health status, battery internal resistance, battery temperature), charging demand parameters (user-set target charging amount, expected charging time, charging priority), charging equipment parameters (charging gun head type, charging protocol, maximum output power, charging gun head temperature), real-time charging data (current charging power, real-time charging voltage, real-time charging current, charging time, charging efficiency), environmental parameters (ambient temperature, ambient humidity, weather conditions) and power grid parameters (voltage, current, harmonics, power factor, frequency, charging pile load).
[0116] 2) Inputting the above-obtained parameters into the charging pile power allocation model trained in step S50.
[0117] 3) The model outputs the optimal charging power allocation vector for each charging gun head through forward calculation based on the input parameters.
[0118] Through this step, the comprehensive parameter information of the current charging scene is obtained and input into the trained charging pile power allocation model to obtain the optimal power allocation of each charging gun head. This provides a basis for subsequent real-time power adjustment.
[0119] Step S70: According to the power distribution vector, the charging power of each gun head is adjusted in real time The purpose of this step is to adjust the charging power of each charging gun head in real time according to the power distribution vector obtained in step S60, and at the same time collect the actual charging data of each gun head in real time to calculate the error of power distribution. The specific implementation method includes: 1) The power distribution vector outputted in step S60 is transmitted to the power regulation module of the charging pile to indicate the power that each charging gun head should output.
[0120] 2) The charging pile control system monitors the charging status of each charging gun head in real time, and adjusts the output power of the charging gun head according to the real-time charging data (charging power, voltage, current, etc.) fed back to make it as close to the target power distribution as possible.
[0121] 3) At the same time, the charging pile control system collects the actual charging data of each gun head in real time, compares it with the target power allocation vector, and calculates the error between the actual power allocation and the target allocation.
[0122] 4) The real-time collected charging data and power distribution error information are used as input for the subsequent step S80 fine-tuning model.
[0123] Through this step, the real-time dynamic adjustment of the charging pile power is realized to ensure that the charging process of each charging head conforms to the optimized power distribution plan. At the same time, it also provides the necessary feedback data for the next step of model fine-tuning.
[0124] Step S80: Use Lora technology to build a lightweight model and perform real-time fine-tuning on the fusion sub-network The purpose of this step is to use the real-time charging data and power allocation errors collected in step S70, use Lora technology to build a lightweight fine-tuning model, and optimize the fusion sub-network in step S40 in real time to further improve the accuracy and adaptability of power allocation. The specific implementation includes: 1) The real-time charging data and power distribution error collected in step S70 are used as input data to build a lightweight fine-tuning model using Lora technology. Lora is a low-rank adaptation technology that can efficiently adjust the parameters of the neural network model without changing the original pre-trained weights.
[0125] 2) The goal of this lightweight fine-tuning model is to fit the real-time power allocation error observed in step S70 as closely as possible, so as to better capture the dynamic change characteristics during the charging process.
[0126] 3) Specifically, the structure of the fine-tuning model focuses on the last three fully connected layers of the fusion sub-network, and a low-rank adaptation matrix is introduced in these layers, with the rank set to 16. This allows the model to efficiently adjust some parameters during the fine-tuning process without changing the main structure of the pre-training.
[0127] 4) The fine-tuning model is trained using online learning, and the model is updated using the latest real-time data every certain period of time (e.g., 10 minutes) so that it can track changes in the charging process in real time.
[0128] Through this step, a lightweight fine-tuning model is constructed, which can continuously optimize the fusion sub-network of the charging pile power allocation model and improve its adaptability to real-time charging scenarios, thereby further improving the overall power allocation accuracy.
[0129] Step S90: Regularly merge the fine-tuned model into the fusion sub-network The purpose of this step is to regularly merge the lightweight model fine-tuned using the Lora technology in step S80 into the fusion sub-network constructed in step S40 to continuously improve the performance and adaptability of the charging pile power allocation strategy. The specific implementation includes: 1) During the operation of the charging pile, at regular intervals (e.g., 1 day), the lightweight model fine-tuned using the Lora technology in step S80 is merged into the fusion sub-network constructed in step S40.
[0130] 2) The specific merging method is: the parameters of the last three fully connected layers of the lightweight fine-tuning model are directly overwritten with the parameters of the corresponding layers of the fusion sub-network. Due to the use of Lora technology, this parameter update will not significantly change the original structure and pre-trained weights of the fusion sub-network.
[0131] 3) After the merger is completed, the power allocation performance of the entire hybrid model (including the mathematical model and the fusion sub-network) will be further improved to better adapt to the actual changes in charging scenarios.
[0132] 4) By periodically performing this model merging, the charging pile power allocation strategy can be continuously optimized, and the accuracy and adaptability can be continuously improved as the operating time increases.
[0133] This step ensures the continuous improvement of the charging pile power allocation model, enabling it to be dynamically adjusted as the charging scenario changes, providing a more optimized power allocation solution for the charging pile.
[0134] In summary, this multi-head charging pile power allocation method realizes the intelligent optimization of the charging pile power allocation strategy through mathematical modeling, machine learning modeling and the fusion of the two. Among them, the mathematical model ensures the interpretability and controllability of the method, while the neural network model improves the adaptive learning ability of the actual operation data. The Lora fine-tuning of the fusion sub-network further enhances the real-time and robustness of the model, ensuring that the charging pile can maintain efficient and safe power allocation in complex dynamic environments.
[0135] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the above-mentioned multi-gun head charging pile power distribution method.
[0136] A third aspect of the present invention provides a multi-gun charging pile power distribution system, characterized in that it includes the above-mentioned computer-readable storage medium.
[0137] Specifically, the principle of the present invention is: 1. Mathematical modeling: First, based on the various parameters obtained from the historical operation data of the charging pile, a series of mathematical equations describing the charging process were established, including the charging power equation, charging time equation, battery capacity equation, charging efficiency equation and grid load equation. These equations take into account the impact of multiple factors such as battery status, charging equipment characteristics, environmental conditions, grid characteristics, etc. on charging performance, and introduce corresponding error terms. By fitting these equations and determining the parameters, a mathematical model that can more accurately describe the actual charging process is obtained.
[0138] 2. Neural network modeling: Based on mathematical modeling, a multi-branch neural network model is designed, which includes multiple sub-networks, each used to predict the error terms of each mathematical equation. These sub-networks can make full use of historical charging data, adaptively learn the complex dynamic characteristics of the actual charging process, and provide effective correction for the mathematical model. At the same time, a fusion sub-network is designed to integrate the outputs of each sub-network to obtain the final charging power allocation strategy.
[0139] 3. Hybrid model fusion: The above mathematical model and neural network model are integrated to form a hybrid model. The specific fusion method is: each sub-network processes the input data in parallel, and the output result is sent to the fusion sub-network. The output of the fusion sub-network is weighted averaged with the calculation result of the mathematical model to obtain the final power allocation result. This fusion can give full play to the physical interpretability of mathematical modeling and the adaptive learning ability of neural networks to achieve comprehensive optimization of charging performance.
[0140] 4. Online fine-tuning: In order to further improve the real-time and robustness of the model, Lora technology is used to perform online fine-tuning on the fusion sub-network. Specifically, charging data and power allocation errors are collected in real time during the charging process, and a lightweight fine-tuning model is built using these data to regularly update some parameters of the fusion sub-network. This can track the dynamic changes of the charging scene without significantly changing the pre-trained model structure, thereby ensuring continuous optimization of the overall performance.
[0141] The above technical solution makes full use of the advantages of mathematical modeling and machine learning. On the one hand, mathematical modeling ensures the physical interpretability of the method and can conduct in-depth analysis and modeling of key factors in the charging process; on the other hand, the adaptive learning ability of the neural network model can make up for the insufficient description of complex dynamic characteristics by the mathematical model and realize the comprehensive optimization of charging performance. At the same time, the online fine-tuning mechanism supported by Lora technology further improves the real-time and robustness of the entire system, ensuring that it can adapt to changes in charging scenarios in the long term. Therefore, this hybrid modeling method provides an efficient and reliable power allocation strategy for multi-gun charging piles, which not only ensures the charging quality, but also maximizes the utilization efficiency of the charging infrastructure.
[0142] In order to better understand and implement the present invention, a specific embodiment 1 of the present invention is provided below. The steps of this embodiment 1 are specifically described as follows: Step S10: Obtain the historical operating parameters of each charging station gun head The purpose of this step is to collect relevant parameter data of each charging pile gun head during its historical operation, and provide basic input for subsequent mathematical modeling and machine learning model training. Specifically include: 1) Obtain the historical operation records of each charging gun head from the charging pile data acquisition system, including: Battery parameters ,in Respectively represent battery capacity, remaining power, battery temperature, battery internal resistance and battery health status; Charging requirement parameters ,in They represent the target charging amount, expected charging time and charging priority set by the user respectively; Charging equipment parameters ,in Respectively indicate the charging gun head type, maximum output power and charging gun head temperature; Real-time charging data ,in Respectively represent the current charging power, real-time charging voltage, real-time charging current, charging time and charging efficiency; Environmental parameters , indicating ambient temperature, ambient humidity and weather conditions; Grid parameters , represents the grid voltage, current, phase angle, power factor, frequency and charging pile load.
[0143] 2) Organize the collected parameter data into a structured data set , prepare for subsequent mathematical modeling and machine learning model training.
[0144] 3) Dataset Preliminary statistical analysis and outlier detection were performed to ensure the completeness and accuracy of the data.
[0145] Step S20: Establishing a mathematical model including multiple error terms taking into account the operating parameters The purpose of this step is to establish a mathematical model containing multiple error terms based on the operating parameter data collected from step S10 to describe the relationship between the charging power, charging time, battery capacity, charging efficiency and grid load of the charging pile. Specifically, it includes: 1) Establish a charging power equation, consider the impact of battery parameters, charging equipment parameters and ambient temperature on charging power, and introduce a power error term : ; in, is the charging power at time t; is the energy of the battery at time t; is the charging efficiency at time t; is the charging current at time t; is the charging voltage at time t; is the charging time constant; is the partial derivative of power with respect to temperature; For ambient temperature changes.
[0146] 2) Establish a charging time equation, consider the impact of charging demand parameters and real-time charging data on charging time, and introduce a time error term : ; in, is the total charging time; is the initial charge; is the target power; For electricity Charging power at 100 Hz; is the number of charging stages; and The charging time is Partial derivatives of phase current and voltage; and Respectively The amount of change in current and voltage during the phase.
[0147] 3) Establish a battery capacity equation, consider the impact of battery parameters, charge and discharge current, temperature and other factors on battery capacity, and introduce a capacity error term : ; in, For the Battery capacity after cycles; is the initial capacity; and is the attenuation coefficient; is the number of cycles; and is the power coefficient; For the The charging current of the cycle; is the activation energy; is the gas constant; For the The temperature of the secondary cycle; is the capacity function in the frequency domain; is the angular frequency; is the time constant.
[0148] 4) Establish a charging efficiency equation, consider the impact of charging equipment parameters, ambient temperature, and charging current on charging efficiency, and introduce an efficiency error term : ; in, is the charging efficiency at time t; For ideal charging efficiency; is the efficiency time constant; is the temperature influence coefficient; is the current temperature; is the optimal temperature; is the current influence coefficient; is the current; is the optimal current; is the partial derivative of efficiency with respect to state of charge (SoC); is the change amount of SoC.
[0149] 5) Establish the grid load equation, taking into account the impact of basic load, power of each charging pile, other dynamic loads and grid frequency on the total grid load, and introduce the load error term : ; in, is the total grid load at time t; is the base load; is the number of charging piles; For the The power of a charging pile at time t; For other dynamic load quantities; For the The complex power of a dynamic load at time t; For the The power factor angle of a dynamic load; is the frequency influence coefficient; is the grid frequency at time t; is the standard frequency.
[0150] 6) For the unknown parameters in the above equations, formulate corresponding parameter acquisition methods, including obtaining them through experimental measurement, numerical calculation, historical data analysis, etc. These parameters include: charging efficiency , Charging current and voltage , Charging time constant , partial derivative of temperature with respect to power , Power and , Charging power function , Capacity attenuation parameters , , , , and the optimal temperature and current wait.
[0151] 7) Establish the constraints of the above equations, including: Charging efficiency constraints: , ; Charging time constraints: , ; Grid load constraints: , , To ensure that the charging process is carried out within a safe and reliable range.
[0152] Step S30: Fit the mathematical model according to the historical operating parameters to obtain a fitting model The purpose of this step is to use the historical operating parameter data collected from step S10 to fit the mathematical model established in step S20 to obtain a more accurate and practical mathematical model. Specifically, it includes: 1) The various operating parameter data collected in step S10 Input into the mathematical model established in step S20 as the independent variable of the model.
[0153] 2) Use numerical optimization algorithms such as nonlinear least squares method to minimize the objective function: ; in, , , , and are the charging power, charging time, battery capacity, charging efficiency and grid load predicted by the mathematical model, respectively. , , , and Then is the actual observed value. By iteratively optimizing the model parameters, the mean square error of the above five indicators is minimized.
[0154] 3) Through repeated iterations, until the deviation between the model prediction value and the actual observation value is less than the preset threshold (for example, 1%), it is considered that the model has fully fitted the historical data and the final fitting model is obtained.
[0155] 4) Verify the accuracy and stability of the fitting model, including evaluating the model performance on a new test data set and analyzing the changing trend of model parameters. If necessary, the model structure can be further optimized to improve the fitting effect.
[0156] Step S40: Establishing a hybrid model The purpose of this step is to build a hybrid model that includes a mathematical model and a neural network model, using the powerful learning ability of the neural network to supplement the deficiencies of the mathematical model and improve the accuracy and robustness of the power allocation strategy. Specifically include: 1) Design a multi-branch neural network model, including: Charging power equation error term subnetwork: Input is battery parameters and charging equipment parameters , the output is the power error The network structure is a three-layer feedforward neural network, and each layer uses the ReLU activation function. The number of neurons in the input layer is , the number of neurons in the hidden layer is 32 , the number of neurons in the output layer is .
[0157] Charging time equation error term subnetwork: Input is charging demand parameter and real-time charging data , the output is the time error The network structure is an LSTM network, which contains two layers of LSTM units and a fully connected output layer. The hidden state dimension of each layer of LSTM units is 64 , the number of neurons in the fully connected output layer is .
[0158] Battery capacity equation error term subnetwork: Input is battery parameters and real-time charging data , the output is the capacity error The network structure is a one-dimensional convolutional neural network, which includes two convolutional layers, one pooling layer and two fully connected layers. The number of filters in the convolutional layer is 16 and 32 , the number of neurons in the fully connected layer is 64 and 32 , the number of neurons in the output layer is .
[0159] Charging efficiency equation error term subnetwork: Input is charging equipment parameters , Environmental parameters and real-time charging data , the output is the efficiency error The network structure is a residual network, which contains three residual blocks and a fully connected output layer. The number of convolutional layer filters in each residual block is 32. , the number of neurons in the fully connected output layer is .
[0160] The error term subnetwork of the power grid load equation: Input is grid parameters and real-time charging data , the output is the charging pile load error The network structure is a time series prediction network, using GRU units and attention mechanism. The hidden state dimension of the GRU layer is 64 , the dimension of the attention layer is 32 , the number of neurons in the output layer is .
[0161] Environmental parameters subnetwork: Input as environment parameter , the output is the environmental impact factor. The network structure is a multi-layer perceptron, which contains three hidden layers, and each layer uses the Leaky ReLU activation function. The number of neurons in the three hidden layers is 32 , 64 and 32 ,The number of neurons in the output layer is the dimension of the environmental ,factors.
[0162] Charging gun head battery mutual response sub-network: Input is charging equipment parameters , Battery parameters and real-time charging data , the output is the charging efficiency and dynamic power adjustment vector. The network structure is a bidirectional LSTM network combined with a self-attention mechanism, including two layers of bidirectional LSTM and a multi-head self-attention layer. The hidden state dimension of each layer of LSTM is 64 , the number of heads in the self-attention layer is 4 ,The number of neurons in the output layer is the total dimension of the ,charging efficiency and dynamic power adjustment vector.
[0163] Fusion sub-network: The input is the output of each sub-network, and the output is the charging pile power allocation vector at the next moment. The network structure is a Transformer-based encoder-decoder network, which includes a multi-layer self-attention mechanism and a feedforward neural network. The encoder and decoder each contain 4 layers, and the number of self-attention heads in each layer is 8. , the hidden layer dimension of the feedforward neural network is 256 To adapt to Lora fine-tuning, a low-rank adaptation matrix with a rank of 16 is introduced in the last three fully connected layers. The number of neurons in the output layer is the dimension of the charging pile power allocation vector at the next moment.
[0164] 2) The above neural network model is integrated with the mathematical model obtained in step S30 to form a hybrid model. The integration method is: each sub-network processes the input data in parallel, and the output result is sent to the fusion sub-network. The output of the fusion sub-network is weighted averaged with the calculation result of the mathematical model to obtain the final power allocation result.
[0165] 3) The function of the neural network sub-network is to predict the error terms of each equation. These error terms are input into the mathematical model as correction factors to improve the accuracy of the mathematical model.
[0166] Step S50: Use historical operating parameters to train the hybrid model The purpose of this step is to use the historical operating parameter data collected from step S10 to train the hybrid model constructed in step S40 so that it can accurately predict the optimal charging power distribution of each gun head. Specifically, it includes: 1) The various operating parameter data collected in step S10 Divide into training set and validation set , where the training set is used for model parameter optimization and the validation set is used for model performance evaluation.
[0167] 2) Define the training objective function of the hybrid model as: ; in, , and They are respectively The charging power, charging efficiency and charging time of each charging gun head are , and is the actual observed value. The goal is to minimize the prediction error of charging power, efficiency and time of each gun head.
[0168] 3) Use a gradient-based optimization algorithm, such as the Adam optimizer, to iteratively update the parameters of the hybrid model so that the training set The value of the objective function keeps decreasing.
[0169] 4) During training, use the validation set regularly Evaluate the generalization performance of the model, such as charging power allocation error, charging time error, battery capacity prediction error and other indicators, and adjust the training hyperparameters such as learning rate and batch size according to the evaluation results.
[0170] 5) When the performance indicators of the validation set reach the preset convergence threshold (for example, each performance indicator is less than 5%), the model is considered to have been fully trained and the final charging pile power allocation model is obtained.
[0171] Step S60: Obtain the parameters of the current charging scenario and input them into the charging pile power allocation model The purpose of this step is to obtain various parameters of the current charging scenario and input them into the charging pile power allocation model trained in step S50, so as to obtain the optimal power allocation for each charging gun head. Specifically, it includes: 1) Obtain the battery parameters of the current charging scenario from the charging pile data acquisition system 、Charging requirement parameters , Charging equipment parameters , real-time charging data , Environmental parameters And grid parameters .
[0172] 2) Inputting the above-obtained parameters into the charging pile power allocation model trained in step S50.
[0173] 3) The model outputs the optimal charging power allocation vector for each charging gun head based on the input parameters through forward calculation .
[0174] Step S70: According to the power distribution vector, the charging power of each gun head is adjusted in real time The purpose of this step is to allocate the power vector according to the power distribution vector obtained in step S60. , adjust the charging power of each charging gun head in real time, and collect the actual charging data of each gun head in real time to calculate the error of power distribution. Specifically include: 1) The power allocation vector outputted in step S60 is The power is transmitted to the power regulation module of the charging pile, indicating the power that each charging gun head should output.
[0175] 2) The charging pile control system monitors the charging status of each gun head in real time, and based on the real-time charging data fed back Adjust the output power of the charging gun , making it as close to the target power allocation as possible .
[0176] 3) At the same time, the charging pile control system collects the actual charging data of each gun head in real time , and the target power allocation vector of step S60 Compare and calculate the actual power distribution With target allocation The error between .
[0177] 4) Collect these charging data in real time and power allocation error , as the input for fine-tuning the model in the subsequent step S80.
[0178] Step S80: Use Lora technology to build a lightweight model and perform real-time fine-tuning on the fusion sub-network The purpose of this step is to use the real-time charging data collected in step S70 and power allocation error , a lightweight fine-tuning model is constructed using Lora technology to perform real-time optimization on the fusion sub-network in step S40 to further improve the accuracy and adaptability of power allocation. Specifically, it includes: 1) The real-time charging data collected in step S70 is and power allocation error , as input data, and use Lora technology to build a lightweight fine-tuning model. Lora is a low-rank adaptation technology that can efficiently adjust the parameters of the neural network model without changing the original pre-trained weights.
[0179] 2) The goal of this lightweight fine-tuning model is to fit the real-time power allocation error observed in step S70 as closely as possible. , so as to better capture the dynamic change characteristics of the charging process.
[0180] 3) Specifically, the structure of the fine-tuning model focuses on the last three fully connected layers of the fusion sub-network, and a low-rank adaptation matrix is introduced in these layers, with the rank set to 16. This allows the model to efficiently adjust some parameters during the fine-tuning process without changing the main structure of the pre-training.
[0181] 4) The fine-tuning model is trained using online learning, using the latest real-time data every once in a while (e.g. 10 minutes) and The model is updated once so that it can track changes in the charging process in real time.
[0182] Step S90: Regularly merge the fine-tuned model into the fusion sub-network The purpose of this step is to regularly merge the lightweight model fine-tuned using Lora technology in step S80 into the fusion sub-network constructed in step S40 to continuously improve the performance and adaptability of the charging pile power allocation strategy. Specifically, it includes: 1) During the operation of the charging pile, at regular intervals (e.g., 1 day), the lightweight model fine-tuned using the Lora technology in step S80 is merged into the fusion sub-network constructed in step S40.
[0183] 2) The specific merging method is: the parameters of the last three fully connected layers of the lightweight fine-tuning model are directly overwritten with the parameters of the corresponding layers of the fusion sub-network. Due to the use of Lora technology, this parameter update will not significantly change the original structure and pre-trained weights of the fusion sub-network.
[0184] 3) After the merger is completed, the power allocation performance of the entire hybrid model (including the mathematical model and the fusion sub-network) will be further improved to better adapt to the actual changes in charging scenarios.
[0185] 4) By periodically performing this model merging, the charging pile power allocation strategy can be continuously optimized, and the accuracy and adaptability can be continuously improved as the operating time increases.
[0186] In summary, this embodiment 1 realizes intelligent optimization of charging pile power allocation strategy through mathematical modeling, machine learning modeling and the integration of the two. Among them, the mathematical model ensures the interpretability and controllability of the method, while the neural network model improves the adaptive learning ability of actual operation data. The Lora fine-tuning of the fusion sub-network further enhances the real-time and robustness of the model, ensuring that the charging pile can maintain efficient and safe power allocation in a complex dynamic environment.
[0187] In order to further better understand and implement the present invention, the following is a specific application scenario of the present invention, Example 2: A multi-gun charging pile system with 8 gun heads is installed in a public parking lot in a certain city to provide charging services for electric vehicles in the parking lot. The specific implementation steps are as follows: Initial parameter acquisition and mathematical model construction When the charging pile was first put into operation, the operator first obtained the historical operating parameters of each charging gun head through the data acquisition system, including: Battery parameters: Battery capacity :18 kWh; remaining power :10% ~ 90%; Battery temperature :20°C ~40°C; battery internal resistance :0.05 Ω ~ 0.2 Ω; Battery health :80% ~ 100%; Charging requirement parameters: target charging amount set by the user :5 kWh ~ 15 kWh; expected charging time :0.5 h ~ 2 h; Charging priority :1 ~ 5; Charging equipment parameters: Charging gun head type :AC Level 2; Maximum output power :7 kW; Charging gun tip temperature :25°C ~ 45°C; Real-time charging data: current charging power :0 kW ~ 7 kW; real-time charging voltage :200 V ~ 450 V; real-time charging current :0 A ~ 25 A; Charging time :0 s ~ 7200 s; Charging efficiency :75% ~ 95%; Environmental parameters: Ambient temperature :25°C; Humidity :60%; Weather conditions :Sunny without rain; Grid parameters: Grid voltage :230 V; grid current :200 A ~ 500 A; Phase Angle :0° ~30°; Power factor :0.9 ~ 1.0; Grid frequency :50 Hz; Charging pile load :10 kW ~ 50 kW; Based on the above data, the operator first established a mathematical model with multiple error terms to describe the key characteristics of the charging process: 1) Charging power equation: ; in, is the charging time constant, which is 1800 s after experimental measurement; is the partial derivative of power with respect to temperature, which is -20 W / °C as measured experimentally.
[0188] 2) Charging time equation: ; in, and are the partial derivatives of charging time with respect to current and voltage, respectively, which are calculated by numerical differentiation.
[0189] 3) Battery capacity equation: ; in, The initial capacity is 18 kWh, and are 0.05 and 0.01, respectively, obtained by fitting through cyclic experiments; It is 40 kJ / mol, measured by the Arrhenius experiment.
[0190] 4) Charging efficiency equation: ; in, The ideal charging efficiency is 90%, is 1200 s, measured by experiment; and 0.001 and 0.02, respectively, obtained by multiple regression analysis; It is 15 A, which is determined by optimization experiments.
[0191] 5) Grid load equation: ; in, is a base load of 30 kW, predicted from historical data; is the complex power of the other three dynamic loads, obtained through grid monitoring; It is 0.01, which is measured by experiment.
[0192] Various error terms introduced in the above mathematical model , , , and , which will be predicted and corrected in the subsequent neural network model.
[0193] At the same time, the operator also established corresponding constraints for the above mathematical model: Charging efficiency constraints: ; ; Charging time constraints: ; ; Grid load constraints: ; ; ; Training of Neural Network Models After determining the mathematical model, the operator further constructed a neural network model with a multi-branch structure to predict the error terms of each mathematical equation and integrated it into the mathematical model to form a hybrid model.
[0194] Specifically, the neural network model includes the following sub-networks: 1) Charging power equation error term subnetwork: Input is battery parameters and charging equipment parameters , the output is the power error The network structure is a three-layer feedforward neural network, and each layer uses the ReLU activation function. The number of neurons in the input layer is 13 (5 battery parameters + 3 charging device parameters), the number of neurons in the hidden layer is 256, and the number of neurons in the output layer is 1.
[0195] 2) Charging time equation error term subnetwork: Input is charging demand parameter and real-time charging data , the output is the time error The network structure is an LSTM network, which contains two layers of LSTM units and a fully connected output layer. The hidden state dimension of each LSTM unit is 512, and the number of neurons in the fully connected output layer is 1.
[0196] 3) Battery capacity equation error term subnetwork: Input is battery parameters and real-time charging data , the output is the capacity error The network structure is a one-dimensional convolutional neural network, which includes two convolutional layers, one pooling layer and two fully connected layers. The number of filters in the convolutional layer is 128 and 256 respectively, the number of neurons in the fully connected layer is 512 and 256 respectively, and the number of neurons in the output layer is 1.
[0197] 4) Charging efficiency equation error term subnetwork: Input is charging equipment parameters , Environmental parameters and real-time charging data , the output is the efficiency error The network structure is a residual network, which contains three residual blocks and a fully connected output layer. The number of convolutional layer filters in each residual block is 256, and the number of neurons in the fully connected output layer is 1.
[0198] 5) Grid load equation error term subnetwork: Input is grid parameters and real-time charging data , the output is the charging pile load error The network structure is a time series prediction network, using GRU units and attention mechanisms. The hidden state dimension of the GRU layer is 512, the dimension of the attention layer is 256, and the number of neurons in the output layer is 1.
[0199] 6) Environmental parameter sub-network: Input as environment parameter , the output is the environmental impact factor. The network structure is a multi-layer perceptron, which contains three hidden layers, and each layer uses the Leaky ReLU activation function. The number of neurons in the three hidden layers is 256, 512 and 256 respectively, and the number of neurons in the output layer is 3.
[0200] 7) Charging gun head battery mutual response sub-network: Input is charging equipment parameters , Battery parameters and real-time charging data , the output is charging efficiency and dynamic power adjustment vector. The network structure is a bidirectional LSTM network combined with a self-attention mechanism, which includes two layers of bidirectional LSTM and a multi-head self-attention layer. The hidden state dimension of each LSTM layer is 512, the number of heads in the self-attention layer is 32, and the number of neurons in the output layer is 9 (1 for charging efficiency and 8 for dynamic power adjustment vector).
[0201] 8) Fusion sub-network: The input is the output of the above sub-networks, and the output is the charging pile power allocation vector at the next moment. The network structure is a Transformer-based encoder-decoder network, which includes a 4-layer self-attention mechanism and a feedforward neural network. The encoder and decoder each contain 4 layers, the number of self-attention heads in each layer is 64, and the hidden layer dimension of the feedforward neural network is 2048. The rank of the introduced low-rank adaptation matrix is 16. The number of neurons in the output layer is 8, corresponding to the power distribution of 8 charging gun heads.
[0202] During the training process, the operator divides the historical operating parameter data obtained in step S10 into a training set and a validation set, and uses the Adam optimizer to update the parameters of the hybrid model according to the objective function defined in formula (2). During the training process, the validation set is used regularly to evaluate the model performance, and the hyperparameters are adjusted according to the evaluation results until all performance indicators are less than 5%, and the model training is considered to have converged.
[0203] ; Real-time power allocation and online fine-tuning After the charging pile is put into formal operation, the operator will obtain various parameter data of the current charging scene in real time, including battery parameters 、Charging requirement parameters , Charging equipment parameters , real-time charging data , Environmental parameters and grid parameters , and input it into the trained hybrid model to obtain the optimal power allocation vector for each charging gun head .
[0204] The charging pile control system will adjust the output power of the eight charging gun heads in real time according to this power distribution vector to make it as close to the target value as possible. At the same time, the system will also collect the actual charging data of each gun head in real time. , and calculate the target power allocation The error between .
[0205] In summary, this embodiment 2 achieves comprehensive optimization of charging efficiency, battery health and grid load through the organic integration of mathematical modeling and machine learning, and provides an excellent solution for charging electric vehicles in public parking lots. The online fine-tuning mechanism supported by the Lora technology in embodiment 2 also ensures that the system can adapt to changes in charging scenarios in the long term.
[0206] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for distributing power of a multi-charger charging pile, characterized in that: The following steps are involved: S10, obtaining the historical operating parameters of each charging pile gun head; S20, establishing a mathematical model including a plurality of equations with error terms taking into account the operating parameters, including a charging power equation, a charging time equation, a battery capacity equation, a charging efficiency equation, and a grid load equation; S30, fitting the mathematical model according to the historical operating parameters to obtain a fitting model; S40, establishing a hybrid model, including a neural network model with a multi-branch structure and the mathematical model; S50, using the historical operating parameters to train the hybrid model to obtain a charging pile power allocation model, wherein the training input is the operating parameters and environmental parameters of each gun head, and the training output is the optimal charging power allocation of each gun head; S60, obtaining battery parameters, charging demand parameters, charging equipment parameters, real-time charging data, environmental parameters and power grid parameters of the charging pile in the current charging scenario, and inputting them into the charging pile power allocation model to obtain a power allocation vector; S70, adjusting the charging power of each gun head in real time according to the power allocation vector, and collecting the actual charging data of each gun head in real time during the charging process to calculate the power error; S80, based on the collected real-time data and prediction errors, a lightweight model is constructed using Lora technology to fine-tune the last three layers of the fully connected layer of the fusion subnetwork of the charging pile power allocation model in real time; S90. Regularly merge the fine-tuned lightweight model into the fusion sub-network to continuously improve the accuracy and adaptability of power allocation.
2. A multi-gun charging pile power distribution method according to claim 1, characterized in that: The operating parameters include battery parameters, charging demand parameters, charging equipment parameters, real-time charging data, environmental parameters, charging gun head power allocation parameters and power grid parameters; wherein the battery parameters include battery capacity, remaining power, battery type, battery health status, battery internal resistance and battery temperature; the charging demand parameters include the user-set target charging amount, expected charging time and charging priority of each charging gun head; the charging equipment parameters include the charging gun head type, charging protocol, maximum output power and charging gun head temperature; the real-time charging data include the current charging power, real-time charging voltage, real-time charging current, charging time and charging efficiency; the environmental parameters include ambient temperature, ambient humidity and weather conditions; the charging gun head power allocation parameters include the current allocated power, the maximum allocable power, the minimum allocable power, the power adjustment step and the power adjustment frequency; the power grid parameters include voltage, current, harmonics, power factor, frequency and charging pile load.
3. A multi-gun charging pile power distribution method according to claim 1, characterized in that: The multi-branch neural network model includes a charging power equation error term subnetwork, a charging time equation error term subnetwork, a battery capacity equation error term subnetwork, a charging efficiency equation error term subnetwork, a power grid load equation error term subnetwork, an environmental parameter subnetwork, a charging gun head battery mutual response subnetwork and a fusion subnetwork.
4. A multi-gun charging pile power distribution method according to claim 1, characterized in that: The charging power equation error term subnetwork is used to predict the error of the charging power equation. The input is the battery parameters and the charging device parameters, and the output is the power error. The structure is a three-layer feedforward neural network, and each layer uses a ReLU activation function. The charging time equation error term subnetwork is used to predict the error of the charging time equation, the input is the charging demand parameter and the real-time charging data, and the output is the time error; The structure is an LSTM network, which contains two layers of LSTM units and a fully connected output layer; The battery capacity equation error term subnetwork is used to predict the error of the battery capacity equation. The input is battery parameters and real-time charging data, and the output is capacity error. The structure is a one-dimensional convolutional neural network, including two convolutional layers, one pooling layer and two fully connected layers. The charging efficiency equation error term subnetwork is used to predict the error of the charging efficiency equation, the input is charging equipment parameters, environmental parameters and real-time charging data, and the output is efficiency error; The structure is a residual network, which contains three residual blocks and a fully connected output layer; The grid load equation error term subnetwork is used to predict the error of the grid load equation. The input is grid parameters and real-time charging data, and the output is the charging pile load error. The structure is a time series prediction network, using GRU units and attention mechanism. The environmental parameter subnetwork is used to process the impact of the environment on charging. The input is the environmental parameter and the output is the environmental impact factor. The structure is a multi-layer perceptron, including three hidden layers, and each layer uses a Leaky ReLU activation function. The charging gun head battery mutual response sub-network is used to analyze the dynamic interaction relationship between the charging gun head and the battery. The input is the charging device parameters, battery parameters and real-time charging data, and the output is the charging efficiency and dynamic power adjustment vector. The structure is a bidirectional LSTM network combined with a self-attention mechanism, which includes two layers of bidirectional LSTM and a multi-head self-attention layer; The fusion subnetwork is used to integrate the outputs of each subnetwork. The input is the output of all subnetworks, and the output is the charging pile power allocation vector at the next moment. The structure is an encoder-decoder network based on Transformer, which includes a multi-layer self-attention mechanism and a feedforward neural network.
5. A multi-gun charging pile power distribution method according to claim 1, characterized in that: The number of hidden layer neurons in each sub-network is a variable parameter, which is used to adjust according to the number of gun heads of the charging pile to adapt to charging piles of different sizes.
6. A multi-head charging pile power distribution method according to claim 1, characterized in that: The structure of the hybrid model is specifically as follows: each sub-network processes input data in parallel, and the output result is sent to the fusion sub-network, and the output of the fusion sub-network is weighted averaged with the calculation result of the mathematical model to obtain the final power allocation result.
7. A multi-head charging pile power distribution method according to claim 6, characterized in that: The data transmission relationship between the neural network and the mathematical model is specifically: the neural network predicts the error terms of each equation, and these error terms are input into the mathematical model as correction factors to improve the accuracy of the mathematical model.
8. A multi-head charging pile power distribution method according to claim 1, characterized in that: The constraints of the mathematical model include charging efficiency constraints, time constraints, and grid load constraints.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to execute the power distribution method for a multi-gun charging pile according to any one of claims 1 to 8.
10. A multi-gun charging pile power distribution system, characterized by comprising the computer-readable storage medium according to claim 9.
Citation Information
Patent Citations
Charging method capable of automatically distributing control power
CN116691418A
Multi-gun low-power charging pile system and charging method
CN117465272A
Power supply control method and system of power distribution cabinet for intelligent charging pile
CN117901694A
Charging power determination method and device, computer program product and charging system
CN118343015A
Intelligent management method and platform for electric vehicle charging station based on Internet of Things
CN118560331A
Cited By
Intelligent electric energy meter data acquisition and alarm device
CN120301916A
A smart energy meter data acquisition and alarm device
CN120301916B
New energy charging pile power distribution method and system for multiple charging guns
CN120735645A
Multi-gun charging pile power flexible distribution method and cooperative control system
CN120963442A