Double-layer model collaborative optimization method and device based on battery scheduling and vehicle path
By employing a two-layer model collaborative optimization method that combines battery scheduling and vehicle routing, the problem of battery demand mismatch between charging and swapping stations was solved, achieving a balance in battery demand and improving user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI FANGCHENGSHI NEW ENERGY TECHNOLOGY CO LTD
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-10
AI Technical Summary
The lack of existing technologies for the coordinated optimization of battery scheduling and vehicle routing between charging and swapping stations leads to charging and swapping stations being unable to meet battery demand, thus affecting the use of electric vehicles.
A two-layer collaborative optimization method based on battery scheduling and vehicle routing is adopted. By determining the model solutions for battery allocation between stations and battery transport vehicle route planning, the optimization processes of the two models are connected by an interaction function to realize information sharing and feedback mechanisms, and gradually optimize to the global optimal solution.
This achieved a balance between supply and demand among charging and battery swapping stations, improved the user experience, and ensured that actual battery demand met forecasts.
Smart Images

Figure CN121836210A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of charging and swapping site scheduling technology, and in particular to a two-layer model collaborative optimization method and device based on battery scheduling and vehicle routing. Background Technology
[0002] With the rapid development of the electric vehicle market, charging and battery swapping stations have become a fast and efficient solution for replacing batteries, enabling electric vehicles to complete charging or battery replacement in a short time. However, due to the dynamic changes in battery demand and inventory at charging and swapping stations, there may be instances where the batteries provided by these stations cannot meet the demand, directly impacting the usability of electric vehicles. Therefore, battery scheduling between charging and swapping stations is necessary, and the rationality of this scheduling directly affects the user experience. Current technologies only provide algorithmic models for battery scheduling or vehicle scheduling, without offering a method for collaborative optimization of both models. Summary of the Invention
[0003] In view of this, one of the technical problems solved by the embodiments of this application is to provide a method, device, equipment and medium for collaborative optimization based on a two-layer model of battery scheduling and vehicle routing, so as to solve the problem of supply and demand balance between charging and battery swapping stations.
[0004] According to a first aspect of the embodiments of this application, a two-layer model collaborative optimization method based on battery scheduling and vehicle routing is provided, the method comprising:
[0005] Determine the first solution of the first model for battery allocation between sites and the second solution of the second model for battery transport vehicle route planning between sites;
[0006] The first model is optimized based on the second solution and the first fitness function of the first model to obtain a candidate first solution. The second model is then optimized based on the second fitness function of the second model to obtain a candidate second solution. The first fitness function is obtained by weighted combination of the first objective function and the first interaction function of the first model, and the second fitness function is obtained by weighted combination of the second objective function and the second interaction function of the second model.
[0007] The process involves iteratively optimizing the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and then using the candidate first solution to optimize the second model based on the second fitness function of the second model to obtain a candidate second solution, until convergence is achieved.
[0008] A second aspect of this application discloses a two-layer model collaborative optimization device based on battery scheduling and vehicle routing, the device comprising:
[0009] The initial solution determination module is used to determine the first solution of the first model for battery allocation between sites and the second solution of the second model for battery transport vehicle route planning between sites.
[0010] The model co-optimization module is used to optimize the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and to optimize the second model based on the second fitness function of the second model using the candidate first solution to obtain a candidate second solution. The first fitness function is obtained by weighted combination of the first objective function and the first interaction function of the first model, and the second fitness function is obtained by weighted combination of the second objective function and the second interaction function of the second model.
[0011] The optimization decision determination module is used to iteratively execute the steps of optimizing the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and then optimizing the second model based on the second fitness function of the second model using the candidate first solution to obtain a candidate second solution until convergence.
[0012] A third aspect of this application discloses an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.
[0013] A fourth aspect of this application discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0014] The embodiments of this application optimize the first and second models alternately by determining the first solution of the first model for battery allocation between stations and the second solution of the second model for battery transport vehicle route planning between stations. Since the two models have their own independent objective functions, the optimization processes of the two models are connected by introducing interactive functions that influence each other. This allows the objective functions of the two models to interact with each other through the introduced interactive functions, thereby achieving the goal of collaborative optimization of the two models through information sharing and feedback mechanisms. This ensures that the predicted battery demand of charging and swapping stations meets the actual demand, achieving the goal of supply and demand balance between charging and swapping stations and further improving the user experience. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0016] Figure 1This is a flowchart illustrating a two-layer model collaborative optimization method based on battery scheduling and vehicle routing provided in one embodiment of this application.
[0017] Figure 2 This is a schematic diagram of the structure of a two-layer model collaborative optimization device based on battery scheduling and vehicle routing provided in one embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0019] It should be noted that although the functional modules are divided in the device diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than the module division in the device or the order in the flowchart.
[0020] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0021] According to one embodiment of this application, a two-layer collaborative optimization method based on battery scheduling and vehicle routing is provided, such as... Figure 1 As shown, the method includes steps S101, S102 and S103.
[0022] Step S101: Determine the first solution of the first model for battery allocation between sites and the second solution of the second model for battery transport vehicle route planning between sites.
[0023] In this embodiment of the application, the first solution is used to characterize the number of full batteries and empty batteries that need to be transferred in and out at different charging and swapping stations.
[0024] In this embodiment of the application, the second solution is used to characterize the number of full batteries and empty batteries that are unloaded and loaded by different vehicles at different stations.
[0025] Specifically, using a preset algorithm (such as a random algorithm), initial values are selected from the feasible range of battery allocation and vehicle route planning at each station to obtain the first and second solutions. Alternatively, the first solution is obtained based on the needs of each station, while the second solution is the initial vehicle route generated by the nearest neighbor algorithm and its corresponding arrangement (i.e., the full and empty batteries loaded and unloaded).
[0026] Step S102: Optimize the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution. Optimize the second model based on the second fitness function of the second model using the candidate first solution to obtain a candidate second solution. The first fitness function is obtained by weighted combination of the first objective function and the first interaction function of the first model, and the second fitness function is obtained by weighted combination of the second objective function and the second interaction function of the second model.
[0027] In this embodiment, the first objective function and the second objective function are used to quantify the quality of the solution of a single model, such as minimizing allocation costs or minimizing transportation costs, and are used to guide the search for a better direction.
[0028] Specifically, the first interaction function is used to characterize the impact of the output of the first model on the second model.
[0029] Specifically, the second interaction function is used to measure the consistency between the solutions of the first model and the second model.
[0030] Step S103: Repeatedly execute the steps of optimizing the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and then optimizing the second model based on the second fitness function of the second model using the candidate first solution to obtain a candidate second solution until convergence.
[0031] Specifically, a preset number of iterations or a threshold can be used as a convergence condition, such as stopping when the number of iterations in step S103 reaches the preset number of iterations.
[0032] This application embodiment optimizes the first and second models alternately by determining the first solution of the first model for battery allocation between stations and the second solution of the second model for battery transport vehicle route planning between stations. Since the two models have their own independent objective functions, the optimization processes of the two models are connected by introducing interactive functions that influence each other. This allows the objective functions of the two models to interact with each other through the introduced interactive functions, achieving the goal of gradually optimizing the two models through information sharing and feedback mechanisms to obtain the global optimal solution. This achieves the goal of collaborative optimization of the two models, ensuring that the predicted battery demand of charging and swapping stations meets the actual demand, achieving the goal of supply and demand balance between charging and swapping stations, and further improving the user experience.
[0033] In some embodiments, the formula for the first fitness function is: The formula for the second fitness function is: ,in, , , , These are, respectively, a first objective function for evaluating the output of the first model, a second objective function for evaluating the output of the second model, a first interaction function, and a second interaction function. and These are the weighting coefficients. The degree of importance attached to controlling the impact of the first model's output on the performance of the second model is relatively large. The value makes the first model more likely to produce solutions that optimize the performance of the second model, such as This indicates that the first model will ignore the impact on the second model. To adjust the importance of consistency between the outputs of the second model and the first model, a larger... This value forces the output of the second model to be highly consistent with that of the first model. In this case, the second model will not consider its compatibility with the first model.
[0034] In this embodiment of the application, the first objective function is a function that evaluates the satisfaction rate of the battery demand between sites by the first solution of the first model (i.e., the inter-site battery allocation plan).
[0035] In this embodiment of the application, the second objective function is a function that evaluates the benefit of the second solution of the second model (i.e., the battery transport vehicle route planning between stations).
[0036] In the embodiments of this application, A function used to measure the impact of the output of the first model on the optimization of the second model.
[0037] In the embodiments of this application, A function used to measure the consistency of solutions between the first model and the second model.
[0038] In one embodiment, before step S103, the method further includes: inputting the candidate first solution and the candidate second solution into a pre-constructed joint objective function to obtain a joint objective value, wherein the joint objective function is obtained by combining the first fitness function and the second fitness function; step S103 further includes: if the joint objective value is not less than a preset objective value threshold, then repeatedly executing the steps of optimizing the first model based on the second solution and the first fitness function of the first model to obtain the candidate first solution, and optimizing the second model based on the candidate first solution using the second fitness function of the second model to obtain the candidate second solution until convergence; the joint objective function The formula is: .
[0039] Specifically, middle , , All are weighting coefficients. Used to balance the relative importance of the objective functions of the two models. This indicates that the original goals of both models are treated equally. It will emphasize the goals of the second model. This places greater emphasis on the objective of the first model. In the embodiments of this application, the joint objective is separated into the original objective. One-way influence and two-way coordination This structure provides a clearer dimension of control, through The relative weights of the two original objectives can be adjusted independently, through... and The strength of the interaction effects can be adjusted independently, and this separation design helps to converge more smoothly to the harmonic solution. In application, each model can be optimized independently first, such as... Then, gradually introduce interaction terms, starting with small weights and increasing them. Specifically, you can first emphasize the original goal and then strengthen coordination. In application, the convergence condition is: when... Stop at time, among which Let the joint objective value be the result of the nth optimization. For the (n-1)th optimization, The target value threshold.
[0040] In some embodiments, prior to step S102, the method further includes: determining a first objective function based on a user-selected battery allocation quantification index; and determining a second objective function based on a user-selected vehicle scheduling quantification index.
[0041] Specifically, multiple indicators (battery allocation quantification indicators and vehicle scheduling quantification indicators) and their corresponding objective functions can be pre-configured, allowing users to determine the objective functions of the two models based on the selected indicators. This eliminates the need for users to design their own objective functions, thus avoiding potential convergence problems associated with user-defined functions. Through the pre-configured diverse battery allocation quantification indicators, users can switch indicators according to real-time conditions to achieve dynamic response to user needs.
[0042] In some embodiments, the user-selected battery allocation quantification metric is maximizing the battery scheduling satisfaction rate between sites, and the user-selected vehicle scheduling quantification metric is maximizing revenue.
[0043] By iteratively optimizing the two models alternately using the objective functions corresponding to maximizing the battery scheduling satisfaction rate between sites and maximizing the revenue, the goal of collaborative optimization of the two models can be achieved.
[0044] In some embodiments, step S102 further includes:
[0045] The second solution is input into the first interaction function to evaluate the first evaluation value of the battery transport vehicle path planning output by the second model. The first fitness of the first model is calculated based on the first evaluation value and the first fitness function. The first solution is then optimized based on the first evaluation value and the first fitness to generate a candidate first solution.
[0046] The candidate first solution is input into the second interaction function to obtain the matching value between the second solution and the candidate first solution. The second fitness of the second model is calculated based on the matching value and the second fitness function. The second solution is then optimized based on the matching value and the second fitness to generate a candidate second solution.
[0047] Specifically, the first solution can be randomly generated or obtained through heuristic initialization, while the second solution can be customized. The fixed input of the first model includes the initial solution of the second model (i.e., the second solution), which serves as the first interaction function during the first optimization. The input is used to calculate the impact of the first model on the second model; the first interaction function For predefined functions, such as , It is given The objective function of the second model, i.e. Indicates that the first model is given Then, the objective function value of the second model, calculated based on the optimal solution of the second model, is fed back to the first model. (Initial optimization) Depending on the second solution, adjustments are made during the optimization process. In order to indirectly affect the subsequent The update can be performed using pre-defined algorithms, such as gradient descent or evolutionary algorithms, to optimize the initially fixed solution.
[0048] In some embodiments, step S101 further includes:
[0049] Based on preset battery allocation constraints, the corresponding battery scheduling parameters for each of the multiple charging and swapping stations are determined. The battery scheduling parameters include the parameters for loading and unloading full batteries, as well as the parameters for loading and unloading empty batteries.
[0050] Based on preset vehicle scheduling constraints, vehicle scheduling parameters corresponding to each of the multiple battery transfer vehicles are determined. The vehicle scheduling parameters include the loading and unloading parameters of the battery transfer vehicles for loading and unloading full batteries at multiple charging and swapping stations, as well as the loading and unloading parameters of empty batteries.
[0051] Specifically, solutions can be generated through random initialization, heuristic rules, or historical data. For example, the process of random initialization involves first defining the solution space range, such as the battery scheduling range of each charging and swapping station in the battery allocation scheme, and then generating solutions randomly according to uniform distribution, Gaussian distribution, or other methods based on this range. Similarly, historical data generation can be determined using data from a predetermined time period (such as the past week), specifically through statistical analysis of the data within that period.
[0052] One embodiment of this application provides a two-layer model collaborative optimization device based on battery scheduling and vehicle routing, such as... Figure 2 As shown, the device 20 includes: an initial solution determination module 201, a model co-optimization module 202, and an optimization decision determination module 203.
[0053] The initial solution determination module 201 is used to determine the first solution of the first model for battery allocation between sites and the second solution of the second model for battery transport vehicle route planning between sites.
[0054] The model co-optimization module 202 is used to optimize the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and to optimize the second model based on the second fitness function of the second model using the candidate first solution to obtain a candidate second solution. The first fitness function is obtained by weighted combination of the first objective function and the first interaction function of the first model, and the second fitness function is obtained by weighted combination of the second objective function and the second interaction function of the second model.
[0055] The optimization decision determination module 203 is used to repeatedly execute the steps of optimizing the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and optimizing the second model based on the candidate first solution using the second fitness function of the second model to obtain a candidate second solution until convergence.
[0056] This application embodiment optimizes the first and second models alternately by determining the first solution of the first model for battery allocation between sites and the second solution of the second model for battery transport vehicle route planning between sites. Since the two models have their own independent objective functions, the optimization processes of the two models are connected by introducing interactive functions that influence each other. This allows the objective functions of the two models to interact with each other through the introduced interactive functions, thereby achieving the goal of collaborative optimization of the two models by gradually optimizing each other through information sharing and feedback mechanisms to obtain the global optimal solution.
[0057] Furthermore, the formula for the first fitness function is: The formula for the second fitness function is: ;in, , , , These are, respectively, a first objective function for evaluating the output of the first model, a second objective function for evaluating the output of the second model, a first interaction function, and a second interaction function. and These are the weighting coefficients.
[0058] Furthermore, before convergence, the optimization decision determination module, in the process of iteratively executing the steps of optimizing the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and using the candidate first solution to optimize the second model based on the second fitness function of the second model to obtain a candidate second solution, also includes:
[0059] The joint objective determination submodule is used to input the candidate first solution and the candidate second solution into the pre-constructed joint objective function to obtain the joint objective value. The joint objective function is obtained by combining the first fitness function and the second fitness function.
[0060] The optimization decision-making module includes:
[0061] The optimal solution determination submodule is used to iteratively execute the steps of optimizing the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and then optimizing the second model based on the candidate first solution and the second fitness function of the second model to obtain a candidate second solution until convergence if the joint objective value is not less than the preset objective value threshold.
[0062] Joint objective function The formula is:
[0063] .
[0064] Furthermore, before the model co-optimization module optimizes the first model to obtain a candidate first solution based on the second solution and the first fitness function of the first model, and then optimizes the second model to obtain a candidate second solution using the candidate first solution and the second fitness function of the second model, the module further includes:
[0065] The first function determination submodule is used to determine the first objective function based on the battery allocation quantification index selected by the user.
[0066] The second function determination submodule is used to determine the second objective function based on the vehicle scheduling quantification indicators selected by the user.
[0067] Furthermore, the user-selected quantitative metric for battery allocation is maximizing the battery scheduling satisfaction rate between sites, and the user-selected quantitative metric for vehicle scheduling is maximizing revenue.
[0068] Furthermore, the model co-optimization module includes:
[0069] The first model optimization submodule is used to input the first solution into the first interaction function to evaluate the first evaluation value of the battery transport vehicle path planning output by the second model, calculate the first fitness of the first model based on the first evaluation value and the first fitness function, and optimize the first solution based on the first evaluation value and the first fitness to generate a candidate first solution.
[0070] The second model optimization submodule is used to input the candidate first solution into the second interaction function to obtain the matching value between the second solution and the candidate first solution, calculate the second fitness of the second model based on the matching value and the second fitness function, and optimize the second solution based on the matching value and the second fitness to generate the candidate second solution.
[0071] Furthermore, the initial solution determination module includes:
[0072] The first determination submodule is used to determine the corresponding battery scheduling parameters among multiple charging and swapping stations based on preset battery allocation constraints. The battery scheduling parameters include the input and output parameters for full batteries, as well as the input and output parameters for empty batteries.
[0073] The second determining module is used to determine the vehicle scheduling parameters corresponding to each of the multiple battery transfer vehicles based on preset vehicle scheduling constraints. The vehicle scheduling parameters include the transfer-in parameters and transfer-out parameters for loading and unloading full batteries and empty batteries for the battery transfer vehicles at the multiple charging and swapping stations.
[0074] The dual-layer model collaborative optimization device based on battery scheduling and vehicle routing in this embodiment can execute the dual-layer model collaborative optimization method based on battery scheduling and vehicle routing shown in the embodiment of this application. The implementation principle is similar and will not be described again here.
[0075] Another embodiment of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor can implement the above-described method when executing the computer program.
[0076] Specifically, the processor can be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0077] Specifically, the processor connects to the memory via a bus, which may include a path for transmitting information. The bus can be a PCI bus or an EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc.
[0078] The memory may be ROM or other types of static storage devices that can store static information and instructions, RAM or other types of dynamic storage devices that can store information and instructions, or EEPROM, CD-ROM or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
[0079] Optionally, the memory stores the code of a computer program that executes the scheme of this application, and the execution is controlled by a processor. The processor executes the application code stored in the memory to implement the operation of the apparatus provided in the above embodiments.
[0080] Another embodiment of this application provides a computer-readable storage medium storing computer-executable instructions for performing the methods provided in the above embodiments.
[0081] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0082] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information transmission medium.
[0083] The above is a detailed description of the preferred embodiments of this application. However, this application is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A two-layer collaborative optimization method based on battery scheduling and vehicle routing, characterized in that, include: Determine the first solution of the first model for battery allocation between sites and the second solution of the second model for battery transport vehicle route planning between sites; The first model is optimized based on the second solution and the first fitness function of the first model to obtain a candidate first solution. The second model is then optimized based on the candidate first solution and the second fitness function of the second model to obtain a candidate second solution. The first fitness function is obtained by weighted combination of the first objective function and the first interaction function of the first model, and the second fitness function is obtained by weighted combination of the second objective function and the second interaction function of the second model. The process of repeatedly optimizing the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and then optimizing the second model based on the second fitness function of the second model using the candidate first solution to obtain a candidate second solution, continues until convergence is achieved.
2. The method according to claim 1, characterized in that, The formula for the first fitness function is: ; The formula for the second fitness function is: ; in, , , , These are, respectively, the first objective function used to evaluate the output of the first model, the second objective function used to evaluate the output of the second model, the first interaction function, and the second interaction function. and These are the weighting coefficients.
3. The method according to claim 2, characterized in that, The method further includes the following steps: 1) Optimizing the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution; 2) Optimizing the second model based on the second fitness function of the second model using the candidate first solution to obtain a candidate second solution; 3) Optimizing the second model based on the second fitness function of the second model to obtain a candidate second solution, until convergence. The candidate first solution and the candidate second solution are input into a pre-constructed joint objective function to obtain a joint objective value. The joint objective function is obtained by combining the first fitness function and the second fitness function. The step of iteratively executing the steps of optimizing the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and then optimizing the second model based on the second fitness function of the second model using the candidate first solution to obtain a candidate second solution until convergence includes: If the joint objective value is not less than a preset objective value threshold, then the steps of optimizing the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and using the candidate first solution to optimize the second model based on the second fitness function of the second model to obtain a candidate second solution are executed repeatedly until convergence. The joint objective function The formula is: 。 4. The method according to claim 1, characterized in that, Before optimizing the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and then optimizing the second model using the candidate first solution to obtain a candidate second solution via the second fitness function of the second model, the method further includes: The first objective function is determined based on the battery allocation quantification index selected by the user; The second objective function is determined based on the vehicle scheduling quantification index selected by the user.
5. The method according to claim 4, characterized in that, The user-selected battery allocation quantification metric is to maximize the battery scheduling satisfaction rate between sites, and the user-selected vehicle scheduling quantification metric is to maximize revenue.
6. The method according to claim 1, characterized in that, The step of optimizing the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and then using the candidate first solution to optimize the second model based on the second fitness function of the second model to obtain a candidate second solution, includes: The first solution is input into the first interaction function to evaluate the first evaluation value of the battery transport vehicle route planning output by the second model. The first fitness of the first model is calculated based on the first evaluation value and the first fitness function. The first solution is then optimized based on the first evaluation value and the first fitness to generate the candidate first solution. The candidate first solution is input into the second interaction function to obtain the matching value between the second solution and the candidate first solution. The second fitness of the second model is calculated based on the matching value and the second fitness function. The second solution is then optimized based on the matching value and the second fitness to generate the candidate second solution.
7. The method according to claim 1, characterized in that, The determination of the first solution of the first model for inter-site battery allocation and the second solution of the second model for inter-site battery transport vehicle route planning includes: Based on preset battery allocation constraints, the corresponding battery scheduling parameters for each of the multiple charging and swapping stations are determined. The battery scheduling parameters include the input and output parameters for full batteries, as well as the input and output parameters for empty batteries. Based on preset vehicle scheduling constraints, vehicle scheduling parameters corresponding to each of the multiple battery transfer vehicles are determined. The vehicle scheduling parameters include the loading and unloading parameters of the battery transfer vehicles for loading and unloading full batteries at the multiple charging and swapping stations, as well as the loading and unloading parameters of empty batteries.
8. A two-layer model collaborative optimization device based on battery scheduling and vehicle routing, characterized in that, include: The initial solution determination module is used to determine the first solution of the first model for battery allocation between sites and the second solution of the second model for battery transport vehicle route planning between sites. The model co-optimization module is used to optimize the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and to optimize the second model based on the second fitness function of the second model using the candidate first solution to obtain a candidate second solution. The first fitness function is obtained by weighted combination of the first objective function and the first interaction function of the first model, and the second fitness function is obtained by weighted combination of the second objective function and the second interaction function of the second model. The optimization decision determination module is used to repeatedly execute the steps of optimizing the first model based on the second solution and the first fitness function of the first model to obtain a candidate first solution, and using the candidate first solution to optimize the second model based on the second fitness function of the second model to obtain a candidate second solution until convergence.
9. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing computer-readable instructions, and the processor being configured to execute the computer-readable instructions, wherein the computer-readable instructions, when executed, perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing computer-executable instructions for performing the method according to any one of claims 1 to 7.