Deployment method of battery swapping stations in areas with no historical data based on electric two-wheeler traffic flow
By constructing a traffic generation method for electric two-wheeled vehicles based on a denoising diffusion probability model and simulated annealing algorithm, the complexity and non-convexity issues of battery swapping station deployment in areas without historical data are solved, and the efficient and reasonable deployment of battery swapping stations in areas with electric two-wheeled vehicles is realized.
Patent Information
- Application Number
- CN202411609428.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-11-12
AI Technical Summary
In areas without historical data, the generation of traffic flow for electric two-wheeled vehicles is complex and difficult to be accurate, resulting in poor practicality of battery swapping station deployment and poor efficiency in solving optimization problems. In particular, the non-convexity of the problem increases the difficulty of finding local optima.
Based on historical data of areas where battery swapping stations have been deployed, a generative model is constructed by combining a denoising diffusion probability model. The simulated annealing algorithm is used to solve the battery swapping station deployment optimization problem. The generative model is used to generate the traffic flow of electric two-wheeled vehicles. Complex spatiotemporal dependencies are captured by urban knowledge graph and spatiotemporal module. The battery swapping station deployment optimization problem is constructed to balance the number of stations and coverage.
This improves the practicality and efficiency of deploying battery swapping stations for electric two-wheelers in the region, ensures a balance between the number of stations and traffic flow, avoids over-construction, reduces construction and operation costs, and shortens the decision-making cycle.
Smart Images

Figure CN119476618B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of battery swapping technology for electric two-wheeled vehicles, and more specifically to a method for deploying battery swapping stations in areas without historical data based on the traffic flow of electric two-wheeled vehicles. Background Technology
[0002] Electric two-wheelers have become an important mode of transportation for short-distance travel due to their speed, convenience, and environmental friendliness. However, traditional charging methods for two-wheeled electric vehicles pose serious fire safety issues due to long charging times and unregulated charging locations. Therefore, an innovative battery-sharing and swapping model has emerged, achieving rapid and safe energy replenishment through "swapping instead of charging." In recent years, the battery swapping industry has entered a period of rapid development, prompting companies providing battery swapping services to expand their operations to new urban areas. During this expansion, the deployment of new battery swapping stations becomes crucial. A well-designed deployment plan for battery swapping stations is essential to ensuring a positive customer experience.
[0003] For battery swapping companies, there is a preference to place swapping stations in areas with high user activity. In the battery swapping scenario, regional traffic flow of two-wheeled electric vehicles is a type of urban data that describes the dynamic flow patterns of users between urban areas. Traffic flow includes inflow and outflow, representing the number of people entering or leaving a certain area within a given time interval. Regional traffic flow of two-wheeled electric vehicles can reflect the user activity in different areas. Generally, a large regional traffic flow of two-wheeled electric vehicles indicates high user activity, and the number of swapping stations in that area should also be large. However, there is a strong correlation between the size of regional traffic flow of two-wheeled electric vehicles and the deployment of swapping stations. Based on a large-scale real-world battery swapping dataset provided by a battery swapping company in a certain city, the applicant found that the Pearson index between the number of swapping stations near a region and the size of the electric two-wheeled vehicle traffic in that region is 0.715. That is to say, when using regional traffic flow to determine the deployment plan of swapping stations, the impact of different deployment plans on the regional traffic flow itself should be considered. However, regional traffic flow data is difficult to obtain before actual deployment of swapping stations, leading to a deadlock in the decision-making process for swapping station deployment in areas without historical data.
[0004] In recent years, generative artificial intelligence has developed rapidly. Among these, denoising diffusion probability models have received widespread attention across various fields, including computer vision, natural language processing, time series analysis, audio processing, graphics generation, and geospatial data generation, offering opportunities to address the deadlock dilemma in the deployment of battery swapping stations. Battery swapping companies have placed battery swapping stations in certain areas of cities and stored historical traffic data through hardware devices. Based on this historical data, a denoising diffusion probability model can be trained to generate regional traffic flow under different deployment schemes for areas where battery swapping stations are to be deployed (i.e., areas without historical data).
[0005] Against this backdrop, the applicant focuses on researching battery swapping station deployment schemes in areas lacking historical data. Specifically, a denoising and diffusion probability model is trained using data from already deployed battery swapping station areas, and corresponding regional traffic is generated for different battery swapping station deployment schemes in areas lacking historical data. However, implementing the above scheme faces the following challenges:
[0006] 1) The generation of electric two-wheeled vehicle traffic flow is highly complex. The accuracy of regional traffic flow generation directly affects the decision-making scheme for the deployment of battery swapping stations. However, regional traffic flow is not only affected by a combination of factors, such as user behavior, regional characteristics, and urban environment, but also has significant spatiotemporal dependence. Therefore, it is difficult to accurately measure electric two-wheeled vehicle traffic flow, resulting in poor practicality of subsequent regional battery swapping station deployment.
[0007] 2) The optimization problem of battery swapping station deployment is non-convex. Because the objective function contains multiple complex factors, such as the correlation between regional traffic and the number of battery swapping stations and the trade-off of coverage area, there are multiple local optima in the solution space. This increases the difficulty for the algorithm to escape local optima, resulting in poor accuracy and efficiency in solving the battery swapping station deployment optimization problem. Summary of the Invention
[0008] To address the shortcomings of existing technologies, the technical problem this invention aims to solve is: how to provide a method for deploying battery swapping stations in areas without historical data based on electric two-wheeled vehicle traffic flow. This method involves constructing and training a generative model based on the analysis results of historical data from already deployed battery swapping station areas, combined with a denoising diffusion probability model. This generates electric two-wheeled vehicle traffic flow data in the target area, improving the practicality of battery swapping station deployment in electric two-wheeled vehicle areas. Simultaneously, a battery swapping station deployment optimization problem is constructed for the target area to achieve a maximum balance between the correlation between the number of battery swapping stations and the traffic flow in the two-wheeled vehicle area and the coverage area of the battery swapping stations. This optimization problem is solved using a simulated annealing algorithm, thereby improving the accuracy and efficiency of solving the battery swapping station deployment optimization problem.
[0009] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0010] Deployment methods for battery swapping stations in areas with no historical data based on electric two-wheeler traffic flow include:
[0011] S1: Obtain regional characteristic data and environmental data related to battery swapping stations in the city;
[0012] S2: Based on the analysis results of historical data of the deployed battery swapping station area, a noise reduction and diffusion probability model is constructed and trained to generate a model;
[0013] The trained generative model is used to generate traffic flow of electric two-wheeled vehicles in the target area.
[0014] S3: To construct a battery swapping station deployment optimization problem for the target area that maximizes the balance between the correlation between the number of battery swapping stations and the traffic flow of two-wheeled vehicles in the area and the coverage of the battery swapping stations.
[0015] S4: Solve the battery swapping station deployment optimization problem using the simulated annealing algorithm to obtain the optimal battery swapping station deployment scheme;
[0016] In the process of solving step by step, the trained generative model is called to generate the traffic flow of electric two-wheeled vehicles in sync with the regional feature data and environmental data of the target area.
[0017] S5: Deploy swapping stations in the target area using the optimal swapping station deployment plan.
[0018] Preferably, in step S2, the processing steps for training the generative model are as follows:
[0019] S201: Obtain the raw data x0, the feature data of the deployed battery swapping station area, and the environmental data as training data;
[0020] S202: Input regional feature data and environmental data into the flow estimator to estimate the flow and output the predicted regional flow; construct a loss function by using the predicted regional flow and the actual regional flow, and optimize the flow estimator model parameters until the loss function value tends to stabilize;
[0021] S203: Forward diffusion is achieved by adding randomly sampled noise ε to the original data x0 to obtain noise data;
[0022] Among them, the noise data conforms to the predicted regional flow rate output by the flow estimator. The normal distribution;
[0023] S204: Input the constructed city knowledge graph and the sampled noise data into the denoising network for denoising and restoration, and predict the noise level of the corresponding sampling step.
[0024] S205: Through predicted noise Construct a loss function with the noise ε, and then optimize the model parameters of the denoising network in reverse.
[0025] S206: Repeat steps S203 to S205 until the loss function value tends to stabilize.
[0026] Preferably, in step S202, the flow estimator consists of a two-layer feedforward neural network, with the Leaky ReLU activation function and the loss function being...
[0027] The output of the flow estimator is the predicted regional flow. Combine regional characteristic data with predicted regional flow After being processed by fully connected layers, the features are concatenated, and the concatenated features are used as input conditions into the denoising network.
[0028] Preferably, in step S203, the forward diffusion step is as follows:
[0029] In the original denoising diffusion probability model, for the original data x0, the data after adding noise in step t is x. t The noise addition process is represented as Where: ε t-1 This indicates that the sample is taken from a standard normal distribution, i.e., ε ~ N(0,I); β t The variance represents the added noise;
[0030] Define β t =1-α t The noise-adding process is then rewritten as follows: in
[0031] The generated noise data x T It conforms to a perfect standard normal distribution, i.e., x T ~N(0,I).
[0032] The original denoising diffusion probability model was modified so that the noise data generated in each region conformed to the predicted regional flow whose mean was the output of the flow estimator. The normal distribution of the noise data
[0033] Preferably, in step S204, the city knowledge graph is used to model the urban environment, including the following five facts:
[0034] <region BorderBy region> This indicates the adjacency relationship between regions;
[0035] <region NearBy region> This indicates the proximity relationship between regions;
[0036] <region SimilarFunc region> This indicates the functional similarity relationship between regions;
[0037] <POI LocateAt region> This indicates the region to which the POI belongs;
[0038] <POI CateOf category> This indicates the category to which the POI belongs;
[0039] One type of fact is a triple containing a head entity, a relation, and a tail entity.
[0040] Preferably, in step S204, the denoising network is built based on the DiffWave model, and the bidirectional dilated convolutional blocks in the DiffWave model are replaced with knowledge-enhanced spatiotemporal modules.
[0041] The knowledge-enhanced spatiotemporal module includes a spatial module and a temporal module. The spatial module uses a single-layer R-GCN, and the temporal module uses a Transformer layer. An attention mechanism is used to fuse the outputs of the spatial and temporal modules. The city knowledge graph is converted into a city knowledge graph through TuckER and embedded as a query for the attention mechanism to guide the fusion process.
[0042] Preferably, in step S205, the formula for calculating the loss function is expressed as follows:
[0043]
[0044] Preferably, in step S2, after the generative model is trained, the traffic flow of electric two-wheeled vehicles is generated through the following steps:
[0045] S211: Input the regional characteristic data of the target area into the flow estimator for flow estimation, and output the predicted regional flow.
[0046] p;
[0047] S212: Based on predicted regional flow From obedience Sampling noise data from a normal distribution;
[0048] S213: Input the sampled noise data into the trained denoising network for denoising and restoration, and generate denoised data as the traffic flow of electric two-wheeled vehicles.
[0049] Preferably, in step S3, the battery swapping station deployment optimization problem is expressed as:
[0050] Objective function:
[0051] Cost constraints:
[0052] Battery swapping station quantity constraints:
[0053] in:
[0054] r = corr(Flow) TR ,X TR );
[0055]
[0056] e j =l j+bss j +m j ;
[0057] In the formula: α represents the variable used to adjust for the importance of correlation and service coverage of battery swapping stations; r represents the correlation between the number of battery swapping stations and regional traffic flow; cov total This represents the union of the service coverage areas of the battery swapping stations. The service coverage area of the battery swapping stations is calculated as follows: If region r j If there is a battery swapping station, then take r. j The center point position c j Set the service radius r; e j B represents the deployment cost of the battery swapping station; C represents the total cost constraint; and D represents the upper limit on the number of battery swapping stations that can be deployed in each region to avoid unrealistic allocation of the number of battery swapping stations. ij This indicates whether the j-th battery swapping station is deployed in the i-th region, when x ij =1 represents deployment, x ij =0 indicates not deployed; Flow TR Indicates the flow of electric two-wheeled vehicles in the target area; Flow i This represents the traffic flow of electric two-wheeled vehicles in the i-th region of the target area; This represents the traffic flow of electric two-wheeled vehicles in the i-th region during the t-th time period; u t The factors influencing traffic flow in electric vehicle zones at different times are derived from user battery swapping habits, indicating the importance of traffic flow in each time period. t The closer the value is to 1, the more likely users are to swap batteries during that period, and the greater the impact on regional traffic flow during that period; j Indicates land cost; bss j This indicates the cost of purchasing battery swapping stations and batteries; m j This indicates the cost of subsequent maintenance.
[0058] Preferably, in step S4, the processing steps of the simulated annealing optimization algorithm include:
[0059] S401: Determine the initial solution S0, initial temperature T0, cooling coefficient ε, total cost constraint B, upper limit of the number of battery swapping stations deployed in the region C, maximum number of iterations N, and minimum temperature T for the simulated annealing optimization algorithm. min ;
[0060] S402: Initialization: Current solution S current ←S0, optimal solution S * ←S0, temperature T←T0, iteration number k←0;
[0061] S403: From the current solution S current A new solution S is generated in the neighborhood. new That is, change the current solution S currentGenerate a new solution S from partial regional feature data. new The solution refers to the deployment plan for battery swapping stations in the target area.
[0062] S404: When a new solution is found... new When satisfying the cost constraints of the battery swapping station deployment optimization problem: call the generative model to generate the current solution S. current And new interpretation S new The flow rate of electric two-wheeled vehicles is then substituted into the objective function of the battery swapping station deployment optimization problem to calculate the current solution S. current objective function value And the new interpretation S new objective function value
[0063] S405: Determine if the condition is met. If so, then accept the new solution S. current ←S new Otherwise, proceed to step S406.
[0064] S406: If the random number is satisfied Then accept the new solution S. current ←S new Otherwise, new interpretations will not be accepted.
[0065] S407: Use the generative model to generate the optimal solution S* for the electric two-wheeled vehicle traffic flow, and then substitute it into the objective function of the battery swapping station deployment optimization problem to calculate the objective function value of the optimal solution S*. When satisfied Update the optimal solution S at that time. * ←S current ;
[0066] S408: Update temperature T←ε·T, iteration count k←k+1;
[0067] S409: Determine if T>T is satisfied min If k < N: If so, return to step S403 and execute the next iteration; otherwise, end the iteration and output the optimal battery swapping station deployment scheme corresponding to the optimal solution S*.
[0068] Compared with existing technologies, the method for deploying battery swapping stations in areas with no historical data based on the traffic flow of electric two-wheeled vehicles in this invention has the following advantages:
[0069] This invention constructs and trains a generative model based on the analysis results of historical data from areas with deployed battery swapping stations, combined with a denoising diffusion probability model. The trained generative model can generate electric two-wheeled vehicle traffic flow based on regional feature data and environmental data of the target area. First, the denoising diffusion probability model generates high-quality data samples by progressively removing noise. In generating electric two-wheeled vehicle traffic flow, it can capture the nonlinear relationship between complex regional feature data (such as battery swapping station distribution, urban environment, and user behavior) and two-wheeled vehicle traffic flow, thus accurately generating electric two-wheeled vehicle traffic flow and improving the practicality of battery swapping station deployment in electric two-wheeled vehicle areas. Second, because the generative model learns the mapping from noise to data during training, it can generate reasonable electric two-wheeled vehicle traffic flow when faced with new and unseen regional feature data and urban data, and can adapt to dynamic changes in regional feature data and urban data. This generalization ability is particularly important for battery swapping station deployment in areas without historical data. Finally, this invention constructs a generative model based on the denoising diffusion probability model and the analysis results of historical data from areas with deployed battery swapping stations. First, an inverse denoising network for the generative model, composed of spatial and temporal modules, aims to better capture the complex spatiotemporal dependencies of electric two-wheeler traffic flow, thus considering the impact of battery swapping station distribution and user behavior on regional traffic flow. Second, an urban knowledge graph is constructed to simulate the urban environment and represent the complex relationships between entities. This urban knowledge graph is used as input to the denoising network of the generative model, and under the guidance of urban knowledge graph embedding, an attention mechanism is further utilized to fuse the spatiotemporal modules, thereby better capturing the impact of the urban environment on regional traffic flow. Third, a traffic estimator is used to pre-estimate the volume of electric two-wheeler traffic flow using regional features, thus better adapting to situations where there are significant differences in traffic flow between different regions.
[0070] This invention constructs a battery swapping station deployment optimization problem that maximizes the balance between the correlation between the number of battery swapping stations and the traffic flow in two-wheeled vehicle areas, and the coverage area of the battery swapping stations. First, by constructing the optimization problem, it ensures that the number and location of battery swapping stations are closely related to the traffic flow in two-wheeled vehicle areas, avoiding over-construction and resource waste, thereby improving the rationality of battery swapping station deployment in electric two-wheeled vehicle areas. Second, the optimization problem also considers the coverage area of the battery swapping stations, ensuring that as many two-wheeled vehicle users as possible can easily access the stations, which helps improve user satisfaction and station utilization. Finally, by balancing the number and coverage of battery swapping stations, this optimization problem can reduce the construction and operation costs of battery swapping stations while meeting user needs.
[0071] This invention addresses the non-convexity of this optimization problem by employing a simulated annealing algorithm. Firstly, the optimization problem of battery swapping station deployment involves multiple complex factors, such as the correlation between regional traffic flow and the number of swapping stations, and the trade-off between coverage area. The solution space contains multiple local optima, increasing the difficulty for the algorithm to escape these local optima. Simulated annealing, a heuristic search algorithm, introduces probabilistic approaches to the global optimum in large-scale non-convex optimization problems, thereby improving the accuracy and efficiency of solving the battery swapping station deployment optimization problem. Secondly, simulated annealing has a fast convergence speed, capable of finding a near-optimal battery swapping station deployment scheme in a short time, helping to shorten the decision-making cycle and thus improving the efficiency of battery swapping station deployment in electric two-wheeled vehicle areas. Finally, during the gradual optimization of the battery swapping station layout, a trained generative model is used to synchronously generate regional traffic flow, thereby improving the practicality of battery swapping station deployment in electric two-wheeled vehicle areas. Attached Figure Description
[0072] To make the objectives, technical solutions, and advantages of the invention clearer, the invention will now be described in further detail with reference to the accompanying drawings, wherein:
[0073] Figure 1 This is a network structure diagram for a method of deploying battery swapping stations in areas without historical data based on the traffic flow of electric two-wheeled vehicles.
[0074] Figure 2 This is a schematic diagram of a battery swapping system.
[0075] Figure 3 This represents the spatial distribution of electric two-wheeled vehicle traffic in a certain city.
[0076] Figure 4 The temporal distribution of electric two-wheeled vehicle traffic at different time scales: (a) is the hourly distribution, and (b) is the daily distribution.
[0077] Figure 5 The temporal distribution of electric two-wheeled vehicle traffic in the office area at different time scales: (a) is the hourly distribution, and (b) is the daily distribution.
[0078] Figure 6 The temporal distribution of electric two-wheeled vehicle traffic in residential areas at different time scales: (a) is the hourly distribution, and (b) is the daily distribution.
[0079] Figure 7 This is an architecture diagram for training the generative model.
[0080] Figure 8 Network structure diagram of the knowledge-enhancing spatiotemporal module. Detailed Implementation
[0081] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but only to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0082] The following detailed explanation illustrates the specific implementation methods:
[0083] Example:
[0084] This embodiment discloses a method for deploying battery swapping stations in areas without historical data based on the traffic flow of electric two-wheeled vehicles.
[0085] like Figure 1 As shown, the deployment method for battery swapping stations in areas with no historical data based on electric two-wheeler traffic flow includes:
[0086] S1: Obtain regional characteristic data and environmental data related to battery swapping stations in the city;
[0087] In this embodiment, the city is divided into I non-overlapping regions by the main road network.
[0088] Regional characteristic data includes the number of battery swapping stations within the region, the number of battery swapping stations in adjacent areas, the number of battery swapping stations in neighboring areas, and the density of POIs (Points of Interest) in ten categories—companies, education, entertainment, catering, government departments, residences, hotels, life services, medical care, and shopping—in adjacent and neighboring areas. Environmental data includes road network data and urban knowledge graph data.
[0089] S2: Based on the analysis results of historical data of the deployed battery swapping station area, combined with the denoising diffusion probabilistic models (DDPMs), a generative model is constructed and trained.
[0090] The trained generative model is used to generate traffic flow of electric two-wheeled vehicles in the target area.
[0091] S3: To construct a swapping station deployment optimization problem for the target area that maximizes the balance between the correlation between the number of swapping stations and the traffic flow of two-wheeled vehicles in the area and the coverage of swapping stations.
[0092] S4: Solve the battery swapping station deployment optimization problem using the simulated annealing algorithm to obtain the optimal battery swapping station deployment scheme;
[0093] In the process of solving step by step, the trained generative model is called to generate the traffic flow of electric two-wheeled vehicles in sync with the regional feature data and environmental data of the target area.
[0094] S5: Deploy swapping stations in the target area using the optimal swapping station deployment plan.
[0095] This invention constructs and trains a generative model based on the analysis results of historical data from areas with deployed battery swapping stations, combined with a denoising diffusion probability model. The trained generative model can generate electric two-wheeled vehicle traffic flow based on regional feature data and environmental data of the target area. First, the denoising diffusion probability model generates high-quality data samples by progressively removing noise. In generating electric two-wheeled vehicle traffic flow, it can capture the nonlinear relationship between complex regional feature data (such as battery swapping station distribution, urban environment, and user behavior) and two-wheeled vehicle traffic flow, thus accurately generating electric two-wheeled vehicle traffic flow and improving the practicality of battery swapping station deployment in electric two-wheeled vehicle areas. Second, because the generative model learns the mapping from noise to data during training, it can generate reasonable electric two-wheeled vehicle traffic flow when faced with new and unseen regional feature data and urban data, and can adapt to dynamic changes in regional feature data and urban data. This generalization ability is particularly important for battery swapping station deployment in areas without historical data. Finally, this invention constructs a generative model based on the denoising diffusion probability model and the analysis results of historical data from areas with deployed battery swapping stations. First, an inverse denoising network for the generative model, composed of spatial and temporal modules, aims to better capture the complex spatiotemporal dependencies of electric two-wheeler traffic flow, thus considering the impact of battery swapping station distribution and user behavior on regional traffic flow. Second, an urban knowledge graph is constructed to simulate the urban environment and represent the complex relationships between entities. This urban knowledge graph is used as input to the denoising network of the generative model, and under the guidance of urban knowledge graph embedding, an attention mechanism is further utilized to fuse the spatiotemporal modules, thereby better capturing the impact of the urban environment on regional traffic flow. Third, a traffic estimator is used to pre-estimate the volume of electric two-wheeler traffic flow using regional features, thus better adapting to situations where there are significant differences in traffic flow between different regions.
[0096] This invention constructs a battery swapping station deployment optimization problem that maximizes the balance between the correlation between the number of battery swapping stations and the traffic flow in two-wheeled vehicle areas, and the coverage area of the battery swapping stations. First, by constructing the optimization problem, it ensures that the number and location of battery swapping stations are closely related to the traffic flow in two-wheeled vehicle areas, avoiding over-construction and resource waste, thereby improving the rationality of battery swapping station deployment in electric two-wheeled vehicle areas. Second, the optimization problem also considers the coverage area of the battery swapping stations, ensuring that as many two-wheeled vehicle users as possible can easily access the stations, which helps improve user satisfaction and station utilization. Finally, by balancing the number and coverage of battery swapping stations, this optimization problem can reduce the construction and operation costs of battery swapping stations while meeting user needs.
[0097] This invention addresses the non-convexity of this optimization problem by employing a simulated annealing algorithm. Firstly, the optimization problem of battery swapping station deployment involves multiple complex factors, such as the correlation between regional traffic flow and the number of swapping stations, and the trade-off between coverage area. The solution space contains multiple local optima, increasing the difficulty for the algorithm to escape these local optima. Simulated annealing, a heuristic search algorithm, introduces probabilistic approaches to the global optimum in large-scale non-convex optimization problems, thereby improving the accuracy and efficiency of solving the battery swapping station deployment optimization problem. Secondly, simulated annealing has a fast convergence speed, capable of finding a near-optimal battery swapping station deployment scheme in a short time, helping to shorten the decision-making cycle and thus improving the efficiency of battery swapping station deployment in electric two-wheeled vehicle areas. Finally, during the gradual optimization of the battery swapping station layout, a trained generative model is used to synchronously generate regional traffic flow, thereby improving the practicality of battery swapping station deployment in electric two-wheeled vehicle areas.
[0098] To better illustrate the technical solution of the present invention, this embodiment is described in the following parts.
[0099] I. Traffic Flow Analysis of Electric Two-Wheeled Vehicles
[0100] Typical battery swapping systems include Figure 2 As shown, battery swapping companies deploy swapping stations throughout the city. Drivers arrive at a swapping station and exchange their low-charge battery for a high-charge battery in the swapping cabinet. The battery management system transmits relevant battery data via 4G / 5G to the cloud management platform of the battery swapping service provider. This provides battery trajectory data, which, when matched with areas defined by the city's road network, allows for the determination of electric two-wheeled vehicle traffic flow. The dataset in this example comes from a battery swapping company in a certain city, spanning from March 1st to March 31st, 2023. Data details are as follows.
[0101] Battery status data: This data comprises over 2000 shared batteries, collected through the battery management system on each battery. It primarily includes the battery ID, data timestamp, and battery GPS information. GPS data is updated every 15 minutes.
[0102] Battery swapping transaction data: describes the battery swapping record ID, user ID, transaction time, location of the battery swapping station, and the ID of the battery swapped in and out.
[0103] Battery swapping station data includes the station's ID, specific location, and construction timestamp.
[0104] Based on this real dataset, this embodiment analyzes the data characteristics of electric two-wheeler traffic flow to better utilize the generative model in new areas where historical traffic data is unavailable. The analysis details are as follows.
[0105] 1) The spatial distribution of regional flow is highly uneven. Figure 3 The average daily traffic volume of electric two-wheelers in different areas of Chengdu after road network segmentation was visualized. Traffic volume exhibits a clear clustering characteristic across different areas, showing high concentrations within multiple areas, while significant differences exist between different areas. Furthermore, this embodiment analyzes which regional characteristics influence electric two-wheeler traffic volume. The characteristics of each region were standardized using the z-score method to ensure consistency across regions. As shown in Table 1, regional traffic volume is closely related to the number and location of battery swapping stations, as well as the density and type of Points of Interest (POIs). These characteristics reflect the region's attractiveness to users and its overall prosperity, respectively.
[0106] Table 1. Regional Characteristics of the Top Five Regions by Pearson Correlation Coefficient.
[0107]
[0108] 2) User-oriented time distribution. The user group for battery swapping services is primarily on-demand delivery personnel who frequently use electric two-wheelers. Therefore, the regional traffic time distribution is closely related to people's food delivery behavior patterns. For example... Figure 4 As shown in (a), traffic is concentrated during the day, with two peak periods: 12-1 PM and 6-7 PM. 12-1 PM is the highest peak, and also the peak time for people to order takeout. Figure 4 As shown in (b), the weekly time pattern is similar to the daily time pattern, with the daily average flow distribution showing the same peak periods.
[0109] 3) The spatiotemporal dependence of regional traffic is highly complex and varies significantly. On the one hand, the regional traffic of two-wheeled vehicles is influenced by neighboring areas, exhibiting spatial dependence; on the other hand, the regional traffic with similar urban functions shows similar temporal patterns, indicating that regional traffic is also significantly affected by the urban environment. Figure 5 (a) Figure 5 (b) represents the daily and weekly traffic patterns for the office area, respectively. Figure 6 (a) Figure 6 (b) Represents the daily and weekly traffic patterns in residential areas, respectively. In office areas, the ratio of peak traffic at noon to peak traffic is higher, indicating a preference for ordering food at lunchtime on weekdays. The number of people ordering takeout decreases starting on Fridays, with a more significant decrease on weekends. Compared to office areas, residents in residential areas order takeout more frequently in the mornings and evenings. Saturday noon is the peak time for takeout orders throughout the week.
[0110] II. Electric Two-Wheeled Vehicle Traffic Generation Model
[0111] To better utilize the denoising diffusion probability model, this embodiment constructs a generative model based on the analysis results of historical data from deployed battery swapping station areas. The denoising network structure of the generative model is closely integrated with the characteristics of the data to be generated. The overall architecture of the model is as follows: Figure 7 As shown. A detailed description of the model is as follows.
[0112] 1) Denoising Diffusion Probability Model. The electric two-wheeler traffic generation model is based on the denoising diffusion probability model. As one of the most advanced generative models, it comprises two interconnected processes: a predefined forward process that maps the original data x0 to a simpler prior distribution (standard normal distribution) by adding noise ε; and a denoising inference backward process that uses a denoising network to predict the noise. Reverse the effects of the forward process to reconstruct the data from the standard normal distribution.
[0113] In the forward denoising process, the diffusion model is divided into multiple time steps, linearly combining the initial data with randomly sampled Gaussian noise. In the original denoising diffusion probability model, for the original data x0, the data after denoising at step t is x t The noise addition process is represented as Where: ε t-1 This indicates that the sample is taken from the standard normal distribution, i.e., ε ~ N(0,I), where I represents the identity matrix; β t The variance of the added noise is represented by a scheduling method that predefines the value of β.
[0114] Define β t =1-α t The noise-adding process is then rewritten as follows: in
[0115] Generated completely noisy data x T It conforms to a perfect standard normal distribution, i.e., x T ~N(0,I).
[0116] To make the generated flow rate more accurate, the original denoising diffusion probability model was modified so that the generated completely noisy data for each region conforms to the predicted regional flow rate output by the flow estimator, with the mean value being the mean value. The normal distribution of the noise data
[0117] In the backward denoising process, x0 is recovered from a perfectly normal distribution. Considering q(x t-1 |x t This distribution is difficult to solve directly, so this embodiment uses a neural network to learn it, i.e., p. θ (x t-1 |x t Ultimately, this process can be represented as... In fact, it can be viewed as learning noise ε θ (x t The core of training is constructing the loss function. Minimize the error between the model's predicted noise and the actual noise, specifically: In actual sampling, noise is gradually removed starting from t=T, eventually generating x0.
[0118] 2) Flow Estimator Based on Regional Features. The basic denoising diffusion probability model maps the data distribution uniformly to a standard normal distribution. However, this is not suitable for situations where flow differences between regions are significant. Therefore, a flow estimator is used to pre-estimate the flow of electric two-wheelers based on regional features. The estimated result serves as the mean of the Gaussian distribution to be mapped during the forward process, thus distinguishing different regions. Specifically, the data generated in the final noisy step follows a distribution x. T ~N(p,I), where p is the preset electric vehicle area flow rate output by the trained flow estimator for different area features.
[0119] The flow estimator consists of a two-layer feedforward neural network, using the Leaky ReLU activation function and a loss function of... The output of the flow estimator is the predicted regional flow. Combine regional characteristic data with predicted regional flow After being processed by fully connected layers, the features are concatenated, and the concatenated features are used as input conditions into the denoising network.
[0120] 3) Urban Knowledge Graph Construction. To better capture the complex spatiotemporal dependencies of electric two-wheeler traffic flow, an urban knowledge graph is constructed to model the urban environment and capture the complex relationships between entities. The urban knowledge graph consists of five facts, each fact being a triple containing a head entity, a relation, and a tail entity. These five facts are as follows:
[0121] <region BorderBy region> This indicates the adjacency relationship between regions;
[0122] <region NearBy region> This indicates the proximity relationship between regions;
[0123] <region SimilarFunc region> This indicates the functional similarity relationship between regions;
[0124] <POI LocateAt region> This indicates the region to which the POI belongs;
[0125] <POI CateOf category> This indicates the category to which the POI belongs;
[0126] This city knowledge graph represents the adjacency, proximity, and functional area similarity relationships between regions, indicating the region and category to which a POI belongs.
[0127] 4) Knowledge-enhanced denoising network. The core of the denoising probabilistic model is the structure of an inverse denoising network. The denoising network is built on the DiffWave model, replacing the bidirectional dilated convolutional blocks in the DiffWave model with knowledge-enhanced spatiotemporal modules;
[0128] like Figure 8 As shown, the knowledge enhancement spatiotemporal module includes a spatial module and a temporal module. The spatial module adopts a 1-layer R-GCN, and the temporal module adopts a Transformer layer. The outputs of the spatial module and the temporal module are fused using an attention mechanism. The city knowledge graph is converted into a city knowledge graph by TuckER and embedded as a query of the attention mechanism to guide the fusion process.
[0129] In this embodiment, the knowledge-enhanced spatiotemporal module is better able to capture the spatiotemporal dependencies of data in this scenario, thereby generating traffic flow data for electric two-wheeled vehicles.
[0130] In this embodiment, the DiffWave model is based on the diffusion probability model and uses the fixed steps of a Markov chain to convert white noise signals into structured waveforms. The DiffWave network model mainly consists of the following modules:
[0131] Initial noise sampling module: Samples initial noise from a standard Gaussian distribution as the starting point for waveform generation.
[0132] Denoising Module: Through a series of denoising steps, noise is gradually converted into target audio. Each denoising step is completed by a neural network model, which takes the noise signal at the current moment and time step information as input, and outputs an audio signal estimate for the corresponding moment to guide the next step of denoising.
[0133] Bidirectional dilated convolution module: This is a unique module in the DiffWave model. Unlike the WaveNet architecture, it avoids the one-way error and error accumulation problems of autoregressive models. The bidirectional dilated convolution module enables the network to process input signals in parallel, improving the generation speed.
[0134] Local Conditioner Module (Optional): In speech synthesis systems, neural vocoders can synthesize corresponding waveforms based on local conditional information (such as aligned semantic features or spectrograms). DiffWave supports synthesizing corresponding sounds based on Mel spectrograms, a function implemented through the local conditioner module.
[0135] Combination Figure 7 As shown, the processing steps for training the generative model are as follows:
[0136] S201: Obtain the raw data x0, the feature data of the deployed battery swapping station area, and the environmental data as training data;
[0137] S202: Input regional feature data and environmental data into the flow estimator to estimate the flow and output the predicted regional flow; construct a loss function by using the predicted regional flow and the actual regional flow, and optimize the flow estimator model parameters until the loss function value tends to stabilize;
[0138] S203: Forward diffusion is achieved by adding randomly sampled noise ε to the original data x0 to obtain noise data;
[0139] Among them, the noise data conforms to the predicted regional flow rate output by the flow estimator. The normal distribution;
[0140] S204: Input the constructed city knowledge graph and the sampled noise data into the denoising network for denoising and restoration, and predict the noise level of the corresponding sampling step.
[0141] S205: Through predicted noise Construct a loss function with the noise ε, and then optimize the model parameters of the denoising network in reverse.
[0142] S206: Repeat steps S203 to S205 until the loss function value tends to stabilize.
[0143] Specifically, after the generative model is trained, the traffic flow of electric two-wheeled vehicles is generated through the following steps:
[0144] S211: Input the regional characteristic data of the target area into the flow estimator for flow estimation, and output the predicted regional flow.
[0145] S212: Based on predicted regional flow From obedience Sampling noise data from a normal distribution;
[0146] S213: Input the sampled noise data into the trained denoising network for denoising and restoration, and generate denoised data as the traffic flow of electric two-wheeled vehicles.
[0147] This invention constructs a generative model based on a denoised diffusion probability model and incorporating historical data analysis of deployed battery swapping station areas. First, an inverse denoising network for the generative model, composed of spatial and temporal modules, aims to better capture the complex spatiotemporal dependencies of electric two-wheeler traffic flow, thus considering the impact of battery swapping station distribution and user behavior on regional traffic flow. Second, an urban knowledge graph is constructed to simulate the urban environment and represent the complex relationships between entities. This urban knowledge graph is used as input to the denoising network of the generative model, and under the guidance of urban knowledge graph embedding, an attention mechanism is further utilized to fuse the spatiotemporal modules, thereby better capturing the impact of the urban environment on regional traffic flow. Third, a traffic estimator uses regional features to pre-estimate the size of electric two-wheeler traffic flow, making it better suited for situations with significant differences in traffic flow between different regions.
[0148] III. Modeling the Deployment Optimization Problem of Battery Swapping Stations
[0149] After obtaining the trained electric two-wheeled vehicle traffic generation model, the model is used to optimize the deployment of actual battery swapping stations. Therefore, this embodiment establishes an optimization model for battery swapping station deployment, aiming to comprehensively maximize the correlation between the number of battery swapping stations and regional traffic flow, as well as the coverage area of the battery swapping stations.
[0150] 1. Define the urban region. The city is divided into I non-overlapping regions by the main road network. Further, R = {r1, r2, ..., r...} I} represents the set of all regions of a city, R TR ={r1,r2,...,r m}∈R represents m target areas awaiting the deployment of battery swapping stations, R SR ={r m+1 ,r m+2 ,...,r I}∈R represents the remaining source areas where battery swapping stations have been deployed.
[0151] 2. Define the flow rate of electric two-wheeled vehicles. F i =[f i 1 ,f i 2 ,...f i T ] represents the traffic flow in the i-th region. Where, f i t This represents the flow rate of electric two-wheeled vehicles (i.e., the average inflow and outflow) during the t-th time interval of a day, reflecting the user activity level in that area during that period. For convenience, F is used. SR R represents SR The collection of electric two-wheeled vehicle traffic in the source area.
[0152] 3. Define a battery swapping station. Assume the number of battery swapping stations waiting to be deployed is J, and the tuple w... j =(g j ,e j ) represents the j-th battery swapping station.
[0153] Among them, g j ∈R represents the location of the battery swapping station, e j This represents the deployment cost of a battery swapping station. Specifically, e j It consists of three parts:
[0154] e j =l j +bss j +m j ;
[0155] Among them, l j For land costs, BSS j To cover the cost of purchasing battery swapping stations and batteries, m j This is for later maintenance costs.
[0156] 4. Define the battery swapping station deployment plan. Matrix X = [x ij ] I×J This represents the deployment scheme of battery swapping stations, where the variable x ij This indicates whether the j-th battery swapping station is deployed in the i-th region, when x ij =1 represents deployment, x ij =0 indicates not deployed. For convenience, X TR Represents the target area R TR Deployment plan, X SR Representing the source region R SR The actual deployment plan.
[0157] 5. Define the generation of electric two-wheeled vehicle traffic flow. f(·) represents the generation model for region r.j ∈R TR Traffic generation can be represented as:
[0158]
[0159] Among them, D SR and D TR They represent the environmental information and regional characteristics of their respective included areas.
[0160] 6. Define the battery swapping station deployment optimization problem. This problem aims to maximize both the correlation between the number of battery swapping stations and regional traffic flow, as well as the service coverage of the battery swapping stations. The correlation between the number of battery swapping stations and regional traffic flow is defined as follows:
[0161] r = corr(Flow) TR X TR );
[0162] Flow TR =[Flow1, Flow2,...,Flow m ] represents the flow vector of the target region. Further, the flow magnitude of the i-th region is defined as:
[0163]
[0164] u t The factors influencing traffic flow in electric vehicle areas at different times are derived from users' battery swapping habits, representing the importance of traffic flow in each time period. t The closer the value is to 1, the more likely users are to swap batteries during that time period, and the greater the impact on regional traffic during that period. The service coverage of a battery swapping station is calculated as follows: if r j If there is a battery swapping station, then take r. j The center point position c j Set the service radius r, and for all areas where battery swapping stations are deployed, calculate the union of the network service coverage areas of the battery swapping stations and represent it as CoV. total .
[0165] Therefore, the problem of optimizing the deployment of battery swapping stations can be expressed as:
[0166] Objective function:
[0167] Cost constraints:
[0168] Battery swapping station quantity constraints:
[0169] in:
[0170] r = corr(Flow) TR XTR );
[0171]
[0172] e j =l j +bss j +m j ;
[0173] In the formula: α represents the variable used to adjust for the importance of correlation and service coverage of battery swapping stations; r represents the correlation between the number of battery swapping stations and regional traffic; Cov total The union of the service coverage areas of the battery swapping stations (to eliminate the influence of different dimensions, the coordinates of the cov) represents the total area covered by the battery swapping stations. total (After normalization processing), the calculation method for the service coverage of a battery swapping station is as follows: if region r j If there is a battery swapping station, then take r. j The center point position c j Set the service radius r; e j B represents the deployment cost of the battery swapping station; C represents the total cost constraint; and D represents the upper limit on the number of battery swapping stations that can be deployed in each region to avoid unrealistic allocation of the number of battery swapping stations. ij This indicates whether the j-th battery swapping station is deployed in the i-th region, when x ij =1 represents deployment, x ij =0 indicates not deployed; Flow TR Indicates the flow of electric two-wheeled vehicles in the target area; Flow i This represents the traffic flow of electric two-wheeled vehicles in the i-th region of the target area; This represents the traffic flow of electric two-wheeled vehicles in the i-th region during the t-th time period; u t The factors influencing traffic flow in electric vehicle zones at different times are derived from user battery swapping habits, indicating the importance of traffic flow in each time period. t The closer the value is to 1, the more likely users are to swap batteries during that period, and the greater the impact on regional traffic flow during that period; j Indicates land cost; bss j This indicates the cost of purchasing battery swapping stations and batteries; m j This indicates the cost of subsequent maintenance.
[0174] IV. Simulated Annealing Optimization Algorithm
[0175] In this embodiment, the simulated annealing algorithm is used to solve the non-convex optimization problem of the battery swapping station deployment optimization problem. In the process of gradually approaching the global optimal solution, the synchronous generation of electric two-wheeled vehicle traffic is achieved.
[0176] Since the battery swapping station site selection problem is a complex non-convex optimization problem, and is constrained by multiple conditions such as deployment cost and regional upper limits, it is difficult to find the global optimum in polynomial time. To effectively solve this problem, this embodiment employs an optimization algorithm based on simulated annealing. To achieve synchronous generation of electric two-wheeled vehicle traffic flow, for each possible battery swapping station deployment scheme, regional features are calculated and a regional feature vector is generated, which is then input into the traffic estimator of the generation model. Specifically, the following are modified in the regional features: 1) the number of battery swapping stations in the region; 2) the number of battery swapping stations in adjacent regions; and 3) the number of battery swapping stations in neighboring regions. At this point, the generation model generates regional traffic flow for the battery swapping station deployment scheme and then calculates the scheme's... Value. During the iterative process of simulated annealing, the electric two-wheeler traffic flow is generated and calculated by continuously calling the model. To obtain the optimal deployment plan for battery swapping stations.
[0177] Specifically, the processing steps of the simulated annealing optimization algorithm include:
[0178] S401: Determine the initial solution S0, initial temperature T0, cooling coefficient ε, total cost constraint B, upper limit of the number of battery swapping stations deployed in the region C, maximum number of iterations N, and minimum temperature T for the simulated annealing optimization algorithm. min ;
[0179] S402: Initialization: Current solution S current ←S0, optimal solution S * ←S0, temperature T←T0, iteration number k←0;
[0180] S403: From the current solution S current A new solution S is generated in the neighborhood. new That is, change the current solution S current Generate a new solution S from partial regional feature data. new The solution refers to the deployment plan for battery swapping stations in the target area.
[0181] In this embodiment, the following features are changed: 1) the number of battery swapping stations in the region; 2) the number of battery swapping stations in the adjacent region; and 3) the number of battery swapping stations in the neighboring region.
[0182] S404: When a new solution is found... new When satisfying the cost constraints of the battery swapping station deployment optimization problem: call the generative model to generate the current solution S. current And new interpretation S new The flow rate of electric two-wheeled vehicles is then substituted into the objective function of the battery swapping station deployment optimization problem to calculate the current solution S. current objective function value And the new interpretation S new objective function value
[0183] S405: Determine if the condition is met. If so, then accept the new solution S. current ←S new Otherwise, proceed to step S406.
[0184] S406: Determine whether to accept the new solution based on the Metropolis acceptance criterion. That is, based on probability. Accept new solutions: if they satisfy the random number... Then accept the new solution S. current ←S new Otherwise, new interpretations will not be accepted.
[0185] S407: Use the generative model to generate the optimal solution S* for the electric two-wheeled vehicle traffic flow, and then substitute it into the objective function of the battery swapping station deployment optimization problem to calculate the objective function value of the optimal solution S*. When satisfied Update the optimal solution S at that time. * ←S current ;
[0186] S408: Update temperature T←ε·T, iteration count k←k+1;
[0187] S409: Determine if T>T is satisfied min If k < N: If so, return to step S403 and execute the next iteration; otherwise, end the iteration and output the optimal battery swapping station deployment scheme corresponding to the optimal solution S*.
[0188] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit the technical solutions. Those skilled in the art should understand that any modifications or equivalent substitutions to the technical solutions of the present invention without departing from the spirit and scope of the present invention should be covered within the scope of the claims of the present invention.
Claims
1. A method for deploying battery swapping stations in areas with no historical data based on the traffic flow of electric two-wheeled vehicles, characterized in that: include: S1: Obtain regional characteristic data and environmental data related to battery swapping stations in the city; S2: Based on the analysis results of historical data of the deployed battery swapping station area, a noise reduction and diffusion probability model is constructed and trained to generate a model; The trained generative model is used to generate traffic flow of electric two-wheeled vehicles in the target area. In step S2, the processing steps for training the generative model are as follows: S201: Obtain the raw data x0, the feature data of the deployed battery swapping station area, and the environmental data as training data; S202: Input regional feature data and environmental data into the flow estimator to estimate the flow and output the predicted regional flow; construct a loss function by using the predicted regional flow and the actual regional flow, and optimize the flow estimator model parameters until the loss function value tends to stabilize; S203: Forward diffusion is achieved by adding randomly sampled noise ε to the original data x0 to obtain noise data; Among them, the noise data conforms to the predicted regional flow rate output by the flow estimator. The normal distribution; S204: Input the constructed city knowledge graph and the sampled noise data into the denoising network for denoising and restoration, and predict the noise level of the corresponding sampling step. In step S204, the denoising network is built based on the DiffWave model, and the bidirectional dilated convolutional blocks in the DiffWave model are replaced with knowledge-enhanced spatiotemporal modules. The knowledge-enhanced spatiotemporal module includes a spatial module and a temporal module. The spatial module uses a single-layer R-GCN, and the temporal module uses a Transformer layer. An attention mechanism is used to fuse the outputs of the spatial and temporal modules. The city knowledge graph is converted into a city knowledge graph using TuckER and embedded as a query for the attention mechanism to guide the fusion process. S205: Through predicted noise Construct a loss function with the noise ε, and then optimize the model parameters of the denoising network in reverse. S206: Repeat steps S203 to S205 until the loss function value tends to stabilize; S3: To construct a swapping station deployment optimization problem for the target area that maximizes the balance between the correlation between the number of swapping stations and the traffic flow of two-wheeled vehicles in the area and the coverage of swapping stations. In step S3, the optimization problem for the deployment of battery swapping stations is expressed as follows: Objective function: Cost constraints: Battery swapping station quantity constraints: in: r=corr(Flow TR ,X TR ); e j =l j +bss j +m j ; In the formula: α represents the variable used to adjust for the importance of correlation and service coverage of battery swapping stations; r represents the correlation between the number of battery swapping stations and regional traffic flow; cov total This represents the union of the service coverage areas of the battery swapping stations. The service coverage area of the battery swapping stations is calculated as follows: If region r j If there is a battery swapping station, then take r. j The center point position c j Set the service radius r; e j B represents the deployment cost of a battery swapping station; C represents the total cost constraint; and D represents the upper limit on the number of battery swapping stations that can be deployed in each region to avoid unrealistic allocation of battery swapping stations. ij This indicates whether the j-th battery swapping station is deployed in the i-th region, when x ij =1 represents deployment, x ij =0 indicates not deployed; Flow TR Indicates the flow of electric two-wheeled vehicles in the target area; Flow i This represents the traffic flow of electric two-wheeled vehicles in the i-th region of the target area; This represents the traffic flow of electric two-wheeled vehicles in the i-th region during the t-th time period; u t The factors influencing traffic flow in electric vehicle zones at different times are derived from user battery swapping habits, indicating the importance of traffic flow in each time period. t The closer the value is to 1, the more likely users are to swap batteries during that period, and the greater the impact on regional traffic flow during that period; j Indicates land cost; bss j This indicates the cost of purchasing battery swapping stations and batteries; m j Indicates the cost of subsequent maintenance; S4: Solve the battery swapping station deployment optimization problem using the simulated annealing algorithm to obtain the optimal battery swapping station deployment scheme; In the process of solving step by step, the trained generative model is called to generate the traffic flow of electric two-wheeled vehicles in sync with the regional feature data and environmental data of the target area. S5: Deploy swapping stations in the target area using the optimal swapping station deployment plan.
2. The method for deploying battery swapping stations in areas without historical data based on the traffic flow of electric two-wheeled vehicles as described in claim 1, characterized in that: In step S202, the flow estimator consists of a two-layer feedforward neural network, with the Leaky ReLU activation function and the loss function being... The output of the flow estimator is the predicted regional flow. Combine regional characteristic data with predicted regional flow After being processed by fully connected layers, the features are concatenated, and the concatenated features are used as input conditions into the denoising network.
3. The method for deploying battery swapping stations in areas without historical data based on the traffic flow of electric two-wheeled vehicles as described in claim 2, characterized in that: In step S203, the forward diffusion process is as follows: In the original denoising diffusion probability model, for the original data x0, the data after adding noise in step t is x. t The noise addition process is represented as Where: ε t-1 This indicates that the sample is taken from a standard normal distribution, i.e., ε ~ N(0,I); β t The variance represents the added noise; Define β t =1-α t The noise-adding process is then rewritten as follows: in The generated noise data x T It conforms to a perfect standard normal distribution, i.e., x T ~N(0,I); The original denoising diffusion probability model was modified so that the noise data generated in each region conformed to the predicted regional flow whose mean was the output of the flow estimator. The normal distribution of the noise data 4. The method for deploying battery swapping stations in areas without historical data based on the traffic flow of electric two-wheeled vehicles as described in claim 1, characterized in that: In step S204, the city knowledge graph is used to model the urban environment, including the following five facts: <region BorderBy region> This indicates the adjacency relationship between regions; <region NearBy region> This indicates the proximity relationship between regions; <region SimilarFunc region> This indicates the functional similarity relationship between regions; <POI LocateAt region> This indicates the region to which the POI belongs; <POI CateOf category> This indicates the category to which the POI belongs; One type of fact is a triple containing a head entity, a relation, and a tail entity.
5. The method for deploying battery swapping stations in areas without historical data based on the traffic flow of electric two-wheeled vehicles as described in claim 1, characterized in that: In step S205, the formula for calculating the loss function is expressed as follows:
6. The method for deploying battery swapping stations in areas without historical data based on the traffic flow of electric two-wheeled vehicles as described in claim 1, characterized in that: In step S2, after the generative model is trained, the traffic flow of electric two-wheeled vehicles is generated through the following steps: S211: Input the regional characteristic data of the target area into the flow estimator for flow estimation, and output the predicted regional flow. S212: Based on predicted regional flow From obedience Sampling noise data from a normal distribution; S213: Input the sampled noise data into the trained denoising network for denoising and restoration, and generate denoised data as the traffic flow of electric two-wheeled vehicles.
7. The method for deploying battery swapping stations in areas without historical data based on the traffic flow of electric two-wheeled vehicles as described in claim 1, characterized in that: In step S4, the processing steps of the simulated annealing optimization algorithm include: S401: Determine the initial solution S0, initial temperature T0, cooling coefficient ε, total cost constraint B, upper limit of the number of battery swapping stations deployed in the region C, maximum number of iterations N, and minimum temperature T for the simulated annealing optimization algorithm. min ; S402: Initialization: Current solution S current ←S0, optimal solution S * ←S0, temperature T←T0, iteration number k←0; S403: From the current solution S current A new solution S is generated in the neighborhood. new That is, change the current solution S current Generate a new solution S from partial regional feature data. new The solution refers to the deployment plan for battery swapping stations in the target area. S404: When a new solution is found... new When satisfying the cost constraints of the battery swapping station deployment optimization problem: call the generative model to generate the current solution S. current And new interpretation S new The flow rate of electric two-wheeled vehicles is then substituted into the objective function of the battery swapping station deployment optimization problem to calculate the current solution S. current objective function value And the new interpretation S new objective function value S405: Determine if the condition is met. If so, then accept the new solution S. current ←S new Otherwise, proceed to step S406. S406: If the random number is satisfied Then accept the new solution S. current ←S new Otherwise, new interpretations will not be accepted. S407: Invoke the generative model to generate the optimal solution S * The flow rate of electric two-wheeled vehicles is then substituted into the objective function of the battery swapping station deployment optimization problem to calculate the optimal solution S. a objective function value When satisfied Update the optimal solution S at that time. * ←S current ; S408: Update temperature T←ε·T, iteration count k←k+1; S409: Determine whether T > T is satisfied min or k < N: If so, return to step S403 to perform the next iteration; otherwise, end the iteration and output the optimal solution S * The corresponding optimal deployment plan of battery swapping stations