A multi-head charging pile power distribution method, medium and system
Through the combination of hybrid model and Lora technology, intelligent power distribution of multi-gun charging piles is achieved, solving the problem of inability to adapt to complex scenarios in the existing technology, and improving charging efficiency and grid stability.
Patent Information
- Application Number
- CN202411669491.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2044-11-21
AI Technical Summary
The power distribution methods of existing multi-gun charging piles are mainly distributed through simple preset or fixed modes, and cannot adapt to complex charging scenarios and needs, resulting in problems such as inefficient charging resource utilization, poor user experience, and unbalanced grid load.
A hybrid model is used to combine multi-branch neural networks and mathematical models. By obtaining the historical operating parameters of the charging pile, an equation containing error terms is established, and real-time fine-tuning is used to achieve intelligent and dynamic power distribution.
It improves charging efficiency, optimizes resource utilization, improves user experience, and protects grid stability, is real-time and robust, while maintaining physical interpretability.
Smart Images

Figure CN119416651B_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 a critical issue. Multi-head charging stations, as an efficient charging solution, have gained widespread adoption in public charging stations, parking lots, and commercial areas. These charging devices can simultaneously charge multiple electric vehicles, improving charging efficiency and site utilization.
[0003] However, the current power distribution strategy for multi-head charging piles still has many shortcomings. The main application scenarios include:
[0004] 1. Public charging stations: During peak hours, multiple electric vehicles charge at the same time, posing a challenge to the power distribution of charging piles.
[0005] 2. Commercial parking lots: Charging vehicles of different models and with different charging requirements simultaneously requires a flexible power allocation strategy.
[0006] 3. Charging facilities in residential areas: When charging is carried out in a centralized manner at night, how to balance the grid load and user demand becomes a key issue.
[0007] 4. Long-distance charging stations: The demands for both fast charging and long-distance charging coexist, requiring charging piles to be able to intelligently allocate power.
[0008] The power distribution methods in the prior art mainly have the following problems:
[0009] 1. Simple preset allocation: Many charging stations use fixed power allocation strategies, such as equal allocation or allocation according to a preset ratio. This approach cannot adapt to the charging characteristics of different vehicle models and the actual needs of users.
[0010] 2. Single parameter consideration: Some charging piles only consider a single factor such as battery capacity or charging time for power allocation, ignoring important parameters such as charging efficiency and grid load.
[0011] 3. Static model: Most existing power distribution models are static models and cannot be dynamically adjusted according to real-time charging data and environmental changes.
[0012] 4. Lack of learning ability: Traditional methods lack adaptive learning capabilities and are unable to optimize allocation strategies from historical data.
[0013] 5. Poor scale adaptability: Existing methods are difficult to flexibly adjust and expand for charging stations of different sizes.
[0014] 6. Ignoring environmental factors: rarely considering the impact of environmental factors such as temperature and humidity on charging efficiency.
[0015] 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.
[0016] 8. Poor user experience: Unable to personalize allocation based on user charging preferences and urgency.
[0017] In summary, existing technologies for power distribution in multi-pile charging stations have shortcomings, primarily due to their simple pre-set or fixed modes, which fail to adapt well to complex charging scenarios and requirements. These issues lead to a range of problems, including inefficient use of charging resources, decreased user satisfaction, and unbalanced grid load. Therefore, an intelligent, dynamic, and comprehensive power distribution method for multi-pile charging stations is urgently needed to improve charging efficiency, optimize resource utilization, enhance user experience, and protect grid stability. Summary of the Invention
[0018] In view of this, the present invention provides a multi-gun head charging pile power distribution method, medium and system, which can solve the technical problem that the existing technology mainly distributes the power of multi-gun head charging piles through simple preset or fixed modes, and is unable to adapt well to complex charging scenarios and needs.
[0019] The present invention is achieved in that:
[0020] A first aspect of the present invention provides a multi-charger charging pile power distribution method, which includes the following steps:
[0021] S10, obtaining historical operating parameters of each charging pile gun head;
[0022] S20. Establishing a mathematical model that takes into account the operating parameters and includes multiple equations with error terms, including a charging power equation, a charging time equation, a battery capacity equation, a charging efficiency equation, and a grid load equation;
[0023] S30, fitting the mathematical model according to the historical operating parameters to obtain a fitting model;
[0024] S40, establishing a hybrid model, including a neural network model with a multi-branch structure and the mathematical model;
[0025] S50: Using the historical operating parameters to train the hybrid model to obtain a charging pile power distribution model, wherein the training input is the operating parameters and environmental parameters of each charging head, and the training output is the optimal charging power distribution of each charging head;
[0026] S60: Obtain battery parameters, charging demand parameters, charging equipment parameters, real-time charging data, environmental parameters, and grid parameters of the charging pile in the current charging scenario, and input them into the charging pile power allocation model to obtain a power allocation vector;
[0027] S70, adjusting the charging power of each gun head in real time according to the power distribution vector, and collecting actual charging data of each gun head in real time during the charging process to calculate the power error;
[0028] S80. Based on the collected real-time data and prediction error, a lightweight model is constructed 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;
[0029] S90. Regularly merge the fine-tuned lightweight model into the fusion sub-network to continuously improve the accuracy and adaptability of power allocation.
[0030] 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.
[0031] 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 grid load equation error term subnetwork, an environmental parameter subnetwork, a charging gun head battery mutual response subnetwork and a fusion subnetwork.
[0032] The charging power equation error term subnetwork is used to predict the error of the charging power equation. The input is battery parameters and charging device parameters, and the output is power error. The structure is a three-layer feedforward neural network, and each layer uses the ReLU activation function.
[0033] 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 real-time charging data, and the output is the time error. The structure is an LSTM network, which includes two layers of LSTM units and a fully connected output layer.
[0034] 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 the capacity error. The structure is a one-dimensional convolutional neural network, which includes two convolutional layers, one pooling layer and two fully connected layers.
[0035] 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.
[0036] 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.
[0037] 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 the Leaky ReLU activation function.
[0038] The charging gun head battery mutual response subnetwork 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.
[0039] 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.
[0040] Specifically, the subnetwork structure for the error term in the charging power equation is a three-layer feedforward neural network, with each layer using the ReLU activation function. The number of neurons in the input layer is determined by the dimensions of the battery and charging device parameters. The number of neurons in the hidden layer is 32×n, where n is the number of charging station tips. The number of neurons in the output layer matches the dimension of the power error.
[0041] The subnetwork structure for the error term in the charging time equation is an LSTM network, consisting of two layers of LSTM units and a fully connected output layer. The hidden state dimension of each LSTM unit is 64 × n, where n is the number of charging station charging points. The number of neurons in the fully connected output layer matches the dimension of the time error.
[0042] The battery capacity equation error term subnetwork is a one-dimensional convolutional neural network consisting of two convolutional layers, one pooling layer, and two fully connected layers. The convolutional layers have filters of 16×n and 32×n, respectively, and the fully connected layers have neurons of 64×n and 32×n, respectively, where n is the number of charging station tips. The number of neurons in the output layer matches the capacity error dimension.
[0043] The subnetwork structure for the error term in the charging efficiency equation is a residual network, consisting of three residual blocks and a fully connected output layer. The number of convolutional filters in each residual block is 32×n, where n is the number of charging station tips. The number of neurons in the fully connected output layer matches the efficiency error dimension.
[0044] The grid load equation error term subnetwork is a time series prediction network that uses GRU units and an attention mechanism. 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.
[0045] The environmental parameter subnetwork is a multilayer perceptron with three hidden layers, each using a 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 station tips. The number of neurons in the output layer matches the dimensionality of the environmental influencing factors.
[0046] The charging gun head-battery interaction subnetwork architecture is a bidirectional LSTM network combined with a self-attention mechanism, consisting of two bidirectional LSTM layers 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 charging gun heads in the charging station. The number of neurons in the output layer matches the total dimension of the charging efficiency and dynamic power adjustment vectors.
[0047] The fusion sub-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, with 8×n self-attention heads in each layer. The hidden layer dimension of the feedforward neural network is 256×n, where n is the number of charging pile heads. To adapt to Lora fine-tuning, low-rank adaptation matrices with a rank of 16 are introduced in the last three fully connected layers. These low-rank adaptation matrices allow efficient adjustment of model parameters during fine-tuning 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.
[0048] The number of hidden layer neurons in each sub-network is a variable parameter, which is adjusted according to the number of gun heads of the charging pile to adapt to charging piles of different sizes.
[0049] 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, 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.
[0050] 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.
[0051] The constraints of the mathematical model include charging efficiency constraints, time constraints, and grid load constraints.
[0052] 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; 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.
[0053] Among them, step S20 includes: establishing a charging power equation, a charging time equation, a battery capacity equation, a charging efficiency equation and a 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 the unknown parameters in each equation; establishing constraints for the above-mentioned set of equations, including charging efficiency constraints, charging time constraints and grid load constraints, to ensure that the charging process is carried out within a safe and reliable range.
[0054] Among them, step S30 includes: inputting various 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.
[0055] Among them, 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 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, giving a specific network structure design, including hyperparameters such as the number of layers, the number of neurons, and the activation function; fusing the above-mentioned neural network model with the mathematical model obtained in step S30 to form a hybrid model that includes mathematical modeling and machine learning, thereby combining the advantages of both parties.
[0056] Among them, step S50 includes: dividing the various 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 in 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 based on the evaluation results until the validation set performance index reaches a preset convergence threshold.
[0057] Among them, 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 scenario from the charging pile data acquisition system; inputting the above-obtained parameters into the charging pile power distribution model trained in step S50, and the model outputs the optimal charging power distribution vector for each charging gun head through forward calculation.
[0058] Among them, step S70 includes: transmitting the power distribution vector output in step S60 to the power regulation 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 of 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.
[0059] Among them, step S80 includes: using the real-time charging data and power distribution 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 distribution performance and adaptability of the entire hybrid model.
[0060] Furthermore, the charging power equation is specifically expressed as follows:
[0061] ;
[0062] Where, 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; The ambient temperature changes; is the power error term.
[0063] Parameter acquisition method:
[0064] It is calculated by real-time monitoring of the charging process. The calculation formula is: ,in is the output power, is the input power.
[0065] and It is obtained through real-time measurement of the current and voltage sensors of the charging pile.
[0066] Obtained experimentally, including step 1: charging the battery at a constant current; step 2: recording the battery voltage curve over time; step 3: fitting the curve to obtain the time constant .
[0067] The data is obtained experimentally, including step 1: measuring the charging power at different temperatures; and step 2: calculating the rate of change of power with temperature.
[0068] The charging time equation is specifically expressed as follows:
[0069] ;
[0070] Where, 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 current and voltage in stage i respectively; and are the changes of current and voltage in stage i respectively; is the time error term.
[0071] Parameter acquisition method:
[0072] and Obtained through data provided by the battery management system (BMS).
[0073] The function is obtained through experiments, including step 1: measuring the charging power at different power levels; step 2: fitting function.
[0074] and The calculation is done by numerical differentiation method. The specific steps are as follows: in each charging stage, the current or voltage is slightly changed, the change in charging time is measured, and the partial derivative is calculated.
[0075] The battery capacity equation is specifically expressed as follows:
[0076] ;
[0077] Where, 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 frequency domain capacity function; is the angular frequency; is the time constant; is the capacity error term.
[0078] Parameter acquisition method:
[0079] Obtained through battery specification parameters.
[0080] 、 、 and It is obtained through experiments, including step 1: conducting a large number of cyclic charge and discharge experiments; step 2: recording the capacity after each cycle; and step 3: fitting parameters using a nonlinear regression method.
[0081] 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 .
[0082] 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.
[0083] The charging efficiency equation is specifically expressed as follows:
[0084] ;
[0085] Where, 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 of SoC; is the efficiency error term.
[0086] Parameter acquisition method:
[0087] Obtained through battery specification parameters.
[0088] 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 .
[0089] and It is obtained experimentally, including step 1: measuring the charging efficiency at different temperatures and currents; step 2: obtaining the coefficients using multiple regression analysis.
[0090] 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.
[0091] The data is obtained experimentally, including step 1: measuring the charging efficiency at different SoCs; step 2: calculating the rate of change of efficiency with SoC.
[0092] The grid load equation is specifically expressed as follows:
[0093] ;
[0094] Where, 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.
[0095] Parameter acquisition method:
[0096] Obtained through historical load data and load forecasting models.
[0097] Obtained through real-time power measurement of the charging pile.
[0098] and Obtained through real-time measurement by the power grid monitoring system.
[0099] It is obtained through experiments, including step 1: measuring the grid load at different frequencies; step 2: analyzing the relationship between load and frequency; step 3: fitting to obtain .
[0100] Obtained through real-time measurement by the power grid frequency measurement device.
[0101] The charging efficiency constraint condition is specifically expressed as follows:
[0102] ;
[0103] ;
[0104] Where, is the minimum allowable charging efficiency; is the maximum allowable charging efficiency; is the maximum allowable efficiency change rate.
[0105] Parameter acquisition method:
[0106] and Determined by battery specifications and charging safety standards.
[0107] The efficiency 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.
[0108] The time constraint conditions are specifically expressed as follows:
[0109] ;
[0110] ;
[0111] Where, is the minimum allowed charging time; is the maximum allowed charging time; Charge the energy you need.
[0112] Parameter acquisition method:
[0113] and Determined by user settings and charging station operation strategy.
[0114] Obtained through user demand or data provided by the battery management system.
[0115] The grid load constraint conditions are specifically expressed as follows:
[0116] ;
[0117] ;
[0118] ;
[0119] Where, is the maximum allowable grid load; is the maximum allowable load change rate; The maximum allowed power of the charging station.
[0120] Parameter acquisition method:
[0121] Determined by grid capacity and safe operation standards.
[0122] Obtained through power grid stability analysis and historical data statistics.
[0123] Determined by charging station design specifications and power system capacity.
[0124] 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 run, they are used to execute the above-mentioned multi-gun head charging pile power distribution method.
[0125] 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.
[0126] Compared with the prior art, the multi-head charging pile power distribution method, medium and system provided by the present invention have the following beneficial effects:
[0127] 1) Comprehensively optimize multiple metrics, including charging efficiency, battery health, and grid load. The mathematical modeling describes the physical relationships between the battery, charging equipment, environment, and grid during the charging process, taking into account the impact of various factors on charging performance. Furthermore, the neural network model, acting as an "error term corrector," adaptively learns the complex dynamic characteristics of the actual charging process, improving the accuracy of the overall optimization.
[0128] 2) Strong real-time and robustness. This method integrates machine learning models with mathematical models in real time and uses Lora technology to efficiently fine-tune the core network layer, enabling the entire system to continuously adapt to changes in charging scenarios and avoid performance degradation caused by drastic changes in the environment or user needs.
[0129] 3) Maintaining physical interpretability. Unlike purely data-driven "black box" models, the hybrid modeling approach of this invention maintains the excellent performance of machine learning models while also preserving the interpretability of mathematical models. This helps to better understand the physical mechanisms of the charging process and provides a basis for further optimizing charging strategies.
[0130] 4) Intelligent coordination of charging pile power is achieved. This method not only considers the power distribution of each charging head within a single charging pile, but also incorporates grid load factors into the optimization. This can achieve coordination between multiple charging piles and reduce the overall burden on the grid.
[0131] In general, the multi-gun charging pile power distribution method proposed in the present invention combines mathematical modeling with machine learning. On the basis of maintaining physical interpretability, it uses a data-driven approach to adaptively optimize the charging power distribution strategy, 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 distribution 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
[0132] Figure 1 A flow chart of the method provided by the present invention. DETAILED DESCRIPTION
[0133] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0134] like Figure 1 FIG. 1 is a flow chart of a method for distributing power to a multi-head charging pile provided by the present invention. The method includes the following steps:
[0135] S10, obtaining historical operating parameters of each charging pile gun head;
[0136] S20. Establishing a mathematical model that takes into account operating parameters and includes multiple equations with error terms, including a charging power equation, a charging time equation, a battery capacity equation, a charging efficiency equation, and a grid load equation;
[0137] S30, fitting the mathematical model according to historical operating parameters to obtain a fitting model;
[0138] S40, establishing a hybrid model, including a neural network model with a multi-branch structure and a mathematical model;
[0139] S50. Use historical operating parameters to train the hybrid model to obtain a charging pile power distribution model, where the training input is the operating parameters and environmental parameters of each charging head, and the training output is the optimal charging power distribution of each charging head;
[0140] S60: Obtain battery parameters, charging demand parameters, charging equipment parameters, real-time charging data, environmental parameters, and grid parameters of the charging pile in the current charging scenario, and input them into a charging pile power allocation model to obtain a power allocation vector;
[0141] S70, adjusting the charging power of each gun head in real time according to the power distribution vector, and collecting the actual charging data of each gun head in real time during the charging process to calculate the power error;
[0142] S80: Based on the collected real-time data and prediction errors, a lightweight model is built using Lora technology to perform real-time fine-tuning on the last three layers of the fully connected layer of the fusion sub-network of the charging pile power allocation model.
[0143] S90 regularly merges the fine-tuned lightweight model into the fusion sub-network to continuously improve the accuracy and adaptability of power allocation.
[0144] The specific implementation of the above steps is described in detail below:
[0145] Step S10: Obtain the historical operating parameters of each charging station gun head
[0146] The purpose of this step is to collect relevant parameter data of each charging pile gun head during its historical operation, providing basic input for subsequent mathematical modeling and machine learning model training. The specific implementation method includes:
[0147] 1) Obtain the historical operation records of each charging gun head from the charging pile's data acquisition system, including battery parameters (battery capacity, remaining power, battery type, battery health status, battery internal resistance, battery temperature), charging demand parameters (user-set target charge 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.
[0148] 2) Organize the collected parameter data into a structured data set to prepare for subsequent mathematical modeling and machine learning model training.
[0149] 3) Conduct preliminary statistical analysis and outlier detection on the data set to ensure the integrity and accuracy of the data.
[0150] Step S20: Establish a mathematical model that takes into account the operating parameters and includes multiple error terms
[0151] The purpose of this step is to establish a mathematical model containing multiple error terms based on the operating parameter data collected in step S10 to describe the relationship between the charging power, charging time, battery capacity, charging efficiency, and grid load of the charging pile. Specific implementation methods include:
[0152] 1) Establish a charging power equation, taking into account the impact of battery parameters, charging equipment parameters and ambient temperature on charging power, and introduce a power error term :
[0153] ;
[0154] 2) Establish a charging time equation, taking into account the impact of charging demand parameters and real-time charging data on charging time, and introduce a time error term :
[0155] ;
[0156] 3) Establish a battery capacity equation, taking into account the impact of battery parameters, charge and discharge current, temperature and other factors on battery capacity, and introduce a capacity error term :
[0157] ;
[0158] 4) Establish a charging efficiency equation, taking into account the impact of charging equipment parameters, ambient temperature, and charging current on charging efficiency, and introduce an efficiency error term :
[0159] ;
[0160] 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 :
[0161] ;
[0162] 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.
[0163] 7) Establish the constraints for 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.
[0164] Through the above steps, a mathematical model containing multiple error terms was established. This model can accurately describe the key characteristics of the charging pile operation and consider the impact of various practical factors on the charging process. This provides a foundation for the subsequent construction of hybrid models and power allocation optimization.
[0165] Step S30: Fit the mathematical model according to the historical operating parameters to obtain the fitting model
[0166] 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:
[0167] 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.
[0168] 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 observation data.
[0169] 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%), the model is considered to have fully fitted the historical data and the final fitting model is obtained.
[0170] 4) Verify the accuracy and stability of the fitted model, including evaluating model performance on a new test dataset and analyzing the changing trends of model parameters. If necessary, further optimize the model structure to improve the fitting effect.
[0171] 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 basis for subsequent hybrid model construction and power distribution optimization.
[0172] Step S40: Establishing a hybrid model
[0173] 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. Specific implementation methods include:
[0174] 1) Design a multi-branch neural network model, including:
[0175] Charging power equation error term subnetwork, used to predict the error term of the charging power equation;
[0176] Charging time equation error term subnetwork, used to predict the error term of the charging time equation;
[0177] The battery capacity equation error term subnetwork is used to predict the error term of the battery capacity equation;
[0178] Charging efficiency equation error term subnetwork, used to predict the error term of the charging efficiency equation;
[0179] The grid load equation error term subnetwork is used to predict the error term of the grid load equation;
[0180] Environmental parameter sub-network, used to process the impact of the environment on charging;
[0181] The charging gun head battery mutual response subnetwork is used to analyze the dynamic interaction relationship between the charging gun head and the battery;
[0182] The fusion sub-network is used to integrate the outputs of each sub-network to obtain the final power allocation vector;
[0183] 2) The specific structure design of each sub-network is as follows:
[0184] The charging power equation error term subnetwork consists of a three-layer feedforward neural network, each layer using the ReLU activation function. The number of neurons in the input layer is determined by the dimensions of the battery and charging device parameters. The number of neurons in the hidden layer is 32×n, and the number of neurons in the output layer matches the dimensions of the power error.
[0185] The charging time equation error term subnetwork is an LSTM network consisting of two layers of LSTM units and a fully connected output layer. The hidden state dimension of each LSTM unit is 64×n, and the number of neurons in the fully connected output layer matches the dimension of the time error.
[0186] The battery capacity equation error term subnetwork is 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 layers is 16×n and 32×n, respectively, and the number of neurons in the fully connected layers is 64×n and 32×n, respectively. The number of neurons in the output layer matches the capacity error dimension.
[0187] The charging efficiency equation error term subnetwork is a residual network consisting of three residual blocks and a fully connected output layer. The number of convolutional filters in each residual block is 32×n, and the number of neurons in the fully connected output layer matches the efficiency error dimension.
[0188] The grid load equation error term subnetwork: A time series prediction network using GRU units and an 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.
[0189] Environmental parameter subnetwork: A multilayer perceptron with three hidden layers, each using a Leaky ReLU activation function. The number of neurons in the three hidden layers is 32×n, 64×n, and 32×n, respectively. The number of neurons in the output layer matches the dimensions of the environmental influencing factors.
[0190] Charging gun head battery mutual response subnetwork: A bidirectional LSTM network with a self-attention mechanism consists of two bidirectional LSTM layers 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 vectors.
[0191] Fusion subnetwork: A Transformer-based encoder-decoder network with a multi-layer self-attention mechanism and a feedforward neural network. The encoder and decoder each contain four layers, each with 8×n self-attention heads. The hidden layer of the feedforward neural network has a dimension of 256×n. To accommodate 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 dimensions of the charging pile power allocation vector at the next moment.
[0192] 3) The neural network model is integrated with the mathematical model obtained in step S30 to form a hybrid model. The integration method is as follows: each sub-network processes the input data in parallel, and the output results are fed into the fusion sub-network. The output of the fusion sub-network is weighted averaged with the calculation results of the mathematical model to obtain the final power allocation result.
[0193] 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.
[0194] 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 distribution strategy of the charging pile in a data-driven manner, thereby improving the overall performance and adaptability.
[0195] Step S50: Use historical operating parameters to train the hybrid model
[0196] 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 for each gun head. Specific implementation methods include:
[0197] 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.
[0198] 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.
[0199] 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.
[0200] 4) During the training process, the validation set is regularly used 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.
[0201] 5) When the performance index of the validation set reaches the preset convergence threshold.
[0202] Step S60: Obtain the parameters of the current charging scenario and input them into the charging pile power distribution model
[0203] The purpose of this step is to obtain the various parameters of the current charging scenario and input them into the charging pile power distribution model trained in step S50, thereby obtaining the optimal power distribution for each charging gun head. The specific implementation method includes:
[0204] 1) Obtain relevant parameters of the current charging scenario from the charging pile's data acquisition system, including battery parameters (battery capacity, remaining power, battery type, battery health status, battery internal resistance, battery temperature), charging demand parameters (user-set target charge 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).
[0205] 2) Input the above-obtained parameters into the charging pile power distribution model trained in step S50.
[0206] 3) The model uses forward calculation to output the optimal charging power distribution vector for each charging gun head based on the input parameters.
[0207] This step captures comprehensive parameter information for the current charging scenario and feeds it into the trained charging pile power allocation model, resulting in optimal power allocation for each charging station. This provides the foundation for subsequent real-time power adjustments.
[0208] Step S70: Adjust the charging power of each gun head in real time according to the power distribution vector
[0209] The purpose of this step is to adjust the charging power of each charging head in real time based on the power distribution vector obtained in step S60, and at the same time collect the actual charging data of each charging head in real time to calculate the power distribution error. The specific implementation method includes:
[0210] 1) The power distribution vector output 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.
[0211] 2) The charging pile control system monitors the charging status of each charging gun 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.
[0212] 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 distribution vector, and calculates the error between the actual power distribution and the target distribution.
[0213] 4) The real-time collected charging data and power distribution error information are used as input for the subsequent step S80 fine-tuning model.
[0214] This step enables real-time dynamic adjustment of the charging pile power, ensuring that the charging process of each charging head conforms to the optimized power distribution plan. It also provides necessary feedback data for the next step of model fine-tuning.
[0215] Step S80: Use Lora technology to build a lightweight model and perform real-time fine-tuning on the fusion sub-network
[0216] The purpose of this step is to use the real-time charging data and power allocation errors collected in step S70 to build a lightweight fine-tuning model 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. Specific implementation methods include:
[0217] 1) Using the real-time charging data and power allocation error collected in step S70 as input, a lightweight fine-tuning model is constructed using Lora technology. Lora is a low-rank adaptation technology that can efficiently adjust the parameters of a neural network model without changing the original pre-trained weights.
[0218] 2) The goal of this lightweight fine-tuning model is to fit the real-time power distribution error observed in step S70 as closely as possible, so as to better capture the dynamic change characteristics during the charging process.
[0219] 3) Specifically, the structure of the fine-tuning model focuses on the last three fully connected layers of the fusion sub-network. Low-rank adaptation matrices are introduced in these layers, with a rank of 16. This allows the model to efficiently adjust some parameters during fine-tuning without changing the main structure of the pre-training.
[0220] 4) The fine-tuning model is trained using online learning. The model is updated with the latest real-time data every certain period of time (for example, 10 minutes) so that it can track changes in the charging process in real time.
[0221] Through this step, a lightweight fine-tuning model was constructed, which can continuously optimize the fusion sub-network of the charging pile power distribution model, improve its adaptability to real-time charging scenarios, and thus further improve the overall power distribution accuracy.
[0222] Step S90: Regularly merge the fine-tuned model into the fusion sub-network
[0223] 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. Specific implementation methods include:
[0224] 1) During the operation of the charging pile, at regular intervals (e.g., one day), the lightweight model fine-tuned using Lora technology in step S80 is merged into the fusion sub-network constructed in step S40.
[0225] 2) The specific merging method is to directly overwrite the parameters of the corresponding layers of the fused sub-network with the parameters of the last three fully connected layers of the lightweight fine-tuning model. Due to the use of Lora technology, this parameter update does not significantly change the original structure and pre-trained weights of the fused sub-network.
[0226] 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, better adapting to the actual changes in charging scenarios.
[0227] 4) By periodically performing this model merging, the charging pile power allocation strategy can be continuously optimized, and the accuracy and adaptability will continue to improve as the operating time increases.
[0228] This step ensures the continuous improvement of the charging pile power distribution model, enabling it to dynamically adjust as the charging scenario changes, providing a more optimized power distribution solution for the charging pile.
[0229] In summary, this multi-pile charging pile power allocation method achieves intelligent optimization of charging pile power allocation strategies through mathematical modeling, machine learning modeling, and the fusion of the two. The mathematical model ensures the method's interpretability and controllability, while the neural network model enhances its adaptive learning capabilities based on real-world operating data. Lora fine-tuning of the fused sub-network further enhances the model's real-time performance and robustness, ensuring efficient and safe power allocation for charging piles even in complex dynamic environments.
[0230] 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 run, they are used to execute the above-mentioned multi-gun head charging pile power distribution method.
[0231] 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.
[0232] Specifically, the principle of the present invention is:
[0233] 1. Mathematical Modeling: First, based on various parameters obtained from historical charging station operation data, a series of mathematical equations describing the charging process were established, including equations for charging power, charging time, battery capacity, charging efficiency, and grid load. These equations account for the impact of multiple factors on charging performance, including battery state, charging equipment characteristics, environmental conditions, and grid characteristics, and introduce corresponding error terms. By fitting these equations and determining their parameters, a mathematical model was developed that accurately describes the actual charging process.
[0234] 2. Neural Network Modeling: Based on mathematical modeling, a multi-branch neural network model was designed, comprising multiple subnetworks, each used to predict the error terms in each mathematical equation. These subnetworks fully leverage historical charging data, adaptively learning the complex dynamic characteristics of the actual charging process and providing effective corrections to the mathematical model. A fusion subnetwork was also designed to integrate the outputs of each subnetwork to derive the final charging power allocation strategy.
[0235] 3. Hybrid Model Fusion: The aforementioned mathematical model and neural network model are combined to form a hybrid model. Specifically, each subnetwork processes input data in parallel, feeding the output into the fusion subnetwork. The output of the fusion subnetwork is then weighted averaged with the mathematical model's calculations to produce the final power allocation result. This fusion leverages the physical interpretability of mathematical modeling and the adaptive learning capabilities of neural networks to achieve comprehensive optimization of charging performance.
[0236] 4. Online Fine-tuning: To further improve the model's real-time performance and robustness, Lora technology is used to perform online fine-tuning of the fusion sub-network. Specifically, charging data and power allocation errors are collected in real time during the charging process. This data is used to construct a lightweight fine-tuning model, which regularly updates some parameters of the fusion sub-network. This allows tracking of dynamic changes in the charging scenario without significantly altering the pre-trained model structure, ensuring continuous optimization of overall performance.
[0237] The above technical solution fully utilizes the advantages of mathematical modeling and machine learning. On the one hand, mathematical modeling ensures the physical interpretability of the method and enables 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 mathematical model's inadequate description of complex dynamic characteristics and achieve 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 its long-term adaptability to changes in charging scenarios. Therefore, this hybrid modeling approach provides an efficient and reliable power allocation strategy for multi-head charging piles, which not only ensures charging quality but also maximizes the utilization efficiency of charging infrastructure.
[0238] 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:
[0239] Step S10: Obtain the historical operating parameters of each charging station gun head
[0240] The purpose of this step is to collect relevant parameter data of each charging pile gun head during its historical operation, providing basic input for subsequent mathematical modeling and machine learning model training. Specifically, it includes:
[0241] 1) Obtain the historical operation records of each charging gun head from the charging pile data acquisition system, including:
[0242] Battery parameters ,in Respectively represent battery capacity, remaining power, battery temperature, battery internal resistance and battery health status;
[0243] Charging requirement parameters ,in They represent the target charging amount, expected charging time and charging priority set by the user respectively;
[0244] Charging equipment parameters ,in Respectively represent the charging gun head type, maximum output power and charging gun head temperature;
[0245] Real-time charging data ,in Respectively represent the current charging power, real-time charging voltage, real-time charging current, charging time and charging efficiency;
[0246] Environmental parameters , represents the ambient temperature, ambient humidity and weather conditions;
[0247] Grid parameters , represents the grid voltage, current, phase angle, power factor, frequency and charging pile load.
[0248] 2) Organize the collected parameter data into a structured data set , prepare for subsequent mathematical modeling and machine learning model training.
[0249] 3) Dataset Preliminary statistical analysis and outlier detection were performed to ensure the integrity and accuracy of the data.
[0250] Step S20: Establish a mathematical model that takes into account the operating parameters and includes multiple error terms.
[0251] The purpose of this step is to establish a mathematical model containing multiple error terms based on the operating parameter data collected in 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:
[0252] 1) Establish a charging power equation, taking into account the impact of battery parameters, charging equipment parameters and ambient temperature on charging power, and introduce a power error term :
[0253] ;
[0254] 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; The ambient temperature changes.
[0255] 2) Establish a charging time equation, taking into account the impact of charging demand parameters and real-time charging data on charging time, and introduce a time error term :
[0256] ;
[0257] in, is the total charging time; is the initial charge; is the target power; For electricity Charging power at 1000 Hz; is the number of charging stages; and The charging time is respectively partial derivatives of stage current and voltage; and Respectively The amount of change in current and voltage during the phase.
[0258] 3) Establish a battery capacity equation, taking into account the impact of battery parameters, charge and discharge current, temperature and other factors on battery capacity, and introduce a capacity error term :
[0259] ;
[0260] in, For the Battery capacity after 1 cycle; 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 frequency domain capacity function; is the angular frequency; is the time constant.
[0261] 4) Establish a charging efficiency equation, taking into account the impact of charging equipment parameters, ambient temperature, and charging current on charging efficiency, and introduce an efficiency error term :
[0262] ;
[0263] 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 of SoC.
[0264] 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 :
[0265] ;
[0266] in, is the total grid load at time t; As the basic 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.
[0267] 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.
[0268] 7) Establish the constraints of the above equations, including:
[0269] Charging efficiency constraints: , ;
[0270] Charging time constraints: , ;
[0271] Grid load constraints: , ,
[0272] To ensure that the charging process is carried out within a safe and reliable range.
[0273] Step S30: Fit the mathematical model according to the historical operating parameters to obtain the fitting model
[0274] 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 realistic mathematical model. Specifically, it includes:
[0275] 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.
[0276] 2) Use numerical optimization algorithms such as nonlinear least squares to minimize the objective function:
[0277] ;
[0278] 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 observation value. By iteratively optimizing the model parameters, the mean square error of the above five indicators is minimized.
[0279] 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%), the model is considered to have fully fitted the historical data and the final fitting model is obtained.
[0280] 4) Verify the accuracy and stability of the fitted model, including evaluating model performance on a new test dataset and analyzing the changing trends of model parameters. If necessary, further optimize the model structure to improve the fitting effect.
[0281] Step S40: Establishing a hybrid model
[0282] 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, it includes:
[0283] 1) Design a multi-branch neural network model, including:
[0284] Charging power equation error term subnetwork:
[0285] 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 hidden layer neurons is 32 , the number of neurons in the output layer is .
[0286] Charging time equation error term subnetwork:
[0287] 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 unit is 64 , the number of neurons in the fully connected output layer is .
[0288] Battery capacity equation error term subnetwork:
[0289] 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 .
[0290] Charging efficiency equation error term subnetwork:
[0291] 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 .
[0292] The error term subnetwork of the power grid load equation:
[0293] 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 that uses GRU units and attention mechanisms. 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 .
[0294] Environmental parameter subnetwork:
[0295] Input is 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 influencing factors.
[0296] Charging gun head battery mutual response sub-network:
[0297] 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, which includes 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.
[0298] Fusion sub-network:
[0299] 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.
[0300] 2) The neural network model is integrated with the mathematical model obtained in step S30 to form a hybrid model. The integration method is as follows: each sub-network processes the input data in parallel, and the output results are fed into the fusion sub-network. The output of the fusion sub-network is weighted averaged with the calculation results of the mathematical model to obtain the final power allocation result.
[0301] 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.
[0302] Step S50: Use historical operating parameters to train the hybrid model
[0303] 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 for each gun head. Specifically, it includes:
[0304] 1) The various operating parameter data collected in step S10 Divide into training set and validation set ,The training set is used for model parameter optimization, and the validation set is used for model performance evaluation.
[0305] 2) Define the training objective function of the hybrid model as:
[0306] ;
[0307] in, 、 and The model predicts the The charging power, charging efficiency and charging time of each charging gun head are 、 and The goal is to minimize the prediction error of charging power, efficiency and time of each gun head.
[0308] 3) Adopting gradient-based optimization algorithms, such as Adam optimizer, to iteratively update the parameters of the hybrid model so that the training set The objective function value keeps decreasing.
[0309] 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 training hyperparameters such as learning rate and batch size based on the evaluation results.
[0310] 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.
[0311] Step S60: Obtain the parameters of the current charging scenario and input them into the charging pile power distribution model
[0312] The purpose of this step is to obtain the various parameters of the current charging scenario and input them into the charging pile power distribution model trained in step S50, thereby obtaining the optimal power distribution for each charging gun head. Specifically, it includes:
[0313] 1) Obtain the battery parameters of the current charging scenario from the charging pile data acquisition system , charging demand parameters , charging equipment parameters , real-time charging data , environmental parameters and grid parameters .
[0314] 2) Input the above-obtained parameters into the charging pile power distribution model trained in step S50.
[0315] 3) The model outputs the optimal charging power distribution vector for each charging gun head based on the input parameters through forward calculation .
[0316] Step S70: Adjust the charging power of each gun head in real time according to the power distribution vector
[0317] The purpose of this step is to use 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 including:
[0318] 1) The power distribution vector outputted in step S60 is The power regulation module is transmitted to the charging pile to indicate the power that each charging gun head should output.
[0319] 2) The charging pile control system monitors the charging status of each gun head in real time, and responds to the real-time charging data Adjust the output power of the charging gun , so that it is as close as possible to the target power distribution .
[0320] 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 in step S60 Compare and calculate the actual power distribution With target allocation The error between .
[0321] 4) Collect these real-time charging data and power allocation error , as the input for fine-tuning the model in the subsequent step S80.
[0322] Step S80: Use Lora technology to build a lightweight model and perform real-time fine-tuning on the fusion sub-network
[0323] The purpose of this step is to use the real-time charging data collected in step S70 and power allocation error ,Use Lora technology to build a lightweight fine-tuning model to perform real-time optimization on the fusion sub-network in step S40 to further improve the accuracy and adaptability of power allocation. Specifically including:
[0324] 1) The real-time charging data collected in step S70 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.
[0325] 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.
[0326] 3) Specifically, the structure of the fine-tuning model focuses on the last three fully connected layers of the fusion sub-network. Low-rank adaptation matrices are introduced in these layers, with a rank of 16. This allows the model to efficiently adjust some parameters during fine-tuning without changing the main structure of the pre-training.
[0327] 4) The fine-tuning model is trained using online learning, using the latest real-time data every once in a while (for example, 10 minutes) and The model is updated once so that it can track changes in the charging process in real time.
[0328] Step S90: Regularly merge the fine-tuned model into the fusion sub-network
[0329] 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:
[0330] 1) During the operation of the charging pile, at regular intervals (e.g., one day), the lightweight model fine-tuned using Lora technology in step S80 is merged into the fusion sub-network constructed in step S40.
[0331] 2) The specific merging method is to directly overwrite the parameters of the corresponding layers of the fused sub-network with the parameters of the last three fully connected layers of the lightweight fine-tuning model. Due to the use of Lora technology, this parameter update does not significantly change the original structure and pre-trained weights of the fused sub-network.
[0332] 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, better adapting to the actual changes in charging scenarios.
[0333] 4) By periodically performing this model merging, the charging pile power allocation strategy can be continuously optimized, and the accuracy and adaptability will continue to improve as the operating time increases.
[0334] In summary, this first embodiment achieves intelligent optimization of charging pile power allocation strategies through mathematical modeling, machine learning modeling, and the fusion of the two. The mathematical model ensures the interpretability and controllability of the method, while the neural network model enhances its adaptive learning capabilities based on actual operating data. Lora fine-tuning of the fused subnetwork further enhances the model's real-time performance and robustness, ensuring efficient and safe power allocation for charging piles even in complex dynamic environments.
[0335] To further understand and implement the present invention, Example 2 of a specific application scenario is provided below: A multi-head charging station system with eight charging 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:
[0336] Initial parameter acquisition and mathematical model construction
[0337] 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:
[0338] 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%;
[0339] 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;
[0340] Charging equipment parameters: Charging gun head type :AC Level 2; maximum output power :7 kW; Charging gun tip temperature :25°C ~ 45°C;
[0341] 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%;
[0342] Environmental parameters: ambient temperature :25°C; ambient humidity :60%; Weather conditions :Sunny without rain;
[0343] Grid parameters: Grid voltage :230 V; grid current :200 A ~ 500 A; Phase angle :0° ~30°; power factor :0.9 ~ 1.0;
[0344] Grid frequency :50 Hz; charging pile load :10 kW ~ 50 kW;
[0345] 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:
[0346] 1) Charging power equation:
[0347] ;
[0348] 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 experimentally measured to be -20 W / °C.
[0349] 2) Charging time equation:
[0350] ;
[0351] in, and are the partial derivatives of charging time with respect to current and voltage, respectively, which are calculated by numerical differentiation.
[0352] 3) Battery capacity equation:
[0353] ;
[0354] 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.
[0355] 4) Charging efficiency equation:
[0356] ;
[0357] in, The ideal charging efficiency is 90%, is 1200 s, measured by experiment; and 0.001 and 0.02, respectively, obtained through multiple regression analysis; It is 15 A, which is determined through optimization experiments.
[0358] 5) Grid load equation:
[0359] ;
[0360] 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 through experiments.
[0361] Various error terms introduced in the above mathematical model 、 、 、 and , which will be predicted and corrected in the subsequent neural network model.
[0362] At the same time, the operator also established corresponding constraints for the above mathematical model:
[0363] Charging efficiency constraints:
[0364] ;
[0365] ;
[0366] Charging time constraints:
[0367] ;
[0368] ;
[0369] Grid load constraints:
[0370] ;
[0371] ;
[0372] ;
[0373] Training of neural network models
[0374] After determining the mathematical model, the operator further constructed a multi-branch neural network model to predict the error terms of each mathematical equation and integrated it into the mathematical model to form a hybrid model.
[0375] Specifically, the neural network model includes the following sub-networks:
[0376] 1) Charging power equation error term subnetwork:
[0377] Input is battery parameters and charging equipment parameters , the output is the power error The network structure is a three-layer feedforward neural network, with each layer using the ReLU activation function. The input layer has 13 neurons (5 battery parameters + 3 charging device parameters), the hidden layer has 256 neurons, and the output layer has 1 neuron.
[0378] 2) Charging time equation error term subnetwork:
[0379] Input is charging demand parameter and real-time charging data , the output is the time error The network structure is an LSTM network, consisting of 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.
[0380] 3) Battery capacity equation error term subnetwork:
[0381] 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, consisting of two convolutional layers, one pooling layer, and two fully connected layers. The number of filters in the convolutional layers is 128 and 256, respectively, the number of neurons in the fully connected layers is 512 and 256, respectively, and the number of neurons in the output layer is 1.
[0382] 4) Charging efficiency equation error term subnetwork:
[0383] 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, consisting of 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.
[0384] 5) Grid load equation error term subnetwork:
[0385] 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 that uses GRU units and attention mechanism. 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.
[0386] 6) Environmental parameter subnetwork:
[0387] Input is environment parameter , the output is the environmental impact factor. The network structure is a multi-layer perceptron, which contains three hidden layers. 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.
[0388] 7) Charging gun head battery mutual response sub-network:
[0389] Input is charging equipment parameters , battery parameters and real-time charging data The output is the charging efficiency and the dynamic power adjustment vector. The network structure is a bidirectional LSTM network combined with a self-attention mechanism, consisting of two bidirectional LSTM layers 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 the charging efficiency and 8 for the dynamic power adjustment vector).
[0390] 8) Fusion sub-network:
[0391] The input is the output of each sub-network mentioned above, and the output is the charging pile power allocation vector at the next moment. The network structure is a Transformer-based encoder-decoder network, consisting of a four-layer self-attention mechanism and a feedforward neural network. The encoder and decoder each contain four layers, with 64 self-attention heads per layer. 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 heads.
[0392] During the training process, the operator divides the historical operating parameter data obtained in step S10 into a training set and a validation set. According to the objective function defined in formula (2), the Adam optimizer is used to update the parameters of the hybrid model. During the training process, the validation set is regularly used to evaluate the model performance, and the hyperparameters are adjusted based on the evaluation results. The model training is considered to have converged until all performance indicators are less than 5%.
[0393] ;
[0394] Real-time power allocation and online fine-tuning
[0395] After the charging pile is put into formal operation, the operator will obtain the various parameter data of the current charging scene in real time, including battery parameters , charging demand 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 .
[0396] 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 .
[0397] In summary, Example 2, through the organic integration of mathematical modeling and machine learning, achieves comprehensive optimization of charging efficiency, battery health, and grid load, providing an excellent solution for EV charging in public parking lots. The online fine-tuning mechanism supported by LoRa technology in Example 2 also ensures the system's long-term adaptability to changing charging scenarios.
[0398] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be covered by the scope of protection of the present invention.
Claims
1. A multi-head charging pile power distribution method, characterized in that: The following steps are involved: S10, obtaining historical operating parameters of each charging pile gun head; S20. Establishing a mathematical model that takes into account the operating parameters and includes multiple equations with error terms, 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 distribution model, wherein the training input is the operating parameters and environmental parameters of each charging head, and the training output is the optimal charging power distribution of each charging head; S60: Obtain battery parameters, charging demand parameters, charging equipment parameters, real-time charging data, environmental parameters, and grid parameters of the charging pile in the current charging scenario, and input 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 distribution vector, and collecting 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 error, a lightweight model is constructed 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 merging the fine-tuned lightweight model into the fusion sub-network to continuously improve the accuracy and adaptability of power allocation; 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 grid load equation error term subnetwork, an environmental parameter subnetwork, a charging gun head battery mutual response subnetwork and a fusion subnetwork; the structure of the hybrid model is specifically: each subnetwork processes input data in parallel, and the output result is sent to the fusion subnetwork, and the output of the fusion subnetwork is weighted averaged with the calculation result of the mathematical model to obtain the final power allocation result.
2. A multi-head 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, 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.
3. A multi-head charging pile power distribution method according to claim 2, characterized in that: The charging power equation error term subnetwork is used to predict the error of the charging power equation. The input is battery parameters and charging device parameters, and the output is power error. The structure is a three-layer feedforward neural network, and each layer uses the 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 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 the capacity error. The structure is a one-dimensional convolutional neural network, which includes 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 the 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, consisting of 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.
4. A multi-head charging pile power distribution method according to claim 3, 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 charging pile gun heads to adapt to charging piles of different sizes.
5. A multi-head charging pile power distribution method according to claim 4, 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.
6. A multi-head charging pile power distribution method according to claim 5, characterized in that: The constraints of the mathematical model include charging efficiency constraints, time constraints, and grid load constraints.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores program instructions, which, when executed, are used to execute the multi-charger charging pile power distribution method according to any one of claims 1 to 6.
8. A multi-gun charging pile power distribution system, characterized by comprising the computer-readable storage medium according to claim 7.
Citation Information
Patent Citations
Intelligent management method and platform for electric vehicle charging station based on Internet of Things
CN118560331A
Charging pile power distribution control method, system and equipment
CN118636728A
Cited By
Multiport hybrid charging pile power pool reinforcement learning scheduling method and system
CN121417296A
Multi-port hybrid charging pile power pool reinforcement learning scheduling method and system
CN121417296B