Battery swap station battery swap demand prediction method and device, equipment, medium and product

CN122927587APending Publication Date: 2026-10-16CONTEMPORARY AMPEREX TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510404915.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-01
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

目前,在对电池需求量进行预测时,预测结果的准确性较低

Benefits of technology

[0064] Fifthly, this application also provides a computer program product, wherein the instructions in the computer program product, when executed by the processor of an electronic device, cause the electronic device to perform the battery swapping demand prediction method for battery swapping stations as described above.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122927587A_ABST
    Figure CN122927587A_ABST
Patent Text Reader

Abstract

The application discloses a battery swap station battery swap demand prediction method and device, equipment, medium and product, and relates to the technical field of battery swap. The application obtains a first parameter matrix and battery swap station position data and inputs a prediction model. Since the first parameter matrix contains a historical time sequence of the first parameter, the change trend of the first parameter matrix in the time dimension can be extracted. Since the battery demand of each battery swap station influences each other, and the position data of each battery swap station represents the influence degree between different battery swap stations, the influence of different battery swap stations in the space dimension can be determined based on the position data between different battery swap stations. Finally, the battery swap demand information of the target battery swap station in at least one first time period is predicted. In this way, the application combines the change trend in time and the mutual influence of different battery swap stations in space, comprehensively considers the space-time factors for prediction, and can obtain more accurate battery swap demand information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of battery swapping technology, and in particular to a method, device, equipment, medium and product for predicting battery swapping demand at battery swapping stations. Background Technology

[0002] In the battery swapping business, rationally scheduling battery charging at swapping stations is crucial for reducing costs and improving efficiency; therefore, it is necessary to forecast the battery demand at swapping stations in advance. Currently, the accuracy of battery demand forecasts is relatively low. Summary of the Invention

[0003] This application provides a method, apparatus, equipment, medium, and product for predicting battery swapping demand at battery swapping stations, which can improve the accuracy of the prediction results for battery swapping demand at battery swapping stations.

[0004] Firstly, this application provides a method for predicting the demand for battery swapping at battery swapping stations, including:

[0005] The system acquires location data among multiple battery swapping stations and obtains a first parameter matrix; the matrix elements of the first parameter matrix include the historical time series of the first parameter of each battery swapping station; the first parameter includes the attribute characteristics of the battery swapping station and the battery demand.

[0006] Based on the first parameter matrix and the location data, predict the battery swapping demand information of the target battery swapping station in at least one first time period; the target battery swapping station is at least one of the plurality of battery swapping stations.

[0007] In this embodiment, a first parameter matrix and battery swapping station location data are acquired and input into the prediction model. Since the first parameter matrix contains the historical time series of the first parameters, its temporal trend can be extracted. Furthermore, because each battery swapping station influences the other's battery demand, and the location data of each station characterizes the degree of influence between them, the spatial impact of different swapping stations can be determined based on their location data. Finally, the battery swapping demand information for the target swapping station within at least one first time period is predicted.

[0008] Thus, this application not only considers the changing trend of battery demand over time, but also the mutual influence of different battery swapping stations on battery demand in space. By combining the changing trend over time and the mutual influence of different battery swapping stations in space, and comprehensively considering spatiotemporal factors for prediction, more accurate battery swapping demand information can be obtained.

[0009] In one possible implementation, based on the first parameter matrix and the location data, the battery swapping demand information of the target battery swapping station during at least one first time period is predicted, including:

[0010] Based on the first parameter matrix, a second parameter matrix is ​​predicted; the matrix elements of the second parameter matrix include the time series of the first parameter of each of the battery swapping stations within the at least one first time period;

[0011] The matrix elements of the second parameter matrix are adjusted based on the location data to obtain the third parameter matrix;

[0012] Based on the third parameter matrix, the battery swapping demand information of the target battery swapping station during the at least one first time period is predicted.

[0013] This implementation provides a specific prediction scheme. First, a second parameter matrix is ​​determined based on a historical first parameter matrix, corresponding to at least one future time period. Since each battery swapping station influences the battery demand of the others, and the location data of each station characterizes the degree of influence between them, the spatial influence of different swapping stations can be determined based on their location data. The spatial module adjusts the second parameter matrix based on this spatial influence to obtain a more accurate third parameter matrix, ultimately yielding the battery swapping demand information for the target swapping station in at least one future time period.

[0014] In one possible implementation, a second parameter matrix is ​​predicted based on the first parameter matrix, including:

[0015] Based on the parameter values ​​of each of the first parameters of each of the first battery swapping stations in the first parameter matrix at different time steps, determine the parameter change trend;

[0016] Based on the trend of parameter changes, the second parameter matrix is ​​predicted.

[0017] This implementation provides a time-based data processing method. By determining the parameter value change trend of the first parameter at different time steps, the variation pattern of each first parameter in the time dimension can be accurately obtained. This allows for the prediction of the time series of at least one future first time period, thus obtaining the second parameter matrix. Therefore, this implementation predicts the first parameter based on the time dimension, enabling relatively accurate prediction of the first parameter in the future first time period. Based on the corresponding second parameter matrix, the battery swapping demand information of the target battery swapping station in the first time period can be determined relatively accurately.

[0018] In one possible implementation, a second parameter matrix is ​​predicted based on the first parameter matrix, including:

[0019] Perform a linear transformation on the first parameter matrix to generate the corresponding query vector, key vector, and value vector;

[0020] Based on the query vector and the key vector, determine the corresponding attention weight matrix;

[0021] The second parameter matrix is ​​determined based on the value vector and the attention weight matrix.

[0022] This implementation uses a multi-head self-attention mechanism to process time-dimensional data, improving the accuracy of the final prediction. By performing a linear transformation on the first parameter matrix, this implementation obtains three vectors: a query vector, a key vector, and a value vector. Based on the query vector and key vector, the corresponding attention weight matrix can be determined. Combining the attention weight matrix and the value vector, the second parameter matrix for the first time period can be accurately obtained, thus enabling a more accurate determination of the battery swapping demand information of the target battery swapping station during the first time period.

[0023] In one possible implementation, the matrix elements of the second parameter matrix are adjusted according to the location data to obtain the third parameter matrix, including:

[0024] The influence weights between different battery swapping stations are determined based on the location data.

[0025] Based on the influence weights and correlation sequences, the time series corresponding to the target battery swapping station in the second parameter matrix is ​​adjusted to obtain the third parameter matrix; the correlation sequence is the future time series corresponding to battery swapping stations that have an influence relationship with the target battery swapping station.

[0026] This implementation provides a specific method for data adjustment based on spatial dimension information. Specifically, it determines the influence weights between different battery swapping stations based on location data. By using these influence weights and associated sequences, the future time series corresponding to the target battery swapping station can be adjusted, thereby completing the adjustment of the second parameter matrix. It is evident that in this application, when adjusting the sequences within the second parameter matrix, it identifies influential associated sequences and then performs precise adjustments based on the corresponding influence weights. This allows for accurate adjustment of the second parameter matrix according to spatial dimension data, ensuring the accuracy of the final result.

[0027] In one possible implementation, determining the influence weights between different battery swapping stations based on the location data includes:

[0028] For any two of the aforementioned battery swapping stations:

[0029] The distance between the two battery swapping stations is determined based on the location data;

[0030] If the distance between two battery swapping stations is greater than a distance threshold, the influence weight between the two battery swapping stations is determined to be zero.

[0031] If the distance between two battery swapping stations is not greater than the distance threshold, the reciprocal of the distance between the two battery swapping stations is determined as the corresponding influence weight.

[0032] This implementation determines whether two battery swapping stations influence each other's battery demand by setting a distance threshold. Specifically, the influence weights in this application are determined by distance. If the distance between two swapping stations is greater than the distance threshold, it is determined that there is no influence between the two stations, i.e., the influence weight is zero, thus reducing the computational load and ensuring calculation accuracy. Furthermore, if the distance between two swapping stations is not greater than the distance threshold, the reciprocal of the distance between the two stations is determined as the influence weight for each pair. This is because the closer the two swapping stations are, the greater the influence. Therefore, based on this principle, determining the reciprocal of the distance between each pair of swapping stations as the influence weight ensures that the influence weights reflect the actual situation and guarantee the accuracy of the predicted battery swapping demand information.

[0033] In one possible implementation, before predicting the battery swapping demand information of the target battery swapping station during the at least one first time period based on the third parameter matrix, the method further includes:

[0034] Obtain the auxiliary parameters corresponding to the multiple battery swapping stations; the auxiliary parameters include any one or any combination of the following: region identification data, date data, meteorological data, and vehicle data;

[0035] Correspondingly, based on the third parameter matrix, the battery swapping demand information of the target battery swapping station during the at least one first time period is predicted, including:

[0036] Based on the third parameter matrix and the auxiliary parameters, the battery swapping demand information of the target battery swapping station during the at least one first time period is predicted.

[0037] This implementation employs a multi-source feature fusion strategy. By acquiring auxiliary parameters and predicting battery swapping demand based on the potential relationships between different parameters, it provides a more comprehensive information basis for predicting battery swapping demand. Therefore, this implementation combines auxiliary parameters, location data, and the first parameter matrix, among other parameter information, to further improve prediction accuracy.

[0038] In one possible implementation, the auxiliary parameters include multiple types;

[0039] Correspondingly, based on the third parameter matrix and the auxiliary parameters, the battery swapping demand information of the target battery swapping station during the at least one first time period is predicted, including:

[0040] A first vector is generated based on the auxiliary parameters, and a second vector is generated based on the third parameter matrix;

[0041] The first vector and the second vector are concatenated to obtain the first concatenated vector;

[0042] Based on the first splicing vector, predict the battery swapping demand information of the target battery swapping station during the at least one first time period.

[0043] This implementation provides a data processing method that primarily combines different parameters through vector concatenation. Specifically, by converting auxiliary parameters and the third parameter matrix into vectors and concatenating them, a first concatenated vector capable of accurate prediction is obtained. Based on this first concatenated vector, the battery swapping demand information of the target battery swapping station is accurately determined.

[0044] In one possible implementation, generating the first vector based on the auxiliary parameters includes:

[0045] Convert the multiple auxiliary parameters into corresponding multiple auxiliary parameter vectors;

[0046] The multiple auxiliary parameter vectors are concatenated to obtain a second concatenated vector;

[0047] The first vector is obtained by weighted summation and nonlinear transformation of each element of the second concatenated vector.

[0048] This implementation uses a feedforward neural network to process auxiliary parameters, enabling the extraction of effective information from them. Specifically, each auxiliary parameter is first converted into a corresponding auxiliary parameter vector. Then, different types of auxiliary parameter vectors are concatenated to obtain a second concatenated vector that represents all auxiliary parameter vectors. Next, based on the feedforward neural network, through weighted summation and nonlinear transformation, the first vector corresponding to each auxiliary parameter is obtained. This feedforward neural network-based approach can more effectively extract effective information from the auxiliary parameters. Combined with the second vector corresponding to the spatiotemporal dimension parameters, the battery swapping demand information of the target battery swapping station can be accurately determined.

[0049] In one possible implementation, obtaining the first parameter matrix includes:

[0050] Determine the target period and target sub-period to which the first time period belongs;

[0051] Obtain the historical time series of the first parameter corresponding to multiple historical time periods, wherein the multiple historical time periods include: at least one previous time period that is continuous with the first time period, the same period in the first N periods of the target period, and the same period in the first M sub-periods of the target sub-period; wherein N and M are positive integers;

[0052] The first parameter matrix is ​​determined based on the historical time series of the first parameter corresponding to the multiple historical periods.

[0053] This implementation considers the local continuity, local periodicity, and global periodicity of battery swapping demand at battery swapping stations, and obtains historical time series within each corresponding historical period to determine the corresponding first parameter matrix. Specifically, at least one previous period continuous with the first period, the same period within the first N periods of the target period, and the same period within the first M sub-periods of the target sub-period are all periods with strong correlation to the first period. Therefore, prediction based on the first parameter matrix of these three periods can yield more accurate prediction results for battery swapping demand information.

[0054] In one possible implementation, after predicting the battery swapping demand information of the target battery swapping station in at least one first time period based on the first parameter matrix and the location data, the method further includes:

[0055] After a preset time interval, the first parameter matrix is ​​reacquired to predict the battery swapping demand information of the target battery swapping station in at least one second time period; there is an overlap between the at least one first time period and the at least one second time period;

[0056] Based on the battery swapping demand information within the at least one second time period, update the battery swapping demand information within the target time period that overlaps with the at least one first time period.

[0057] This implementation provides a rolling prediction scheme, which predicts battery swapping demand information every preset time interval and updates previously predicted battery swapping demand information based on the latest predicted demand information. Since the latest prediction result is obtained based on the latest parameters, the reliability of the parameters is stronger, thereby ensuring the accuracy of the predicted battery swapping demand information.

[0058] Secondly, this application also provides a battery swapping station demand forecasting device, the device comprising:

[0059] The acquisition module is used to acquire location data among multiple battery swapping stations and to acquire a first parameter matrix; the matrix elements of the first parameter matrix include the historical time series of the first parameter of each of the battery swapping stations; the first parameter includes the attribute characteristics of the battery swapping station and the battery demand.

[0060] The prediction module is used to predict the battery swapping demand information of the target battery swapping station in at least one first time period based on the first parameter matrix and the location data; the target battery swapping station is at least one of the plurality of battery swapping stations.

[0061] Thirdly, this application also provides a battery swapping station demand prediction device, the device comprising: a processor and a memory storing computer program instructions;

[0062] When the processor executes the computer program instructions, it implements the battery swapping demand prediction method for battery swapping stations as described above.

[0063] Fourthly, this application also provides a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the battery swapping demand prediction method for battery swapping stations as described above.

[0064] Fifthly, this application also provides a computer program product, wherein the instructions in the computer program product, when executed by the processor of an electronic device, cause the electronic device to perform the battery swapping demand prediction method for battery swapping stations as described above.

[0065] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description

[0066] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiments below. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0067] Figure 1 A flowchart illustrating a method for predicting battery swapping demand at a battery swapping station, provided as an embodiment of this application;

[0068] Figure 2 A schematic diagram of an undirected graph provided for an embodiment of this application;

[0069] Figure 3 A schematic diagram of a first parameter matrix provided in an embodiment of this application;

[0070] Figure 4 A flowchart illustrating another method for predicting battery swapping demand at a battery swapping station, provided in an embodiment of this application;

[0071] Figure 5 A flowchart illustrating another method for predicting battery swapping demand at a battery swapping station, provided in an embodiment of this application;

[0072] Figure 6 A flowchart illustrating another method for predicting battery swapping demand at a battery swapping station, provided in an embodiment of this application;

[0073] Figure 7 A flowchart illustrating another method for predicting battery swapping demand at a battery swapping station, provided in an embodiment of this application;

[0074] Figure 8 A flowchart illustrating another method for predicting battery swapping demand at a battery swapping station, provided in an embodiment of this application;

[0075] Figure 9 A flowchart illustrating another method for predicting battery swapping demand at a battery swapping station, provided in an embodiment of this application;

[0076] Figure 10 A flowchart illustrating another method for predicting battery swapping demand at a battery swapping station, provided in an embodiment of this application;

[0077] Figure 11 A flowchart illustrating another method for predicting battery swapping demand at a battery swapping station, provided in an embodiment of this application;

[0078] Figure 12 A schematic diagram illustrating the training and application process of the prediction model provided in the embodiments of this application;

[0079] Figure 13 A schematic diagram of training samples for the prediction model provided in the embodiments of this application;

[0080] Figure 14 This is a schematic diagram of the structure of the prediction model provided in the embodiments of this application;

[0081] Figure 15 A schematic diagram of the battery swapping demand prediction device for a battery swapping station provided in an embodiment of this application is shown.

[0082] Figure 16 A schematic diagram of the hardware structure of the battery swapping station demand prediction device provided in an embodiment of this application is shown. Detailed Implementation

[0083] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.

[0084] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0085] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0086] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0087] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0088] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0089] Battery swapping stations are infrastructure that provides battery replacement services for electric vehicles. Their primary function is to quickly replace the depleted battery with a fully charged one, replacing the traditional charging method. When an electric vehicle's battery is low, the owner drives it to a swapping station, where staff or automated equipment quickly remove the depleted battery and install a fully charged one, allowing the vehicle to continue driving. This significantly reduces the recharging time and improves vehicle efficiency.

[0090] In practical applications, the battery swapping demand at battery swapping stations varies at different times of day. Different battery swapping demands require corresponding battery charging plans to reduce charging costs and improve efficiency. For example, electricity prices vary at different times of day; charging during periods of relatively lower electricity prices, while still meeting battery swapping needs, can reduce costs. Therefore, it is necessary to predict the battery demand at battery swapping stations in advance to ensure users' battery swapping needs are met while minimizing charging costs.

[0091] Currently, when forecasting battery demand, it is often necessary to rely solely on the historical demand data of a single battery swapping station. However, there are many factors that affect the battery demand of a battery swapping station, and forecasting based solely on the historical demand data of the station itself will result in low accuracy.

[0092] It is evident that traditional methods, which only predict battery demand over time, have low accuracy. Furthermore, the battery swapping demand at a swapping station is influenced not only by its own historical data but also by the demand from nearby stations. For example, if a swapping station shuts down due to unforeseen circumstances, the battery demand at other nearby stations will increase.

[0093] Therefore, this application proposes to consider spatial information in addition to time-based prediction in order to improve the accuracy of battery demand prediction. Specifically, this application will obtain the location data of battery swapping stations within a preset range. Based on the location data, the spatial correlation between different battery swapping stations can be determined. Combined with the historical data of the battery swapping stations, the battery demand can be accurately predicted.

[0094] Based on this, this application provides a method for predicting the battery swapping demand of battery swapping stations. Figure 1 This is a flowchart illustrating a method for predicting battery swapping demand at a battery swapping station, provided as an embodiment of this application. Figure 1 As shown, the method may include the following steps: S101 and S102.

[0095] S101: Obtain location data between multiple battery swapping stations and obtain the first parameter matrix.

[0096] This application does not limit the specific content of the location data, which can be selected according to the actual situation. The location data can typically include distance data between different battery swapping stations. For example, an undirected graph can be constructed based on battery swapping stations within a preset range. Figure 2 This is a schematic diagram of an undirected graph provided as an embodiment of this application. For example... Figure 2As shown, the undirected graph includes multiple nodes 201 and edges 202 connecting different nodes. Specifically, battery swapping stations within a preset range are used as nodes 201, and the distance between any two battery swapping stations is used as the edge 202 between nodes 201. It should be noted that the distance data here can be the straight-line distance between any two battery swapping stations or the distance of the navigation route on the map. The appropriate distance can be selected based on the actual effect of the two distances in the actual situation.

[0097] The matrix elements of the first parameter matrix include the historical time series of the first parameter of each battery swapping station. The first parameter is time-related data, which has a certain pattern of change in continuous time periods. Based on this pattern of change, the corresponding first parameter in future time periods can be predicted. Figure 3 This is a schematic diagram of a first parameter matrix provided in an embodiment of this application. Figure 3 As shown, the first parameter matrix 301 is specifically a three-dimensional matrix. Assuming there are N battery swapping stations (station 1, station 2… station N), and each station has C types of first parameters (feature 1, feature 2… feature C), then the matrix elements of the first parameter matrix 301 are the values ​​of the C types of first parameters from the N battery swapping stations at different historical time steps (t1, t2… tn). From a time perspective, in the first parameter matrix 301, each type of first parameter from each battery swapping station represents a time series.

[0098] It should be noted that the specific content of the first parameter is not limited. As an optional implementation, the first parameter may include the attribute characteristics of the battery swapping station and the battery demand.

[0099] The historical time series of battery demand at a battery swapping station refers to the sequence of battery demand at the station in each historical period. For example, if the current time is 5 PM, the historical time series of battery demand at a battery swapping station can be a sequence obtained by arranging the battery demand at different times between 1 PM and 5 PM in chronological order.

[0100] The attribute characteristics of a battery swapping station are related to the attributes of the station itself. As an optional embodiment, the attribute characteristics of a battery swapping station may include at least any one or any combination of the following: the number of swappable batteries, the number of available batteries (total number of batteries), and the operating status (battery swapping service is available during normal operating status, and battery swapping service is suspended during closed status), etc.

[0101] Furthermore, since the matrix elements of the first parameter matrix include historical time series, the specific historical time period is not limited and can be selected according to the actual situation. As an optional implementation method, the corresponding historical time period can be selected based on the continuity, local periodicity, and overall periodicity of the first parameter.

[0102] As some alternative embodiments, suppose we need to predict battery demand for a future period. Based on the continuity of a first parameter, we can obtain the value of the first parameter within a historical period prior to the current time. Based on the local periodicity of the first parameter, we can take a day as a period and obtain the value of the first parameter within the same period yesterday. Based on the overall periodicity of the first parameter, we can take a week or a month as a period and obtain the value of the first parameter within the same period last week or last month. For example, to predict data from 4 PM to 6 PM today (Friday), we can obtain historical data from 1 PM to 4 PM today, historical data from 4 PM to 6 PM this week (Monday to Thursday), historical data from 4 PM to 6 PM the previous four weeks, and so on.

[0103] In this application, the specific locations of multiple battery swapping stations are not limited; they can be multiple battery swapping stations within a preset range, and the specific size of the preset range is not limited, depending on the actual situation. As some optional implementation methods, they can be battery swapping stations within a city, or battery swapping stations within a certain area of ​​a city. These battery swapping stations generally have interchangeable batteries, and vehicles can choose one of the battery swapping stations for battery swapping services.

[0104] S102: Based on the first parameter matrix and location data, predict the battery swapping demand information of the target battery swapping station in at least one first time period.

[0105] The target battery swapping station is at least one of a plurality of battery swapping stations. As some optional embodiments, the target battery swapping station may be all of the plurality of battery swapping stations, or it may be one or some of them.

[0106] The matrix elements of the first parameter matrix are the historical time series of the first parameter. As information in the time dimension, the future time series corresponding to the first parameter can be predicted based on this. Combined with the location data in the spatial dimension, the battery swapping demand information of the target battery swapping station in at least one first time period can be predicted.

[0107] As an optional implementation, the trend of the first parameter matrix in the time dimension can be extracted, and then at least one second parameter matrix in the first time period can be predicted. The second parameter matrix is ​​predicted from the first parameter matrix. The matrix elements of the two are the same, the difference is that they belong to parameter matrices in different time periods.

[0108] Then, the matrix elements of the second parameter matrix can be adjusted based on the location data to obtain the third parameter matrix, which realizes the adjustment of the spatial dimension. Finally, the battery swapping demand information within at least one time period can be determined based on the third parameter matrix.

[0109] It is important to note that there are no specific limitations on the length or number of the first time period; these can be selected based on the actual situation. For example, if one hour is used as a first time period, then the battery swapping demand information for each hour in the following hours can be predicted.

[0110] In this embodiment, a first parameter matrix and battery swapping station location data are acquired and input into the prediction model. Since the first parameter matrix contains the historical time series of the first parameters, its temporal trend can be extracted. Furthermore, because each battery swapping station influences the other's battery demand, and the location data of each station characterizes the degree of influence between them, the spatial impact of different swapping stations can be determined based on their location data. Finally, the battery swapping demand information for the target swapping station within at least one first time period is predicted.

[0111] Thus, this application not only considers the changing trend of battery demand over time, but also the mutual influence of different battery swapping stations on battery demand in space. By combining the changing trend over time and the mutual influence of different battery swapping stations in space, and comprehensively considering spatiotemporal factors for prediction, more accurate battery swapping demand information can be obtained.

[0112] Figure 4 This is a flowchart illustrating another method for predicting battery swapping demand at battery swapping stations, provided in an embodiment of this application. Figure 4 As shown, S102 may include the following steps: S1021 to S1023.

[0113] S1021: Based on the first parameter matrix, the second parameter matrix is ​​predicted.

[0114] The matrix elements of the second parameter matrix include the time series of the first parameter of each battery swapping station within at least one first time period.

[0115] As mentioned above, this application requires prediction of battery swapping demand based on both time and space dimensions. Therefore, after constructing the first parameter matrix, it needs to be processed in the time dimension. Specifically, the first parameter matrix is ​​processed through the time module in the prediction model, for example, by obtaining the changing trend of each first parameter in the first parameter matrix over historical periods. Based on this changing trend, the second parameter matrix for future periods can be predicted.

[0116] The elements of the second parameter matrix include the time series of the first parameter of each battery swapping station within at least one future first time period. The matrix structure of the second parameter matrix is ​​the same as that of the first parameter matrix, both being three-dimensional matrices composed of multiple time series. The difference is that the first parameter matrix is ​​a time series within a historical period, while the second parameter matrix is ​​a time series within at least one future first time period.

[0117] S1022: Adjust the matrix elements of the second parameter matrix according to the location data to obtain the third parameter matrix.

[0118] After processing the second parameter matrix in the time dimension based on the first parameter matrix, spatial processing is then performed on the second parameter matrix in conjunction with the location data. Specifically, adjusting the matrix elements of the second parameter matrix according to the location data yields the third parameter matrix.

[0119] Since the second parameter matrix is ​​determined by the first parameter matrix, and it consists of the time series of the first parameter of each battery swapping station over at least one future time period, the second parameter matrix contains the parameter values ​​of multiple battery swapping stations in the first time period. The parameters of any two battery swapping stations will influence each other. Therefore, for a target battery swapping station, the spatial module can adjust the parameter values ​​of the target battery swapping station based on the parameter values ​​of the other battery swapping stations that influence it. That is, for the time series corresponding to a target battery swapping station in the second parameter matrix, the time series corresponding to the target battery swapping station will be adjusted based on the time series corresponding to the other battery swapping stations. If it is necessary to predict the battery swapping demand of each battery swapping station, the above steps can be performed on each battery swapping station to adjust each element in the second parameter matrix, resulting in the third parameter matrix.

[0120] Because the degree of influence between the parameters of two battery swapping stations is usually related to the distance between them, adjusting a sequence requires combining location data with relevant associated sequences. Generally speaking, the closer the two battery swapping stations are, the greater the influence.

[0121] S1023: Based on the third parameter matrix, predict the battery swapping demand information of the target battery swapping station in at least one first time period.

[0122] After processing the parameter matrix in both time and space dimensions, a third parameter matrix is ​​obtained. Based on this third parameter matrix, the battery swapping demand information of the target battery swapping station in at least one future time period can be predicted. The target battery swapping station here can be all the battery swapping stations corresponding to the first parameter matrix mentioned above, or it can be a subset of them.

[0123] As some optional implementation methods, the prediction module can directly predict battery swapping demand information based on the third parameter matrix, or it can combine the third parameter matrix with some related auxiliary parameters to jointly predict battery swapping demand information. Auxiliary parameters may include region identification data, date data, meteorological data, and vehicle data, etc. Based on the region identification data, the region to which the predicted battery swapping station belongs can be determined, and the prediction results can then be corrected based on the battery swapping demand in that region. Based on the date data, the characteristics of the date to which the predicted first time period belongs can be determined; for example, the different impacts of weekdays and holidays on battery demand can be distinguished. Meteorological data may include weather data and temperature data, etc. Vehicle data may include the number of vehicles using relevant batteries within a preset range.

[0124] This implementation provides a specific prediction scheme. First, a second parameter matrix is ​​determined based on a historical first parameter matrix, corresponding to at least one future time period. Since each battery swapping station influences the battery demand of the others, and the location data of each station characterizes the degree of influence between them, the spatial influence of different swapping stations can be determined based on their location data. The spatial module adjusts the second parameter matrix based on this spatial influence to obtain a more accurate third parameter matrix, ultimately yielding the battery swapping demand information for the target swapping station in at least one future time period.

[0125] As mentioned above, after constructing the first parameter matrix, it is necessary to predict the second parameter matrix based on the first parameter matrix. Here is a specific implementation method. Figure 5 This is a flowchart illustrating another method for predicting battery swapping demand at battery swapping stations, provided in an embodiment of this application. Figure 5 As shown, S1021 may include S10211 to S10212.

[0126] S10211: Determine the parameter change trend based on the parameter values ​​of each first parameter of each battery swapping station at different time steps in the first parameter matrix.

[0127] Since the matrix elements of the first parameter matrix include the historical time series of the first parameter of each battery swapping station, the parameter values ​​of each first parameter at different time steps have a certain trend of change. This application specifically obtains this trend of change through a time module. It should be noted that the specific implementation method of the time module is not limited, and it can be implemented based on a time trend-aware multi-head self-attention module.

[0128] S10212: Based on the parameter change trend, the second parameter matrix is ​​predicted.

[0129] After obtaining the changing trends of each first parameter at different time steps, the second parameter matrix can be predicted based on these changing trends. The matrix elements of the second parameter matrix include the time series of the first parameter of each battery swapping station in at least one future first time period, that is, the time series of future time periods is predicted based on the time series of the first parameter in historical time periods.

[0130] This implementation provides a time-based data processing method. By determining the parameter value change trend of the first parameter at different time steps, the variation pattern of each first parameter in the time dimension can be accurately obtained. This allows for the prediction of the time series of at least one future first time period, thus obtaining the second parameter matrix. Therefore, this implementation predicts the first parameter based on the time dimension, enabling relatively accurate prediction of the first parameter in the future first time period. Based on the corresponding second parameter matrix, the battery swapping demand information of the target battery swapping station in the first time period can be determined relatively accurately.

[0131] As mentioned above, in practical applications, the parameter change trend can be obtained based on the time trend perception multi-head self-attention module, which will be explained in detail here. Figure 6 This is a flowchart illustrating another method for predicting battery swapping demand at battery swapping stations, provided in an embodiment of this application. Figure 6 As shown, S10211 may include S10213 to S1025.

[0132] S10213: Perform a linear transformation on the first parameter matrix to generate the corresponding query vector, key vector, and value vector.

[0133] In this application, an Adaptive Spatial Temporal Graph Neural Network (ASTGNN) model can be used as the spatiotemporal model, which includes both a temporal and a spatial model. The spatiotemporal model comprehensively considers both time and spatial dimensions, enabling a more accurate grasp of the changing patterns of battery demand across these dimensions. Faced with demand changes caused by sudden spatial events, the spatiotemporal model is more adaptable and can be flexibly adjusted based on spatiotemporal data, thereby improving the accuracy of battery demand prediction.

[0134] Specifically, the multi-head self-attention mechanism (Transformer Self-Attention, TrSelfAttention) module can be treated as a temporal module, and the specific calculation formula is as follows:

[0135]

[0136] in For vector concatenation operations, W OThe output projection matrix is ​​given by Q, K, V, and d, which represent the query vector, key vector, value vector, and their dimensions, respectively. For convolution operations, These are the convolution kernel parameters acting on matrices Q and K, respectively. Let Q be the projection matrix acting on matrix V. Q, K, and V are determined based on the first parameter matrix.

[0137] S10214: Determine the corresponding attention weight matrix based on the query vector and key vector.

[0138] As shown in Equation (3), the attention weight matrix is ​​obtained.

[0139] S10215: Determine the second parameter matrix based on the value vector and the attention weight matrix.

[0140] Specifically, as shown in formulas (1) and (2), based on the value vector and the attention weight matrix, the result of the single-head attention mechanism is first determined, and the results of multiple single-head attention mechanisms are concatenated. Then, through the action of the output projection matrix, the second parameter matrix TrSelfAttention(Q,K,V) is determined. It should be noted that the solution provided in this embodiment is merely an example of this application and is not intended to limit this application.

[0141] This implementation uses a multi-head self-attention mechanism to process time-dimensional data, improving the accuracy of the final prediction. By performing a linear transformation on the first parameter matrix, this implementation obtains three vectors: a query vector, a key vector, and a value vector. Based on the query vector and key vector, the corresponding attention weight matrix can be determined. Combining the attention weight matrix and the value vector, the second parameter matrix for the first time period can be accurately obtained, thus enabling a more accurate determination of the battery swapping demand information of the target battery swapping station during the first time period.

[0142] As mentioned above, after obtaining the second parameter matrix based on the time module, the second parameter matrix and location data are input into the spatial module of the prediction model. Then, the matrix elements of the second parameter matrix are adjusted according to the location data to obtain the third parameter matrix. Here, a specific implementation method is provided. Figure 7 This is a flowchart illustrating another method for predicting battery swapping demand at battery swapping stations, provided in an embodiment of this application. Figure 7 As shown, S1022 may include S10221 and S10222.

[0143] S10221: Determine the influence weights between different battery swapping stations based on location data.

[0144] Specifically, in this embodiment, a Dynamic Graph Convolutional Network (DGCN) module can be used as the spatial module to achieve spatial dimension processing. The calculation formula for the DGCN module is as follows:

[0145] DGCN(Z t )=σ((A⊙S t )Z t W) (4)

[0146]

[0147]

[0148] Z t ∈R N×d W∈R d×d σ and σ represent the node representation (the output of the previous layer, obtained based on the second parameter matrix), projection matrix, and activation function, respectively, and ⊙ represents the Hadamard product. For the graph adjacency matrix, Influence weight of elements The influence weight can be the reciprocal of the distance between the two battery swapping stations.

[0149] As an optional implementation, when determining the influence weights between different battery swapping stations based on location data, the following steps can be performed for any two battery swapping stations:

[0150] The distance between two battery swapping stations is determined based on location data. If the distance between the two stations is greater than a distance threshold, it is determined that there is no impact between them, i.e., the impact weight is set to zero. If the distance between the two stations is not greater than the distance threshold, the reciprocal of the distance between them is determined as the corresponding impact weight.

[0151] This implementation determines whether two battery swapping stations influence each other's battery demand by setting a distance threshold. Specifically, the influence weights in this application are determined by distance. If the distance between two swapping stations is greater than the distance threshold, it is determined that there is no influence between the two stations, i.e., the influence weight is zero, thus reducing the computational load and ensuring calculation accuracy. Furthermore, if the distance between two swapping stations is not greater than the distance threshold, the reciprocal of the distance between the two stations is determined as the influence weight for each pair. This is because the closer the two swapping stations are, the greater the influence. Therefore, based on this principle, determining the reciprocal of the distance between each pair of swapping stations as the influence weight ensures that the influence weights reflect the actual situation and guarantee the accuracy of the predicted battery swapping demand information.

[0152] S10222: Based on the influence weights and correlation sequences, the time series corresponding to the target battery swapping station in the second parameter matrix is ​​adjusted to obtain the third parameter matrix.

[0153] The target battery swapping station is any battery swapping station within a preset range, and the associated sequence is the future time series corresponding to battery swapping stations that have an influence relationship with the target station. Because the parameters of any pair of battery swapping stations will influence each other, for any target battery swapping station, the space module can adjust the parameter values ​​of the target battery swapping station based on the parameter values ​​of the other battery swapping stations that influence it. That is, for the time series corresponding to a certain target battery swapping station in the second parameter matrix, the time series corresponding to the target battery swapping station will be adjusted based on the time series corresponding to other battery swapping stations.

[0154] This implementation provides a specific method for data adjustment based on spatial dimension information. Specifically, it determines the influence weights between different battery swapping stations based on location data. By using these influence weights and associated sequences, the future time series corresponding to the target battery swapping station can be adjusted, thereby completing the adjustment of the second parameter matrix. It is evident that in this application, when adjusting the sequences within the second parameter matrix, it identifies influential associated sequences and then performs precise adjustments based on the corresponding influence weights. This allows for accurate adjustment of the second parameter matrix according to spatial dimension data, ensuring the accuracy of the final result.

[0155] In one possible implementation, the prediction results can be adjusted based on some auxiliary parameters to improve the accuracy of the final result. Specifically, before predicting the battery swapping demand information of the target battery swapping station in at least one first time period, auxiliary parameters corresponding to multiple battery swapping stations can be obtained first. The number and type of auxiliary parameters can be determined according to the actual situation. As an optional implementation method, auxiliary parameters can include any one or any combination of the following: region identification data, date data, meteorological data, and vehicle data.

[0156] Correspondingly, S1023 may include the following when it is executed: inputting the third parameter matrix and auxiliary parameters into the prediction module to predict the battery swapping demand information of the battery swapping station in at least one first time period in the future.

[0157] This implementation employs a multi-source feature fusion strategy. By acquiring auxiliary parameters and predicting battery swapping demand based on the potential relationships between different parameters, it provides a more comprehensive information basis for predicting battery swapping demand. Therefore, this implementation combines auxiliary parameters, location data, and the first parameter matrix, among other parameter information, to further improve prediction accuracy.

[0158] In one possible implementation, the auxiliary parameters may include multiple types; for example, they may simultaneously include region identification data, date data, weather data, and vehicle data. Then, based on the third parameter matrix and the auxiliary parameters, predicting the battery swapping demand information of the target battery swapping station in at least one first time period may include: Figure 8 This is a flowchart illustrating another method for predicting battery swapping demand at battery swapping stations, provided in an embodiment of this application. Figure 8 As shown, S1023 may specifically include S10231 to S10233.

[0159] S10231: Generate a first vector based on auxiliary parameters; and generate a second vector based on the third parameter matrix.

[0160] Figure 9 This is a flowchart illustrating another method for predicting battery swapping demand at battery swapping stations, provided in an embodiment of this application. Figure 9 As shown, S10231 may include S102311 to S102313.

[0161] S102311: Convert multiple auxiliary parameters into a corresponding vector of multiple auxiliary parameters.

[0162] S102312: Concatenate multiple auxiliary parameter vectors to obtain the second concatenated vector.

[0163] S102313: Perform weighted summation and nonlinear transformation on each element of the second concatenated vector to obtain the first vector.

[0164] This application employs a multi-source feature fusion strategy to uncover potential relationships between data, providing more comprehensive information for estimating battery demand. Furthermore, this application utilizes a feed-forward neural network (FNN) model for feature fusion. This is because inputting auxiliary parameters indiscriminately with historical battery demand at battery swapping stations dilutes the impact of auxiliary parameters on battery demand prediction, making it difficult for the model to extract effective information from the auxiliary parameters. Therefore, this application introduces an FNN to process the auxiliary parameters, thereby extracting key information and fusing it with a spatiotemporal model to improve prediction accuracy and reliability.

[0165] This implementation uses a Functional Neural Network (FNN) to process auxiliary parameters, enabling the extraction of effective information from them. Specifically, each auxiliary parameter is first converted into a corresponding auxiliary parameter vector. Then, different types of auxiliary parameter vectors are concatenated to obtain a second concatenated vector that represents all auxiliary parameter vectors. Based on the FNN, through weighted summation and nonlinear transformations, a first vector corresponding to each auxiliary parameter is obtained. This FNN-based approach can more effectively extract effective information from the auxiliary parameters. Combined with the second vector corresponding to the spatiotemporal dimension parameters, the battery swapping demand information of the battery swapping station can be accurately determined.

[0166] S10232: Concatenate the first vector and the second vector to obtain the first concatenated vector.

[0167] After obtaining the first vector and the second vector, they can be concatenated to obtain the first concatenated vector for easier subsequent processing.

[0168] S10233: Based on the first splicing vector, predict the battery swapping demand information of the target battery swapping station in at least one first time period.

[0169] Ultimately, the required battery swapping demand information can be predicted based on the obtained first splicing vector.

[0170] This implementation provides a data processing method that primarily combines different parameters through vector concatenation. Specifically, by converting auxiliary parameters and the third parameter matrix into vectors and concatenating them, a first concatenated vector capable of accurate prediction is obtained. Based on this first concatenated vector, the battery swapping demand information of the target battery swapping station is accurately determined.

[0171] This application does not limit the specific selection method of the historical time period in the first parameter matrix, but provides an optional embodiment for obtaining the first parameter matrix. Figure 10 This is a flowchart illustrating another method for predicting battery swapping demand at battery swapping stations, provided in an embodiment of this application. Figure 10 As shown, the specific steps for obtaining the first parameter matrix in S101 may include: S1011 to S1013.

[0172] S1011: Determine the target period and target sub-period to which the first time period belongs.

[0173] This application does not specifically limit the target period and the target sub-period. As an optional implementation method, the target period can be in weeks or months, and the target sub-period can be in days.

[0174] S1012: Obtain the historical time series of the first parameter corresponding to multiple historical time periods.

[0175] As an optional implementation, multiple historical time periods may include: at least one previous time period that is continuous with the first time period, simultaneous periods in the first N periods of the target period, and simultaneous periods in the first M sub-periods of the target sub-period; N and M are positive integers.

[0176] For example, assuming the target period is in weeks and the target sub-period is in days, and the first time period is from 4 PM to 5 PM today (Friday). Then, the same time period in the first N periods of the target period is specifically from 4 PM to 5 PM every Friday of the first N weeks. The same time period in the first M periods of the target sub-period is specifically from 4 PM to 5 PM every day of the first M days.

[0177] S1013: Determine the first parameter matrix based on the historical time series of the first parameter corresponding to multiple historical periods.

[0178] After obtaining the historical time series for the aforementioned historical periods, a first parameter matrix can be constructed, comprising three dimensions: time, battery swapping station locations, and the first parameter. This embodiment incorporates local and global periodicity in the time dimension, enabling more effective capture of the temporal patterns of battery demand and improving prediction accuracy.

[0179] This implementation considers the local continuity, local periodicity, and global periodicity of battery swapping demand at battery swapping stations, and obtains historical time series within each corresponding historical period to determine the corresponding first parameter matrix. Specifically, at least one previous period continuous with the first period, the same period within the first N periods of the target period, and the same period within the first M sub-periods of the target sub-period are all periods with strong correlation to the first period. Therefore, prediction based on the first parameter matrix of these three periods can yield more accurate prediction results for battery swapping demand information.

[0180] In practical applications, each forecast typically predicts data for a relatively long period in the future. However, the accuracy of the forecast decreases as the timeframe becomes longer. Therefore, to ensure the accuracy of the forecast results, a rolling forecasting approach can be used. For example, if the forecast is for data over the next four hours, a forecast can be made every hour. Figure 11 This is a flowchart illustrating another method for predicting battery swapping demand at battery swapping stations, provided in an embodiment of this application. Figure 11 As shown, after S102, this method may also include S103 and S104.

[0181] S103: After a preset time interval, the first parameter matrix is ​​reacquired to predict the battery swapping demand information of the battery swapping station in at least one second time period in the future.

[0182] The specific length of the preset duration is not limited; as an optional implementation, it can be the same as the length of the first time period. In this embodiment, there is an overlap between at least one first time period and at least one second time period. For example, assuming that the first time period specifically refers to data from 2 PM to 6 PM, and each first and second time period is 1 hour, then the second time period specifically refers to data from 3 PM to 7 PM.

[0183] S104: Based on the battery swapping demand information in at least one second time period, update the battery swapping demand information in the target time period that overlaps with the second time period in the first time period.

[0184] Using the example above, the data for the corresponding time period in the first period will be replaced based on the data from the second period, which is from 3 PM to 6 PM.

[0185] This implementation provides a rolling prediction scheme, which predicts battery swapping demand information every preset time interval and updates previously predicted battery swapping demand information based on the latest predicted demand information. Since the latest prediction result is obtained based on the latest parameters, the reliability of the parameters is stronger, thereby ensuring the accuracy of the predicted battery swapping demand information.

[0186] An optional implementation method is provided here, which can be based on a prediction model to implement the battery swapping demand prediction method for battery swapping stations proposed in this application. The prediction model can achieve accurate prediction of battery demand, thereby reducing the charging cost of battery swapping stations and improving efficiency. The prediction model can be obtained by pre-training a machine learning model based on training samples. Specifically, the ASTGNN-FNN spatiotemporal model can be used. After training the prediction model, the prediction model can be applied to predict battery demand.

[0187] Figure 12 This is a schematic diagram illustrating the training and application process of the prediction model provided in the embodiments of this application. Figure 12 As shown, this method may include S1201 to S1204.

[0188] S1201: Obtain the first parameter and auxiliary parameters.

[0189] The first parameter may include the attribute characteristics of the battery swapping station and historical battery demand, while the auxiliary parameters may include regional identification data, date data, weather data, and vehicle data, etc.

[0190] The attributes of a battery swapping station can include the number of available batteries, the number of swappable batteries, and its operational status. Regional identification data can include city ID, region ID, and battery swapping station ID. Date data can include date type, month, day x of the month, day of the week x, and hour x. Meteorological data can include weather data and temperature data. Vehicle data can include the number of taxis charging in the region, the number of ride-hailing vehicles charging, the number of taxis that are running but not charging, the number of ride-hailing vehicles that are running but not charging, the number of taxis running but not charging in different State of Charge (SOC) segments, and the number of ride-hailing vehicles running but not charging in different SOC segments, etc.

[0191] S1202: Preprocess the acquired data.

[0192] Continuous data is normalized using Min-Max to the interval [-1, 1]. The normalization formula is as follows:

[0193]

[0194] where x∈R n This is the original data, x min ∈R n Each element is the minimum value in x, x max ∈R n Each element is the maximum value in x; discrete data is encoded by mapping each distinct value to a numerical label. For example, for date types, "normal working day" is encoded as 1, "normal weekend" as 2, "weekend with make-up days" as 3, and "statutory holiday" as 4. Continuous features to be processed include historical battery demand at battery swapping stations, battery swapping station attribute features, temperature features, urban vehicle features, etc., while discrete features to be processed include battery swapping station geographical location features, weather features, date types, etc.

[0195] A battery swapping station network topology can be defined based on map data. The battery swapping station network is transformed into a station network topology map according to the connection structure of the transportation network on the map. in for A set of n nodes, ε = {(v i ,v j Let )} be the set of |ε| = M edges.

[0196] Treat each battery swapping station as a node v in the graph i Add attributes to each node, namely the characteristic parameters of the battery swapping station; and add weights to each edge. The distance between battery swapping stations is represented by the reciprocal of the distance between them, and a distance threshold is set. Only when the distance d between the two battery swapping stations is... ij Only when the values ​​are less than this threshold are they considered to be connected.

[0197]

[0198] Define the station network signal matrix. The data observations of the station network topology at time step t are denoted as the station network signal matrix X. t =(x t,1 ,x t,2 ,…,x t,N ) T ∈R N×C , where x t,v ∈R C Let V represent the feature vector of node v at time step t, and C be the number of categories of the first parameter.

[0199] S1203: Train a prediction model based on the processed data.

[0200] The problem of predicting battery demand at battery swapping stations can be abstracted into a mathematical problem: given the network signal matrix of the stations over the past T1 time steps. Predict the target variable at the next T time steps using a model. Where y t Let be the battery demand at time step t, i.e.:

[0201]

[0202] Where f is the prediction model.

[0203] Considering that the demand for batteries at battery swapping stations exhibits both local and global cyclicality, features from the same time period yesterday and the same time period last week were also incorporated into the time dimension.

[0204] Figure 13 This is a schematic diagram of training samples for the prediction model provided in an embodiment of this application. Figure 13 As shown, a spatiotemporal sample 1301 for the battery swapping service scenario is constructed according to the description above. A single sample contains C first parameters (feature 1 to feature C) and their corresponding parameter values ​​for N battery swapping stations (station 1 to station N) at multiple historical time steps (t1, t2...tn). The corresponding labels are the battery swapping demand of the N stations in each first time period (t, t+1, t+T). These samples can be divided into training, validation, and test sets according to a certain ratio.

[0205] S1204: Predicting battery swapping demand information based on a predictive model.

[0206] Figure 14 This is a schematic diagram of the structure of the prediction model provided in an embodiment of this application. Figure 14 As shown, the first parameter related to the battery swapping station (historical battery demand and battery swapping station attribute characteristics) is processed by the first fully connected layer 1401 and then input into the spatiotemporal model 1402. The remaining auxiliary data (regional identification data, date data, meteorological data, and vehicle data) are processed by the transformation submodule 1403 (projection layer), and then concatenated along the feature dimension vector by the splicing submodule 1404 and input into the feature fusion submodule 1405 (feature fusion model). The vector splicing module 1406 concatenates the outputs of the feature fusion submodule 1405 and the spatiotemporal model 1402 along the feature dimension and inputs them into the second fully connected layer 1406. The second fully connected layer 1406 performs a weighted sum and inputs it into the prediction module 1408 to obtain the final predicted value.

[0207] Discrete features such as region identifiers, date data, and weather data are embedded using the projection layer. Continuous features such as temperature data and vehicle data are linearly mapped using the projection layer. Furthermore, features of the same type are summed as vectors after projection to obtain the feature representation. For example, weather features and temperature features both belong to the meteorological category. Assume the embedding result for the weather feature is [1,3,2]. T The temperature characteristics after linear mapping are [2,1,4]. T The meteorological characteristics are represented as [3,4,6]. T The same applies to date characteristics, geographic location characteristics, and urban vehicle characteristics, which will not be elaborated upon here.

[0208] In this application, as an optional implementation, the spatiotemporal model can be ASTGNN, and the feature fusion model can be FNN. ASTGNN adopts an encoder-decoder structure and generates the output sequence in an autoregressive manner. The model includes TrSelfAttention and DGCN. The former is used to model the data sequence in the time dimension, and the latter is used to capture the correlation in the spatial dimension.

[0209] In practical applications, model training can be carried out at fixed intervals. Based on the dynamic changes in training sample data of battery swapping business, parameters can be adjusted in a timely manner to continuously optimize the model and improve the accuracy of model prediction.

[0210] In addition, a rolling forecasting method for battery demand can be used, and the performance of the rolling forecasting model can be evaluated. Based on the evaluation results, an appropriate time interval can be selected as the rolling time interval.

[0211] For example, the mean absolute error (MAE) can be used for evaluation:

[0212]

[0213] The objective function is defined as follows: y is the target variable, f(x) is the model's predicted value, and n is the number of predicted results. The Adam optimizer is used for optimization. The training set is input into the model f for training. The training parameters are adjusted in each iteration, and the objective function value L is calculated on the validation set. val To verify the model's effectiveness, minimize L across all iterations. val The corresponding model is saved.

[0214] The test set is input into the saved prediction model for evaluation. The evaluation metric set in this scheme is the mean absolute error (MAE), which is the objective function mentioned above. It is determined whether the evaluation metric of the prediction model on the test set meets the preset evaluation metric. If it does, the model is saved; otherwise, the sample features are re-selected, and the above steps are repeated until the preset evaluation metric is met.

[0215] Set up a scheduled task on the server to train the model every p time intervals, repeating the above steps. In practical applications, acquire real-time sample features every q time intervals. After data preprocessing, input the data into the model for prediction, overwriting the prediction result of the previous time interval with the battery demand for the next T time steps, where q ≤ T. Assume that the daily battery demand of the battery swapping station has been roughly estimated using a strategy, with q = 1 hour and T = 4 hours. Iterate through all values ​​of the rolling interval q and evaluate the integrated result corresponding to each value. Based on actual data, the MAE corresponding to q = 1 hour is the smallest, therefore, a rolling interval of 1 hour can be selected.

[0216] To address the aforementioned technical problems, this application also provides a device for predicting the battery swapping demand at battery swapping stations. Figure 15 A schematic diagram of the battery swapping demand prediction device for a battery swapping station provided in an embodiment of this application is shown. Figure 15 As shown, the device includes the following modules:

[0217] The acquisition module 1501 is used to acquire location data among multiple battery swapping stations and to acquire a first parameter matrix. The matrix elements of the first parameter matrix include the historical time series of the first parameter of each battery swapping station. The first parameter includes the attribute characteristics of the battery swapping station and the battery demand.

[0218] The prediction module 1502 is used to predict the battery swapping demand information of the target battery swapping station in at least one first time period based on the first parameter matrix and location data; the target battery swapping station is at least one of a plurality of battery swapping stations.

[0219] Thus, this application not only considers the changing trend of battery demand over time, but also the mutual influence of different battery swapping stations on battery demand in space. By combining the changing trend over time and the mutual influence of different battery swapping stations in space, and comprehensively considering spatiotemporal factors for prediction, more accurate battery swapping demand information can be obtained.

[0220] As some optional implementations, the prediction module 1502 may specifically be used for:

[0221] Based on the first parameter matrix, a second parameter matrix is ​​predicted; the matrix elements of the second parameter matrix include the time series of the first parameter of each of the battery swapping stations within the at least one first time period;

[0222] The matrix elements of the second parameter matrix are adjusted based on the location data to obtain the third parameter matrix;

[0223] Based on the third parameter matrix, the battery swapping demand information of the target battery swapping station during the at least one first time period is predicted.

[0224] As some optional implementations, the prediction module 1502 may specifically be used for:

[0225] Based on the parameter values ​​of each of the first parameters of each of the first battery swapping stations in the first parameter matrix at different time steps, determine the parameter change trend;

[0226] Based on the trend of parameter changes, the second parameter matrix is ​​predicted.

[0227] As some optional implementations, the prediction module 1502 may specifically be used for:

[0228] Perform a linear transformation on the first parameter matrix to generate the corresponding query vector, key vector, and value vector;

[0229] Based on the query vector and the key vector, determine the corresponding attention weight matrix;

[0230] The second parameter matrix is ​​determined based on the value vector and the attention weight matrix.

[0231] As some optional implementations, the prediction module 1502 may specifically be used for:

[0232] The influence weights between different battery swapping stations are determined based on the location data.

[0233] Based on the influence weights and correlation sequences, the time series corresponding to the target battery swapping station in the second parameter matrix is ​​adjusted to obtain the third parameter matrix; the correlation sequence is the future time series corresponding to battery swapping stations that have an influence relationship with the target battery swapping station.

[0234] As some optional implementations, the prediction module 1502 may specifically be used for:

[0235] For any two of the aforementioned battery swapping stations:

[0236] The distance between the two battery swapping stations is determined based on the location data;

[0237] If the distance between two battery swapping stations is greater than a distance threshold, the influence weight between the two battery swapping stations is determined to be zero.

[0238] If the distance between two battery swapping stations is not greater than the distance threshold, the reciprocal of the distance between the two battery swapping stations is determined as the corresponding influence weight.

[0239] As some optional implementations, the acquisition module 1501 can also be used to: acquire auxiliary parameters corresponding to the target battery swapping station before predicting the battery swapping demand information of the target battery swapping station in the at least one first time period based on the third parameter matrix; the auxiliary parameters include any one or any combination of the following: region identification data, date data, meteorological data, and vehicle data;

[0240] The prediction module 1502 can be specifically used to: predict the battery swapping demand information of the target battery swapping station during the at least one first time period based on the third parameter matrix and the auxiliary parameters.

[0241] As some optional implementation methods, the auxiliary parameters include a variety of types;

[0242] Correspondingly, prediction module 1502 can be used specifically for:

[0243] A first vector is generated based on the auxiliary parameters, and a second vector is generated based on the third parameter matrix;

[0244] The first vector and the second vector are concatenated to obtain the first concatenated vector;

[0245] Based on the first splicing vector, predict the battery swapping demand information of the target battery swapping station during at least one first time period.

[0246] As some optional implementations, the prediction module 1502 may specifically be used for:

[0247] Convert the multiple auxiliary parameters into corresponding multiple auxiliary parameter vectors;

[0248] The multiple auxiliary parameter vectors are concatenated to obtain a second concatenated vector;

[0249] The first vector is obtained by weighted summation and nonlinear transformation of each element of the second concatenated vector.

[0250] As some optional implementations, the acquisition module 1501 can be specifically used for:

[0251] Determine the target period and target sub-period to which the first time period belongs;

[0252] Obtain the historical time series of the first parameter corresponding to multiple historical time periods, wherein the multiple historical time periods include: at least one previous time period that is continuous with the first time period, the same period in the first N periods of the target period, and the same period in the first M sub-periods of the target sub-period; wherein N and M are positive integers;

[0253] The first parameter matrix is ​​determined based on the historical time series of the first parameter corresponding to the multiple historical periods.

[0254] As some optional implementations, the acquisition module 1501 can also be used to: after predicting the battery swapping demand information of the target battery swapping station in at least one first time period based on the first parameter matrix and the location data, after an interval of a preset time, re-acquire the first parameter matrix to predict the battery swapping demand information of the target battery swapping station in at least one second time period respectively; there is an overlap between the at least one first time period and the at least one second time period.

[0255] The battery swapping station demand forecast may further include: an update module, used to update the battery swapping demand information for a target time period that overlaps with the at least one second time period based on the battery swapping demand information within the at least one second time period.

[0256] The apparatus provided in this application is the same as the method in the above embodiments, and therefore both have the same embodiments and beneficial effects, which will not be repeated here.

[0257] Figure 16 A schematic diagram of the hardware structure of the battery swapping demand prediction device for a battery swapping station provided in an embodiment of this application is shown. Figure 16 As shown, the battery swapping station demand forecasting device may include a processor 1601 and a memory 1602 storing computer program instructions.

[0258] Specifically, the processor 1601 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0259] Memory 1602 may include mass storage for data or instructions. For example, and not limitingly, memory 1602 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 1602 may include removable or non-removable (or fixed) media. Where appropriate, memory 1602 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 1602 is non-volatile solid-state memory.

[0260] Memory 1602 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.

[0261] The processor 1601 reads and executes computer program instructions stored in the memory 1602 to implement any of the battery swapping demand prediction methods in the above embodiments.

[0262] In one example, the battery swapping station demand forecasting device may also include a communication interface 1603 and a bus 1604. The processor 1601, memory 1602, and communication interface 1603 are connected via the bus 1604 and communicate with each other.

[0263] The communication interface 1603 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0264] Bus 1604 includes hardware, software, or both, that couples components of the battery swapping demand forecasting equipment at a battery swapping station together. For example, and not limited to, the bus may include an Accelerated Graphical Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 1604 may include one or more buses. Although specific buses are described and illustrated in the embodiments of this application, this application considers any suitable bus or interconnection.

[0265] Furthermore, in conjunction with the battery swapping demand forecasting method for battery swapping stations in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the battery swapping demand forecasting methods for battery swapping stations in the above embodiments.

[0266] This application also provides a computer program product, including a computer program that, when executed, implements any of the battery swapping demand prediction methods for battery swapping stations described above.

[0267] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0268] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable-ROM (E-ROM), floppy disks, compact disc-ROMs (CD-ROMs), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0269] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0270] The foregoing flowcharts and / or block diagrams of methods, apparatus (systems) according to embodiments of this application have described various aspects of the present application. It should be understood that each block in the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to create a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowcharts and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0271] Although this application has been described with reference to preferred embodiments, various modifications can be made thereto and components can be replaced with equivalents without departing from the scope of this application. In particular, the technical features mentioned in the various embodiments can be combined in any manner, provided there is no structural conflict. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. A method for predicting battery swapping demand at battery swapping stations, characterized in that, include: Obtain location data between multiple battery swapping stations, and obtain the first parameter matrix; The matrix elements of the first parameter matrix include the historical time series of the first parameter of each of the battery swapping stations; the first parameter includes the attribute characteristics of the battery swapping station and the battery demand. Based on the first parameter matrix and the location data, predict the battery swapping demand information of the target battery swapping station in at least one first time period; the target battery swapping station is at least one of the plurality of battery swapping stations.

2. The method for predicting battery swapping demand at battery swapping stations according to claim 1, characterized in that, Based on the first parameter matrix and the location data, predict the battery swapping demand information of the target battery swapping station in at least one first time period, including: Based on the first parameter matrix, a second parameter matrix is ​​predicted; the matrix elements of the second parameter matrix include the time series of the first parameter of each of the battery swapping stations within the at least one first time period; The matrix elements of the second parameter matrix are adjusted based on the location data to obtain the third parameter matrix; Based on the third parameter matrix, the battery swapping demand information of the target battery swapping station during the at least one first time period is predicted.

3. The method for predicting battery swapping demand at battery swapping stations according to claim 2, characterized in that, Based on the first parameter matrix, the second parameter matrix is ​​predicted, including: Based on the parameter values ​​of each of the first parameters of each of the first battery swapping stations in the first parameter matrix at different time steps, determine the parameter change trend; Based on the trend of parameter changes, the second parameter matrix is ​​predicted.

4. The method for predicting battery swapping demand at battery swapping stations according to claim 3, characterized in that, Based on the first parameter matrix, the second parameter matrix is ​​predicted, including: Perform a linear transformation on the first parameter matrix to generate the corresponding query vector, key vector, and value vector; Based on the query vector and the key vector, determine the corresponding attention weight matrix; The second parameter matrix is ​​determined based on the value vector and the attention weight matrix.

5. The method for predicting battery swapping demand at battery swapping stations according to claim 2, characterized in that, The matrix elements of the second parameter matrix are adjusted based on the location data to obtain the third parameter matrix, which includes: The influence weights between different battery swapping stations are determined based on the location data. Based on the influence weights and correlation sequences, the time series corresponding to the target battery swapping station in the second parameter matrix is ​​adjusted to obtain the third parameter matrix; the correlation sequence is the future time series corresponding to battery swapping stations that have an influence relationship with the target battery swapping station.

6. The method for predicting battery swapping demand at battery swapping stations according to claim 5, characterized in that, Determining the influence weights between different battery swapping stations based on the location data includes: For any two of the aforementioned battery swapping stations: The distance between the two battery swapping stations is determined based on the location data; If the distance between two battery swapping stations is greater than a distance threshold, the influence weight between the two battery swapping stations is determined to be zero. If the distance between two battery swapping stations is not greater than the distance threshold, the reciprocal of the distance between the two battery swapping stations is determined as the corresponding influence weight.

7. The method for predicting battery swapping demand at battery swapping stations according to any one of claims 2 to 6, characterized in that, Before predicting the battery swapping demand information of the target battery swapping station during the at least one first time period based on the third parameter matrix, the method further includes: Obtain the auxiliary parameters corresponding to the target battery swapping station; the auxiliary parameters include any one or any combination of the following: region identification data, date data, meteorological data, and vehicle data; Correspondingly, based on the third parameter matrix, the battery swapping demand information of the target battery swapping station during the at least one first time period is predicted, including: Based on the third parameter matrix and the auxiliary parameters, the battery swapping demand information of the target battery swapping station during the at least one first time period is predicted.

8. The method for predicting battery swapping demand at battery swapping stations according to claim 7, characterized in that, The auxiliary parameters include a variety of types; Correspondingly, based on the third parameter matrix and the auxiliary parameters, the battery swapping demand information of the target battery swapping station during the at least one first time period is predicted, including: A first vector is generated based on the auxiliary parameters, and a second vector is generated based on the third parameter matrix; The first vector and the second vector are concatenated to obtain the first concatenated vector; Based on the first splicing vector, predict the battery swapping demand information of the target battery swapping station during at least one first time period.

9. The method for predicting battery swapping demand at battery swapping stations according to claim 8, characterized in that, Generate a first vector based on the auxiliary parameters, including: Convert the multiple auxiliary parameters into corresponding multiple auxiliary parameter vectors; The multiple auxiliary parameter vectors are concatenated to obtain a second concatenated vector; The first vector is obtained by weighted summation and nonlinear transformation of each element of the second concatenated vector.

10. The method for predicting battery swapping demand at battery swapping stations according to any one of claims 1 to 9, characterized in that, The process of obtaining the first parameter matrix includes: Determine the target period and target sub-period to which the first time period belongs; Obtain the historical time series of the first parameter corresponding to multiple historical time periods, wherein the multiple historical time periods include: at least one previous time period that is continuous with the first time period, the same period in the first N periods of the target period, and the same period in the first M sub-periods of the target sub-period; wherein N and M are positive integers; The first parameter matrix is ​​determined based on the historical time series of the first parameter corresponding to the multiple historical periods.

11. The method for predicting battery swapping demand at battery swapping stations according to any one of claims 1 to 9, characterized in that, After predicting the battery swapping demand information of the target battery swapping station in at least one first time period based on the first parameter matrix and the location data, the method further includes: After a preset time interval, the first parameter matrix is ​​reacquired to predict the battery swapping demand information of the target battery swapping station in at least one second time period; there is an overlap between the at least one first time period and the at least one second time period; Based on the battery swapping demand information within the at least one second time period, update the battery swapping demand information within the target time period that overlaps with the at least one first time period.

12. A device for predicting battery swapping demand at a battery swapping station, characterized in that, The device includes: The acquisition module is used to acquire location data among multiple battery swapping stations and to acquire a first parameter matrix; the matrix elements of the first parameter matrix include the historical time series of the first parameter of each of the battery swapping stations; the first parameter includes the attribute characteristics of the battery swapping station and the battery demand. The prediction module is used to predict the battery swapping demand information of the target battery swapping station in at least one first time period based on the first parameter matrix and the location data; the target battery swapping station is at least one of the plurality of battery swapping stations.

13. A battery swapping station demand forecasting device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the battery swapping demand prediction method for battery swapping stations as described in any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the battery swapping demand prediction method for battery swapping stations as described in any one of claims 1 to 11.

15. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the battery swapping demand prediction method for battery swapping stations as described in any one of claims 1 to 11.