Battery replacement method of battery swap station based on particle swarm optimization

Through the battery swap station battery replacement method combined with particle swarm algorithm and traditional solvers, the long charging time and battery safety problems of electric vehicles are solved, efficient battery replacement and power management are achieved, and the operational efficiency and user satisfaction of the battery swap station are improved.

CN118982165APending Publication Date: 2024-11-19GUANGZHOU INSTITUTE OF TECHNOLOY XIDIAN UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410923793.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-11-19

AI Technical Summary

Technical Problem

The long charging time and slow charging speed of electric vehicles lead to battery safety and loss problems. The traditional charging method is difficult to meet users' needs for quick recharge, and it also affects the stability and benefits of the battery swap station.

Method used

The battery replacement method of battery swap station based on particle swap algorithm is adopted. By sorting and initializing the charge queue in the station, the battery swap algorithm and traditional solvers are used to determine the battery swap strategy, consider the stability and benefits of the battery swap station, and meet users' quick replenishment. Electricity demand.

Benefits of technology

The operational efficiency and user satisfaction of the battery swap station are improved, and the battery replacement and power management are achieved through intelligent optimization algorithms, reducing battery idle time and charge and discharge losses, ensuring that users can receive sufficient power replenishment in the shortest time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982165A_ABST
    Figure CN118982165A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of battery swapping stations, and discloses a battery swapping station battery replacement method based on a particle swarm algorithm. The method comprises the following steps: initializing a charge queue of each battery in a battery swap station, reading battery swap information including the number of battery swap requests and the charge states of swapped batteries, creating particles according to the battery swap information, and initializing the positions (replacement strategies) and speeds of the particles, the charge queue of the batteries exchanged out in the station is updated according to the battery replacement strategy determined by the particles, the battery replacement penalty is calculated, a target function is solved through a traditional solver, the fitness is obtained, and the battery replacement penalty is calculated; global and individual optimal particle information is updated, particle positions and speeds are updated, particle positions are limited, duplicate removal is carried out on repeated positions of particles until iteration is finished, and a final battery replacement strategy is obtained. According to the invention, the replacement strategy of the battery swap station can be optimized, and the economic benefit and operation stability of the swap station are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of battery swap stations, and specifically relates to a battery replacement method, storage medium, equipment and system for a battery swap station based on a particle swarm algorithm. Background Art

[0002] Growing concerns about climate change and environmental issues have driven an urgent need for renewable energy and clean transportation. Against this backdrop, electric vehicles have quickly emerged as an innovative solution to reduce carbon emissions and create sustainable urban transportation. However, with the popularity of electric vehicles, the lack of charging infrastructure and the relative lag of traditional charging methods have quickly become a major bottleneck restricting the development of electric vehicles.

[0003] Although electric vehicles have made significant progress in the field of sustainable transportation, their development is still affected by many factors. An important factor currently hindering the development of electric vehicles is the mileage and charging speed of electric vehicles. Although some electric vehicle manufacturers can greatly improve the charging speed of electric vehicles through technical means, over-fast charging brings about battery safety and battery loss issues.

[0004] In order to effectively solve the charging problem of electric vehicles, electric vehicle battery swap stations came into being. Compared with traditional charging methods, battery swap stations provide a more efficient and faster charging solution. Users only need to replace the battery with a charged battery when the battery is exhausted, and no longer need to wait for a long time for the charging process, thereby greatly shortening the charging time of electric vehicles and improving the convenience of travel. The introduction of electric vehicle battery swap stations not only provides electric vehicle users with more flexible and convenient charging options, but also contributes to the popularization of electric travel worldwide.

[0005] Electric vehicles provide battery replacement services for users. From the perspective of battery replacement stations, when users submit battery replacement requests, they need to consider the stability of their own operations. They cannot blindly replace batteries, but need to arrange battery replacements reasonably. They must ensure that users' requests for rapid charging are met while also considering the stability of the current battery replacement station, so that more battery replacement requests in the future can meet user needs.

[0006] Therefore, in response to the existing problems, there is an urgent need to provide a battery replacement method that can take into account the operating stability of the battery swap station itself and the revenue of the battery swap station, while ensuring the overall stable operation of the system, improving the operating revenue of the battery swap station and meeting the user's needs for rapid power replenishment. Summary of the invention

[0007] In view of the problems existing in the prior art, the present invention provides a battery replacement method for battery swap stations based on a particle swarm algorithm. By using a particle swarm algorithm and a traditional solver to search for a battery replacement strategy for a battery swap station, the stability of the battery swap station itself and the revenue of the battery swap station are considered in the process of searching for a battery swap strategy, thereby improving the operating revenue of the battery swap station and meeting the needs of users for rapid power replenishment.

[0008] The present invention is implemented in this way. The battery replacement method of a battery swap station based on a particle swarm algorithm includes:

[0009] S1. Sort the batteries in the station according to SOC and initialize the charging queue of the batteries in the station.

[0010] S2. Initialize particles and the charging queue of the swapped batteries according to the battery swap request. If the number of battery swap requests is equal to 0, use the solver to solve directly and obtain the charging strategy. If the number of battery swap requests is greater than 0, initialize the particle position and speed according to the number of requests, and the particle dimension is equal to the number of requests.

[0011] S3. Update the batteries in the station according to the battery replacement strategy of each particle, calculate the battery replacement penalty of the particle, and update the charge queue of the replaced battery.

[0012] S4. The position of each particle represents the current replacement strategy. The replacement strategy is fixed. At this time, the objective function becomes a simple linear programming. The solver is used to solve the function to obtain the fitness of each particle.

[0013] S5. Update the global and individual optimal particles.

[0014] S6. Update particles and replace duplicate items in the position of each particle to ensure that the battery replacement strategy is effective and feasible.

[0015] S7. Iterate and execute S2-S6 until the maximum number of iterations is reached to obtain the final battery replacement strategy.

[0016] Furthermore, in step S1, the battery charging queue is:

[0017] X i =SOC i -β

[0018]

[0019] Where X i Is the battery charge queue, SOC i is the battery SOC, β is the charge queue constant used to initialize the battery charge queue, P i is the charging and discharging power of the ith battery, dt is the time interval for the system optimization calculation, ξ ev Charge and discharge efficiency,i is a binary variable representing the battery swapping action, 0 means that battery i has not been swapped out, 1 means that battery i has been swapped out, It is the SOC of the replaced battery.

[0020] Further, in step S2, the charging queue of the particles and the replaced battery is initialized according to the battery replacement request:

[0021] E i =(e i,1 ,e i,2 ,...,e i,j ,...,e i,n )

[0022] e i,j is the jth element of the ith particle, and n is the number of battery replacements requested.

[0023] Furthermore, in step S3, the penalty of each particle is calculated, which represents the penalty measure of the difference between the power of the swapped-out battery and the swapped-in battery, ensuring that in each iteration, the station battery with a larger power than the user's swapped-in battery is selected as much as possible for swapping out, so that the user can get power replenishment:

[0024]

[0025] N is the total number of batteries in the battery swap station, SOC max It is the maximum value of the battery SOC.

[0026] Further, in step S4, the position e of each particle i,j It is used to determine which battery is replaced. At this time, the problem can be modeled as a linear programming problem. The objective function for the i-th particle is:

[0027]

[0028] It is the price of battery replacement. is the interaction price with the upper grid, Cb EV is the battery purchase cost, E ev is the total charge and discharge capacity of the battery during its life cycle. B is the revenue function of the battery swap station.

[0029] Constraints:

[0030] d.Battery charging power constraints:

[0031] P min ≤P j ≤P max ;

[0032] Among them, P max , P minThey represent the maximum and minimum battery charging power respectively.

[0033] e. The charging power of the currently replaced battery is always zero, and charging will start at the next moment:

[0034] P e =0e∈E i

[0035] E i represents the i-th particle in the current iteration, P e It is the charging power of the replaced battery represented by the i-th particle in the iteration process.

[0036] f. Battery SOC constraint:

[0037] SOC min ≤SOC j +P j *dt*ξ ev ≤SOC max

[0038] SOC max , SOC min These are the upper and lower limits of the battery SOC.

[0039] The objective function can be solved using a traditional solver, and the result obtained by adding a penalty is the fitness of each particle.

[0040] Furthermore, in step S6, each particle E i Inside i,j No repetition is allowed, and the duplicates at each particle's position are replaced by the nearest replacement.

[0041] Another object of the present invention is to provide a computer device, characterized in that it includes a general-purpose memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the following steps are performed:

[0042] Initialize the charging queue of each battery in the battery swap station, read the battery swap information: the number of battery swap requests and the charge state of the swapped battery, create particles according to the battery swap information and initialize the particle position (replacement strategy) and speed, iteratively execute: update the charging queue of the swapped batteries in the station according to the battery replacement strategy determined by the particles, calculate the battery swap penalty of the particles, calculate the fitness of the objective function using the traditional solver, update the global optimal particle and record the particle's own optimal information, update the particle position and speed, limit the particle position and remove duplicates until the iteration ends to obtain the replacement strategy and charging strategy.

[0043] The present invention also provides a battery replacement system for a battery swap station based on a particle swarm, the system comprising:

[0044] A battery sorting initialization module is used to sort the batteries in the station according to SOC and initialize the charging queue of the batteries in the station;

[0045] The particle initialization module is used to initialize particles and the charging queue of the swapped batteries according to the battery swap request. When the number of battery swap requests is 0, the solver is directly called to solve the charging strategy. When the number of battery swap requests is greater than 0, the particle position and speed are initialized according to the number of requests. The dimension of the particle is equal to the number of requests.

[0046] The battery swap strategy update module is used to update the batteries in the station according to the battery swap strategy of each particle, calculate the battery swap penalty of the particle, and update the charge queue of the swapped-in battery;

[0047] The fitness calculation module is used to fix the replacement strategy represented by the position of each particle, transform the objective function into a simple linear programming problem, solve the function through the solver, and obtain the fitness of each particle;

[0048] The optimal particle update module is used to update the global and individual optimal particles;

[0049] The particle update module is used to update particles and perform adjacent replacements on duplicate items at the position of each particle to ensure that the battery swap strategy is effective and feasible;

[0050] The iterative control module is used to iteratively execute the operations of the above modules until the maximum number of iterations is reached to obtain the final battery replacement strategy.

[0051] The system further comprises:

[0052] The penalty calculation submodule is used to calculate the penalty of each particle in the battery swap strategy update module. The penalty represents a measure of the difference between the power of the swapped-out battery and the swapped-in battery, to ensure that in each iteration, a battery in the station that is larger than the battery swapped in by the user is selected as much as possible for swapping out, so that the user can replenish his power.

[0053] The system further comprises:

[0054] The duplicate item processing submodule, in the particle update module, is used to ensure that the elements within each particle are not repeated, and to perform adjacent replacements on the duplicate items at the position of each particle to maintain the effectiveness and feasibility of the battery swap strategy.

[0055] Combining all the above technical solutions, the advantages and positive effects of the present invention are as follows:

[0056] First, the battery replacement method for a battery swap station based on a particle swarm algorithm provided by the present invention processes the binary variables introduced by the battery swap action in the modeling process of the battery swap station by using a nested solution mode of the particle swarm algorithm and the traditional solver, and determines the battery swap strategy of the battery swap station by the particles of the particle swarm algorithm. When the replacement strategy is determined, the target problem is converted into a linear programming problem, which is then solved by the solver, and then the fitness of the particles is obtained by combining the particle replacement penalty. The replacement strategy is obtained by continuously iterating to the maximum number of iterations. In the process of searching for the battery swap strategy, the operating stability of the battery swap station itself and the revenue of the battery swap station are taken into account, thereby improving the operating revenue of the battery swap station and meeting the user's needs for quick power replenishment.

[0057] Second, the battery replacement method of battery swap stations based on particle swarm optimization achieves efficient battery replacement and power management by intelligently optimizing battery swap requests and the status of batteries in the station. This method combines particle swarm optimization (PSO) and linear programming in multiple steps to ensure the optimality and feasibility of the battery swap strategy, thereby improving the operational efficiency and user satisfaction of the battery swap station.

[0058] 1) Initialization and sorting:

[0059] First, the batteries in the station are sorted according to their state of charge (SOC) and the battery charging queue is initialized. This step ensures the orderly management of the battery status and provides basic data support for subsequent battery replacement strategies.

[0060] 2) Particle initialization and update:

[0061] The position and velocity of the particle are initialized according to the number of battery swap requests, and the dimension of the particle is equal to the number of requests. In each iteration, the state of the battery in the station is updated according to the battery swap strategy of each particle, and the battery swap penalty of the particle is calculated. By continuously updating the global and individual optimal particles, the optimal battery swap strategy is gradually approached.

[0062] 3) Linear programming solution:

[0063] The position of each particle represents a replacement strategy. By fixing the replacement strategy, the problem is simplified to linear programming. The objective function is solved using a traditional solver to obtain the fitness of each particle. The fitness calculation takes into account the battery replacement price, interaction price, battery purchase cost, and the total charge and discharge capacity during the battery life cycle.

[0064] 4) Iterative optimization:

[0065] In each iteration, the position of the particles is updated to ensure the effectiveness of the battery swap strategy. The initialization, update, and solution steps are repeatedly performed until the maximum number of iterations is reached, and the optimal battery swap strategy is finally obtained.

[0066] Technological advancements:

[0067] 1) Optimize battery management:

[0068] Through intelligent optimization algorithms, the battery SOC is managed in an orderly manner and replaced efficiently, which improves the battery utilization rate and the operating efficiency of the battery swap station, and reduces the battery idle time and charging and discharging losses.

[0069] 2) Efficient battery replacement strategy:

[0070] By combining the particle swarm optimization algorithm with linear programming, we can quickly find the optimal battery replacement strategy, ensuring that users can get sufficient power replenishment in the shortest time, thereby improving user satisfaction.

[0071] 3) Intelligent penalty mechanism:

[0072] By calculating the difference in power between the replaced battery and the replaced battery, an intelligent penalty mechanism is set up to ensure that suitable batteries are selected for replacement in each iteration to avoid unnecessary waste of power, thereby improving the intelligence and energy-saving effects of the system.

[0073] 4) Reliable solution:

[0074] Through iterative optimization and solving, this method provides a reliable battery replacement solution, overcoming many shortcomings in the existing technology, especially in the intelligence of battery replacement strategy and optimization efficiency, achieving significant technological progress. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] Figure 1 It is a flow chart of the battery replacement method of a battery swap station based on a particle swarm algorithm implemented by the present invention.

[0076] Figure 2 It is a system architecture diagram of the battery replacement method of a battery swap station based on a particle swarm algorithm of the present invention;

[0077] Figure 3 It is a comparison diagram of the experimental effects of the present invention. DETAILED DESCRIPTION

[0078] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation mode, structure, characteristics and effects of the present invention are described in detail below in combination with the accompanying drawings and preferred embodiments.

[0079] See also Figure 1-2 The present application embodiment provides a battery replacement method for a battery swap station based on a particle swarm algorithm, which is applied to a computer device and includes the following steps:

[0080] S1. Sort the batteries in the station according to SOC and initialize the charging queue of the batteries in the station.

[0081] S2. Initialize particles and the charging queue of the swapped batteries according to the battery swap request. If the number of battery swap requests is equal to 0, use the solver to solve directly and obtain the charging strategy. If the number of battery swap requests is greater than 0, initialize the particle position and speed according to the number of requests, and the particle dimension is equal to the number of requests.

[0082] S3. Update the batteries in the station according to the battery replacement strategy of each particle, calculate the battery replacement penalty of the particle, and update the charge queue of the replaced battery.

[0083] S4. The position of each particle represents the current replacement strategy. The replacement strategy is fixed. At this time, the objective function becomes a simple linear programming. The solver is used to solve the function to obtain the fitness of each particle.

[0084] S5. Update the global and individual optimal particles.

[0085] S6. Update particles and replace duplicate items in the position of each particle to ensure that the battery replacement strategy is effective and feasible.

[0086] S7. Iterate and execute S2-S6 until the maximum number of iterations is reached to obtain the final battery replacement strategy.

[0087] Furthermore, in step S1, the battery charging queue is:

[0088] X i =SOC i -β

[0089]

[0090] Where X i Is the battery charge queue, SOC i is the battery SOC, β is the charge queue constant used to initialize the battery charge queue, P i is the charging and discharging power of the ith battery, dt is the time interval for the system optimization calculation, ξ ev Charge and discharge efficiency, i is a binary variable representing the battery swapping action, 0 means that battery i has not been swapped out, 1 means that battery i has been swapped out, It is the SOC of the replaced battery.

[0091] Further, in step S2, the charging queue of the particles and the replaced battery is initialized according to the battery replacement request.

[0092] E i =(e i,1 ,e i,2 ,...,e i,j ,...,e i,n )

[0093] e i,j is the jth element of the ith particle, and n is the number of battery replacements requested.

[0094] Furthermore, in step S3, the penalty of each particle is calculated, which represents the penalty measure of the difference between the power of the swapped-out battery and the swapped-in battery, ensuring that in each iteration, a battery in the station that is larger than the battery swapped in by the user is selected as much as possible for swapping out, so that the user can get power replenishment.

[0095]

[0096] N is the total number of batteries in the battery swap station, SOC max It is the maximum value of the battery SOC.

[0097] Further, in step S4, the position e of each particle i,j It is used to determine which battery is replaced. At this time, the problem can be modeled as a linear programming problem. The objective function for the i-th particle is:

[0098]

[0099] It is the price of battery replacement. is the interaction price with the upper grid, Cb EV is the battery purchase cost, E ev is the total charge and discharge capacity of the battery during its life cycle. B is the revenue function of the battery swap station.

[0100] Constraints:

[0101] g. Battery charging power constraints:

[0102] P min ≤P j ≤P max

[0103] h. The charging power of the currently replaced battery is always zero, and charging will start at the next moment:

[0104] P e =0e∈E i

[0105] i. Battery SOC constraint:

[0106] SOC min ≤SOC j +P j *dt*ξ ev ≤SOC max

[0107] SOC max , SOC minThese are the upper and lower limits of the battery SOC.

[0108] The objective function can be solved using a traditional solver, and the result obtained by adding a penalty is the fitness of each particle.

[0109] Furthermore, in step S6, each particle E i Inside i,j No repetition is allowed, and the duplicates at each particle's position are replaced by the nearest replacement.

[0110] An embodiment of the present application further provides a storage medium, in which a computer program is stored. When the computer program is executed on a computer, the computer is enabled to execute the above-mentioned particle swarm-based microgrid two-layer optimization scheduling model.

[0111] An embodiment of the present application also provides a computer device, including a general-purpose memory and a processor, wherein the memory is electrically connected to the processor, a computer program is stored in the memory, and the processor is used to execute the above-mentioned particle swarm-based microgrid two-layer optimization scheduling model by calling the computer program stored in the memory.

[0112] The battery replacement method for battery swap stations based on particle swarm algorithm adopted in the present invention processes the binary variables introduced by the battery swap action in the battery swap station modeling process by using the particle swarm algorithm and the nested solution mode of the traditional solver, and determines the battery swap strategy of the battery swap station by the particles of the particle swarm algorithm. When the replacement strategy is determined, the target problem is converted into a linear programming problem, which is then solved by the solver. The fitness of the particles is then obtained by combining the particle replacement penalty, and the replacement strategy is obtained by continuously iterating to the maximum number of iterations. In the process of searching for the battery swap strategy, the operating stability of the battery swap station itself and the revenue of the battery swap station are taken into account, thereby improving the operating revenue of the battery swap station and meeting the needs of users for quick power replenishment.

[0113] The following are two specific embodiments of the battery replacement method of a battery swap station based on a particle swarm algorithm:

[0114] Embodiment 1:

[0115] 1) Initialization phase:

[0116] There are 100 batteries in the battery swap station, which are sorted according to the battery SOC (remaining power) and the battery charging queue is initialized. For example, assume that the battery SOC ranges from 20% to 80%.

[0117] After receiving 10 battery replacement requests, the system initializes 10 particles based on these requests, and the dimension of each particle is equal to the number of requests, that is, 10 dimensions.

[0118] 2) Particle swarm optimization process:

[0119] For each particle, the battery status in the station is updated according to its battery swap strategy, and the battery swap penalty is calculated. For example, if the SOC of the swapped-out battery is lower than the SOC of the swapped-in battery, a certain penalty will be given.

[0120] The position of each particle represents a replacement strategy. After fixing this strategy, the objective function becomes a simple linear programming problem. Use the solver to solve and obtain the fitness of each particle. For example, the fitness of a particle may represent the revenue of the battery swap station under its battery swap strategy.

[0121] Update the global and individual optimal particles. Select the particle with the highest fitness as the global optimal particle, and each particle also retains its own individual optimal position.

[0122] Update particle positions and velocities. Perform adjacent replacements for duplicate particle positions to ensure the effectiveness and feasibility of the battery swap strategy.

[0123] 3) Iteration and result output:

[0124] The above steps are iterated until a maximum number of iterations, for example, 100, is reached.

[0125] Output the final battery replacement strategy, including which batteries should be replaced and the corresponding batteries to be replaced.

[0126] Embodiment 2:

[0127] 1) Scene setting:

[0128] The battery swap station is located in a busy commercial area where batteries are frequently used, requiring an efficient battery replacement strategy to meet user needs.

[0129] There are 50 batteries in the station, with SOC ranging from 30% to 90%.

[0130] 2) Battery replacement request processing:

[0131] During peak hours, the system receives 20 battery swap requests. According to the number of requests, 20 particles are initialized, sorted, and the battery charging queue is initialized.

[0132] 3) Optimization process:

[0133] Using the particle swarm optimization algorithm, each particle represents a possible battery replacement solution.

[0134] The fitness of each particle is calculated iteratively, taking into account multiple factors such as battery replacement efficiency, user waiting time, and battery utilization.

[0135] In each iteration, the global and individual optimal solutions are updated according to the fitness of the particles.

[0136] 4) Strategy adjustment and optimization:

[0137] In order to reduce user waiting time, the system tends to choose batteries with higher SOC for replacement.

[0138] At the same time, in order to balance the battery life and avoid excessive use of certain batteries, the system will also take the number of battery uses into consideration in the strategy.

[0139] 5) Application of results:

[0140] After a certain number of iterations, the system outputs the optimal battery replacement strategy.

[0141] The staff at the battery swap station performs battery replacement operations according to this strategy to ensure that users' battery swap needs are met efficiently and quickly.

[0142] 1. Specific application fields or related products of the present invention.

[0143] The present invention is applicable to mixed integer programming models that are difficult to solve by solvers and to situations where intelligent algorithms solve models that converge data slowly. By decomposing the model, using intelligent algorithms to process related integer variables, and then using solvers to further improve the model, the difficulty of solving the model by solvers can be reduced and the number of iterations of intelligent algorithms can be reduced.

[0144] 2. Relevant evidence of the technical effects obtained by the embodiments of the present invention.

[0145] like Figure 3 , which is a comparison diagram of the experimental results of the present invention when solving mixed integer programming problems.

[0146] Through many experiments, it can be clearly found that the number of iterations required for solving the model by the method proposed in the present invention is less than the number of iterations required for solving the model by the PSO algorithm, and the solution accuracy is also better than the PSO algorithm.

[0147] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. A battery replacement method for a battery swap station based on a particle swarm algorithm, characterized in that: The following steps are involved: S1. Sort the batteries in the station according to SOC and initialize the charging queue of the batteries in the station; S2. Initialize particles and the charging queue of the swapped batteries according to the battery swap request. If the number of battery swap requests is equal to 0, directly use the solver to solve and obtain the charging strategy. If the number of battery swap requests is greater than 0, initialize the particle position and speed according to the number of requests, and the dimension of the particle is equal to the number of requests. S3: Update the batteries in the station according to the battery swap strategy of each particle, calculate the battery swap penalty of the particle, and update the charge queue of the swapped-in battery; S4. The position of each particle represents the current replacement strategy. The replacement strategy is fixed. At this time, the objective function becomes a simple linear programming. The solver is used to solve the function to obtain the fitness of each particle. S5, update the global and individual optimal particles; S6, update particles and replace the duplicate items of each particle's position to ensure that the battery replacement strategy is effective and feasible; S7. Iterate and execute S2-S6 until the maximum number of iterations is reached to obtain the final battery replacement strategy.

2. The battery replacement method for a battery swap station based on a particle swarm algorithm according to claim 1, characterized in that: In step S1, the battery charging queue is: X i =SOC i -β; Where X i Is the battery charge queue, SOC i is the battery SOC, β is the charge queue constant used to initialize the battery charge queue, P i is the charging and discharging power of the ith battery, dt is the time interval for the system optimization calculation, ξ ev Charge and discharge efficiency, i is a binary variable representing the battery swapping action, 0 means that battery i has not been swapped out, 1 means that battery i has been swapped out, It is the SOC of the replaced battery.

3. The battery replacement method for a battery swap station based on a particle swarm algorithm according to claim 1, characterized in that: In step S2, the charging queue of the particles and the replaced battery is initialized according to the battery replacement request: AND i =(and i,1 ,And i,2 ,...,And i,j ,...,And i,n ); e i,j is the jth element of the ith particle, and n is the number of battery replacements requested.

4. The battery replacement method for a battery swap station based on a particle swarm algorithm as claimed in claim 1, characterized in that: In step S3, the penalty of each particle is calculated, which represents the penalty measure of the difference between the power of the swapped-out battery and the swapped-in battery, ensuring that in each iteration, a battery in the station that is larger than the battery swapped in by the user is selected as much as possible to be swapped out, so that the user can get power replenishment: N is the total number of batteries in the battery swap station, SOC max It is the maximum value of the battery SOC.

5. The battery replacement method for a battery swap station based on a particle swarm algorithm as described in claim 1, characterized in that: In step S4, the position e of each particle i,j It is used to determine which battery is replaced. At this time, the problem can be modeled as a linear programming problem. The objective function for the i-th particle is: θ eb is the battery replacement price, θ bg is the interaction price with the upper grid, Cb EV is the battery purchase cost, E ev is the total charge and discharge capacity of the battery during its life cycle, and B is the revenue function of the battery swap station; Constraints: a. Battery charging power constraints: P min ≤P j ≤P max b. The charging power of the currently replaced battery is always zero, and charging will start at the next moment: P e =0e∈E i c. Battery SOC constraint: SOCIETY min ≤SOC j +P j *dt*ξ ev ≤SOC max SOC max , SOC min are the upper and lower limits of the battery SOC; The objective function can be solved using a traditional solver, and the result obtained by adding a penalty is the fitness of each particle.

6. The battery replacement method for a battery swap station based on a particle swarm algorithm according to claim 1, characterized in that: In step S6, each particle E i Inside i,j No repetition is allowed, and the duplicates at each particle's position are replaced by the nearest neighbor.

7. A battery replacement system for a battery swap station based on a particle swarm algorithm for executing the battery replacement method for a battery swap station based on a particle swarm algorithm as claimed in any one of claims 1 to 6, characterized in that: The battery replacement system for battery swap stations based on particle swarm algorithm includes: A battery sorting initialization module is used to sort the batteries in the station according to SOC and initialize the charging queue of the batteries in the station; The particle initialization module is used to initialize particles and the charging queue of the swapped batteries according to the battery swap request. When the number of battery swap requests is 0, the solver is directly called to solve the charging strategy. When the number of battery swap requests is greater than 0, the particle position and speed are initialized according to the number of requests. The dimension of the particle is equal to the number of requests. The battery swap strategy update module is used to update the batteries in the station according to the battery swap strategy of each particle, calculate the battery swap penalty of the particle, and update the charge queue of the swapped-in battery; The fitness calculation module is used to fix the replacement strategy represented by the position of each particle, transform the objective function into a simple linear programming problem, solve the function through the solver, and obtain the fitness of each particle; The optimal particle update module is used to update the global and individual optimal particles; The particle update module is used to update particles and perform adjacent replacements on duplicate items at the position of each particle to ensure that the battery swap strategy is effective and feasible; The iterative control module is used to iteratively execute the operations of the above modules until the maximum number of iterations is reached to obtain the final battery replacement strategy.

8. The battery replacement system for battery swap stations based on particle swarm algorithm as claimed in claim 7, characterized in that: The battery swap strategy update module includes: The penalty calculation submodule is used to calculate the penalty of each particle. The penalty represents the difference between the power of the swapped-out battery and the swapped-in battery to ensure that in each iteration, the station battery with a larger power than the user's swapped-in battery is selected as much as possible for swapping out so that the user can get power replenishment.

9. The battery replacement system for battery swap stations based on particle swarm algorithm according to claim 7, characterized in that: The particle update module comprises: The duplicate item processing submodule is used to ensure that the elements within each particle are not repeated and to perform adjacent replacements on the duplicate items at the position of each particle to maintain the effectiveness and feasibility of the battery swap strategy.

10. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the battery replacement method for a battery swap station based on a particle swarm algorithm as claimed in any one of claims 1 to 6.