A method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station

By optimizing the location and equipment capacity of electric bus charging and swapping stations, and using genetic algorithms to calculate the optimal location and quantity of equipment, we solve the problems of unreasonable location and capacity in the existing technology and achieve maximum utilization of charging and swapping stations. The efficiency and lowest cost ensure the normal operation of electric buses.

CN113554239BInactive Publication Date: 2024-08-27GUANGDONG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110939679.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-16
Publication Date
2024-08-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The location and equipment capacity of existing electric bus charging and swapping stations are unreasonable, resulting in idle facilities and waste of resources, which cannot meet the normal operation of electric buses.

Method used

By obtaining the operation data of electric buses, establishing a driving model, using genetic algorithms to optimize the location and equipment capacity of charging and swapping stations, forming a full life cycle cost optimization model, calculating the optimal location and number of equipment, and ensuring that charging and swapping stations are maximum utilization and minimum cost.

Benefits of technology

It achieves the optimal location and equipment configuration of the charging and swapping station, avoids idle facilities and waste of resources, meets the normal operation of electric buses, and reduces the whole life cycle cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113554239B
    Figure CN113554239B
Patent Text Reader

Abstract

The present invention discloses a method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station, including: obtaining the operation data of the electric bus, obtaining the site selection location variables of the charging and swapping station according to the operation data; establishing an electric bus driving model, calculating the number of battery replacement machines, chargers, and spare batteries corresponding to the site selection location variables and the total cost function of the entire life cycle; using the total cost function of the entire life cycle as the objective function, setting constraints, and forming a full life cycle cost optimization model; using a genetic algorithm to optimize the site selection location variables according to the full life cycle cost optimization model, obtaining the most optimal site selection location, and the corresponding number of battery replacement machines, chargers, and spare batteries as the optimal value of the equipment capacity. Under the premise of ensuring the normal operation of the electric bus, the present invention optimizes the site selection and equipment capacity of the charging and swapping station, so that the charging and swapping station can achieve the maximum utilization rate and the lowest cost, and avoids the idleness of facilities and waste of resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of transportation facility planning, and more specifically, to a method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station. Background Art

[0002] The popularity of electric vehicles has brought great challenges to the existing transportation infrastructure in cities, and new charging facilities need to be built to meet the charging needs of electric vehicles. Charging and swapping stations can provide charging services or quick replacement services for the power batteries of electric vehicles. Compared with charging stations, the advantage of charging and swapping stations is that they can fully charge electric vehicles by replacing batteries in a short time. Charging and swapping stations are very suitable as charging tools for electric buses and electric taxis. This type of vehicle belongs to the company's property and can be uniformly deployed. Using the same model of electric vehicles, the charging and swapping station can serve only one model of electric vehicles, thereby improving work efficiency.

[0003] Chinese patent application CN107031439A published on August 11, 2017 provides a method for replacing batteries for electric buses running at night. A charging device is set in the battery replacement station in the return yard to count the battery power when the bus leaves and enters the station, the battery consumption of the bus in a round trip, and the remaining operating shifts n of the bus on that day. In this method, the charging device is only set in the return yard, the site selection is unreasonable, and it cannot meet the normal operation of the electric bus. There is also no specific design of the optimal solution for the equipment capacity of the charging device, resulting in idle facilities and waste of resources. Summary of the invention

[0004] In order to overcome the defects of unreasonable siting and equipment capacity of charging and swapping stations in the above-mentioned prior art, the present invention provides a method for optimizing the siting and equipment capacity of electric bus charging and swapping stations. Under the premise of ensuring the normal operation of electric buses, the siting and equipment capacity of the charging and swapping stations are optimized in combination with actual environmental factors to achieve maximum utilization of the charging and swapping stations.

[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0006] The present invention provides a method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station, the method comprising:

[0007] S1: Obtain the operation data of electric buses and obtain the location variables of charging and swapping stations based on the operation data;

[0008] S2: Establish an electric bus driving model, input the operation data of the electric bus and the location variables of the charging and swapping station, and calculate the equipment capacity corresponding to the location variables of the charging and swapping station, that is, the number of battery swap machines, chargers and spare batteries;

[0009] S3: Calculate the total life cycle cost function of the location variable of the charging and swapping station according to the number of battery swap machines, chargers and spare batteries corresponding to the location variable of the charging and swapping station;

[0010] S4: Take the total cost function of the whole life cycle as the objective function and set constraints to form a whole life cycle cost optimization model;

[0011] S5: Using a genetic algorithm to optimize the location variables according to the life cycle cost optimization model, the optimal solution of the location variables of the charging and swapping station is obtained as the optimal location of the charging and swapping station;

[0012] S6: The number of battery swap machines, chargers and spare batteries corresponding to the optimal location of the charging and swapping station is taken as the optimal value of the equipment capacity.

[0013] Preferably, the operating data of the electric bus includes electric bus routes, the total number of bus stops, the first and last departure times, the departure interval, the number of departures in a day, the distance between adjacent bus stops on the electric bus routes, the running time between adjacent bus stops on the bus routes, the electric bus number, the battery capacity, the low power coefficient, the battery replacement operation time and the number of simulated running days.

[0014] Preferably, the location variable of the charging and swapping station is recorded as Vec = [x1 x2 x3 ... x n ] T , where x n Represents the nth bus stop, with a dimension of n×1. The location variable of the charging and swapping station is represented in vector form, and each element uses a discrete number from 0 to 1 to represent the location of the charging and swapping station. 0 indicates that the corresponding bus stop has no charging and swapping station, and 1 indicates that the corresponding bus stop has a charging and swapping station.

[0015] For example, if there are 5 bus stops on the electric bus line, and the bus stops are numbered 1, 2, 3, 4, and 5, charging and swapping stations are set up at bus stops 1 and 4. At this time, the location vector of the charging and swapping stations is Vec = [1 0 0 1 0] T .

[0016] Preferably, the total life cycle cost function is specifically:

[0017]

[0018] Among them, sslcc represents the total life cycle cost function, sslcc w represents the life cycle cost of the wth charging and swapping station, ssn represents the total number of charging and swapping stations, and pcc w represents the construction cost of the wth charging and swapping station considering the capital recovery coefficient, mcw represents the maintenance cost of the wth charging and swapping station, ecy w Represents the annual electricity cost of the wth charging and swapping station.

[0019] Preferably, the construction cost pcc of the wth charging and swapping station considering the capital recovery factor is calculated w The specific method of sending is:

[0020]

[0021] dec w =e pv,w ×pvia w ×pvpc+e wt,w ×swtc

[0022] pvia w =f pvia (ca w )

[0023] ca w =f ca (smn w ,cpn w ,ebn w )

[0024] Among them, a represents the interest rate, b represents the service life of the charging and swapping station; dec w represents the construction cost of the distributed energy of the wth charging and swapping station, cc w represents the construction cost of the wth charging and swapping station; e pv,w represents the first determination coefficient, pvia w represents the installed area of ​​solar panels at the wth charging and swapping station, pvpc represents the price of solar panels per unit area, e wt,w represents the second determination coefficient, swtc represents the price of wind turbine; f pvia (*) indicates the calculation function of solar panel installation area, ca w represents the building area of ​​the wth charging and swapping station; f ca (*) indicates the building area calculation function, smn w represents the number of battery replacement machines at the wth charging and swapping station, cpn w represents the number of chargers at the wth charging and swapping station, ebn w Indicates the number of backup batteries in the wth charging and swapping station.

[0025] Preferably, the maintenance cost mc of the wth charging and swapping station is calculated w The specific method of sending is:

[0026] mc w =f mc(smn w ,cpn w ,ebn w ,ca w ,dec w )

[0027] Among them, f mc (*) indicates maintenance cost calculation function, smn w represents the number of battery replacement machines at the wth charging and swapping station, cpn w represents the number of chargers at the wth charging and swapping station, ebn w represents the number of spare batteries in the wth charging and swapping station, ca w represents the building area of ​​the wth charging and swapping station, ca w represents the building area of ​​the wth charging and swapping station, dec w Represents the construction cost of the distributed energy of the w-th charging and swapping station.

[0028] Preferably, the annual electricity cost ecy of the wth charging and swapping station is calculated w The specific method of sending is:

[0029]

[0030] Among them, ec i,w represents the electricity cost of the wth charging and swapping station on the i-th day, and sdn represents the number of simulated operation days.

[0031] Preferably, the constraint condition includes a first constraint condition and a second constraint condition, specifically:

[0032] The first constraint: There must be at least one charging and swapping station on each electric bus route;

[0033] The second constraint condition: The power level of the battery after the electric bus is unloaded is greater than or equal to 0.

[0034] Preferably, in S5, the specific method of optimizing the site selection variables according to the life cycle cost optimization model by using a genetic algorithm to obtain the optimal solution of the site selection variables of the charging and swapping station is:

[0035] S51: Set the initial values ​​of the genetic algorithm, including: the number of individuals nind, the number of iterations gen, the chromosome crossover probability pc, the chromosome first mutation probability pm1, the chromosome second mutation probability pm2, the generation gap ggap and the constraint penalty coefficient punish; take the location variable of the charging and swapping station as the individual of the population;

[0036] S52: Calculate the fitness of each individual when the iteration number i=1:

[0037]

[0038] If the first constraint and the second constraint are satisfied at the same time, the constraint penalty conspun = 0; otherwise, the constraint penalty conspun = punish;

[0039] Traverse each individual and calculate the fitness of each individual using the same method until the number of individuals nind is reached;

[0040] S53: Using the roulette wheel method, the elite individuals are determined according to the fitness of each individual;

[0041] S54: Elite Individual Crossover:

[0042] Generate a first random number rand1, rand1∈(0,1);

[0043] Determine whether the chromosome crossover probability pc is greater than the first random number rand1; if not, proceed to S55; otherwise, randomly pair elite individuals in the population in pairs to form c pairs;

[0044] Generate a second random number rand2 and a third random number rand3, rand2, rand3∈(1, bstn), where bstn represents the total number of bus stops;

[0045] Determine whether the second random number rand2 is greater than the third random number rand3; if so, swap the numbers between (rand3, 1) and (rand2, 1) in the elite individuals; otherwise, swap the numbers between (rand2, 1) and (rand3, 1) in the elite individuals;

[0046] Traverse each pair of elite individuals until c pairs are reached, complete the elite individual crossover, and obtain (nind×ggap) elite individuals;

[0047] S55: elite individual variation;

[0048] S56: Update population;

[0049] Among the individuals in the population when iteration number i=1 and the elite individuals after crossover and mutation, select nind individuals as the individuals in the population in the next iteration;

[0050] S57: Update the number of iterations and calculate the fitness of each individual in the updated population until the number of iterations gen is reached;

[0051] S58: The individual with the highest fitness is taken as the optimal solution for the location variable of the charging and swapping station.

[0052] Preferably, the specific method of the elite individual mutation is:

[0053] S551: Generate a fourth random number rand4, rand4∈(0,1);

[0054] S552: Determine whether the first chromosome mutation probability pm1 is greater than the fourth random number rand4; if so, actually swap the positions of the two numbers and proceed to S553; otherwise, directly proceed to S553;

[0055] S553: ​​Generate a fifth random number rand5, rand5∈(0, 1);

[0056] S554: Determine whether the second mutation probability pm2 of the chromosome is greater than the fifth random number rand5; if so, generate the sixth random number rand6, rand6∈(1, bstn), change the number at the (ran6, 1)th position in the elite individual, that is, change 0 to 1, or change 1 to 0, and proceed to S555; otherwise, proceed directly to S555;

[0057] S555: Traverse each elite individual and repeat S351-354 until it reaches (nind×ggap) elite individuals to complete the elite individual mutation.

[0058] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:

[0059] The present invention first obtains actual operation data of electric buses, and obtains location variables of charging and swapping stations according to the operation data; establishes an electric bus driving model, and calculates the number of battery replacement machines, chargers, and spare batteries corresponding to the location variables of the charging and swapping stations and the total life cycle cost; takes the total life cycle cost function as the objective function, and sets constraints to form a life cycle cost optimization model, and uses a genetic algorithm to optimize the location variables according to the life cycle cost optimization model to minimize the life cycle cost of the charging and swapping stations, and takes the optimal solution of the corresponding location variables as the optimal location of the charging and swapping stations, and the corresponding number of battery replacement machines, chargers, and spare batteries as the optimal value of the equipment capacity, so that the charging and swapping stations can achieve maximum utilization and minimum cost, and avoid idle facilities and waste of resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 The present invention is a flow chart of a method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station as described in an embodiment. DETAILED DESCRIPTION

[0061] The drawings are for illustrative purposes only and should not be construed as limiting the present patent;

[0062] In order to better illustrate the present embodiment, some parts in the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product;

[0063] It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0064] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0065] Example

[0066] This embodiment provides a method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station, such as Figure 1 As shown, the method includes:

[0067] S1: Obtain the operation data of electric buses and obtain the location variables of charging and swapping stations based on the operation data;

[0068] The operation data of the electric bus includes the electric bus route, the total number of bus stops, the first and last departure times, the departure interval, the number of departures in one day, the distance between adjacent bus stops on the electric bus route, the running time between adjacent bus stops on the bus route, the number of electric buses, the battery capacity, the low power coefficient, the time of battery replacement operation and the number of simulated operation days;

[0069] The location variable of the charging and swapping station is recorded as Vec = [x1 x2 x3 … x n ] T , where x n Represents the nth bus stop, with a dimension of n×1. The location variable of the charging and swapping station is represented in vector form, and each element uses a discrete number from 0 to 1 to represent the location of the charging and swapping station. 0 indicates that the corresponding bus stop has no charging and swapping station, and 1 indicates that the corresponding bus stop has a charging and swapping station.

[0070] For example, if there are 5 bus stops on the electric bus line, and the bus stops are numbered 1, 2, 3, 4, and 5, and charging and swapping stations are set up at bus stops 1 and 4, then the location variable of the charging and swapping stations is Vec = [1 0 0 1 0] T ;

[0071] S2: Establish an electric bus driving model, input the operation data of the electric bus and the location variables of the charging and swapping station, and calculate the equipment capacity corresponding to the location variables of the charging and swapping station, that is, the number of battery swap machines, chargers and spare batteries;

[0072] S21: Establish an electric bus driving model, input the operation data and the location variables of the charging and swapping station into the electric bus driving model, simulate the operation of the electric bus, and obtain the usage data of the charging and swapping station; specifically:

[0073] S2101: Set the number of electric buses that stop at the first stop on electric bus route j at night, binn j,w,(first) 、Number of electric buses stopping at the last station at night j,w,(last) and the initial battery charge bp; where j represents the number of the electric bus route, w represents the number of the bus stop, first represents the first stop, and last represents the last stop;

[0074] S2102: Determine whether a charging and swapping station is set up at the first stop on the electric bus line j; if a charging and swapping station is set up, execute S2103; otherwise, execute S2104;

[0075] S2103: Calculate the sum of the missing initial battery power of all electric buses that stop at the first station on electric bus route j at night, recorded as bvt j,w,(first) ; Charge all electric buses that stop at the first station on electric bus line j at night to full power, that is, battery capacity bbc;

[0076] S2104: Determine whether a charging and swapping station is set up at the last stop on the electric bus line j; if a charging and swapping station is set up, execute S2105; otherwise, execute S2106;

[0077] S2105: Calculate the sum of the missing battery power of all electric buses that stop at the last stop on electric bus line j at night, denoted as bvt j,w,(last) ; Charge all electric buses that stop at the last stop on electric bus line j to full capacity, i.e., battery capacity bbc;

[0078] S2106: Create electric bus operation tables Bustimetable(i,j)(first→last) and Bustimetable(i,j)(last→first); wherein Bustimetable(i,j)(first→last) represents the operation status of electric buses from the first stop to the last stop of electric bus line j on the i-th day, and Bustimetable(i,j)(last→first) represents the operation status of electric buses from the last stop to the first stop of electric bus line j on the i-th day;

[0079] S2107: Record the number of departures of electric bus line j in one day as blsn j , determine the operation data of the kth electric bus from the first station to the last station, and record the operation data from the first station to the last station in the electric bus operation table Bustimetable(i,j)(first→last); the operation data includes the electric bus number, departure time, battery power at departure, battery replacement operation mark, battery replacement position mark, remaining power of the replaced battery, battery replacement operation start time, arrival time at the last station, battery power at the last station, and re-departure mark;

[0080] Take the following table as an example:

[0081]

[0082] The first column of data is the number of the electric bus; the second column is the departure time. In the embodiment of this patent, 1 hour is converted to "1", and 5.3333 is 5:20; the third column is the battery power at departure; the fourth column is the battery replacement operation mark, "1" represents that the battery of the electric bus has been replaced during this trip, and "0" represents that the battery of the electric bus has not been replaced during this trip; the fifth column is the battery replacement position mark, indicating the bus stop where the charging and swapping station for the electric bus to replace the battery is located during this trip, "0" represents that the electric bus has not replaced the battery during this trip, and "1" represents that the electric bus has not replaced the battery during this trip. The battery of the vehicle was replaced at the charging and swapping station at bus stop No. 1 during this trip; the 6th column is the remaining power of the replaced battery, "0" indicates that the electric bus did not replace the battery during this trip; the 7th column is the start time of the battery replacement operation, "0" indicates that the electric bus did not replace the battery during this trip; the 8th column is the time when the electric bus arrives at the last stop on the bus route. In the embodiment of this patent, 1 hour is converted to "1"; the 9th column is the battery power when the electric bus arrives at the last stop; the 10th column is the re-issuance mark, indicating whether the electric bus departs from the last stop again after arriving at the last stop of this trip. If the electric bus departs from the first stop and arrives at the last stop, and then departs from the last stop and arrives at the first stop, the re-issuance mark is set to "1", otherwise, it is set to "0";

[0083] S2108: According to the electric bus operation table Bustimetable(i,j)(first→last), determine the basic operation data of the kth electric bus from the last stop to the first stop, and record it in the electric bus operation table Bustimetable(i,j)(last→first), specifically:

[0084] S210801: Search in the electric bus operation table Bustimetable(i,j)(first→last) whether there is an electric bus that meets the requirement of arriving at the last station no later than the departure time of the kth bus from the last station and has not departed from the last station in the operation data from the first station to the last station; if so, execute S210802; otherwise, execute S210803;

[0085] S210802: Select the electric bus with the earliest arrival time that meets the above conditions as the electric bus that departs from the last stop of the kth shift; set the re-departure flag of the electric bus in the electric bus operation table Bustimetable(i,j) (first→last) to 1, and then execute S210804;

[0086] Take the following table as an example:

[0087]

[0088] If the departure time of the electric bus departing from the last stop of the kth shift is 7 o'clock, the data in the 8th column of the table shows that all electric buses arrive at the last stop before 7 o'clock; but in the 10th column, only the electric bus in the 5th row has a re-departure mark of 0, which means that other electric buses have departed after arriving at the last stop, and only the electric bus in the 5th row has not departed. The selector is the electric bus departing from the last stop of the kth shift, and the re-departure mark is set to 1;

[0089] S210803: select any electric bus that stops at the last stop at night as the electric bus that departs from the last stop of the kth shift, and execute S210804;

[0090] S210804: The electric bus number and battery power at the time of departure of the electric bus selected as the electric bus departing from the last stop of the kth shift are used as the basic operation data for the electric bus departing from the last stop to the first stop.

[0091] S2109: According to the electric bus operation table Bustimetable(i,j)(first→last) and Bustimetable(i,j)(last→first), simulate the driving process of the kth electric bus of the electric bus line j on the i-th day, obtain the detailed operation data of the kth electric bus from the last stop to the first stop, and record it in the electric bus operation table Bustimetable(i,j)(last→first), specifically:

[0092] S210901: According to the departure time of the kth bus, find the number of the electric bus that departs from the last stop of the kth bus and the battery power at the time of departure in the bus operation table Bustimetable(i,j)(last→first);

[0093] S210902: Calculate the speed of the electric bus departing from the last stop of the kth bus between two adjacent bus stops:

[0094] bv j,t,u→u+1 =d j,u→u+1 ÷ct j,t(k),u→u+1

[0095] Among them, bv j,t,u→u+1 represents the driving speed of the electric bus from bus stop u to bus stop u+1 in time period t on electric bus route j, d j,u→u+1 represents the distance between bus stop u and bus stop u+1 in electric bus route j, ct j,t(k),u→u+1It represents the travel time of the kth electric bus from bus stop u to bus stop u+1 in time period t of electric bus line j; time period t is determined by the departure time of the kth bus. When the departure time of the kth bus is between t and t+1 hours, the travel time of the bus is classified as within time period t; if the departure time of the kth bus is 10:20, the travel time of the bus is classified as within the time period of 10 o'clock;

[0096] S210903: Calculate the power consumption of the electric bus departing from the last stop of the kth bus from bus stop u to bus stop u+1:

[0097] cbp j,u→u+1 =d j,u→u+1 ×f(bv j,t,u→u+1 )

[0098] Among them, cbp j,u→u+1 represents the power consumption of an electric bus on electric bus route j from bus stop u to bus stop u+1, and f(*) represents the speed-energy consumption calculation function;

[0099] S210904: Calculate the battery power of the electric bus that leaves from the last stop of the kth bus and arrives at bus stop u+1:

[0100] bp j,u+1 =bp-cbp j,u→u+1

[0101] Among them, bp j,u+1 represents the battery power of the electric bus on electric bus route j when it arrives at bus stop u+1, and bp represents the initial battery power;

[0102] S210905: The total travel time of the electric bus departing from the last stop of the kth shift is recorded as bdt, and the initial value of bdt is set to 0, then:

[0103] bdt=bdt0+ct j,t(k),u→u+1

[0104] Among them, bdt 0 represents the initial value of the total driving time of the electric bus;

[0105] S210906: Determine whether bus stop u+1 is equipped with a charging and swapping station; if so, execute S210907; otherwise, execute S210910;

[0106] S210907: Determine the battery power bp of the electric bus when it arrives at bus stop u+1 j,u+1 Is it less than lbpc×bbc, where lbpc represents the low power factor and bbc represents the battery capacity? If it is less than lbpc, the electric bus will replace the battery at the charging and swapping station, that is, bpj,u+1 =bbc, execute S210908; otherwise, execute S210910;

[0107] S210908: Calculate the start time of battery replacement:

[0108] bts u+1 =blt k +bdt

[0109] Among them, bts u+1 Indicates the start time of battery replacement at bus stop u+1, blt k represents the departure time of the kth bus;

[0110] S210909: Add one battery replacement operation time to the total driving time of the electric bus departing from the last stop of the kth shift:

[0111] bdt=bdt 0 +ct j,t(k),u→u+1 +sct

[0112] Among them, sct represents the battery replacement operation time;

[0113] S210910: Update the bus stops, traverse the bus stops on the k-th electric bus line j, and execute steps S210901-S210909; wherein, each time the bus stop is updated, the total driving time of the electric bus last time is used as the initial value of the total driving time of the electric bus next time;

[0114] S210911: Calculate the arrival time of the kth electric bus departing from the last stop at the terminal:

[0115] at j,k =blt k +bdt

[0116] Among them, at j,k It represents the arrival time of the kth electric bus departing from the last stop at the terminal;

[0117] S210912: The bus stop number, battery power, battery replacement start time, battery replacement operation mark, arrival time at the terminal and battery power at the terminal when the electric bus performs battery replacement operation are used as detailed operation data of the kth electric bus from the last stop to the first stop.

[0118] S2110: Simulate the operation of all electric buses on all electric bus routes on the i-th day, and obtain the operation tables Bustimetable(i,j) (first→last) and Bustimetable(i,j) (last→first) of all electric buses as the usage data of the charging and swapping station;

[0119] S22: Calculate the power load data of all charging and swapping stations based on the usage data of the charging and swapping stations;

[0120] Specifically:

[0121] S2201: Create a charging load record table Electricityload(i,w) for the wth charging and swapping station on the i-th day, recording the charging power values ​​of the charging and swapping stations at different time periods in a day. The time period granularity is 1 minute, the dimension is 1440×1, and 1440 represents 1440 minutes in a day; set the charging power of the charger in the charging and swapping station to P, and the charger is a constant charging power, and the battery starts charging immediately after being unloaded from the electric bus;

[0122] S2202: Determine whether the wth charging and swapping station is set at the first stop or the last stop of the corresponding electric bus line; if so, execute S2203; otherwise, execute S2207;

[0123] S2203: Based on the number of electric buses that stop at the first station on electric bus route j at night, binn j,w,(first) 、Number of electric buses stopping at the last station at night j,w,(last) , the sum of the initial battery power loss of all electric buses that stop at night at the first stop is bvt j,w,(first) , the sum of the battery power loss of all electric buses that stop at night at the terminal bvt j,w,(last) , calculate the nighttime charging time of the first and last stops of electric bus line j on day i:

[0124] bflct j,w,(first) =bvt j,w,(first) ÷(P×binn j,w,(first) )

[0125] bflct j,w,(last) =bvt j,w,(last) ÷(P×binn j,w,(last) )

[0126] Among them, bflct j,w,(first) represents the nighttime charging time of the first stop of the electric bus line j on day i, bflct j,w,(last) It represents the nighttime charging time of the last stop of the electric bus line j on the i-th day;

[0127] S2204: Record the nighttime charging power in the corresponding position of the charging load record table Electricityload(i,w) according to the nighttime charging time of the first and last stops of the electric bus line j on the i-th day;

[0128] Assumption: P = 50kW, binn j,w,(first) =4, bvtj,w,(last) = 300 kWh, the first bus of electric bus line j departs at 5 o'clock, then bflct j,w,(first) =1.5h; according to bflct j,w,(first) From the departure time of the first bus, we can know that the charging time at night from 3:30 to 5:00 is P×binn j,w,(first) =200kW; the charging load record table Electricityload(i,w) has 1440 rows, each row represents 1 minute, and the 211th to 300th rows of the charging load record table Electricityload(i,w) represent nighttime charging, so the charging power of 200kw is added to the positions of rows 211-300;

[0129] S2205: In the electric bus operation table Bustimetable(i,j) of all bus routes on the i-th day, find the shift for battery replacement operation at the w-th charging and swapping station, and record the total number of battery replacement operations as blssn;

[0130] S2206: Set r to represent the number of battery replacement operations, r∈[0, blssn];

[0131] S2207: In the electric bus operation table Bustimetable(i,j) of all bus routes on the i-th day, find the battery replacement start time corresponding to the r-th battery replacement operation and the battery power reaching the station;

[0132] S2208: Calculate the full charge time and charging completion time of the battery removed in the r-th battery replacement operation:

[0133]

[0134] fcbt r =bts r +sct+pcbt r

[0135] Among them, pcbt r Indicates the full charging time of the battery after the battery is removed for the rth battery replacement operation; bp r Indicates the amount of power removed from the battery during the r-th battery replacement operation, determines the bus route j and bus stop u+1 where the r-th battery replacement operation is located, bp r =bp j,u+1 ;

[0136] fcbt r Indicates the time when the battery is removed and charged for the rth battery replacement operation, bts rIndicates the start time of the rth battery replacement operation, determines the bus route j and bus stop u+1 where the rth battery replacement operation is located, bts r =bts u+1 ;

[0137] S2209: According to the full charge time and charging completion time of the battery removed in the rth battery replacement operation, the charging power of the battery replacement operation is recorded in the corresponding position of the charging load record table Electricityload(i,w). The charging load record table Electricityload(i,w) records the power load data of the charging and swapping station;

[0138] S2210: Update the number of battery replacement operations r, traverse the number of battery operations r, and execute steps S2207-S2209 until the total number of battery replacement operations blssn is reached;

[0139] S2211: Set the total number of charging and swapping stations to ssn, update the charging and swapping station w, traverse the charging and swapping station w, and execute steps S2201-S2210 until the total number of swapping stations ssn is reached.

[0140] S23: Calculate the number of battery swap machines, chargers, and backup batteries in the charging and swapping station according to the power load data of the charging and swapping station;

[0141] Specifically:

[0142] S2301: Construct the first record table Swapnote1 for battery replacement, and search for the record of battery replacement operation at the wth charging and swapping station in the electric bus operation table Bustimetable(i,j) of all bus routes on the i-th day, and record the battery replacement start time and battery power removed corresponding to each battery replacement operation in Swapnote1; wherein, the number of rows of Swapnote1 is determined by the number of battery replacement operations performed at the wth charging and swapping station on the i-th day, and the number of columns is 3; the first column of Swapnote1 records the battery replacement start time, the second column records the battery power removed, and the value of the third column is set to 0;

[0143] S2302: Arrange the records in Swapnote1 in ascending order according to the start time of battery replacement;

[0144] S2303: Set the theoretical number of backup batteries at the wth charging and swapping station on the i-th day to ebn i,w ′, then ebn i,w ′ is equal to the number of rows in Swapnote1, and v is set to represent the vth row in Swapnote1, v∈[1,ebn i,w ′-1];

[0145] The number of times the wth charging and swapping station performs battery replacement operations on the i-th day is the number of rows in Swapnote1. The theoretical number of spare batteries is ebn i,w ′ is equal to the number of rows in Swapnote1, indicating that each time the battery is replaced, the replaced battery is the battery prepared in advance by the charging and swapping station on that day; however, in actual operation, after the battery unloaded from the first shift is fully charged, it can be replaced by the electric bus of the next shift, as long as the charging completion time of the battery unloaded from the first shift is ensured to be earlier than the arrival time of the next shift;

[0146] S2304: Calculate the time when the battery is removed and charged for the battery replacement operation corresponding to row v of Swapnote1:

[0147]

[0148] Among them, bcft v Indicates the time when the battery charging is completed for the battery replacement operation corresponding to the vth row; Swapnote1(v,1) indicates the recorded data of the vth row and the first column of Swapnote1, that is, the time when the battery replacement starts; Swapnote1(v,2) indicates the recorded data of the vth row and the second column of Swapnote1, that is, the power of the removed battery;

[0149] S2305: Search the first column of Swapnot1 for records with a battery replacement start time greater than bcft v The corresponding battery replacement operation, the smallest row number is recorded as minrow 1 ; If the battery is not replaced, the start time is greater than bcft v For the corresponding battery replacement operation, minrow 1 Set to 0;

[0150] In this embodiment, it is assumed that when the electric bus needs to replace the battery, the replacement starts immediately after arriving at the station, that is, the arrival time is equal to the battery replacement start time, and the battery replacement start time is greater than bcft v The start time of battery replacement for this shift is later than the time when the battery is removed and charged, so the fully charged battery can be replaced. When a shift meets this condition, the shifts that arrive later also meet this condition. Since Swapnote1 is arranged in ascending order according to the start time of battery replacement, the battery replacement starts from the shift with the smallest number of rows. That is to say, when the condition is met, the electric bus that arrives at the station first will have its battery replaced first.

[0151] S2306: Determine minrow 1 Is it 0? If not, execute S2307; if so, execute S2311;

[0152] S2307: Determine Swapnote1(minrow 1 ,3) is 0, Swapnote1(minrow 1 ,3) represents the minrow in Swapnote1 1 The data recorded in the third column of the row; if yes, execute S2308; if no, execute S2309;

[0153] S2308: Swapnote1(minrow 1 ,3) Set to 1, execute S2311;

[0154] First determine whether there is a condition that the battery replacement start time is greater than bcft v If the shift exists (minrow1≠0), it is determined whether the battery replacement operation has been performed (Swapnote1(minrow 1 ,3)=0), the initial value of the third column of Swapnote1 is 0, indicating that no battery replacement operation has been performed in all shifts. When the third column of Swapnote1 is set to 1, it means that the shift has performed a battery replacement operation once;

[0155] S2309: The remaining battery replacement start time is greater than bcft v Find the minimum number of rows in the corresponding battery replacement operation and update minrow 1 ;

[0156] When the battery of the earliest electric bus that meets the conditions has been replaced, the earliest electric bus that meets the conditions will be selected to replace the battery;

[0157] S2310: Determine the updated minrow 1 Is it greater than ebn i,z ', if it is greater, execute S2311; otherwise, return to S2307, at which time Swapnote1(minrow 1 ,3) in minrow 1 For the updated minrow 1 ;

[0158] This step is to determine whether all electric buses that meet the conditions have been found;

[0159] S2311: Update the number of rows v of Swapnote1, traverse the number of rows v of Swapnote1, and execute steps S2304-S2310 until the number of rows v reaches ebn i,w ′-1;

[0160] S2312: Calculate the actual number of backup batteries ebn at the wth charging and swapping station on the i-th day i,z :

[0161] ebn i,w =ebn i,w ′-sum(Swapnote1(all,3))

[0162] Among them, sum(*) represents the sum operation, and Swapnote1(all,3) represents all the data in the third column of Swapnote1;

[0163] Sum all the data in the third column to get the number of batteries replaced by the electric buses that arrive earlier. Subtract this number from the theoretical number of spare batteries to get the actual number of batteries used.

[0164] S2313: Construct the second battery replacement record table Swapnote2, and search for the record of battery replacement operation at the wth charging and swapping station in the electric bus operation table Bustimetable(i,j) of all bus routes on the i-th day, and record the battery replacement start time corresponding to each battery replacement operation in Swapnote2; wherein, the number of rows of Swapnote2 is determined by the number of battery replacement operations performed at the wth charging and swapping station on the i-th day, and the number of columns is 2; the battery replacement start time recorded in the first column of Swapnote1, and the value of the second column is set to 0;

[0165] S2314: Arrange the records in Swapnote2 in ascending order according to the start time of battery replacement;

[0166] S2315: Set the theoretical number of battery swap machines at the wth charging and swapping station on the i-th day to smn i,w ′, then smn i,w ′ is equal to the number of rows in Swapnote2, and x is set to represent the xth row in Swapnote1, x∈[1, smn i,w ′-1];

[0167] S2316: Calculate the time when the battery charging is completed for the battery replacement operation corresponding to row x of Swapnote2:

[0168] bsft x =Swapnote2(x,1)+sct

[0169] Among them, bsft xIndicates the time when the battery charging is completed for the battery replacement operation corresponding to the xth row; Swapnote2(x,1) indicates the record data of the xth row and the first column of Swapnote2, that is, the time when the battery replacement starts;

[0170] S2317: Search for the battery replacement start time in the first column of Swapnot2 that is greater than bsft x Corresponding battery replacement operation, the smallest row number is recorded as minrow 2 ; If there is no battery replacement operation, the battery replacement start time is greater than bsft x For the corresponding battery replacement operation, minrow 2 Set to 0;

[0171] S2318: Determine minrow 2 Is it 0? If not, execute S2319; if so, execute S2323;

[0172] S2319: Determine Swapnote2(minrow 2 ,2) is 0, Swapnote2(minrow 2 ,2) represents the minrow in Swapnote2 2 The data recorded in the second column of the row; if yes, execute S2320; if no, execute S2321;

[0173] S2320: Swapnote2(minrow 2 ,2) Set to 1, execute S2323;

[0174] S2321: The remaining battery replacement start time is greater than bsft x Find the minimum number of rows in the corresponding battery replacement operation and update minrow 2 ;

[0175] S2322: Determine the updated minrow 2 Is it greater than smn i,w ', if it is greater, execute S2323; otherwise, return to S2319, at which time Swapnote2(minrow 2 ,2) in minrow 2 For the updated minrow 2 ;

[0176] S2323: Update the number of rows x of Swapnote2, traverse the number of rows x of Swapnote2, and execute steps S2316-S2322 until the number of rows x reaches smn i,w ′-1;

[0177] S2324: Calculate the actual number of battery replacement machines smn at the wth charging and swapping station on the i-th day i,w :

[0178] smn i,w =smn i,w ′-sum(Swapnote2(all,2))

[0179] Among them, sum(*) represents the sum operation, and Swapnote(all,2) represents all the data in the second column of Swapnote2;

[0180] S2325: Update the number of simulated running days i, traverse the number of simulated running days i, and execute steps S2301-S2324 until the number of simulated running days i reaches the set maximum value sdn;

[0181] S2326: Calculate the number of backup batteries at the wth charging and swapping station:

[0182]

[0183] Among them, ebn w represents the number of spare batteries at the wth charging and swapping station;

[0184] S2327: Calculate the number of battery replacement machines at the wth charging and swapping station:

[0185]

[0186] Among them, smn w represents the number of battery replacement machines at the wth charging and swapping station;

[0187] S2328: Calculate the number of chargers at the wth charging and swapping station:

[0188] cpn w =ebn w

[0189] Among them, cpn w Represents the number of chargers at the wth charging and swapping station.

[0190] S3: Calculate the total life cycle cost function of the location variable of the charging and swapping station according to the number of battery swap machines, chargers and spare batteries corresponding to the location variable of the charging and swapping station;

[0191] S4: Take the total cost function of the whole life cycle as the objective function and set constraints to form a whole life cycle cost optimization model;

[0192] The total cost function of the whole life cycle is as follows:

[0193]

[0194] Among them, sslcc represents the total cost function of the entire life cycle, sslcc w represents the life cycle cost of the wth charging and swapping station, ssn represents the total number of charging and swapping stations, and pcc w represents the construction cost of the wth charging and swapping station considering the capital recovery coefficient, mc w represents the maintenance cost of the wth charging and swapping station, ecy w represents the annual electricity cost of the wth charging and swapping station;

[0195] The construction cost of the wth charging and swapping station considering the capital recovery coefficient is pcc w Specifically:

[0196]

[0197] dec w =e pv,w ×pvia w ×pvpc+e wt,w ×swtc

[0198] pvia w =f pvia (ca w )

[0199] ca w =f ca (smn w ,cpn w ,ebn w )

[0200] Among them, a represents the interest rate, b represents the service life of the charging and swapping station; dec w represents the construction cost of the distributed energy of the wth charging and swapping station, cc w represents the construction cost of the wth charging and swapping station; e pv,w represents the first determination coefficient, pvia w represents the installed area of ​​solar panels at the wth charging and swapping station, pvpc represents the price of solar panels per unit area, e wt,w represents the second determination coefficient, swtc represents the price of wind turbine; f pvia (*) indicates the calculation function of solar panel installation area, ca w represents the building area of ​​the wth charging and swapping station; f ca (*) indicates the building area calculation function, smn w represents the number of battery replacement machines at the wth charging and swapping station, cpn w represents the number of chargers at the wth charging and swapping station, ebn wrepresents the number of spare batteries at the wth charging and swapping station;

[0201] The maintenance cost of the wth charging and swapping station is mc w Specifically:

[0202] mc w =f mc (smn w ,cpn w ,ebn w ,ca w ,dec w )

[0203] Among them, f mc (*) indicates maintenance cost calculation function, smn w represents the number of battery replacement machines at the wth charging and swapping station, cpn w represents the number of chargers at the wth charging and swapping station, ebn w represents the number of spare batteries in the wth charging and swapping station, ca w represents the building area of ​​the wth charging and swapping station, ca w represents the building area of ​​the wth charging and swapping station, dec w represents the construction cost of the distributed energy of the wth charging and swapping station;

[0204] The annual electricity cost of the wth charging and swapping station is ecy w Specifically:

[0205]

[0206] Among them, ec i,w represents the electricity cost of the wth charging and swapping station on the i-th day, and sdn represents the number of simulated operation days;

[0207] The constraint conditions include a first constraint condition and a second constraint condition, specifically:

[0208] The first constraint: There must be at least one charging and swapping station on each electric bus route;

[0209] The second constraint condition: The power level of the battery after the electric bus is unloaded is greater than or equal to 0.

[0210] S5: Using a genetic algorithm to optimize the location variables according to the life cycle cost optimization model, the optimal solution of the location variables of the charging and swapping station is obtained as the optimal location of the charging and swapping station;

[0211] S51: Set the initial values ​​of the genetic algorithm, including: the number of individuals nind, the number of iterations gen, the chromosome crossover probability pc, the chromosome first mutation probability pm1, the chromosome second mutation probability pm2, the generation gap ggap and the constraint penalty coefficient punish; take the location variable of the charging and swapping station as the individual of the population;

[0212] S52: Calculate the fitness of each individual when the iteration number i=1:

[0213]

[0214] If the first constraint and the second constraint are satisfied at the same time, the constraint penalty conspun = 0; otherwise, the constraint penalty conspun = punish;

[0215] Traverse each individual and calculate the fitness of each individual using the same method until the number of individuals nind is reached;

[0216] S53: Using the roulette wheel method, the elite individuals are determined according to the fitness of each individual;

[0217] S54: Elite Individual Crossover:

[0218] Generate a first random number rand1, rand1∈(0,1);

[0219] Determine whether the chromosome crossover probability pc is greater than the first random number rand1; if not, proceed to S35; otherwise, randomly pair elite individuals in the population to form c pairs;

[0220] Generate a second random number rand2 and a third random number rand3, rand2, rand3∈(1, bstn), where bstn represents the total number of bus stops;

[0221] Determine whether the second random number rand2 is greater than the third random number rand3; if so, swap the numbers between (rand3, 1) and (rand2, 1) in the elite individuals; otherwise, swap the numbers between (rand2, 1) and (rand3, 1) in the elite individuals;

[0222] Traverse each pair of elite individuals until c pairs are reached, complete the elite individual crossover, and obtain (nind×ggap) elite individuals;

[0223] S55: elite individual variation;

[0224] S551: Generate a fourth random number rand4, rand4∈(0,1);

[0225] S552: Determine whether the first chromosome mutation probability pm1 is greater than the fourth random number rand4; if so, actually swap the positions of the two numbers and proceed to S553; otherwise, directly proceed to S553;

[0226] S553: ​​Generate a fifth random number rand5, rand5∈(0, 1);

[0227] S554: Determine whether the second mutation probability pm2 of the chromosome is greater than the fifth random number rand5; if so, generate the sixth random number rand6, rand6∈(1, bstn), change the number at the (ran6, 1)th position in the elite individual, that is, change 0 to 1, or change 1 to 0, and proceed to S555; otherwise, proceed directly to S555;

[0228] S555: Traverse each elite individual and repeat S551-554 until it reaches (nind×ggap) elite individuals to complete the elite individual mutation.

[0229] S56: Update population;

[0230] Among the individuals in the population when iteration number i=1 and the elite individuals after crossover and mutation, select nind individuals as the individuals in the population in the next iteration;

[0231] S57: Update the number of iterations and calculate the fitness of each individual in the updated population until the number of iterations gen is reached;

[0232] S58: The individual with the highest fitness is taken as the optimal solution for the location variable of the charging and swapping station.

[0233] S6: The number of battery swap machines, chargers and spare batteries corresponding to the optimal location of the charging and swapping station is taken as the optimal value of the equipment capacity.

[0234] In this embodiment, the data of the total life cycle cost of all charging and swapping stations is obtained by the following method:

[0235] Calculate the building area of ​​the wth charging and swapping station:

[0236] ca w =f ca (smn w ,cpn w ,ebn w )

[0237] Among them, ca w represents the building area of ​​the wth charging and swapping station, f ca (*) indicates the building area calculation function;

[0238] In this embodiment, only the building area of ​​the charging and swapping station is considered as a function of the number of battery swapping machines, chargers, and batteries in the charging and swapping station;

[0239] Calculate the construction cost of the wth charging and swapping station:

[0240] cc w =f cc (smn w ,cpn w ,ebn w ,ca w )

[0241] Among them, cc w represents the construction cost of the wth charging and swapping station, f cc (*) indicates the construction cost calculation function;

[0242] Calculate the electricity cost ec of the wth charging and swapping station on the i-th day i,w :

[0243] ec i,w =ECT i,w ×Electricitygeneration(i,w)

[0244] Among them, ECT i,w represents the electricity price of the wth charging and swapping station on the i-th day, with a dimension of 1×1440;

[0245] Electricity generation (i, w) is the distributed energy generation meter of the wth charging and swapping station on the i-th day, calculated by the following formula:

[0246] Electricitygeneration(i,w)=Electricityload(i,w)-DEP w

[0247] DEP w =e pv,w ×f pv (ULID w )×pvia w +e wt,w ×f wt (WSD w )

[0248] e pv,w represents the first determination coefficient, f pv Represents the solar panel power calculation function, ULID w represents the unit area light intensity data of the area where the wth charging and swapping station is located; e wt,w represents the second determination coefficient, f wtRepresents the wind turbine power calculation function, WSD w Represents the wind speed data in the area where the wth charging and swapping station is located.

[0249] In this embodiment, the charging and swapping station can be equipped with solar panels and wind turbines, but it is necessary to consider whether the location of the charging and swapping station is suitable for using these distributed energy sources for power generation; therefore, it is necessary to obtain the unit area light intensity data and wind speed data of the area where the charging and swapping station is located to determine whether it is suitable to use these distributed energy sources for power generation. When the unit area light intensity data is excellent, the first determination coefficient e pv,w If it is set to 1, it means it is suitable for installing solar panels, otherwise it is set to 0, which means it is not suitable for installing solar panels. When the wind speed data is excellent, the second determination coefficient e wt,w If it is set to 1, it means that it is suitable for installing wind turbines, otherwise it is set to 0, which means that it is not suitable for installing wind turbines;

[0250] This embodiment has the following advantages:

[0251] (1) Based on the actual operation data of electric buses on existing electric bus routes, arrange charging and battery swapping stations and establish an electric bus driving model. Use the model to simulate the operation of electric buses of the same model on electric bus routes, among which the most concerned is the battery power consumption of electric buses, that is, the usage data of charging and battery swapping stations;

[0252] (2) In this embodiment, the charging and swapping stations can be arranged at the terminal stations (first and last stations) of the electric bus line. When the electric buses are not in operation, the electric buses parked at the terminal stations can fully charge their batteries at night when the electricity price is low, ensuring that the batteries are fully charged when the buses depart the next day.

[0253] (3) This embodiment takes into account the sunlight and wind conditions at the location of the charging and swapping station, installs solar panels and / or wind turbines, and uses distributed energy to charge the battery, saving energy;

[0254] (4) This embodiment takes into account the actual operation of electric buses, the construction cost of the charging and swapping station, the maintenance cost of the charging and swapping station, and the electricity cost of the charging and swapping station, and uses a genetic algorithm to optimize the site selection and equipment capacity of the charging and swapping station to obtain the optimal site location, the optimal number of battery swappers, chargers, and spare batteries. Under the premise of meeting the normal operation of the electric bus, the charging and swapping station has the lowest cost over the entire life cycle, saves construction cost and maintenance cost, and achieves maximum utilization and minimum cost of the charging and swapping station, avoiding idle facilities and waste of resources.

[0255] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station, characterized in that: The method comprises: S1: Obtain the operation data of electric buses and obtain the location variables of charging and swapping stations based on the operation data; S2: Establish an electric bus driving model, input the electric bus operation data and the location variables of the charging and swapping station, and calculate the equipment capacity corresponding to the location variables of the charging and swapping station, that is, the number of battery swappers, chargers and spare batteries, including: S21: Establish an electric bus driving model, input the operation data and the location variables of the charging and swapping station into the electric bus driving model, simulate the operation of the electric bus, and obtain the usage data of the charging and swapping station; specifically: S2101: Set the number of electric buses that stop at the first stop on electric bus route j at night, binn j,w,(first) 、Number of electric buses stopping at the last stop at night j,w,(last) and the initial battery charge bp; where j represents the number of the electric bus route, w represents the number of the bus stop, first represents the first stop, and last represents the last stop; S2102: Determine whether a charging and swapping station is set up at the first stop on the electric bus line j; if a charging and swapping station is set up, execute S2103; otherwise, execute S2104; S2103: Calculate the sum of the missing initial battery power of all electric buses that stop at the first station on electric bus route j at night, recorded as bvt j,w,(first) ; Charge all electric buses that stop at the first station on electric bus line j at night to full power, that is, battery capacity bbc; S2104: Determine whether a charging and swapping station is set up at the last stop on the electric bus line j; if a charging and swapping station is set up, execute S2105; otherwise, execute S2106; S2105: Calculate the sum of the missing battery power of all electric buses that stop at the last stop on electric bus line j at night, denoted as bvt j,w,(last) ; Charge all electric buses that stop at the last stop on electric bus line j at night to full capacity, i.e., battery capacity bbc; S2106: Create electric bus operation tables Bustimetable(i,j)(first→last) and Bustimetable(i,j)(last→first); wherein Bustimetable(i,j)(first→last) represents the operation status of electric buses from the first stop to the last stop of electric bus line j on the i-th day, and Bustimetable(i,j)(last→first) represents the operation status of electric buses from the last stop to the first stop of electric bus line j on the i-th day; S2107: Record the number of departures of electric bus line j in one day as blsn j , determine the operation data of the kth electric bus from the first station to the last station, and record the operation data from the first station to the last station in the electric bus operation table Bustimetable(i,j)(first→last); the operation data includes the electric bus number, departure time, battery power at departure, battery replacement operation mark, battery replacement position mark, remaining power of the replaced battery, battery replacement operation start time, arrival time at the last station, battery power at the last station, and re-departure mark; S2108: According to the electric bus operation table Bustimetable(i,j)(first→last), determine the basic operation data of the kth electric bus from the last stop to the first stop, and record it in the electric bus operation table Bustimetable(i,j)(last→first), specifically: S210801: Search in the electric bus operation table Bustimetable(i,j)(first→last) whether there is an electric bus that meets the requirement of arriving at the last station no later than the departure time of the kth bus from the last station and has not departed from the last station in the operation data from the first station to the last station; if so, execute S210802; otherwise, execute S210803; S210802: Select an electric bus that meets the requirement of arriving at the last stop no later than the departure time of the kth bus from the last stop and has the earliest arrival time among the electric buses that have not departed from the last stop, as the electric bus that departs from the last stop of the kth bus; set the re-departure flag of the electric bus in the electric bus operation table Bustimetable(i,j)(first→last) to 1, and then execute S210804; S210803: select any electric bus that stops at the last stop at night as the electric bus that departs from the last stop of the kth shift, and execute S210804; S210804: The electric bus number and the battery power at the time of departure of the electric bus selected as the last stop of the k-th shift are used as the basic operation data for the electric bus of the k-th shift to be sent from the last stop to the first stop; S2109: According to the electric bus operation table Bustimetable(i,j)(first→last) and Bustimetable(i,j)(last→first), simulate the driving process of the kth electric bus of the electric bus line j on the i-th day, obtain the detailed operation data of the kth electric bus from the last stop to the first stop, and record it in the electric bus operation table Bustimetable(i,j)(last→first), specifically: S210901: According to the departure time of the kth bus, find the number of the electric bus that departs from the last stop of the kth bus and the battery power at the time of departure in the bus operation table Bustimetable(i,j)(last→first); S210902: Calculate the speed of the electric bus departing from the last stop of the kth bus between two adjacent bus stops: bv j,t,u→u+1 =d j,u→u+1 ÷ct j,t(k),u→u+1 Among them, bv j,t,u→u+1 represents the driving speed of the electric bus from bus stop u to bus stop u+1 in time period t on electric bus route j, d j,u→u+1 represents the distance between bus stop u and bus stop u+1 in electric bus route j, ct j,t(k),u→u+1 represents the travel time of the kth electric bus on electric bus line j in time period t from bus stop u to bus stop u+1; time period t is determined by the departure time of the kth bus. When the departure time of the kth bus is between t and t+1 hours, the travel time of the bus is classified as within time period t; S210903: Calculate the power consumption of the electric bus departing from the last stop of the kth bus from bus stop u to bus stop u+1: cbp j,u→u+1 =d j,u→u+1 ×f(bv j,t,u→u+1 ) Among them, cbp j,u→u+1 represents the power consumption of an electric bus on electric bus route j from bus stop u to bus stop u+1, and f(*) represents the speed-energy consumption calculation function; S210904: Calculate the battery power of the electric bus that leaves from the last stop of the kth bus and arrives at bus stop u+1: bp j,u+1 =bp-cbp j,u→u+1 Among them, bp j,u+1 represents the battery power of the electric bus on electric bus route j when it arrives at bus stop u+1, and bp represents the initial battery power; S210905: The total travel time of the electric bus departing from the last stop of the kth shift is recorded as bdt, and the initial value of bdt is set to 0, then: bdt=bdt 0 +ct j,t(k),u→u+1 Among them, bdt 0 represents the initial value of the total driving time of the electric bus; S210906: Determine whether bus stop u+1 is equipped with a charging and swapping station; if so, execute S210907; otherwise, execute S210910; S210907: Determine the battery power bp of the electric bus when it arrives at bus stop u+1 j,u+1 Is it less than lbpc×bbc, where lbpc represents the low power factor and bbc represents the battery capacity? If it is less than lbpc, the electric bus will replace the battery at the charging and swapping station, that is, bp j,u+1 =bbc, execute S210908; otherwise, execute S210910; S210908: Calculate the start time of battery replacement: bts u+1 =blt k +bdt Among them, bts u+1 Indicates the start time of battery replacement at bus stop u+1, blt k represents the departure time of the kth bus; S210909: Add one battery replacement operation time to the total driving time of the electric bus departing from the last stop of the kth shift: bdt=bdt 0 +ct j,t(k),u→u+1 +sct Among them, sct represents the battery replacement operation time; S210910: Update the bus stops, traverse the bus stops on the k-th electric bus line j, and execute steps S210901-S210909; wherein, each time the bus stop is updated, the total driving time of the electric bus last time is used as the initial value of the total driving time of the electric bus next time; S210911: Calculate the arrival time of the kth electric bus departing from the last stop at the terminal: at j,k =blt k +bdt Among them, at j,k It represents the arrival time of the kth electric bus departing from the last stop at the terminal; S210912: The bus stop number, battery power, battery replacement start time, battery replacement operation mark, arrival time at the terminal and battery power at the terminal when the electric bus performs battery replacement operation are used as detailed operation data of the kth electric bus from the last station to the first station; S2110: Simulate the operation of all electric buses on all electric bus routes on the i-th day, and obtain the operation tables Bustimetable(i,j) (first→last) and Bustimetable(i,j) (last→first) of all electric buses as the usage data of the charging and swapping station; S22: Calculate the power load data of all charging and swapping stations based on the usage data of the charging and swapping stations, specifically: S2201: Create a charging load record table Electricityload(i,w) for the wth charging and swapping station on the i-th day, recording the charging power values ​​of the charging and swapping stations at different time periods in a day. The time period granularity is 1 minute, the dimension is 1440×1, and 1440 represents 1440 minutes in a day; set the charging power of the charger in the charging and swapping station to P, and the charger is a constant charging power, and the battery starts charging immediately after being unloaded from the electric bus; S2202: Determine whether the wth charging and swapping station is set at the first stop or the last stop of the corresponding electric bus line; if so, execute S2203; otherwise, execute S2207; S2203: Based on the number of electric buses that stop at the first station on electric bus route j at night, binn j,w,(first) 、Number of electric buses stopping at the last stop at night j,w,(last) , the sum of the initial battery power loss of all electric buses that stop at night at the first stop is bvt j,w,(first) , the sum of the battery power loss of all electric buses that stop at night at the terminal bvt j,w,(last) , calculate the nighttime charging time of the first and last stops of electric bus line j on day i: bflct j,w,(first) =bvt j,w,(first) ÷(P×binn j,w,(first) ) bflct j,w,(last) =bvt j,w,(last) ÷(P×binn j,w,(last) ) Among them, bflct j,w,(first) represents the nighttime charging time of the first stop of the electric bus line j on the i-th day, bflct j,w,(last) It represents the nighttime charging time of the last stop of the electric bus line j on the i-th day; S2204: Record the nighttime charging power in the corresponding position of the charging load record table Electricityload(i,w) according to the nighttime charging time of the first and last stops of the electric bus line j on the i-th day; S2205: In the electric bus operation table Bustimetable(i,j) of all bus routes on the i-th day, find the shift for battery replacement operation at the w-th charging and swapping station, and record the total number of battery replacement operations as blssn; S2206: Set r to represent the number of battery replacement operations, r∈[0, blssn]; S2207: In the electric bus operation table Bustimetable(i,j) of all bus routes on the i-th day, find the battery replacement start time corresponding to the r-th battery replacement operation and the battery power when arriving at the station; S2208: Calculate the full charge time and charging completion time of the battery removed in the rth battery replacement operation: fcbt r =bts r +sct+pcbt r Among them, pcbt r Indicates the full charging time of the battery after the battery is removed for the rth battery replacement operation; bp r Indicates the amount of power removed from the battery during the r-th battery replacement operation, determines the bus route j and bus stop u+1 where the r-th battery replacement operation is located, bp r =bp j,u+1 ; fcbt r Indicates the time when the battery is removed and charged for the rth battery replacement operation, bts r Indicates the start time of the rth battery replacement operation, determines the bus route j and bus stop u+1 where the rth battery replacement operation is located, bts r =bts u+1 ; S2209: According to the full charge time and charging completion time of the battery removed in the rth battery replacement operation, the charging power of the battery replacement operation is recorded in the corresponding position of the charging load record table Electricityload(i,w). The charging load record table Electricityload(i,w) records the power load data of the charging and swapping station; S2210: Update the number of battery replacement operations r, traverse the number of battery operations r, and execute steps S2207-S2209 until the total number of battery replacement operations blssn is reached; S2211: Set the total number of charging and swapping stations to ssn, update the charging and swapping station w, traverse the charging and swapping station w, and execute steps S2201-S2210 until the total number of swapping stations ssn is reached; S23: Calculate the number of battery swap machines, chargers, and backup batteries in the charging and swapping station based on the power load data of the charging and swapping station, specifically: S2301: Construct the first record table Swapnote1 for battery replacement, and search for the record of battery replacement operation at the wth charging and swapping station in the electric bus operation table Bustimetable(i,j) of all bus routes on the i-th day, and record the battery replacement start time and battery power removed corresponding to each battery replacement operation in Swapnote1; wherein, the number of rows of Swapnote1 is determined by the number of battery replacement operations performed at the wth charging and swapping station on the i-th day, and the number of columns is 3; the first column of Swapnote1 records the battery replacement start time, the second column records the battery power removed, and the value of the third column is set to 0; S2302: Arrange the records in Swapnote1 in ascending order according to the start time of battery replacement; S2303: Set the theoretical number of backup batteries at the wth charging and swapping station on the i-th day to ebn i,w ′, then ebn i,w ′ is equal to the number of rows in Swapnote1, and v is set to represent the vth row in Swapnote1, v∈[1,ebn i,w ′-1]; S2304: Calculate the time when the battery is removed and charged for the battery replacement operation corresponding to row v of Swapnote1: Among them, bcft v Indicates the time when the battery charging is completed for the battery replacement operation corresponding to the vth row; Swapnote1(v,1) indicates the recorded data of the vth row and the first column of Swapnote1, that is, the time when the battery replacement starts; Swapnote1(v,2) indicates the recorded data of the vth row and the second column of Swapnote1, that is, the power of the removed battery; S2305: Search the first column of Swapnot1 for records with a battery replacement start time greater than bcft v The corresponding battery replacement operation, the smallest row number is recorded as minrow 1 ; If the battery is not replaced, the start time is greater than bcft v For the corresponding battery replacement operation, minrow 1 Set to 0; S2306: Determine minrow 1 Is it 0? If not, execute S2307; if so, execute S2311; S2307: Determine Swapnote1(minrow 1 ,3) is 0, Swapnote1(minrow 1 ,3) represents the minrow in Swapnote1 1 The data recorded in the third column of the row; if yes, execute S2308; if no, execute S2309; S2308: Swapnote1(minrow 1 ,3) Set to 1, execute S2311; S2309: The remaining battery replacement start time is greater than bcft v Find the minimum number of rows in the corresponding battery replacement operation and update minrow 1 ; S2310: Determine the updated minrow 1 Is it greater than ebn i,z ', if it is greater, execute S2311; otherwise, return to S2307, at which time Swapnote1(minrow 1 ,3) in minrow 1 For the updated minrow 1 ; S2311: Update the number of rows v of Swapnote1, traverse the number of rows v of Swapnote1, and execute steps S2304-S2310 until the number of rows v reaches ebn i,w ′-1; S2312: Calculate the actual number of backup batteries ebn at the wth charging and swapping station on the i-th day i,z : ebn i,w =ebn i,w ′-sum(Swapnote1(all,3)) Among them, sum(*) represents the sum operation, and Swapnote1(all,3) represents all the data in the third column of Swapnote1; S2313: Construct the second battery replacement record table Swapnote2, and search for the record of battery replacement operation at the wth charging and swapping station in the electric bus operation table Bustimetable(i,j) of all bus routes on the i-th day, and record the battery replacement start time corresponding to each battery replacement operation in Swapnote2; wherein, the number of rows of Swapnote2 is determined by the number of battery replacement operations performed at the wth charging and swapping station on the i-th day, and the number of columns is 2; the battery replacement start time recorded in the first column of Swapnote1, and the value of the second column is set to 0; S2314: Arrange the records in Swapnote2 in ascending order according to the start time of battery replacement; S2315: Set the theoretical number of battery swap machines at the wth charging and swapping station on the i-th day to smn i,w ′, then smn i,w ′ is equal to the number of rows in Swapnote2, and x is set to represent the xth row in Swapnote1, x∈[1, smn i,w ′-1]; S2316: Calculate the time when the battery charging is completed for the battery replacement operation corresponding to row x of Swapnote2: bsft x =Swapnote2(x,1)+sct Among them, bsft x Indicates the time when the battery charging is completed for the battery replacement operation corresponding to the xth row; Swapnote2(x,1) indicates the record data of the xth row and the first column of Swapnote2, that is, the time when the battery replacement starts; S2317: Search for the battery replacement start time in the first column of Swapnot2 that is greater than bsft x The corresponding battery replacement operation, the smallest row number is recorded as minrow 2 ; If there is no battery replacement operation, the battery replacement start time is greater than bsft x For the corresponding battery replacement operation, minrow 2 Set to 0; S2318: Determine minrow 2 Is it 0? If not, execute S2319; if so, execute S2323; S2319: Determine Swapnote2(minrow 2 ,2) is 0, Swapnote2(minrow 2 ,2) represents the minrow in Swapnote2 2 The data recorded in the second column of the row; if yes, execute S2320; if no, execute S2321; S2320: Swapnote2(minrow 2 ,2) Set to 1, execute S2323; S2321: The remaining battery replacement start time is greater than bsft x Find the minimum number of rows in the corresponding battery replacement operation and update minrow 2 ; S2322: Determine the updated minrow 2 Is it greater than smn i,w ', if it is greater, execute S2323; otherwise, return to S2319, at which time Swapnote2(minrow 2 ,2) in minrow 2 For the updated minrow 2 ; S2323: Update the number of rows x of Swapnote2, traverse the number of rows x of Swapnote2, and execute steps S2316-S2322 until the number of rows x reaches smn i,w ′-1; S2324: Calculate the actual number of battery replacement machines smn at the wth charging and swapping station on the i-th day i,w : smn i,w =smn i,w ′-sum(Swapnote2(all,2)) Among them, sum(*) represents the sum operation, and Swapnote2(all,2) represents all the data in the second column of Swapnote2; S2325: Update the number of simulated running days i, traverse the number of simulated running days i, and execute steps S2301-S2324 until the number of simulated running days i reaches the set maximum value sdn; S2326: Calculate the number of backup batteries at the wth charging and swapping station: Among them, ebn w represents the number of spare batteries at the wth charging and swapping station; S2327: Calculate the number of battery replacement machines at the wth charging and swapping station: Among them, smn w represents the number of battery replacement machines at the wth charging and swapping station; S2328: Calculate the number of chargers at the wth charging and swapping station: cpn w =even w Among them, cpn w represents the number of chargers at the wth charging and swapping station; S3: Calculate the total life cycle cost function of the location variable of the charging and swapping station according to the number of battery swap machines, chargers and spare batteries corresponding to the location variable of the charging and swapping station; S4: Take the total cost function of the whole life cycle as the objective function and set constraints to form a whole life cycle cost optimization model; S5: Using a genetic algorithm to optimize the location variables according to the life cycle cost optimization model, the optimal solution of the location variables of the charging and swapping station is obtained as the optimal location of the charging and swapping station; S6: The number of battery swap machines, chargers and spare batteries corresponding to the optimal location of the charging and swapping station is taken as the optimal value of the equipment capacity.

2. The method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station according to claim 1, characterized in that: The operating data of the electric bus includes electric bus routes, the total number of bus stops, the first and last departure times, the departure interval, the number of departures in a day, the distance between adjacent bus stops on the electric bus routes, the operating time between adjacent bus stops on the bus routes, the electric bus number, the battery capacity, the low battery coefficient, the battery replacement operation time and the number of simulated operation days.

3. The method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station according to claim 2, characterized in that: The location variable of the charging and swapping station is recorded as Vec = [x1 x2 x3 … x n ] T , where x n Represents the nth bus stop, with a dimension of n×1. The location variable of the charging and swapping station is represented in vector form, and each element uses a discrete number from 0 to 1 to represent the location of the charging and swapping station. 0 indicates that the corresponding bus stop has no charging and swapping station, and 1 indicates that the corresponding bus stop has a charging and swapping station.

4. The method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station according to claim 3, characterized in that: The total life cycle cost function is specifically: Among them, sslcc represents the total cost function of the entire life cycle, sslcc w represents the life cycle cost of the wth charging and swapping station, ssn represents the total number of charging and swapping stations, and pcc w represents the construction cost of the wth charging and swapping station considering the capital recovery coefficient, mc w represents the maintenance cost of the wth charging and swapping station, ecy w Represents the annual electricity cost of the wth charging and swapping station.

5. The method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station according to claim 4, characterized in that: The construction cost of the wth charging and swapping station considering the capital recovery coefficient is pcc w Specifically: dec w =and pv,w ×pvia w ×pvpc+e wt,w ×swtc pvia w =f pvia (ca w ) ca w =f ca (smn w ,cpn w ,ebn w ) Among them, a represents the interest rate, b represents the service life of the charging and swapping station; dec w represents the construction cost of the distributed energy of the wth charging and swapping station, cc w represents the construction cost of the wth charging and swapping station; e pv,w represents the first determination coefficient, pvia w represents the installed area of ​​solar panels at the wth charging and swapping station, pvpc represents the price of solar panels per unit area, e wt,w represents the second determination coefficient, swtc represents the price of wind turbine; f pvia (*) indicates the calculation function of solar panel installation area, ca w represents the building area of ​​the wth charging and swapping station; f ca (*) indicates the building area calculation function, smn w represents the number of battery replacement machines at the wth charging and swapping station, cpn w represents the number of chargers at the wth charging and swapping station, ebn w Indicates the number of backup batteries in the wth charging and swapping station.

6. The method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station according to claim 5, characterized in that: The maintenance cost of the wth charging and swapping station is mc w Specifically: mc w =f mc (smn w ,cpn w ,ebn w ,ca w ,dec w ) Among them, f mc (*) indicates maintenance cost calculation function, smn w represents the number of battery replacement machines at the wth charging and swapping station, cpn w represents the number of chargers at the wth charging and swapping station, ebn w represents the number of spare batteries in the wth charging and swapping station, ca w represents the building area of ​​the wth charging and swapping station, ca w represents the building area of ​​the wth charging and swapping station, dec w Represents the construction cost of the distributed energy of the w-th charging and swapping station.

7. The method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station according to claim 6, characterized in that: The annual electricity cost of the wth charging and swapping station is ecy w Specifically: Among them, ec i,w represents the electricity cost of the wth charging and swapping station on the i-th day, and sdn represents the number of simulated operation days.

8. The method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station according to claim 1, characterized in that: The constraint conditions include a first constraint condition and a second constraint condition, specifically: The first constraint: There must be at least one charging and swapping station on each electric bus route; The second constraint condition: The power level of the battery after the electric bus is unloaded is greater than or equal to 0.

9. The method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station according to claim 1, characterized in that: In S5, the genetic algorithm is used to optimize the location variables according to the life cycle cost optimization model, and the specific method for obtaining the optimal solution of the location variables of the charging and swapping station is: S51: Set the initial values ​​of the genetic algorithm, including: the number of individuals nind, the number of iterations gen, the chromosome crossover probability pc, the chromosome first mutation probability pm1, the chromosome second mutation probability pm2, the generation gap ggap and the constraint penalty coefficient punish; take the location variable of the charging and swapping station as the individual of the population; S52: Calculate the fitness of each individual when the iteration number i=1: Wherein, sslcc represents the total cost function of the entire life cycle; if the first constraint condition and the second constraint condition are satisfied at the same time, the constraint penalty term conspun = 0; otherwise, the constraint penalty term conspun = punish; Traverse each individual and calculate the fitness of each individual using the same method until the number of individuals nind is reached; S53: Using the roulette wheel method, the elite individuals are determined according to the fitness of each individual; S54: Elite Individual Crossover: Generate a first random number rand1, rand1∈(0,1); Determine whether the chromosome crossover probability pc is greater than the first random number rand1; if not, proceed to S55; otherwise, randomly pair elite individuals in the population in pairs to form c pairs; Generate a second random number rand2 and a third random number rand3, rand2, rand3∈(1, bstn), where bstn represents the total number of bus stops; Determine whether the second random number rand2 is greater than the third random number rand3; if so, swap the numbers between (rand3, 1) and (rand2, 1) in the elite individuals; otherwise, swap the numbers between (rand2, 1) and (rand3, 1) in the elite individuals; Traverse each pair of elite individuals until c pairs are reached, complete the elite individual crossover, and obtain (nind×ggap) elite individuals; S55: elite individual variation; S56: Update population; Among the individuals in the population when iteration number i=1 and the elite individuals after crossover and mutation, select nind individuals as the individuals in the population in the next iteration; S57: Update the number of iterations and calculate the fitness of each individual in the updated population until the number of iterations gen is reached; S58: The individual with the highest fitness is taken as the optimal solution for the location variable of the charging and swapping station.

10. The method for optimizing the site selection and equipment capacity of an electric bus charging and swapping station according to claim 9, characterized in that: The specific method of elite individual mutation is: S551: Generate a fourth random number rand4, rand4∈(0,1); S552: Determine whether the first chromosome mutation probability pm1 is greater than the fourth random number rand4; if so, actually swap the positions of the two numbers and proceed to S553; otherwise, directly proceed to S553; S553: ​​Generate a fifth random number rand5, rand5∈(0, 1); S554: Determine whether the second mutation probability pm2 of the chromosome is greater than the fifth random number rand5; if so, generate the sixth random number rand6, rand6∈(1, bstn), change the number at the (rand6, 1)th position in the elite individual, that is, change 0 to 1, or change 1 to 0, and proceed to S555; otherwise, proceed directly to S555; S555: Traverse each elite individual and repeat S551-554 until it reaches (nind×ggap) elite individuals to complete the elite individual mutation.