Interaction method and system between electric vehicle and power grid
The method optimizes EV-grid interactions by using reinforcement learning and clustering to prioritize EV charging/discharging based on scenario data, enhancing grid scheduling and resource allocation.
Patent Information
- Application Number
- CN202510162616.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-03-14
AI Technical Summary
The complexity of interactions between electric vehicles (EVs) and the grid due to uncertain charging behaviors, such as timing, location, and quantity, makes it difficult to optimize EV-grid interactions, increasing the challenge of predicting and evaluating EV load flexibility.
A method and system that generate EV charging/discharging scenario data, extract priority factors, use reinforcement learning to determine weights, cluster EVs based on these weights, and prioritize their interactions with the grid using a pre-built EV-grid model to optimize EV-grid interactions.
This approach provides a scientific basis for grid scheduling, improving efficiency and accuracy by identifying key EV clusters and optimizing resource allocation, enabling faster response and better grid management.
Smart Images

Figure CN119628035A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electric vehicles, and in particular to a method and system for interaction between an electric vehicle and a power grid. Background Art
[0002] With the rapid development of the electric vehicle industry, the number of electric vehicles has increased dramatically, and the interaction between electric vehicles and the grid (V2G) technology has received widespread attention. V2G technology allows electric vehicles to transmit electricity to the grid when they are idle, which can not only improve the efficiency and stability of the grid, but also provide an additional source of income for electric vehicle users.
[0003] As an ideal mobile power source, electric vehicle loads are flexible in time and space. This flexibility enables electric vehicles to transfer energy from different locations according to the actual regulation needs of the power grid when participating in auxiliary services such as peak and frequency regulation of the power grid as energy storage. On the other hand, the flexibility of electric vehicle loads increases the difficulty of predicting and evaluating the adjustable capacity of electric vehicle loads.
[0004] There is a lack of research on the interaction process between electric vehicles and the power grid in the prior art. Since the charging behavior of electric vehicle users is uncertain, such as charging time, charging location, and charging amount, the interaction between electric vehicles and the power grid becomes more complicated and difficult. Therefore, how to optimize the interaction process between electric vehicles and the power grid has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0005] The present application aims to provide a method and system for interaction between electric vehicles and a power grid, so as to solve the technical problem of how to optimize the interaction between electric vehicles and a power grid.
[0006] In order to solve the above technical problems, an embodiment of the present application provides an interaction method between an electric vehicle and a power grid, which is applied to a charging and discharging system composed of an electric vehicle and a power grid, and includes: Generate charging and discharging simulation scenario data of an electric vehicle, extract the charging and discharging priority influencing factors in each of the charging and discharging simulation scenario data, and determine the weights of each of the charging and discharging priority influencing factors based on a preset reinforcement learning model; The electric vehicles are clustered based on the weights, and the obtained electric vehicle aggregate data set is prioritized to obtain a priority ranking table, wherein the clustering process is designed to prioritize the charging and discharging of the electric vehicles according to the weight similarity of the charging and discharging priority influencing factors; Extracting a state data set of a target electric vehicle in a real-time electric vehicle charging and discharging scenario, and prioritizing the state data set according to the priority sorting table to obtain a plurality of electric vehicle aggregate data sets with different charging and discharging priorities; Each of the target electric vehicle aggregate data sets is input into a pre-built electric vehicle charging and discharging model to obtain a two-way interaction strategy between the target electric vehicle and the power grid, and the interaction between the target electric vehicle and the power grid is achieved through the two-way interaction strategy.
[0007] As one preferred solution, the generating of charging and discharging simulation scene data of an electric vehicle includes: Acquire a set of electric vehicles, and determine parameters of each sampling point of the super Latin cube sampling method based on the set of electric vehicles; Normalizing the parameters according to a normalization function, and performing hierarchical random sampling on the normalized sampling points to obtain a sampling value of each sampling point; Mapping the sampled values to the original value range corresponding to the sampled values based on the inverse function of the normalization function to obtain the mapping values of the parameters; The mapping values are combined to generate charging and discharging simulation scenario data for multiple electric vehicles.
[0008] As one of the preferred solutions, the mapping value is expressed as: in, is the mapping value, is the sampling map, and They are The parameter vector of the mean and standard deviation of the normal distribution of the number of electric vehicles departing at time.
[0009] As one of the preferred solutions, extracting the charge and discharge priority influencing factors in each of the charge and discharge simulation scenario data, and determining the weights of each of the charge and discharge priority influencing factors based on a preset reinforcement learning model, includes: Constructing a state space function of the reinforcement learning model based on the charge and discharge state data in the charge and discharge simulation scenario data, and constructing an action space function of the reinforcement learning model based on the charge and discharge priority influencing factor; Constructing an initial reinforcement learning model according to the action space function and the state space function, wherein the reward function of the initial reinforcement learning model is a function for minimizing the charging and discharging cost of the electric vehicle; Preprocessing the charge and discharge state data to obtain a training data set for the initial reinforcement learning model; Iteratively training the initial reinforcement learning model according to the training data set, wherein the iterative training includes evaluating the initial reinforcement learning model through the reward function, and updating the weight value of the charge and discharge priority influencing factor according to the evaluation result; The weights of the various charging and discharging priority influencing factors are determined according to the results of the iterative training.
[0010] As one preferred solution, the state space function is expressed as: in, These are the response charge and discharge capacities of different electric vehicle polymers.
[0011] As one of the preferred solutions, the action space function is expressed as: in, Indicates the influence weight of electric vehicle SOC on charging and discharging priority, Indicates the weight of the impact of electric vehicle battery capacity on charging and discharging priority, Indicates the weight of the maximum charging power on the charging and discharging priority. Indicates the influence weight of the remaining charging time on the charging and discharging priority. Indicates the weight of the impact of charging mode on charging and discharging priority, Indicates the weight of the impact of charging times on the charging and discharging priority. Indicates the weight of the impact of discharge times on the charge and discharge priority.
[0012] As one preferred solution, clustering the electric vehicles based on the weights includes: Calculating a charging and discharging priority data set of the electric vehicle according to the weight; Randomly selecting a plurality of sample data from the charge and discharge priority data set as initial cluster centers; In the distance calculation process, the distance from each sample data in the charge and discharge priority data set to each of the initial cluster centers is calculated; In the process of determining the cluster center, the probability distribution of each of the sample data is calculated based on the distance, and a new cluster center is selected according to the probability distribution; The distance calculation process and the cluster center determination process are repeated until the electric vehicle aggregate data set reflecting the charging and discharging priority of the electric vehicle is obtained.
[0013] As one of the preferred solutions, a state data set of a target electric vehicle in a real-time electric vehicle charging and discharging scenario is extracted, and the state data set is prioritized according to the priority ranking table to obtain a plurality of target electric vehicle aggregate data sets with different charging and discharging priorities, including: Constructing a real-time charging and discharging priority data set according to the state data set; Calculating the Euclidean distance between the real-time sample data in the real-time charging and discharging priority data set and each cluster center in the electric vehicle aggregate data set; The state data set is sorted by charging and discharging priority based on the Euclidean distance to obtain a plurality of target electric vehicle aggregate data sets with different charging and discharging priorities.
[0014] As one preferred solution, the step of inputting each of the target electric vehicle aggregate data sets into a pre-built electric vehicle charging and discharging model to obtain a two-way interaction strategy between the target electric vehicle and the power grid includes: Inputting each target electric vehicle aggregate data set into the electric vehicle charging and discharging model in sequence, wherein the sequence includes an order from high to low priority; The target electric vehicles are simulated and predicted by a model optimization algorithm, and an optimal two-way interaction strategy is generated for each target electric vehicle aggregate.
[0015] Another embodiment of the present application provides an interactive system between an electric vehicle and a power grid, including: An extraction module is used to generate charging and discharging simulation scenario data of an electric vehicle, extract the charging and discharging priority influencing factors in each of the charging and discharging simulation scenario data, and determine the weight of each of the charging and discharging priority influencing factors based on a preset reinforcement learning model; A clustering module, configured to perform clustering processing on the electric vehicles based on the weights, prioritize the obtained electric vehicle aggregate data set, and obtain a priority ranking table, wherein the clustering processing is designed to prioritize the charging and discharging of the electric vehicles according to the weight similarity of the charging and discharging priority influencing factors; An extraction module, used to extract a state data set of a target electric vehicle in a real-time electric vehicle charging and discharging scenario, and prioritize the state data set according to the priority ranking table to obtain a plurality of electric vehicle aggregate data sets with different charging and discharging priorities; The interaction module is used to input each of the target electric vehicle aggregate data sets into a pre-built electric vehicle charging and discharging model, obtain a two-way interaction strategy between the target electric vehicle and the power grid, and realize the interaction between the target electric vehicle and the power grid through the two-way interaction strategy.
[0016] Compared with the prior art, the beneficial effects of the embodiments of the present application are at least one of the following: 1) The charging and discharging priority influencing factors extracted in this application and the weights determined based on the reinforcement learning model provide a scientific basis for power grid dispatching, making the dispatching plan more reasonable and efficient.
[0017] 2) This application uses clustering processing and priority sorting algorithms to enable power grid dispatchers to quickly identify and prioritize key electric vehicle aggregates, thereby improving response speed and dispatch accuracy. At the same time, clustering processing groups electric vehicles with similar charging and discharging requirements into the same aggregate, achieving optimal allocation and efficient use of resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a flow chart of an interaction method between an electric vehicle and a power grid in one embodiment of the present application; Figure 2 It is a schematic diagram of an interactive system between an electric vehicle and a power grid in one embodiment of the present application. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0020] In the description of this application, the terms "first", "second", "third", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", "third", etc. may explicitly or implicitly include one or more of the feature. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0021] In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. The terms "vertical", "horizontal", "left", "right", "upper", "lower" and similar expressions used in this article are only for illustrative purposes, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on this application. The term "and / or" used in this article includes any and all combinations of one or more related listed items. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0022] In the description of this application, it should be noted that, unless otherwise defined, all technical and scientific terms used in this application have the same meaning as those commonly understood by those skilled in the art. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood by specific circumstances.
[0023] An embodiment of the present application provides an interaction method between an electric vehicle and a power grid. For details, see Figure 1 , Figure 1 The flowchart of the interaction method between an electric vehicle and a power grid in one embodiment of the present application is shown, which is used in a charging and discharging system composed of an electric vehicle and a power grid, and includes steps S1-S4: S1: Generate charging and discharging simulation scenario data of an electric vehicle, extract the charging and discharging priority influencing factors in each of the charging and discharging simulation scenario data, and determine the weights of each of the charging and discharging priority influencing factors based on a preset reinforcement learning model; The management of electric vehicles in a market environment involves increased uncertainty, because not only is the market price volatile, but there is also uncertainty in the behavior of electric vehicle owners in using electricity. Therefore, the uncertain parameters considered in this application are the day-ahead market price, the demand for electric vehicle charging, and the availability of electric vehicles. The modeling process is explained by the expected departure time of electric vehicles. Before starting to generate simulation scenario data, you first need to obtain a collection of electric vehicles. This collection contains the basic information of all electric vehicles participating in the simulation, such as battery capacity, charging power, user travel needs, etc.
[0024] If the number of electric vehicles departing per hour is predicted and the prediction error is represented as a random variable, the number of electric vehicles departing can be represented by the normal distribution of the following formula: in, , are the mean and variance of the prediction error of the electric vehicle’s departure at time t.
[0025] Preferably, in one embodiment of the present application, generating the charging and discharging simulation scenario data of the electric vehicle includes: Acquire a set of electric vehicles, and determine parameters of each sampling point of the super Latin cube sampling method based on the set of electric vehicles; Normalizing the parameters according to a normalization function, and performing hierarchical random sampling on the normalized sampling points to obtain a sampling value of each sampling point; Mapping the sampled values to the original value range corresponding to the sampled values based on the inverse function of the normalization function to obtain the mapping values of the parameters; The mapping values are combined to generate charging and discharging simulation scenario data for multiple electric vehicles.
[0026] Among them, Latin Hypercube Sampling (LHS) is a method for generating random samples of multi-dimensional input parameters by independently generating a random sample with equal probability distribution in each dimension, and then combining these samples into a multi-dimensional sample set. This application uses the LHS method to determine the parameters of each sampling point, which will be used to describe the charging and discharging behavior of electric vehicles.
[0027] Since the value ranges and dimensions of different parameters may be different, in order to unify the processing, the parameters of the sampling points need to be normalized. The purpose of normalization is to convert the value range of the parameters to between [0,1] for subsequent random sampling and mapping.
[0028] After normalization, hierarchical random sampling is required. The purpose of this step is to increase the randomness of the sampling points while maintaining the correlation between parameters, thereby generating more diverse simulation scenario data. Hierarchical random sampling is achieved by independently generating random samples in each dimension and combining these samples into a multidimensional sample set.
[0029] After the sampling point is obtained, the sampling value needs to be mapped back to its corresponding original value range to obtain the mapping value of each parameter. The calculation of the mapping value is based on the inverse function of the normalization function. In one embodiment of the present application, the mapping value can be expressed as: in, is the mapping value, is the sampling map, and They are The normal distribution mean and standard deviation parameter vector of the number of electric vehicles departing at a given time. This formula represents how the sampled values are mapped back to the original value domain through the inverse function, and takes into account the statistical characteristics of the distribution of the number of electric vehicles.
[0030] The mapping values of each parameter are combined to generate multiple electric vehicle charging and discharging simulation scenario data. Each simulation scenario data contains a set of specific electric vehicle charging and discharging behavior parameters, which will be used for subsequent simulation analysis and optimization.
[0031] After generating the charging and discharging simulation scenario data of the electric vehicle, it is necessary to extract the charging and discharging priority influencing factors in each set of simulation scenario data. The influencing factors may include multiple aspects such as the battery status of the electric vehicle, user travel needs, grid load conditions, electricity price levels, etc. In one embodiment of the present application, the influencing factors include at least the following.
[0032] Factors affecting charging priority: Electric vehicle SOC: A lower SOC means that the electric vehicle can store more energy and needs to be charged. Therefore, the lower the SOC, the higher the corresponding electric vehicle charging priority.
[0033] Electric vehicle battery capacity: The larger the battery capacity, the more energy the electric vehicle can store and the longer it can maintain a charge. Therefore, the larger the battery capacity, the higher the corresponding electric vehicle charging priority.
[0034] Maximum charging power: The higher the charging power, the greater the electric vehicle's power response, and the more discharge margin it can provide in the subsequent time. Therefore, the higher the charging power, the higher the corresponding electric vehicle charging priority.
[0035] Remaining charging time: The shorter the remaining charging time of an electric vehicle, the more urgent its charging demand is and the less flexibility there is in subsequent charging. Therefore, a higher charging priority is required to ensure the completion of the final charging task.
[0036] Different charging modes: From mode one to mode four, the charging flexibility increases step by step. Therefore, excluding the uncontrollable charging mode one, the more flexible the charging mode is, the higher the charging priority is, thus providing more sufficient discharge margin for subsequent time periods.
[0037] Among them, mode 1: fast charging mode - the user requests fast charging and does not participate in any form of charging scheduling control; Mode 2: Orderly charging mode - users only allow the charging station to control the charging power of the electric vehicle and do not participate in the discharge process of V2G; Mode 3: Fast charging to target SOC - the user requests charging until the battery state of charge expected by the user is reached before participating in V2G. As long as the electric vehicle battery does not reach the expected power, the charging station aggregate is restricted from controlling the discharge of the electric vehicle; Mode 4: Mode with clear charging end time - the user only specifies the time to complete charging. V2G processes are allowed in the intermediate time period.
[0038] Factors affecting discharge priority: Electric vehicle SOC: A high SOC means that the electric vehicle has more energy stored. Therefore, the higher the SOC, the higher the corresponding electric vehicle discharge priority.
[0039] High battery pack capacity: This means that the electric vehicle can provide a lot of energy and can be discharged for a long time. Therefore, the larger the battery capacity, the higher the corresponding electric vehicle charging priority.
[0040] High maximum discharge rate: The higher the discharge power, the greater the electric vehicle's power response. Therefore, the higher the discharge power, the higher the corresponding electric vehicle discharge priority.
[0041] Remaining charging time: The shorter the remaining charging time of an electric vehicle, the more urgent its charging demand is and the less flexibility there is in subsequent charging. Therefore, a lower discharge priority is required to ensure the completion of the final charging task.
[0042] Different charging modes: Excluding the uncontrollable charging modes 1 and 2, the discharge margin of charging mode 3 is lower than that of charging mode 4. Therefore, the discharge priority of charging mode 4 is higher.
[0043] After extracting the influencing factors, the preset reinforcement learning model is used to determine the weights of each influencing factor. The reinforcement learning model continuously learns and adjusts the weights so that the final weight distribution can most accurately reflect the priority and importance of electric vehicle charging and discharging behavior.
[0044] Preferably, in one embodiment of the present application, extracting the charge and discharge priority influencing factors in each of the charge and discharge simulation scenario data, and determining the weights of each of the charge and discharge priority influencing factors based on a preset reinforcement learning model, includes: Constructing a state space function of the reinforcement learning model based on the charge and discharge state data in the charge and discharge simulation scenario data, and constructing an action space function of the reinforcement learning model based on the charge and discharge priority influencing factor; Constructing an initial reinforcement learning model according to the action space function and the state space function, wherein the reward function of the initial reinforcement learning model is a function for minimizing the charging and discharging cost of the electric vehicle; Preprocessing the charge and discharge state data to obtain a training data set for the initial reinforcement learning model; Iteratively training the initial reinforcement learning model according to the training data set, wherein the iterative training includes evaluating the initial reinforcement learning model through the reward function, and updating the weight value of the charge and discharge priority influencing factor according to the evaluation result; The weights of the various charging and discharging priority influencing factors are determined according to the results of the iterative training.
[0045] In-depth analysis of the charging and discharging simulation scenario data, identify and extract key data that can fully reflect the charging and discharging status of electric vehicles, such as the remaining battery power, grid load, electricity price level, etc. Based on these key data, a state space function that can accurately describe the current charging and discharging status of electric vehicles is constructed. This function will be used as part of the input of the reinforcement learning model to guide the learning process of the model. The state space function is expressed as: in, These are the response charge and discharge capacities of different electric vehicle polymers.
[0046] Based on these influencing factors, an action space function is constructed, which defines the possible charging and discharging behaviors or strategies that the electric vehicle may take under a given state. The design of the action space function should ensure that all possible charging and discharging behaviors can be covered and allow the model to explore different strategy combinations during training. The action space function is expressed as: in, Indicates the influence weight of electric vehicle SOC on charging and discharging priority, Indicates the weight of the impact of electric vehicle battery capacity on charging and discharging priority, Indicates the weight of the maximum charging power on the charging and discharging priority. Indicates the influence weight of the remaining charging time on the charging and discharging priority. Indicates the weight of the impact of charging mode on charging and discharging priority, Indicates the weight of the impact of charging times on the charging and discharging priority. Indicates the weight of the impact of discharge times on the charge and discharge priority.
[0047] Minimizing the charging and discharging cost of electric vehicles is used as the reward function of the reinforcement learning model. This can include multiple aspects such as battery depreciation cost, electricity purchase cost, and grid stability maintenance cost. The design of the reward function should be able to accurately reflect the impact of different charging and discharging behaviors on the total cost, thereby guiding the model to learn the optimal charging and discharging strategy. Specifically, the reward function is expressed as: In the formula, the first term is the day-ahead market quotation income of electric vehicle discharge, is the day-ahead market price, is the electricity sales volume / discharge power; the second is the day-ahead market price cost of electric vehicle charging, where The V2G charging fee is to encourage electric vehicle owners to charge in V2G mode. The third item is the energy consumption of electric vehicles, including is the driving demand price, is the energy consumption required for driving; the fourth item is Given the degradation costs of electric vehicle batteries.
[0048] In the formula, and are the minimum and maximum discharge powers, respectively, and are the minimum and maximum charging power respectively, , Binary variables that simulate the discharge and charge cycles of electric vehicles respectively.
[0049] In the formula, the maximum and minimum values of the binary variable are given, where is a binary variable indicating whether the electric vehicle is adjustable.
[0050] The formula constrains the state where electric vehicle batteries cannot be charged and discharged at the same time.
[0051] The formula is the battery state change equation of the charging and discharging process of the electric vehicle battery. is the battery charge state, , is the charge and discharge efficiency, The maximum capacity of an electric vehicle battery.
[0052] and are the minimum and maximum values of the battery state of charge variable, respectively.
[0053] The above formulas respectively constrain the monotonically increasing supply curve of the electricity sales quotation and the monotonically decreasing quotation curve of the electricity purchase quotation, where Power discharge for specific scenarios, It is the power cost for a specific scenario. After market participants submit the bid and ask price curves, the market operator clears the day-ahead market and announces the day-ahead market clearing price and accepted bids.
[0054] The above formula constrains that only one supply curve can be submitted to the day-ahead market every hour.
[0055] The expression for calculating battery degradation is as follows: The parameter that represents the relationship between the cost of charging and discharging the battery and the reduction in its service life. The cost of the battery used in the electric vehicle. Due to the management decision of the integrator, the additional degradation cost incurred during charging or discharging is borne by the electric vehicle owner. This cost is the total degradation cost minus the degradation cost of the owner's driving process.
[0056] Combining the state space function, action space function and reward function, an initial reinforcement learning model is constructed, which is used to guide the initial charging and discharging behavior of electric vehicles.
[0057] After cleaning, denoising and normalizing the charge and discharge state data in the charge and discharge simulation scenario data, the processed data is divided into training sets and test sets for subsequent model training and verification. The initial reinforcement learning model is iteratively trained using the training data set. In each iteration, the model selects an action based on the current state and evaluates the effect of the action based on the reward function. Based on the evaluation results, the model adjusts its internal parameters (including the weights of the charge and discharge priority influencing factors) to optimize future decision-making processes.
[0058] During the iterative training process, the model will continuously try different charging and discharging strategies and observe their impact on the total cost. By comparing the costs under different strategies, the model will gradually learn which charging and discharging priority influencing factors have a greater impact on the total cost and adjust their weights accordingly. This process will continue until the model converges to a stable strategy, that is, the strategy that can produce the minimum charging and discharging cost under a given state. When the model converges, the weights of each charging and discharging priority influencing factor are extracted from the model. These weights reflect the importance of different influencing factors to the total cost under the optimal charging and discharging strategy.
[0059] Further, it is assumed that all influencing factors of the charge and discharge priority have the same influence at the initial moment, and the weights of all influencing factors are initialized to 1. At each time step (such as every hour or every 15 minutes), the size of the influencing factors of the charge and discharge priority of different electric vehicle aggregates is calculated. Each influencing factor is normalized to ensure that its value is within a comparable range. Normalization can be achieved by dividing the value of each influencing factor by its possible maximum value. Using the normalized influencing factor values and the current weight vector, the evaluation score of each electric vehicle aggregate is calculated. This can be achieved by multiplying the value of each influencing factor by its corresponding weight and summing all influencing factors.
[0060] According to the evaluation scores, the charging response power of the charging station is preferentially allocated to the electric vehicle aggregates with high scores. If the power demand of the high-scoring aggregate has been met, the remaining power will continue to be allocated to the second-highest-scoring aggregate, and so on, until all power is allocated. According to the actual charging and discharging behavior of electric vehicles and other external factors (such as grid load, electricity price changes, etc.), the size of the influencing factors of the charging and discharging priority of different electric vehicle aggregates at the next moment is updated. Repeat the above process, and calculate and allocate the charging and discharging response power at subsequent time points according to the updated size of the influencing factors and the weight vector until a charging and discharging plan for all electric vehicle aggregates throughout the day is generated. According to the generated charging and discharging plan and the preset goals (such as minimizing grid load fluctuations, maximizing user satisfaction, etc.), calculate the reward function value of the influencing factor weight setting strategy. The higher the reward function value, the closer the strategy is to the optimal solution.
[0061] Update the charge and discharge influencing factor weight setting strategy through the Q-learning method. In Q-learning, each possible weight setting is regarded as a state or action, and the reward function value is used to update the Q-value table (or Q-function) to reflect the long-term returns under different weight settings. According to the Q-value table (or Q-function), the weight setting with the highest expected return is selected as the new strategy. Repeat this process continuously to gradually improve the weight setting strategy. Until the charge and discharge influencing factor weight setting strategy stops improving (that is, the reward function value no longer increases significantly) or the preset number of iterations is reached. When the termination condition is met, the charge and discharge influencing factor weights at this time are determined to be the optimal weight settings. These weights reflect the importance of each influencing factor to the charge and discharge priority decision under given objectives and constraints.
[0062] S2: clustering the electric vehicles based on the weights, and prioritizing the obtained electric vehicle aggregate data set to obtain a priority ranking table, wherein the clustering process is designed to prioritize the charging and discharging of the electric vehicles according to the weight similarity of the charging and discharging priority influencing factors; Among them, the weight similarity of each electric vehicle on the charging and discharging priority influencing factors can be calculated by comparing the weight values of each electric vehicle on each influencing factor. Similarity calculation can be achieved by a variety of methods, such as Euclidean distance, cosine similarity, Pearson correlation coefficient, etc. According to the weight similarity calculation results, a suitable clustering algorithm is selected to cluster the electric vehicles. Commonly used clustering algorithms include K-means, hierarchical clustering, DBSCAN, etc.
[0063] Preferably, in one embodiment of the present application, clustering the electric vehicles based on the weights includes: Calculating a charging and discharging priority data set of the electric vehicle according to the weight; Randomly selecting a plurality of sample data from the charge and discharge priority data set as initial cluster centers; In the distance calculation process, the distance from each sample data in the charge and discharge priority data set to each of the initial cluster centers is calculated; In the process of determining the cluster center, the probability distribution of each of the sample data is calculated based on the distance, and a new cluster center is selected according to the probability distribution; The distance calculation process and the cluster center determination process are repeated until the electric vehicle aggregate data set reflecting the charging and discharging priority of the electric vehicle is obtained.
[0064] Specifically, based on the clustering results, electric vehicles with similar charge and discharge priority influencing factor weights are divided into the same aggregate. The electric vehicles in each aggregate have similar priority characteristics in charge and discharge behavior, so they can be managed and scheduled as a whole. For each electric vehicle aggregate, its related charge and discharge data, user behavior data, grid status data, etc. are collected to form an aggregate data set.
[0065] S3: extracting a state data set of a target electric vehicle in a real-time electric vehicle charging and discharging scenario, and prioritizing the state data set according to the priority sorting table to obtain a plurality of electric vehicle aggregate data sets with different charging and discharging priorities; Preferably, in one embodiment of the present application, a state data set of a target electric vehicle in a real-time electric vehicle charging and discharging scenario is extracted, and the state data set is prioritized according to the priority ranking table to obtain a plurality of target electric vehicle aggregate data sets with different charging and discharging priorities, including: Constructing a real-time charging and discharging priority data set according to the state data set; Calculating the Euclidean distance between the real-time sample data in the real-time charging and discharging priority data set and each cluster center in the electric vehicle aggregate data set; The state data set is sorted by charging and discharging priority based on the Euclidean distance to obtain a plurality of target electric vehicle aggregate data sets with different charging and discharging priorities.
[0066] Among them, the real-time charging and discharging priority dataset is calculated based on the state dataset and the known charging and discharging priority influencing factors and their weights. The real-time charging and discharging priority dataset will reflect the charging and discharging priority of the target electric vehicle at the current moment. The Euclidean distance is used to measure the similarity between the real-time sample data and the cluster center.
[0067] Based on the calculation results of Euclidean distance, the state data set is sorted by charging and discharging priority. The sorting is based on the distance between the real-time sample data and the cluster center. The closer the distance, the higher the charging and discharging priority. Finally, multiple target electric vehicle aggregate data sets with different charging and discharging priorities are obtained.
[0068] S4: Inputting each of the target electric vehicle aggregate data sets into a pre-built electric vehicle charging and discharging model to obtain a two-way interaction strategy between the target electric vehicle and the power grid, and realizing the interaction between the target electric vehicle and the power grid through the two-way interaction strategy.
[0069] Among them, the electric vehicle charging and discharging model comprehensively considers multiple factors such as the charging and discharging needs of electric vehicles, the load of the power grid, the health status of the battery, user preferences and behavior patterns, etc. The model can use technical means such as machine learning, deep learning, and optimization algorithms to achieve accurate prediction and optimization of electric vehicle charging and discharging behavior.
[0070] Specifically, use historical data to train the model to improve the model's prediction accuracy and generalization ability. Historical data should include electric vehicle charging and discharging records, grid load data, user behavior data, etc.
[0071] Preferably, in one embodiment of the present application, the step of inputting each of the target electric vehicle aggregate data sets into a pre-built electric vehicle charging and discharging model to obtain a two-way interaction strategy between the target electric vehicle and the power grid includes: Inputting each target electric vehicle aggregate data set into the electric vehicle charging and discharging model in sequence, wherein the sequence includes an order from high to low priority; The target electric vehicles are simulated and predicted by a model optimization algorithm, and an optimal two-way interaction strategy is generated for each target electric vehicle aggregate.
[0072] Among them, the target electric vehicle aggregate data set is preprocessed, including data cleaning, format conversion, feature extraction and other steps. The preprocessed target electric vehicle aggregate data set is input into the pre-built electric vehicle charging and discharging model, and the model calculates and analyzes the input data set to generate a two-way interaction strategy between the target electric vehicle and the power grid. The interaction strategy includes information such as the charging and discharging time, power, and location of the electric vehicle, as well as the load regulation scheme of the power grid.
[0073] The generated interaction strategies are optimized to further improve their feasibility and benefits. The optimization can consider multiple objectives, such as maximizing the charging and discharging efficiency of electric vehicles, reducing the peak load of the power grid, and improving user satisfaction.
[0074] According to the generated two-way interactive strategy, the target electric vehicle is scheduled and managed for charging and discharging. The scheduling and management should follow the operation rules of the power grid and the charging and discharging characteristics of electric vehicles to ensure the stable operation of the power grid and the rational use of electric vehicles.
[0075] Another embodiment of the present application provides an interactive system between an electric vehicle and a power grid. For details, see Figure 2 , Figure 2 The diagram shows a schematic diagram of an interactive system between an electric vehicle and a power grid in one embodiment of the present application, which is used in a charging and discharging system composed of an electric vehicle and a power grid, and includes an extraction module 11, a clustering module 12, an extraction module 13, and an interaction module 14, wherein: An extraction module 11 is used to generate charging and discharging simulation scenario data of an electric vehicle, extract a charging and discharging priority influencing factor in each of the charging and discharging simulation scenario data, and determine a weight of each of the charging and discharging priority influencing factors based on a preset reinforcement learning model; A clustering module 12 is used to perform clustering processing on the electric vehicles based on the weights, prioritize the obtained electric vehicle aggregate data set, and obtain a priority ranking table, wherein the clustering processing is designed to prioritize the charging and discharging of the electric vehicles according to the weight similarity of the charging and discharging priority influencing factors; An extraction module 13 is used to extract a state data set of a target electric vehicle in a real-time electric vehicle charging and discharging scenario, and prioritize the state data set according to the priority ranking table to obtain a plurality of electric vehicle aggregate data sets with different charging and discharging priorities; The interaction module 14 is used to input each of the target electric vehicle aggregate data sets into the pre-built electric vehicle charging and discharging model, obtain a two-way interaction strategy between the target electric vehicle and the power grid, and realize the interaction between the target electric vehicle and the power grid through the two-way interaction strategy.
[0076] Compared with the prior art, the beneficial effects of the embodiments of the present application are at least one of the following: 1) The charging and discharging priority influencing factors extracted in this application and the weights determined based on the reinforcement learning model provide a scientific basis for power grid dispatching, making the dispatching plan more reasonable and efficient.
[0077] 2) This application uses clustering processing and priority sorting algorithms to enable power grid dispatchers to quickly identify and prioritize key electric vehicle aggregates, thereby improving response speed and dispatch accuracy. At the same time, clustering processing groups electric vehicles with similar charging and discharging requirements into the same aggregate, achieving optimal allocation and efficient use of resources.
[0078] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for interaction between an electric vehicle and a power grid, characterized in that: Applied in the charging and discharging system consisting of electric vehicles and power grids, including: Generate charging and discharging simulation scenario data of an electric vehicle, extract the charging and discharging priority influencing factors in each of the charging and discharging simulation scenario data, and determine the weights of each of the charging and discharging priority influencing factors based on a preset reinforcement learning model; The electric vehicles are clustered based on the weights, and the obtained electric vehicle aggregate data set is prioritized to obtain a priority ranking table, wherein the clustering process is designed to prioritize the charging and discharging of the electric vehicles according to the weight similarity of the charging and discharging priority influencing factors; Extracting a state data set of a target electric vehicle in a real-time electric vehicle charging and discharging scenario, and prioritizing the state data set according to the priority sorting table to obtain a plurality of electric vehicle aggregate data sets with different charging and discharging priorities; Each of the target electric vehicle aggregate data sets is input into a pre-built electric vehicle charging and discharging model to obtain a two-way interaction strategy between the target electric vehicle and the power grid, and the interaction between the target electric vehicle and the power grid is achieved through the two-way interaction strategy.
2. The method for interaction between an electric vehicle and a power grid as claimed in claim 1, characterized in that: The generating of charging and discharging simulation scene data of an electric vehicle comprises: Acquire a set of electric vehicles, and determine parameters of each sampling point of the super Latin cube sampling method based on the set of electric vehicles; Normalizing the parameters according to a normalization function, and performing hierarchical random sampling on the normalized sampling points to obtain a sampling value of each sampling point; Mapping the sampled values to the original value range corresponding to the sampled values based on the inverse function of the normalization function to obtain the mapping values of the parameters; The mapping values are combined to generate charging and discharging simulation scenario data for multiple electric vehicles.
3. The method for interaction between an electric vehicle and a power grid as claimed in claim 2, characterized in that: The mapping value is expressed as: in, is the mapping value, is the sampling map, and They are The parameter vector of the mean and standard deviation of the normal distribution of the number of electric vehicles departing at time.
4. The method for interaction between an electric vehicle and a power grid as claimed in claim 1, characterized in that: The extracting the charge and discharge priority influencing factors in each of the charge and discharge simulation scenario data, and determining the weights of each of the charge and discharge priority influencing factors based on a preset reinforcement learning model, includes: Constructing a state space function of the reinforcement learning model based on the charge and discharge state data in the charge and discharge simulation scenario data, and constructing an action space function of the reinforcement learning model based on the charge and discharge priority influencing factor; Constructing an initial reinforcement learning model according to the action space function and the state space function, wherein the reward function of the initial reinforcement learning model is a function for minimizing the charging and discharging cost of the electric vehicle; Preprocessing the charge and discharge state data to obtain a training data set for the initial reinforcement learning model; Iteratively training the initial reinforcement learning model according to the training data set, wherein the iterative training includes evaluating the initial reinforcement learning model through the reward function, and updating the weight value of the charge and discharge priority influencing factor according to the evaluation result; The weights of the various charging and discharging priority influencing factors are determined according to the results of the iterative training.
5. The method for interaction between an electric vehicle and a power grid as claimed in claim 4, characterized in that: The state space function is expressed as: in, These are the response charge and discharge capacities of different electric vehicle polymers.
6. The method for interaction between an electric vehicle and a power grid as claimed in claim 4, characterized in that: The action space function is expressed as: in, Indicates the influence weight of electric vehicle SOC on charging and discharging priority, Indicates the weight of the impact of electric vehicle battery capacity on charging and discharging priority, Indicates the weight of the maximum charging power on the charging and discharging priority. Indicates the influence weight of the remaining charging time on the charging and discharging priority. Indicates the weight of the impact of charging mode on charging and discharging priority, Indicates the weight of the impact of charging times on the charging and discharging priority. Indicates the weight of the impact of discharge times on the charge and discharge priority.
7. The method for interaction between an electric vehicle and a power grid as claimed in claim 1, characterized in that: The clustering process of the electric vehicles based on the weights includes: Calculating a charging and discharging priority data set of the electric vehicle according to the weight; Randomly selecting a plurality of sample data from the charge and discharge priority data set as initial cluster centers; In the distance calculation process, the distance from each sample data in the charge and discharge priority data set to each of the initial cluster centers is calculated; In the process of determining the cluster center, the probability distribution of each of the sample data is calculated based on the distance, and a new cluster center is selected according to the probability distribution; The distance calculation process and the cluster center determination process are repeated until the electric vehicle aggregate data set reflecting the charging and discharging priority of the electric vehicle is obtained.
8. The method for interaction between an electric vehicle and a power grid as claimed in claim 7, characterized in that: Extracting a state data set of a target electric vehicle in a real-time electric vehicle charging and discharging scenario, and prioritizing the state data set according to the priority sorting table to obtain a plurality of target electric vehicle aggregate data sets with different charging and discharging priorities, including: Constructing a real-time charging and discharging priority data set according to the state data set; Calculating the Euclidean distance between the real-time sample data in the real-time charging and discharging priority data set and each cluster center in the electric vehicle aggregate data set; The state data set is sorted by charging and discharging priority based on the Euclidean distance to obtain a plurality of target electric vehicle aggregate data sets with different charging and discharging priorities.
9. The method for interaction between an electric vehicle and a power grid as claimed in claim 1, characterized in that: The step of inputting each of the target electric vehicle aggregate data sets into a pre-built electric vehicle charging and discharging model to obtain a two-way interaction strategy between the target electric vehicle and the power grid includes: Inputting each target electric vehicle aggregate data set into the electric vehicle charging and discharging model in sequence, wherein the sequence includes an order from high to low priority; The target electric vehicles are simulated and predicted by a model optimization algorithm, and an optimal two-way interaction strategy is generated for each target electric vehicle aggregate.
10. An interactive system between an electric vehicle and a power grid, characterized in that: Applied in the charging and discharging system consisting of electric vehicles and power grids, including: An extraction module is used to generate charging and discharging simulation scenario data of an electric vehicle, extract the charging and discharging priority influencing factors in each of the charging and discharging simulation scenario data, and determine the weight of each of the charging and discharging priority influencing factors based on a preset reinforcement learning model; A clustering module, configured to perform clustering processing on the electric vehicles based on the weights, prioritize the obtained electric vehicle aggregate data set, and obtain a priority ranking table, wherein the clustering processing is designed to prioritize the charging and discharging of the electric vehicles according to the weight similarity of the charging and discharging priority influencing factors; An extraction module, used to extract a state data set of a target electric vehicle in a real-time electric vehicle charging and discharging scenario, and prioritize the state data set according to the priority ranking table to obtain a plurality of electric vehicle aggregate data sets with different charging and discharging priorities; The interaction module is used to input each of the target electric vehicle aggregate data sets into a pre-built electric vehicle charging and discharging model, obtain a two-way interaction strategy between the target electric vehicle and the power grid, and realize the interaction between the target electric vehicle and the power grid through the two-way interaction strategy.
Citation Information
Patent Citations
Charging and discharging control method and device for electric vehicle
CN117114367A
Electric vehicle aggregation model construction method based on Latin hypercube sampling
CN117650546A
Virtual power plant optimization operation method for aggregating electric vehicle and carbon capture
CN119134279A
Optimal scheduling method for electric vehicles to participate in energy storage market based on reinforcement learning
CN119362543A
Vehicle-to-grid optimization control method for balancing battery aging cost and electricity market income
WO2024192972A1