A charging and feeding method and device for electric vehicle
The particle swarm algorithm is used to optimize the electric vehicle charging and feeding strategy, which solves the problem of insufficient cost optimization of electric vehicle charging and feeding in the existing technology and improves the economy and efficiency of electric vehicle charging and feeding.
Patent Information
- Application Number
- CN202010899205.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-31
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2040-08-31
AI Technical Summary
There is a lack of research on charging and feeding scheduling based on the parking mode and considering the charging and feeding needs of electric vehicles in the existing technology, resulting in insufficient optimization of the charging and feeding costs of electric vehicles.
The particle swarm algorithm is used to construct the objective function and constraint conditions of the charging and feeding cost optimization problem, and the charging and feeding strategy is determined based on the electricity price information, charging pile power threshold and power demand, and the charging and feeding process of electric vehicles is optimized.
The strategy of reducing charging and feeding costs while meeting the charging and feeding needs of electric vehicles has been realized, and the economy and efficiency of charging and feeding of electric vehicles have been improved.
Smart Images

Figure CN113762669B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a charging and feeding method and device for an electric vehicle. Background Art
[0002] As an emerging low-carbon, pollution-free means of transportation, research on electric vehicles and related content has received widespread attention; V2G (Vehicle to Grid) technology is one of the research hotspots; V2G technology brings together a large number of electric vehicles, which can not only reduce the peak load of the power grid by charging in different time periods, but also actively feed power as an energy buffer, providing auxiliary services such as frequency regulation to the power grid. In the process, users can also obtain certain benefits.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] In the research on V2G-based electric vehicle charging and feeding strategy issues, the existing technology mainly considers the optimization of charging scheduling, grid valley filling and other issues. There is a lack of research on charging and feeding scheduling based on the parking mode and considering the charging and feeding needs of electric vehicles, with the goal of optimizing the charging and feeding costs of electric vehicles. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a charging and feeding method and device for an electric vehicle, which can determine the charging and feeding strategy for the electric vehicle based on the parking mode and taking into account the charging and feeding needs of the electric vehicle, using a particle swarm algorithm, with the goal of optimizing the charging and feeding cost of the electric vehicle, and perform charging or feeding of the electric vehicle according to the strategy.
[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a charging and feeding method for an electric vehicle is provided, comprising:
[0007] Obtain charging and feeding configuration information, and determine the charging and feeding demand information of the target electric vehicle;
[0008] According to the demand information and the charging and feeding configuration information, construct an objective function and constraint conditions for the charging and feeding cost optimization problem, solve the objective function under the constraint conditions, and determine the charging and feeding strategy;
[0009] The target electric vehicle is charged or fed according to the charging and feeding strategy.
[0010] Optionally, the charging and feeding configuration information includes at least: electricity price information, charging pile power threshold, and total power threshold; wherein the electricity price information includes: charging electricity price information or feeding electricity price information in each unit time period;
[0011] The demand information includes at least: initial power, expected power, charging and feeding time period information, and power threshold.
[0012] Optionally, the determining the charging and feeding demand information of the target electric vehicle includes:
[0013] Receiving electric vehicle charging and feeding reservation information, the reservation information at least includes: initial power, expected power, power threshold, start time, and end time;
[0014] Determine the charging and feeding period information according to the start time and the end time, wherein the charging and feeding period is composed of an integer number of unit time periods;
[0015] It is determined whether the demand information meets the initial condition, and the demand information that meets the initial condition is determined as the demand information for charging and feeding the target electric vehicle.
[0016] Optionally, determining whether the demand information satisfies an initial condition includes:
[0017] Determining a power change amount according to the initial power amount and the expected power amount;
[0018] The product of the number of unit time periods contained in the charging and feeding period and the charging pile power threshold is taken as the maximum value of the variation, and it is determined whether the maximum value of the variation exceeds the amount of power variation; and
[0019] Determining whether the charging and feeding period exceeds a time threshold;
[0020] If yes, it is determined that the demand information meets the initial condition.
[0021] Optionally, constructing an objective function and constraint conditions of a charging and feeding cost optimization problem according to the demand information and the charging and feeding configuration information, solving the objective function under the constraint conditions, and determining a charging and feeding strategy includes:
[0022] Constructing a charging and feeding cost function for each target electric vehicle within a preset time period according to the electricity price information and the charging and feeding time period information; and determining the constraint condition according to the demand information and the charging and feeding configuration information;
[0023] The objective function is to minimize the sum of the charging and feeding costs of all target electric vehicles, and the actual power of each target electric vehicle charged or fed in each unit time period is used as the optimization variable;
[0024] Under the condition that the constraint conditions are met, an optimal solution is obtained for the objective function to determine the charging and feeding strategy.
[0025] Optionally, the constraint conditions include:
[0026] The power of each target electric vehicle at the beginning of the charging and feeding period is equal to its initial power, and the power of each target electric vehicle at the end of the charging and feeding period is equal to its expected power;
[0027] The power of each target electric vehicle at the end of the charging and feeding period does not exceed the power threshold of the target electric vehicle;
[0028] During the preset time period, the power of each target electric vehicle does not change outside its charging and feeding time period;
[0029] The power change of the target electric vehicle in each unit time period does not exceed the charging pile power threshold;
[0030] In each unit time period, the sum of the changes in power of all target electric vehicles does not exceed the total power threshold; wherein the change in power is determined based on the initial power and the expected power.
[0031] Optionally, a particle swarm algorithm is used to solve the objective function under the constraint conditions to determine the charging and feeding strategy, including:
[0032] According to the number n of unit time periods contained in the preset time period and the number m of the target electric vehicles, a preset number of position particles x and a preset number of speed particles v are generated based on the demand information and constraint conditions to form a particle group; the position particles and speed particles are both m×n two-dimensional arrays; the element x in the position particle x is kt represents the power value of the kth target electric vehicle after the tth unit time period; the element v in the velocity particle v kt represents the amount of power change of the kth target electric vehicle in the tth unit time period; where k∈{1,2,…,m}, t∈{1,2,…,n};
[0033] Establishing a constraint relationship between the position particle and the optimization variable;
[0034] The following steps are executed repeatedly to update the position particles and velocity particles in the particle swarm until the iteration end condition is met:
[0035] Substituting the position particle into the objective function according to the constraint relationship to obtain a function value corresponding to the position particle, and using the function value as the fitness of the position particle; determining a global optimal solution and an individual optimal solution of each position particle according to the fitness of each position particle; updating the position particles and velocity particles in the particle swarm based on the global optimal solution, the individual optimal solution and the constraint conditions;
[0036] The particle at the optimal position is determined from the particle group after the iteration, and the optimization variable corresponding to the particle at the optimal position is determined according to the constraint relationship to determine the charging and feeding strategy.
[0037] Optionally, whether the iteration end condition is met is determined according to the following method:
[0038] When the number of iterations exceeds the iteration threshold, determining that the iteration is finished; or,
[0039] The modulus of the vector corresponding to each updated velocity particle is determined, and the number of velocity particles whose modulus of the vector is less than the modulus threshold is taken as the stable number; when the stable number exceeds the number threshold, the iteration is determined to be ended.
[0040] Optionally, after updating the position particles and the velocity particles in the particle group, the method further includes:
[0041] Determining whether the position particle and the velocity particle satisfy the constraint condition;
[0042] If not, update the position particle or velocity particle using a mutation method or a crossover method of a genetic algorithm; or,
[0043] Regenerate position particles or velocity particles based on the constraint conditions; or,
[0044] The updated position particles and velocity particles that do not satisfy the constraint condition are deleted from the particle group.
[0045] According to another aspect of an embodiment of the present invention, a charging and feeding device for an electric vehicle is provided, comprising:
[0046] An acquisition module is used to acquire charging and feeding configuration information and determine the charging and feeding demand information of the target electric vehicle;
[0047] A solution module, used to construct an objective function and constraint conditions for the charging and feeding cost optimization problem according to the demand information and the charging and feeding configuration information, solve the objective function under the constraint conditions, and determine the charging and feeding strategy;
[0048] An execution module is used to execute charging or feeding of the target electric vehicle according to the charging and feeding strategy.
[0049] Optionally, the charging and feeding configuration information includes at least: electricity price information, charging pile power threshold, and total power threshold; wherein the electricity price information includes: charging electricity price information or feeding electricity price information in each unit time period;
[0050] The demand information includes at least: initial power, expected power, charging and feeding time period information, and power threshold.
[0051] Optionally, the obtaining module determining the target electric vehicle charging and feeding demand information includes:
[0052] Receiving electric vehicle charging and feeding reservation information, the reservation information at least includes: initial power, expected power, power threshold, start time, and end time;
[0053] Determine the charging and feeding period information according to the start time and the end time, wherein the charging and feeding period is composed of an integer number of unit time periods;
[0054] It is determined whether the demand information meets the initial condition, and the demand information that meets the initial condition is determined as the demand information for charging and feeding the target electric vehicle.
[0055] Optionally, the acquisition module determines whether the demand information meets the initial condition, including:
[0056] Determining a power change amount according to the initial power amount and the expected power amount;
[0057] The product of the number of unit time periods contained in the charging and feeding period and the charging pile power threshold is taken as the maximum value of the variation, and it is determined whether the maximum value of the variation exceeds the amount of power variation; and
[0058] Determining whether the charging and feeding period exceeds a time threshold;
[0059] If yes, it is determined that the demand information meets the initial condition.
[0060] Optionally, the solving module constructs an objective function and constraint conditions of the charging and feeding cost optimization problem according to the demand information and the charging and feeding configuration information, solves the objective function under the constraint conditions, and determines the charging and feeding strategy, including:
[0061] Constructing a charging and feeding cost function for each target electric vehicle within a preset time period according to the electricity price information and the charging and feeding time period information; and determining the constraint condition according to the demand information and the charging and feeding configuration information;
[0062] The objective function is to minimize the sum of the charging and feeding costs of all target electric vehicles, and the actual power of each target electric vehicle charged or fed in each unit time period is used as the optimization variable;
[0063] Under the condition that the constraint conditions are met, an optimal solution is obtained for the objective function to determine the charging and feeding strategy.
[0064] Optionally, the constraint conditions include:
[0065] The power of each target electric vehicle at the beginning of the charging and feeding period is equal to its initial power, and the power of each target electric vehicle at the end of the charging and feeding period is equal to its expected power;
[0066] The power of each target electric vehicle at the end of the charging and feeding period does not exceed the power threshold of the target electric vehicle;
[0067] During the preset time period, the power of each target electric vehicle does not change outside its charging and feeding time period;
[0068] The power change of the target electric vehicle in each unit time period does not exceed the charging pile power threshold;
[0069] In each unit time period, the sum of the changes in power of all target electric vehicles does not exceed the total power threshold; wherein the change in power is determined based on the initial power and the expected power.
[0070] Optionally, the solution module uses a particle swarm algorithm to solve the objective function under the constraint conditions to determine the charging and feeding strategy, including:
[0071] According to the number n of unit time periods contained in the preset time period and the number m of the target electric vehicles, a preset number of position particles x and a preset number of speed particles v are generated based on the demand information and constraint conditions to form a particle group; the position particles and speed particles are both m×n two-dimensional arrays; the element x in the position particle x is kt represents the power value of the kth target electric vehicle after the tth unit time period; the element v in the velocity particle v kt represents the amount of power change of the kth target electric vehicle in the tth unit time period; where k∈{1, 2, ..., m}, t∈{1, 2, ..., n};
[0072] Establishing a constraint relationship between the position particle and the optimization variable;
[0073] The following steps are executed repeatedly to update the position particles and velocity particles in the particle swarm until the iteration end condition is met:
[0074] Substituting the position particle into the objective function according to the constraint relationship to obtain a function value corresponding to the position particle, and using the function value as the fitness of the position particle; determining a global optimal solution and an individual optimal solution of each position particle according to the fitness of each position particle; updating the position particles and velocity particles in the particle swarm based on the global optimal solution, the individual optimal solution and the constraint conditions;
[0075] The particle at the optimal position is determined from the particle group after the iteration, and the optimization variable corresponding to the particle at the optimal position is determined according to the constraint relationship to determine the charging and feeding strategy.
[0076] Optionally, the solving module determines whether the iteration end condition is met according to the following method:
[0077] When the number of iterations exceeds the iteration threshold, determining that the iteration is finished; or,
[0078] The modulus of the vector corresponding to each updated velocity particle is determined, and the number of velocity particles whose modulus of the vector is less than the modulus threshold is taken as the stable number; when the stable number exceeds the number threshold, the iteration is determined to be ended.
[0079] Optionally, after updating the position particles and the velocity particles in the particle swarm, the solution module further includes:
[0080] Determining whether the position particle and the velocity particle satisfy the constraint condition;
[0081] If not, update the position particle or velocity particle using a mutation method or a crossover method of a genetic algorithm; or,
[0082] Regenerate position particles or velocity particles based on the constraint conditions; or,
[0083] The updated position particles and velocity particles that do not satisfy the constraint condition are deleted from the particle group.
[0084] According to another aspect of an embodiment of the present invention, there is provided a charging and feeding electronic device for an electric vehicle, comprising:
[0085] one or more processors;
[0086] a storage device for storing one or more programs,
[0087] When the one or more programs are executed by the one or more processors, the one or more processors implement the electric vehicle charging and feeding method provided by the present invention.
[0088] According to another aspect of an embodiment of the present invention, a computer readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the charging and feeding method of the electric vehicle provided by the present invention is implemented.
[0089] An embodiment of the above invention has the following advantages or beneficial effects: because the objective function and constraints of the charging and feeding cost optimization problem are constructed according to the demand information of the target electric vehicle and the charging and feeding configuration information, and the particle swarm algorithm is used to solve the problem and determine the charging and feeding strategy. Therefore, the technical problem of the lack of research on charging and feeding scheduling based on the stop mode and taking into account both charging and feeding, with the goal of optimizing the charging and feeding cost of electric vehicles in the prior art is overcome, and then a charging and feeding scheduling strategy that minimizes the charging and feeding cost of the electric vehicle while meeting the charging and feeding demand of the electric vehicle is obtained, and the charging or feeding of the electric vehicle can be executed according to the strategy.
[0090] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific implementation examples. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0092] Figure 1 is a schematic flow chart of a charging and feeding method for an electric vehicle according to a first embodiment of the present invention;
[0093] Figure 2 is a schematic flow chart of a charging and feeding method for an electric vehicle according to a second embodiment of the present invention;
[0094] Figure 3 is a flow chart of a method for solving an objective function using a particle swarm algorithm according to a third embodiment of the present invention;
[0095] Figure 4 is a schematic diagram of main modules of a charging and feeding device for an electric vehicle according to an embodiment of the present invention;
[0096] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0097] Figure 6 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0098] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0099] Figure 1 FIG. 1 is a flow chart of a charging and feeding method for an electric vehicle according to a first embodiment of the present invention. Figure 1 As shown, the charging and feeding method of the electric vehicle includes:
[0100] Step S101, acquiring charging and feeding configuration information, and determining charging and feeding demand information of a target electric vehicle;
[0101] Step S102: construct an objective function and constraint conditions for the charging and feeding cost optimization problem according to the demand information and the charging and feeding configuration information, solve the objective function under the constraint conditions, and determine the charging and feeding strategy;
[0102] Step S103: charging or feeding the target electric vehicle according to the charging and feeding strategy.
[0103] In some embodiments, the charging and feeding configuration information includes at least: charging electricity price information or feeding electricity price information in each unit time period, charging pile power threshold, and total power threshold;
[0104] The demand information includes at least: initial power, expected power, charging and feeding time period information, and power threshold.
[0105] In the V2G (Vehicle to Grid) scenario, the charging and feeding scenario in the parking mode can be understood as: in a scenario where a charging pile is set up (such as a parking lot), charging and feeding services can be provided for multiple electric vehicles; among them, one charging pile can provide charging function services or feeding function services for one electric vehicle; when using a charging pile to charge an electric vehicle, the user needs to pay the charging cost; when the electric vehicle feeds power to the charging pile, the user can get the feeding cost;
[0106] The user can reserve the charging and feeding of the electric vehicle by registering the reservation information. Specifically, when the user determines to go to a parking lot to park and charge the electric vehicle, the user can register the reservation information before arriving at the parking lot; the user can also register the reservation information when arriving at the parking lot and preparing to use the charging pile; the demand information of the charging and feeding of the electric vehicle can be determined according to the reservation information;
[0107] The unit time period may be a preset value. For example, one hour between two consecutive hours may be used as a unit time period (such as one hour between 8:00 and 9:00), or every 30 minutes may be used as a unit time period (such as 30 minutes between 8:00 and 8:30).
[0108] The charging electricity price information or feeding electricity price information within each unit time period can be obtained from the relevant upstream system. It can be a uniform price for all electric vehicles, or different prices can be set for electric vehicles in different areas, and different prices can be set for users of different levels. The charging pile power threshold and the total power threshold can be obtained from the relevant system of the parking lot where the user makes a reservation for charging and feeding. Among them, the charging pile power threshold can correspond to one charging pile, and the total power threshold can correspond to the entire parking lot. In some practical applications, the total power threshold can be set to be smaller than the product of the charging pile power threshold and the number of charging piles.
[0109] According to the method of the present invention, based on the parking mode of the parking lot and taking into account the charging and feeding needs of the electric vehicles, a charging and feeding strategy for the electric vehicles can be determined with the goal of optimizing the charging and feeding costs of the electric vehicles, and the charging or feeding of the electric vehicles can be performed according to the strategy.
[0110] In some embodiments, determining the charging and feeding demand information of the target electric vehicle includes:
[0111] Receiving electric vehicle charging and feeding reservation information, the reservation information at least includes: initial power, expected power, power threshold, start time, and end time;
[0112] Determine the charging and feeding period information according to the start time and the end time, wherein the charging and feeding period is composed of an integer number of unit time periods;
[0113] It is determined whether the demand information meets the initial condition, and the demand information that meets the initial condition is determined as the demand information for charging and feeding the target electric vehicle.
[0114] When the user registers reservation information before arriving at the parking lot, the initial power, expected power, start time, and end time in the reservation information can be estimated values or set by the user, and the power threshold can be obtained from the electric vehicle related system.
[0115] When the user has arrived at the parking lot and is ready to use the charging pile, the reservation information is registered. The start time in the reservation information may be a certain moment after the electric vehicle is connected to the charging pile, such as: it may be the moment of connection, or the moment after the connection is maintained for a period of time (such as 30 seconds / 1 minute), or the moment when the reservation information is submitted while the connection is maintained, or the moment after the reservation information is submitted while the connection is maintained for a period of time (such as 30 seconds / 1 minute); the initial power and power threshold may be obtained from the electric vehicle related system, and the expected power and end time may be estimated values and / or set by the user;
[0116] The above power threshold can be regarded as the upper limit of the power of the battery in the electric vehicle;
[0117] In some practical applications, the above reservation information may also include the user's identity information, which can be used for big data statistics, or for determining the charging electricity price and feeding electricity price corresponding to different identity levels;
[0118] Determining the charging and feeding period information according to the start time and the end time includes:
[0119] The hourly time period between the start time and the end time can be used as the charging and feeding time period information of the electric vehicle; the following example is used for explanation: the start time registered by the user is 8:20, the end time is 11:15, and one hour is used as the unit time. The time period between every two adjacent hourly times can be regarded as a unit time period, and the charging and feeding time period information of the user's electric vehicle is: 9:00-10:00, 10:00-11:00 these two unit time periods; similarly, if 30 minutes is used as the unit time in this example, the charging and feeding time period information of the user's electric vehicle can be: 8:30-9:00, 9:00-9:30, 9:30-10:00, 10:00-10:30, 10:30-11:00 these five unit time periods;
[0120] After determining the demand information of the electric vehicle according to the reservation information, it can be determined whether the demand information meets the initial conditions. If so, the electric vehicle corresponding to the demand information can be regarded as the target electric vehicle, and the demand information can be determined as the demand information of the target electric vehicle.
[0121] In some embodiments, determining whether the requirement information satisfies the initial condition includes:
[0122] Determining a power change amount according to the initial power amount and the expected power amount;
[0123] The product of the number of unit time periods contained in the charging and feeding period and the charging pile power threshold is taken as the maximum value of the variation, and it is determined whether the maximum value of the variation exceeds the amount of power variation; and
[0124] Determining whether the charging and feeding period exceeds a time threshold;
[0125] If yes, it is determined that the demand information meets the initial condition.
[0126] Determining the amount of power change according to the initial power and the expected power, and taking the difference between the expected power and the initial power as the amount of power change;
[0127] When the amount of change in the amount of electricity of the electric vehicle exceeds the maximum amount of change, it can be considered that during the parking period of the electric vehicle, the entire parking time needs to be used to charge or feed the electric vehicle, and it can be considered that there is no need to calculate the charging and feeding strategy of the electric vehicle;
[0128] When the charging and feeding period of the electric vehicle does not exceed the time threshold, it can be considered that the charging electricity price or the feeding electricity price in the charging and feeding period is unchanged or changes slightly, so that the charging and feeding costs in different charging and feeding strategies have no difference or the difference is small. In considering the charging and feeding cost optimization problem, it can be considered that there is no need to calculate the charging and feeding strategy of the electric vehicle;
[0129] By setting the initial conditions, some electric vehicles that do not need to calculate the charging and feeding strategy can be filtered out, thereby improving the calculation efficiency.
[0130] In some embodiments, based on the demand information and the charging and feeding configuration information, an objective function and constraint conditions of the charging and feeding cost optimization problem are constructed, the objective function is solved under the constraint conditions, and the charging and feeding strategy is determined, including:
[0131] Constructing a charging and feeding cost function for each target electric vehicle within a preset time period according to the electricity price information and the charging and feeding time period information; and determining the constraint condition according to the demand information and the charging and feeding configuration information;
[0132] The objective function is to minimize the sum of the charging and feeding costs of all target electric vehicles, and the actual power of each target electric vehicle charged or fed in each unit time period is used as the optimization variable;
[0133] Under the condition that the constraint conditions are met, an optimal solution is obtained for the objective function to determine the charging and feeding strategy.
[0134] A charging and feeding cost function within a preset time period can be constructed for each target electric vehicle based on the acquired electricity price information and the charging and feeding time period information of the electric vehicle, and then the minimum sum of the charging and feeding costs of each target electric vehicle is taken as the objective function, so that the solved charging and feeding strategy can take all target electric vehicles into consideration at the same time; the constraint condition can be determined based on the demand information and the charging and feeding configuration information, and the constraint condition can be regarded as a restriction condition that satisfies the scenario of the present invention or objective facts.
[0135] In some embodiments, the constraints include:
[0136] The power of each target electric vehicle at the beginning of the charging and feeding period is equal to its initial power, and the power of each target electric vehicle at the end of the charging and feeding period is equal to its expected power;
[0137] The power of each target electric vehicle at the end of the charging and feeding period does not exceed the power threshold of the target electric vehicle;
[0138] During the preset time period, the power of each target electric vehicle does not change outside its charging and feeding time period;
[0139] The power change of the target electric vehicle in each unit time period does not exceed the charging pile power threshold;
[0140] In each unit time period, the sum of the changes in power of all target electric vehicles does not exceed the total power threshold; wherein the change in power is determined based on the initial power and the expected power.
[0141] To understand the relationship between the constraints and the optimization variables in the present invention, the following examples are given:
[0142] It is known that: the preset period is 3 hours, the charging and feeding period of an electric car c1 is the 1st and 2nd hours, the initial power of the electric car c1 is 5, the expected power is 10, and the power threshold is 25; the charging and feeding period of another electric car c2 is the 2nd and 3rd hours, the initial power of the electric car c2 is 23, the expected power is 20, and the power threshold is 25; the charging pile power threshold is p max1 , the total power threshold is p max2 ;
[0143] The optimization variables of electric car c1 can be set as: (p 11 , p 12 , p 13 ), set the optimization variable of electric car c2 to: (p 21 , p 22 , p 23 );
[0144] Then, for the constraint condition "the power of each target electric vehicle at the beginning of the charging and feeding period is equal to its initial power, and the power at the end of the charging and feeding period is equal to its expected power", the optimization variables must satisfy: 5+p 11 +p 12 +p 13 =10;23+p 21 +p 22 +p 23 =20;
[0145] For the constraint condition "the power of each target electric vehicle at the end of the charging and feeding period does not exceed the power threshold of the target electric vehicle", the optimization variables must satisfy:
[0146] 5+p 11 ≤25,5+p 11 +p 12 ≤25;23+p 22 ≤25,23+p 22 +p 23 ≤25;
[0147] For the constraint condition "within the preset period, the power of each target electric vehicle does not change outside its charging and feeding period", the optimization variables need to satisfy: p 13 =0; p 21 =0;
[0148] For the constraint condition "the change in the amount of power of the target electric vehicle in each unit time period does not exceed the power threshold of the charging pile", the optimization variables must satisfy:
[0149] |p 11 |,|p 12 |,|p 13 |,|p 21 |,|p 22 |,|p 23 |≤p max1 ;
[0150] For the constraint condition "the sum of the changes in the power of all target electric vehicles in each unit time period does not exceed the total power threshold", the optimization variables must satisfy:
[0151] p 11 +p 21 ≤p max2 ;p 12 +p 22 ≤p max2 ;p 1a +p 23 ≤p max2 ;
[0152] Among them, for the optimization variable p 11 , p 12 , p 13 , p 21 , p 22 , p 23 When its value is a positive number, the target electric vehicle is charged in the unit time period, that is, the target electric vehicle is charged using the charging pile; when its value is a negative number, the target electric vehicle is fed with power in the unit time period, that is, the target electric vehicle feeds power to the charging pile; when its value is 0, neither charging nor feeding is performed in the unit time period.
[0153] The charging and feeding strategy determined by solving the objective function under the condition of satisfying the constraint conditions can be considered as a strategy that minimizes the sum of the costs under the condition of satisfying the objective conditions; charging or feeding the target electric vehicle according to the strategy can minimize the charging and feeding costs of the user, thereby improving the user experience;
[0154] For example: the total number of target electric vehicles is 1, the initial power of the target electric vehicle is the same as the expected power, both are 5, the power threshold of the electric vehicle is 10, the parking time is the next two hours, the charging price of the first hour is 10, the feeding price is 10, the charging price of the second hour is 50, the feeding price is 50; the charging pile threshold is 3, and the total power threshold is 20;
[0155] Under the condition of satisfying the constraint conditions, the charging and feeding strategy can be calculated by finding the optimal solution to the objective function: charging at a power of 3 in the first hour and feeding at a power of 3 in the second hour; then according to the strategy, the charging and feeding cost of the user corresponding to the electric vehicle is: 3×10-3×50=-120, that is, the user can get 120. Among all the charging and feeding strategies that satisfy the constraint conditions, the charging and feeding strategy obtained by solving the objective function can be regarded as the optimal strategy, and the charging and feeding costs corresponding to other charging and feeding strategies that satisfy the constraint conditions are not as small as the charging and feeding costs corresponding to the above optimal strategy.
[0156] In some embodiments, the objective function is:
[0157]
[0158] in,
[0159] Where m represents the number of target electric vehicles, k represents the kth target electric vehicle, and f k represents the charging and feeding cost of the kth target electric vehicle; n represents the number of unit time periods contained in the preset time period, t represents the tth unit time period in the preset time period; r k (t) represents the electricity price for charging the kth target electric vehicle in the tth unit time period, P chk (t) represents the actual power of charging the kth target electric vehicle in the tth unit time period; q k (t) represents the electricity price fed by the kth target electric vehicle in the tth unit time period, P chk (t) represents the actual power fed by the kth target electric vehicle in the tth unit time period; Δt represents the unit time.
[0160] To facilitate understanding of the charging and feeding method flow of the electric vehicle in the present invention, please refer to Figure 2 ; Figure 2 FIG. 1 is a flow chart of a charging and feeding method for an electric vehicle according to a second embodiment of the present invention. Figure 2 As shown, including:
[0161] Step S201, receiving the reservation information of the electric vehicle charging and feeding; the reservation information may at least include: initial power, expected power, power threshold, start time, and end time;
[0162] Step S202, obtaining charging and feeding configuration information; the charging and feeding configuration information may at least include: charging electricity price information or feeding electricity price information in each unit time period, charging pile power threshold, and total power threshold;
[0163] Step S203, determining the target electric vehicle charging and feeding demand information; specifically, the demand information may be determined according to the reservation information, and the configuration information may be used to determine whether the reservation information meets the initial conditions, and the demand information meeting the initial conditions may be used as the target electric vehicle charging and feeding demand information;
[0164] Step S204: construct an objective function and constraint conditions for the charging and feeding cost optimization problem based on the demand information and the charging and feeding configuration information;
[0165] Step S205: solving the objective function under the constraint conditions to determine the charging and feeding strategy;
[0166] Step S206, charging or feeding the target electric vehicle according to the charging and feeding strategy;
[0167] In some practical situations, there is no restriction on the order of steps S201 and S202. Step S201 may be executed first and then step S202, or step S202 may be executed first and then step S201, or steps S201 and S202 may be executed simultaneously. It is only necessary that steps S201 and S202 are executed before step S203.
[0168] In some embodiments, a particle swarm algorithm is used to solve the objective function under the constraint conditions to determine the charging and feeding strategy, including:
[0169] According to the number n of unit time periods contained in the preset time period and the number m of the target electric vehicles, a preset number of position particles x and a preset number of speed particles v are generated based on the demand information and constraint conditions to form a particle group; the position particles and speed particles are both m×n two-dimensional arrays; the element x in the position particle x is kt represents the power value of the kth target electric vehicle after the tth unit time period; the element v in the velocity particle v kt represents the amount of power change of the kth target electric vehicle in the tth unit time period; where k∈{1, 2, ..., m}, t∈{1, 2, ..., n};
[0170] Establishing a constraint relationship between the position particle and the optimization variable;
[0171] The following steps are executed repeatedly to update the position particles and velocity particles in the particle swarm until the iteration end condition is met:
[0172] Substituting the position particle into the objective function according to the constraint relationship to obtain a function value corresponding to the position particle, and using the function value as the fitness of the position particle; determining a global optimal solution and an individual optimal solution of each position particle according to the fitness of each position particle; updating the position particles and velocity particles in the particle swarm based on the global optimal solution, the individual optimal solution and the constraint conditions;
[0173] The particle at the optimal position is determined from the particle group after the iteration, and the optimization variable corresponding to the particle at the optimal position is determined according to the constraint relationship to determine the charging and feeding strategy.
[0174] In some embodiments, whether the iteration end condition is met is determined according to the following method:
[0175] When the number of iterations exceeds the iteration threshold, determining that the iteration is finished; or,
[0176] The modulus of the vector corresponding to each updated velocity particle is determined, and the number of velocity particles whose modulus of the vector is less than the modulus threshold is taken as the stable number; when the stable number exceeds the number threshold, the iteration is determined to be ended.
[0177] In some embodiments, after updating the position particles and the velocity particles in the particle group, the method further includes:
[0178] Determining whether the position particle and the velocity particle satisfy the constraint condition;
[0179] If not, update the position particle or velocity particle using a mutation method or a crossover method of a genetic algorithm; or,
[0180] Regenerate position particles or velocity particles based on the constraint conditions; or,
[0181] The updated position particles and velocity particles that do not satisfy the constraint condition are deleted from the particle group.
[0182] To facilitate understanding of the method flow of using the particle swarm algorithm to solve the objective function in the present invention, please refer to Figure 3 ; Figure 3 FIG. 1 is a flow chart of a method for solving an objective function using a particle swarm algorithm according to a third embodiment of the present invention. Figure 3 As shown, including:
[0183] Step S301: Generate a preset number of position particles and a preset number of corresponding velocity particles based on demand information and constraint conditions to form a particle group; wherein the preset number can be set according to actual needs, and can be 10 to 20, or 100 to 200;
[0184] Step S302, determine whether the iteration end condition is met; if so, execute step S306; if not, execute the following steps S303 to S305;
[0185] Step S303: Substitute the position particle into the objective function according to the constraint relationship between the position particle and the optimization variable, and use the function value as the fitness of the position particle;
[0186] Step S304: determine the global optimal solution and the individual optimal solution of the particles at each position according to the fitness of the particles at each position; specifically: take the particle at the position corresponding to the minimum value of the fitness determined in this iteration as the global optimal solution, and take the particle at the position corresponding to the minimum value of the fitness determined in all iterations (including this one) of the particles at each position as its individual optimal solution;
[0187] Step S305, updating the position particles and velocity particles in the particle swarm based on the global optimal solution, the individual optimal solution and the constraint conditions;
[0188] Step S306: taking the position particle with the minimum fitness in the current particle swarm as the optimal position particle; and determining the optimization variable corresponding to the optimal position particle according to the constraint relationship, and then determining the charging and feeding strategy.
[0189] In the above step S305, the formula expression of the updating method may be:
[0190] V id =ωV i(d-1) +c1r 1id (P Besti(d-1) -X i(d-1) )+c2r 2id (G Best(d-1) -Xi(d-1);
[0191] X id =X i(d-1) +V id ;
[0192] Where; d represents the dth iteration, i represents the i-th particle in an iteration; V id represents the i-th velocity particle in the d-th iteration, V i(d-1) represents the i-th velocity particle in the (d-1)th iteration, X id represents the particle at position i in the dth iteration, X i(d-1)represents the i-th position particle in the (d-1)th iteration; P Besti(d-1) represents the individual optimal solution of the particle at the ith position obtained in the (d-1)th iteration, G Best(d-1) represents the global optimal solution obtained in the (d-1)th iteration; ω, c1, r 1id ,c2,r 2id is used to calculate V in the dth iteration id Parameters, where
[0193] ω is the inertia factor in the particle swarm algorithm, and its value is between [0, 1]. In general practical applications, ω can be set adaptively, such as ω=0.9 at the beginning, so that the global optimization ability of the algorithm is stronger. As the iteration goes deeper, the parameter ω can be decreased, so that the local optimization ability of the algorithm is stronger. When the iteration ends, ω=0.1.
[0194] c1 and c2 are acceleration factors (or learning factors) in the particle swarm algorithm, and their values are non-negative constants; c1 and c2 can represent the weights of the statistical acceleration terms that push each particle to the individual optimal solution and the global optimal solution; in general practical applications, the values of c1 and c2 can be between [0, 4], such as: they can be set to c1, c2 = 1.4961 or c1, c2 = 2 and other values;
[0195] r 1id 、r 2id is a random number in the particle swarm algorithm, and its value is between [0, 1]; r 1id represents the first random number used to calculate the i-th velocity particle in the d-th iteration, r 2id Represents the second random number used to calculate the i-th velocity particle in the d-th iteration; r can be randomly generated in each iteration 1id 、r 2id .
[0196] Figure 4 is a schematic diagram of main modules of a charging and feeding device for an electric vehicle according to an embodiment of the present invention, such as Figure 4 As shown, the charging and feeding device 400 of the electric vehicle includes:
[0197] The acquisition module 401 is used to acquire charging and feeding configuration information and determine the charging and feeding demand information of the target electric vehicle;
[0198] A solution module 402 is used to construct an objective function and constraint conditions for the charging and feeding cost optimization problem according to the demand information and the charging and feeding configuration information, solve the objective function under the constraint conditions, and determine the charging and feeding strategy;
[0199] The execution module 403 is used to execute charging or feeding of the target electric vehicle according to the charging and feeding strategy.
[0200] In some embodiments, the charging and feeding configuration information includes at least: electricity price information, charging pile power threshold, and total power threshold; wherein the electricity price information includes: charging electricity price information or feeding electricity price information in each unit time period;
[0201] The demand information includes at least: initial power, expected power, charging and feeding time period information, and power threshold.
[0202] In the V2G (Vehicle to Grid) scenario, electric vehicles can be charged and fed in parking lots equipped with charging piles, which can provide charging and feeding functions; users can reserve charging and feeding for electric vehicles by registering reservation information. Specifically, when a user determines that he will go to a parking lot to park and perform charging and feeding, the user can register the reservation information before arriving at the parking lot; the user can also register the reservation information when he has arrived at the parking lot and is ready to use the charging pile; the demand information for charging and feeding of the electric vehicle can be determined based on the reservation information;
[0203] The unit time period may be a preset value. For example, one hour between two consecutive hours may be used as a unit time period (e.g., one hour between 8:00 and 9:00), or every 30 minutes may be used as a unit time period (e.g., 30 minutes between 8:00 and 8:30);
[0204] The charging electricity price information or feeding electricity price information within each unit time period can be obtained from the relevant upstream system. It can be a uniform price for all electric vehicles, or different prices can be set for electric vehicles in different areas, and different prices can be set for users of different levels. The charging pile power threshold and the total power threshold can be obtained from the relevant system of the parking lot where the user makes a reservation for charging and feeding. Among them, the charging pile power threshold can correspond to one charging pile, and the total power threshold can correspond to the entire parking lot. In some practical applications, the total power threshold can be set to be smaller than the product of the charging pile power threshold and the number of charging piles.
[0205] According to the method of the present invention, based on the parking mode of the parking lot and taking into account the charging and feeding needs of the electric vehicles, a charging and feeding strategy for the electric vehicles can be determined with the goal of optimizing the charging and feeding costs of the electric vehicles, and the charging or feeding of the electric vehicles can be performed according to the strategy.
[0206] In some embodiments, the acquisition module determines the target electric vehicle charging and feeding demand information, including:
[0207] Receiving electric vehicle charging and feeding reservation information, the reservation information at least includes: initial power, expected power, power threshold, start time, and end time;
[0208] Determine the charging and feeding period information according to the start time and the end time, wherein the charging and feeding period is composed of an integer number of unit time periods;
[0209] It is determined whether the demand information meets the initial condition, and the demand information that meets the initial condition is determined as the demand information for charging and feeding the target electric vehicle.
[0210] When a user registers reservation information before arriving at the parking lot, the initial power, expected power, start time, and end time in the reservation information may be estimated values and / or set by the user, and the power threshold may be obtained from the electric vehicle related system.
[0211] When the user has arrived at the parking lot and is ready to use the charging pile, the user registers the reservation information. The start time in the reservation information may be a certain time after the electric vehicle is connected to the charging pile, the initial power and power threshold may be obtained from the electric vehicle related system, and the expected power and end time may be estimated values and / or set by the user;
[0212] The above power threshold can be regarded as the upper limit of the power of the battery in the electric vehicle;
[0213] In some practical applications, the above reservation information may also include the user's identity information, which can be used for big data statistics, or for determining the charging electricity price and feeding electricity price corresponding to different identity levels;
[0214] The hourly time period between the start time and the end time can be used as the charging and feeding time period information of the electric vehicle; the following example is used for explanation: the start time registered by the user is 8:20, the end time is 11:15, and one hour is used as the unit time. The time period between every two adjacent hourly times can be regarded as a unit time period, and the charging and feeding time period information of the user's electric vehicle is: 9:00-10:00, 10:00-11:00 these two unit time periods; similarly, if 30 minutes is used as the unit time in this example, the charging and feeding time period information of the user's electric vehicle can be: 8:30-9:00, 9:00-9:30, 9:30-10:00, 10:00-10:30, 10:30-11:00 these five unit time periods;
[0215] After determining the demand information of the electric vehicle according to the reservation information, it can be determined whether the demand information meets the initial conditions. If so, the electric vehicle corresponding to the demand information can be regarded as the target electric vehicle, and the demand information can be determined as the demand information of the target electric vehicle.
[0216] In some embodiments, the acquisition module determines whether the demand information meets the initial condition, including:
[0217] Determining a power change amount according to the initial power amount and the expected power amount;
[0218] The product of the number of unit time periods contained in the charging and feeding period and the charging pile power threshold is taken as the maximum value of the variation, and it is determined whether the maximum value of the variation exceeds the amount of power variation; and
[0219] Determining whether the charging and feeding period exceeds a time threshold;
[0220] If yes, it is determined that the demand information meets the initial condition.
[0221] When the amount of change in the amount of electricity of the electric vehicle exceeds the maximum amount of change, it can be considered that during the parking period of the electric vehicle, the entire parking time needs to be used to charge or feed the electric vehicle, and it can be considered that there is no need to calculate the charging and feeding strategy of the electric vehicle;
[0222] When the charging and feeding period of the electric vehicle does not exceed the time threshold, it can be considered that the charging electricity price or the feeding electricity price in the charging and feeding period is unchanged or changes little. In the charging and feeding cost optimization problem considered, it can be considered that there is no need to calculate the charging and feeding strategy of the electric vehicle;
[0223] By setting the initial conditions, some electric vehicles that do not need to calculate the charging and feeding strategy can be filtered out, thereby improving the calculation efficiency.
[0224] In some embodiments, the solution module constructs an objective function and constraint conditions for the charging and feeding cost optimization problem based on the demand information and the charging and feeding configuration information, solves the objective function under the constraint conditions, and determines the charging and feeding strategy, including:
[0225] Constructing a charging and feeding cost function for each target electric vehicle within a preset time period according to the electricity price information and the charging and feeding time period information; and determining the constraint condition according to the demand information and the charging and feeding configuration information;
[0226] The objective function is to minimize the sum of the charging and feeding costs of all target electric vehicles, and the actual power of each target electric vehicle charged or fed in each unit time period is used as the optimization variable;
[0227] Under the condition that the constraint conditions are met, an optimal solution is obtained for the objective function to determine the charging and feeding strategy.
[0228] A charging and feeding cost function within a preset time period can be constructed for each target electric vehicle based on the acquired electricity price information and the charging and feeding time period information of the electric vehicle, and then the minimum sum of the charging and feeding costs of each target electric vehicle is taken as the objective function, so that the solved charging and feeding strategy can take all target electric vehicles into consideration at the same time; the constraint conditions can be determined based on the demand information and the charging and feeding configuration information, and the constraint conditions can be regarded as constraint conditions that meet the scenario of the present invention or objective facts; the charging and feeding strategy determined by solving the objective function under the condition of satisfying the constraint conditions can be regarded as a strategy that minimizes the sum of the costs under the constraints of the objective conditions.
[0229] In some embodiments, the constraints include:
[0230] The power of each target electric vehicle at the beginning of the charging and feeding period is equal to its initial power, and the power of each target electric vehicle at the end of the charging and feeding period is equal to its expected power;
[0231] The power of each target electric vehicle at the end of the charging and feeding period does not exceed the power threshold of the target electric vehicle;
[0232] During the preset time period, the power of each target electric vehicle does not change outside its charging and feeding time period;
[0233] The power change of the target electric vehicle in each unit time period does not exceed the charging pile power threshold;
[0234] In each unit time period, the sum of the changes in power of all target electric vehicles does not exceed the total power threshold; wherein the change in power is determined based on the initial power and the expected power.
[0235] To understand the relationship between the constraints and the optimization variables in the present invention, the following examples are given:
[0236] It is known that: the preset period is 3 hours, the charging and feeding period of an electric car c1 is the 1st and 2nd hours, the initial power of the electric car c1 is 5, the expected power is 10, and the power threshold is 25; the charging and feeding period of another electric car c2 is the 2nd and 3rd hours, the initial power of the electric car c2 is 23, the expected power is 20, and the power threshold is 25; the charging pile power threshold is p max1 , the total power threshold is p max1 ;
[0237] The optimization variables of electric car c1 can be set as: (p 11 , p 12 , p 13 ), set the optimization variable of electric car c2 to: (p 21 , p 22 , p23 );
[0238] Then, for the constraint condition "the power of each target electric vehicle at the beginning of the charging and feeding period is equal to its initial power, and the power at the end of the charging and feeding period is equal to its expected power", the optimization variables must satisfy: 5+p 11 +p 12 +p 13 =10;23+p 21 +p 22 +p 23 =20;
[0239] For the constraint condition "the power of each target electric vehicle at the end of the charging and feeding period does not exceed the power threshold of the target electric vehicle", the optimization variables must satisfy:
[0240] 5+p 11 ≤25,5+p 11 +p 12 ≤25;23+p 22 ≤25,23+p 22 +p 23 ≤25;
[0241] For the constraint condition "within the preset period, the power of each target electric vehicle does not change outside its charging and feeding period", the optimization variables need to satisfy: p 13 =0; p 21 =0;
[0242] For the constraint condition "the change in the amount of power of the target electric vehicle in each unit time period does not exceed the power threshold of the charging pile", the optimization variables must satisfy:
[0243] |p 11 |,|p 12 |,|p 13 |,|p 21 |,|p 22 |,|p 23 |≤p max1 ;
[0244] For the constraint condition "the sum of the changes in the power of all target electric vehicles in each unit time period does not exceed the total power threshold", the optimization variables must satisfy: p 11 +p 21 ≤p max2 ;p 12 +p 22 ≤p max2 ;p 13 +p 23 ≤p max2 ;
[0245] Among them, for the optimization variable p11 , p 12 , p 13 , p 21 , p 22 , p 23 When its value is a positive number, the target electric vehicle is charged in the unit time period, that is, the target electric vehicle is charged using the charging pile; when its value is a negative number, the target electric vehicle is fed with power in the unit time period, that is, the target electric vehicle feeds power to the charging pile; when its value is 0, neither charging nor feeding is performed in the unit time period.
[0246] In some embodiments, the objective function is:
[0247]
[0248] in,
[0249] Where m represents the number of target electric vehicles, k represents the kth target electric vehicle, and f k represents the charging and feeding cost of the kth target electric vehicle; n represents the number of unit time periods contained in the preset time period, t represents the tth unit time period in the preset time period; r k (t) represents the electricity price for charging the kth target electric vehicle in the tth unit time period, P chk (t) represents the actual power of charging the kth target electric vehicle in the tth unit time period; q k (t) represents the electricity price fed by the kth target electric vehicle in the tth unit time period, P chk (t) represents the actual power fed by the kth target electric vehicle in the tth unit time period; Δt represents the unit time.
[0250] In some embodiments, the solution module uses a particle swarm algorithm to solve the objective function under the constraint conditions to determine the charging and feeding strategy, including:
[0251] According to the number n of unit time periods contained in the preset time period and the number m of the target electric vehicles, a preset number of position particles x and a preset number of speed particles v are generated based on the demand information and constraint conditions to form a particle group; the position particles and speed particles are both m×n two-dimensional arrays; the element x in the position particle x is kt represents the power value of the kth target electric vehicle after the tth unit time period; the element v in the velocity particle v kt represents the amount of power change of the kth target electric vehicle in the tth unit time period; where k∈{1, 2, ..., m}, t∈{1, 2, ..., n};
[0252] Establishing a constraint relationship between the position particle and the optimization variable;
[0253] The following steps are executed repeatedly to update the position particles and velocity particles in the particle swarm until the iteration end condition is met:
[0254] Substituting the position particle into the objective function according to the constraint relationship to obtain a function value corresponding to the position particle, and using the function value as the fitness of the position particle; determining a global optimal solution and an individual optimal solution of each position particle according to the fitness of each position particle; updating the position particles and velocity particles in the particle swarm based on the global optimal solution, the individual optimal solution and the constraint conditions;
[0255] The particle at the optimal position is determined from the particle group after the iteration, and the optimization variable corresponding to the particle at the optimal position is determined according to the constraint relationship to determine the charging and feeding strategy.
[0256] In the above process, the formula expression of the update method can be:
[0257] V id =ωV i(d-1) +c1r 1id (P Besti(d-1) -X i(d-1) )+c2r 2id (G Best(d-1) -Xi(d-1);
[0258] X id =X i(d-1) +V id ;
[0259] Where; d represents the dth iteration, i represents the i-th particle in an iteration; V id represents the i-th velocity particle in the d-th iteration, V i(d-1) represents the i-th velocity particle in the (d-1)th iteration, X id represents the particle at position i in the dth iteration, X i(d-1) represents the i-th position particle in the (d-1)th iteration; P Besti(d-1) represents the individual optimal solution of the particle at the ith position obtained in the (d-1)th iteration, G Best(d-1) represents the global optimal solution obtained in the (d-1)th iteration; ω, c1, r 1id ,c2,r 2id is used to calculate V in the dth iteration id Parameters, where
[0260] ω is the inertia factor in the particle swarm algorithm, and its value is between [0, 1]. In general practical applications, ω can be set adaptively, such as ω=0.9 at the beginning, so that the global optimization ability of the algorithm is stronger. As the iteration goes deeper, the parameter ω can be decreased, so that the local optimization ability of the algorithm is stronger. When the iteration ends, ω=0.1.
[0261] c1 and c2 are acceleration factors (or learning factors) in the particle swarm algorithm, and their values are non-negative constants; c1 and c2 can represent the weights of the statistical acceleration terms that push each particle to the individual optimal solution and the global optimal solution. In general practical applications, the values of c1 and c2 can be between [0, 4], such as c1, c2 = 1.4961 or c1, c2 = 2.
[0262] r 1id 、r 2id is a random number in the particle swarm algorithm, and its value is between [0, 1]; r 1id represents the first random number used to calculate the i-th velocity particle in the d-th iteration, r 2id Represents the second random number used to calculate the i-th velocity particle in the d-th iteration; r can be randomly generated in each iteration 1id 、r 2id .
[0263] In some embodiments, the solution module determines whether the iteration end condition is met according to the following method:
[0264] When the number of iterations exceeds the iteration threshold, determining that the iteration is finished; or,
[0265] The modulus of the vector corresponding to each updated velocity particle is determined, and the number of velocity particles whose modulus of the vector is less than the modulus threshold is taken as the stable number; when the stable number exceeds the number threshold, the iteration is determined to be ended.
[0266] In some embodiments, after updating the position particles and the velocity particles in the particle swarm, the solution module further includes:
[0267] Determining whether the position particle and the velocity particle satisfy the constraint condition;
[0268] If not, update the position particle or velocity particle using a mutation method or a crossover method of a genetic algorithm; or,
[0269] Regenerate position particles or velocity particles based on the constraint conditions; or,
[0270] The updated position particles and velocity particles that do not satisfy the constraint condition are deleted from the particle group.
[0271] Figure 5 An exemplary system architecture 500 is shown to which the charging and feeding method of an electric vehicle or the charging and feeding device of an electric vehicle according to the embodiment of the present invention can be applied.
[0272] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0273] The user can use the terminal devices 501, 502, 503 to interact with the server 505 through the network 504 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 501, 502, 503.
[0274] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0275] The server 505 may be a server that provides various services, such as a backend management server that provides support for the website for booking parking and charging that the user browses using the terminal devices 501, 502, and 503. The backend management server may analyze and process the received data such as the product information query request, and feed back the processing results to the terminal device.
[0276] It should be noted that the charging and feeding method of the electric vehicle provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the charging and feeding device of the electric vehicle is generally arranged in the server 505 .
[0277] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0278] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device suitable for implementing an embodiment of the present invention. Figure 6 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0279] like Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0280] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0281] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.
[0282] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0283] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0284] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor includes an acquisition module, a solution module, and an execution module. The names of these modules do not, in some cases, limit the modules themselves.
[0285] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes: step S101, obtaining charging and feeding configuration information, and determining the charging and feeding demand information of the target electric vehicle; step S102, constructing the objective function and constraint conditions of the charging and feeding cost optimization problem based on the demand information and the charging and feeding configuration information, solving the objective function under the constraint conditions, and determining the charging and feeding strategy; step S103, charging or feeding the target electric vehicle according to the charging and feeding strategy.
[0286] According to the technical solution of the embodiment of the present invention, because the objective function and constraint conditions of the charging and feeding cost optimization problem are constructed according to the demand information of the target electric vehicle and the charging and feeding configuration information, and the particle swarm algorithm is used to solve and determine the charging and feeding strategy, the technical problem of the lack of research on charging and feeding scheduling based on the stop mode and taking into account charging and feeding at the same time, with the goal of optimizing the charging and feeding cost of the electric vehicle in the prior art is overcome, and then a charging and feeding scheduling strategy that minimizes the charging and feeding cost of the electric vehicle while meeting the charging and feeding demand of the electric vehicle is obtained, and the charging or feeding of the electric vehicle can be executed according to the strategy.
[0287] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A charging and feeding method for an electric vehicle, characterized in that: include: Acquire charging and feeding configuration information, and determine the charging and feeding demand information of the target electric vehicle; wherein the charging and feeding configuration information at least includes: electricity price information, charging pile power threshold, and total power threshold; the electricity price information includes: charging electricity price information or feeding electricity price information in each unit time period; the demand information at least includes: initial power, expected power, charging and feeding time period information, and power threshold; According to the demand information and the charging and feeding configuration information, construct an objective function and constraint conditions for the charging and feeding cost optimization problem, solve the objective function under the constraint conditions, and determine the charging and feeding strategy; Execute charging or feeding of the target electric vehicle according to the charging and feeding strategy; The determining of the target electric vehicle charging and feeding demand information includes: Receiving electric vehicle charging and feeding reservation information; wherein the reservation information at least includes: initial power, expected power, power threshold, start time, and end time; when the user registers the reservation information before arriving at the parking lot, the initial power, expected power, start time, and end time in the reservation information are estimated values or set by the user; when the user has arrived at the parking lot, the start time in the reservation information is a certain moment after the electric vehicle is connected to the charging pile, the initial power and power threshold in the reservation information are obtained from the electric vehicle related system, and the expected power and end time in the reservation information are estimated values and / or set by the user; Determine the charging and feeding period information according to the start time and the end time, wherein the charging and feeding period is composed of an integer number of unit time periods; It is determined whether the demand information meets the initial condition, and the demand information that meets the initial condition is determined as the demand information for charging and feeding the target electric vehicle.
2. The method according to claim 1, characterized in that Determining whether the demand information meets the initial conditions includes: Determining a power change amount according to the initial power amount and the expected power amount; The product of the number of unit time periods contained in the charging and feeding period and the charging pile power threshold is taken as the maximum value of the variation, and it is determined whether the maximum value of the variation exceeds the amount of power variation; and Determining whether the charging and feeding period exceeds a time threshold; If yes, it is determined that the demand information meets the initial condition.
3. The method according to claim 1 or 2, characterized in that: According to the demand information and the charging and feeding configuration information, an objective function and constraint conditions of the charging and feeding cost optimization problem are constructed, the objective function is solved under the constraint conditions, and a charging and feeding strategy is determined, including: Constructing a charging and feeding cost function for each target electric vehicle within a preset time period according to the electricity price information and the charging and feeding time period information; and determining the constraint condition according to the demand information and the charging and feeding configuration information; The objective function is to minimize the sum of the charging and feeding costs of all target electric vehicles, and the actual power of each target electric vehicle charged or fed in each unit time period is used as the optimization variable; Under the condition that the constraint conditions are met, an optimal solution is obtained for the objective function to determine the charging and feeding strategy.
4. The method according to claim 3, characterized in that: The constraints include: The power of each target electric vehicle at the beginning of the charging and feeding period is equal to its initial power, and the power of each target electric vehicle at the end of the charging and feeding period is equal to its expected power; The power of each target electric vehicle at the end of the charging and feeding period does not exceed the power threshold of the target electric vehicle; During the preset time period, the power of each target electric vehicle does not change outside its charging and feeding time period; The power change of the target electric vehicle in each unit time period does not exceed the charging pile power threshold; In each unit time period, the sum of the power changes of all target electric vehicles does not exceed the total power threshold; wherein the power change is determined based on the initial power and the expected power.
5. The method according to claim 3, characterized in that: The particle swarm algorithm is used to solve the objective function under the constraints to determine the charging and feeding strategy, including: According to the number n of unit time periods contained in the preset time period and the number m of the target electric vehicles, a preset number of position particles x and a preset number of speed particles v are generated based on the demand information and constraint conditions to form a particle group; the position particles and speed particles are both m×n two-dimensional arrays; the element x in the position particle x is kt represents the power value of the kth target electric vehicle after the tth unit time period; the element v in the velocity particle v kt represents the amount of power change of the kth target electric vehicle in the tth unit time period; where k∈{1,2,…,m}, t∈{1,2,…,n}; Establishing a constraint relationship between the position particle and the optimization variable; The following steps are executed repeatedly to update the position particles and velocity particles in the particle swarm until the iteration end condition is met: Substituting the position particle into the objective function according to the constraint relationship to obtain a function value corresponding to the position particle, and using the function value as the fitness of the position particle; determining a global optimal solution and an individual optimal solution of each position particle according to the fitness of each position particle; updating the position particles and velocity particles in the particle swarm based on the global optimal solution, the individual optimal solution and the constraint conditions; The particle at the optimal position is determined from the particle group after the iteration, and the optimization variable corresponding to the particle at the optimal position is determined according to the constraint relationship to determine the charging and feeding strategy.
6. The method according to claim 5, characterized in that Determine whether the iteration end condition is met according to the following method: When the number of iterations exceeds the iteration threshold, determining that the iteration is finished; or, The modulus of the vector corresponding to each updated velocity particle is determined, and the number of velocity particles whose modulus of the vector is less than the modulus threshold is taken as the stable number; when the stable number exceeds the number threshold, the iteration is determined to be ended.
7. The method according to claim 5, characterized in that After updating the position particles and velocity particles in the particle group, it also includes: Determining whether the position particle and the velocity particle satisfy the constraint condition; If not, update the position particle or velocity particle using a mutation method or a crossover method of a genetic algorithm; or, Regenerate position particles or velocity particles based on the constraint conditions; or, The updated position particles and velocity particles that do not satisfy the constraint condition are deleted from the particle group.
8. A charging and feeding device for an electric vehicle, characterized in that: include: An acquisition module is used to acquire charging and feeding configuration information and determine the charging and feeding demand information of the target electric vehicle; wherein the charging and feeding configuration information at least includes: electricity price information, charging pile power threshold, and total power threshold; the electricity price information includes: charging electricity price information or feeding electricity price information in each unit time period; the demand information at least includes: initial power, expected power, charging and feeding time period information, and power threshold; A solution module, used to construct an objective function and constraint conditions for the charging and feeding cost optimization problem according to the demand information and the charging and feeding configuration information, solve the objective function under the constraint conditions, and determine the charging and feeding strategy; An execution module, used to execute charging or feeding of the target electric vehicle according to the charging and feeding strategy; The acquisition module is specifically used for: Receiving electric vehicle charging and feeding reservation information; wherein the reservation information at least includes: initial power, expected power, power threshold, start time, and end time; when the user registers the reservation information before arriving at the parking lot, the initial power, expected power, start time, and end time in the reservation information are estimated values or set by the user; when the user has arrived at the parking lot, the start time in the reservation information is a certain moment after the electric vehicle is connected to the charging pile, the initial power and power threshold in the reservation information are obtained from the electric vehicle related system, and the expected power and end time in the reservation information are estimated values and / or set by the user; Determine the charging and feeding period information according to the start time and the end time, wherein the charging and feeding period is composed of an integer number of unit time periods; It is determined whether the demand information meets the initial condition, and the demand information that meets the initial condition is determined as the demand information for charging and feeding the target electric vehicle.
9. An electric vehicle charging and feeding electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
