Model training method, method for predicting the number of rechargeable berths, electronic device and medium

By collecting and clustering historical data of charging stations, the long-short-term memory neural network is used to build a charging parking prediction model, which solves the problem of inaccurate prediction of charging parking occupancy, improves prediction accuracy, and helps new energy vehicle owners find available charging stations.

CN118378093BActive Publication Date: 2024-09-17ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410812130.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-09-17
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

The prediction of charging parking occupancy in the existing technology is not accurate enough and cannot effectively solve the problem of new energy vehicle owners finding available charging stations when the battery is low while driving.

Method used

Collect historical data of charging stations, including deterministic and uncertain factors, and obtain multiple different types of clustering results through clustering. A long-short-term memory neural network is used to build a charging berth prediction model, and the model is trained to improve prediction accuracy.

Benefits of technology

By incorporating uncertainty factors on the basis of deterministic factors, the richness of factors in the sample is increased, and the clustering results are used to train the prediction model, which improves the accuracy of charging parking occupancy prediction and helps new energy vehicle owners find available charging stations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118378093B
    Figure CN118378093B
Patent Text Reader

Abstract

The present application relates to a model training method, a method for predicting the number of charging berths, an electronic device and a medium. The method collects historical data of charging stations as samples, wherein the historical data includes a first factor and a second factor that affect the number of charging berths; wherein the relationship between the first factor and the number of charging berths is deterministic, and the relationship between the second factor and the number of charging berths is uncertain; the samples are clustered to obtain a plurality of different types of clustering results; the plurality of different types of clustering results are input into a preset charging berth prediction model to obtain a trained charging berth prediction model corresponding to the different types of clustering results; wherein the charging berth prediction model is constructed based on a long short-term memory neural network; the problem of inaccurate prediction of charging berth occupancy is solved, and the accuracy of the prediction of charging berth occupancy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of charging berth occupancy prediction, and in particular to a model training method, a method for predicting the number of charging berths, an electronic device and a medium. Background Art

[0002] With the innovation of advanced technologies around the world, the new energy industry has broad prospects for development. There is a serious imbalance between the number of new energy vehicles and the charging facilities that have been built. When users are running low on power, they often use various third-party software to query available charging stations, but most third-party software can only display real-time charging station information, which means that when new energy vehicle owners arrive at the charging station, the pre-selected charging gun is already occupied. Although current machine learning and deep learning algorithms can already predict the occupancy of charging spaces at a charging station at a certain point in the future, the prediction results are not always accurate and the prediction accuracy is low.

[0003] With regard to the problem of inaccurate prediction of charging space occupancy in related technologies, no effective solution has been proposed so far. Summary of the invention

[0004] In this embodiment, a model training method, a method for predicting the number of charging berths, an electronic device and a medium are provided to solve the problem of inaccurate prediction of charging berth occupancy in related technologies.

[0005] In a first aspect, a model training method is provided in this embodiment, including:

[0006] Collecting historical data of the charging station as a sample, the historical data includes a first factor and a second factor that affect the number of chargeable berths; wherein the relationship between the first factor and the number of chargeable berths is deterministic, and the relationship between the second factor and the number of chargeable berths is uncertain;

[0007] Clustering the samples to obtain multiple different types of clustering results;

[0008] The plurality of different types of clustering results are input into a preset charging berth prediction model to obtain a trained charging berth prediction model corresponding to the different types of clustering results; wherein the charging berth prediction model is constructed based on a long short-term memory neural network.

[0009] In some of the embodiments, collecting historical data of the charging station as a sample includes:

[0010] Collecting the historical data of the charging station in the past N days;

[0011] Divide the historical data of each day into M time periods according to a preset time length to obtain N×M samples;

[0012] The N×M samples are divided into a training set and a test set.

[0013] In some of the embodiments, the samples are clustered to obtain multiple different types of clustering results, including:

[0014] Select samples in the same period of the past N days from the training set, cluster the selected samples according to different cluster numbers to obtain N clusters;

[0015] Among the N classes, a target class is selected as the final clustering result in the same time period according to the DBI value; wherein the DBI value is the ratio of the sum of the average intra-class distances of any two classes to the distances between the centers of the two classes.

[0016] In some of the embodiments, samples in the same period of the past N days are selected from the training set, and the selected samples are clustered according to different cluster numbers to obtain N classes, including:

[0017] Calculate the Euclidean distance between every two samples in the same period in the past N days;

[0018] Merge the two classes with the smallest Euclidean distance between classes as the current new class;

[0019] Loop through the following steps until only one class remains:

[0020] Calculate the Euclidean distance between the current new class and other current classes;

[0021] The class corresponding to the smallest Euclidean distance is merged with the current new class to obtain the next new class.

[0022] In some embodiments, the charging berth prediction model includes: an input layer, a fully connected layer, a hidden layer and an output layer, wherein the hidden layer includes a forget gate unit, an input gate unit, an output gate unit and an output unit; the plurality of different types of clustering results are input into a preset charging berth prediction model for training, and a trained charging berth prediction model corresponding to different types of clustering results is obtained, including:

[0023] Inputting the plurality of different types of clustering results into the input layer respectively, and transmitting the plurality of different types of clustering results to the fully connected layer via the input layer; wherein each of the clustering results corresponds to a different time period of a day, and the number of neurons in the input layer is consistent with the number of types of the clustering results;

[0024] The fully connected layer integrates the multiple different types of clustering results to obtain an input sequence X with time attributes =﹛X t1 , Xt2 , X t3 , …, X tn ﹜, then pass the input sequence X to the hidden layer;

[0025] Based on the clustering result at time t in the input sequence, the values ​​of the forget gating unit, the input gating unit and the output gating unit are adjusted; based on the values ​​of the forget gating unit, the input gating unit and the output gating unit, the value of the output unit is calculated; and the state value of the hidden layer is determined according to the value of the output unit;

[0026] The output layer generates a final output according to the state value of the hidden layer, wherein the number of neurons in the output layer is consistent with the number of types of the clustering results.

[0027] In some of the embodiments, the state of the hidden layer is , then at time t we have:

[0028]

[0029] in, They are respectively the forget gating unit, the input gating unit and the output gating unit; is the weight of the recursive connection; is the state of the hidden layer; To input information; are the biases of the functions respectively; is the output unit of the hidden layer.

[0030] In a second aspect, a method for predicting the number of charging berths is provided in this embodiment, including:

[0031] Inputting data including the first factor and the second factor associated with the target time point in the target charging station into a charging berth prediction model to predict the number of used charging berths, wherein the charging berth prediction model is trained by the model training method described in the first aspect above;

[0032] The predicted number of available charging berths is obtained by subtracting the predicted number of used charging berths from the actual total number of charging berths at the charging station.

[0033] In some embodiments, before inputting the data including the first factor and the second factor associated with the target time point in the target charging station into the charging berth prediction model, the method further includes:

[0034] receiving a query instruction sent by a user terminal, wherein the query instruction includes a geographical location of the user terminal;

[0035] Determining the target charging station according to the geographical location of the user terminal;

[0036] The target time point is determined according to the query instruction or the geographical location of the user terminal.

[0037] In some embodiments, determining the target charging station according to the geographical location of the user terminal includes:

[0038] Acquire the real geographical location of the user terminal, pre-process the real geographical location, and obtain a replacement geographical location for the real geographical location;

[0039] A charging station that is within a preset distance from the alternative geographical location is used as the target charging station.

[0040] In some embodiments, obtaining the real geographical location of the user terminal, preprocessing the real geographical location, and obtaining a replacement geographical location for the real geographical location includes:

[0041] Obtaining a first location area where the real geographic location is located, a distinguishability level parameter, and a privacy parameter, and calculating a privacy budget value according to the first location area where the real geographic location is located, the distinguishability level parameter, and the privacy parameter;

[0042] Determine a preset range according to the privacy budget value, and draw a second location area around the real geographical location with a value falling within the preset range as a radius;

[0043] If the generated current candidate replacement point is outside the first location area, searching for a location point closest to the current candidate replacement point in the intersection of the first location area and the second location area, and using the location point as a new current candidate replacement point;

[0044] If the generated current candidate replacement point is within the first location area of ​​the location, the location of the current candidate replacement point is used as the replacement geographic location.

[0045] In some of the embodiments, determining the target time point according to the geographical location of the user terminal includes:

[0046] determining a distance from the alternative geographic location to the target charging station;

[0047] The time point from the alternative geographical location to the target charging station is calculated according to the distance and the current speed of the vehicle where the user terminal is located, and the time point is used as the target time point.

[0048] In a third aspect, an electronic device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect or the second aspect when executing the computer program.

[0049] In a fourth aspect, a storage medium is provided in this embodiment, on which a computer program is stored, and when the program is executed by a processor, the steps of the method described in the first aspect or the second aspect are implemented.

[0050] The above-mentioned model training method, charging berth number prediction method, electronic device and medium, on the basis of deterministic factors, incorporate uncertain factors into the sample to improve the richness of factors in the sample; and cluster the samples to obtain multiple different types of clustering results, and the relationship between the samples can be obtained; using multiple different types of clustering results to train the prediction model helps to fully explore the relationship between the factors in the sample, and ultimately obtain a more accurate relationship between the number of used charging berths or the utilization rate of the charging berth and various types of data, thereby improving the accuracy of the prediction model in predicting the occupancy of the charging berths.

[0051] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0053] Figure 1 A hardware structure block diagram of a terminal of a model training method or a method for predicting the number of chargeable berths in an embodiment;

[0054] Figure 2 A flowchart of a model training method in one embodiment;

[0055] Figure 3 A flowchart of a method for generating charging station samples in one embodiment;

[0056] Figure 4 is a flow chart of a clustering method in one embodiment;

[0057] Figure 5 for Figure 4 Execution flow chart of step S401;

[0058] Figure 6 A schematic diagram of the structure of a charging berth prediction model in an embodiment;

[0059] Figure 7 A flowchart of a model training method in another embodiment;

[0060] Figure 8 A flowchart of a method for predicting the number of charging berths in one embodiment;

[0061] Fig. 9 An interactive schematic diagram of a system for predicting the number of charging berths in one embodiment;

[0062] Fig.10 A flowchart of a method for predicting the number of charging berths in another embodiment;

[0063] Fig.11 is a flow chart of a method for calculating an alternative geographical location of a user terminal in one embodiment;

[0064] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0065] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0066] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0067] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 1 is a hardware structure block diagram of a terminal of a model training method or a method for predicting the number of chargeable parking spaces according to an embodiment of the present application. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 101 and memory 102 for storing data, wherein processor 101 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 103 and an input and output device 104 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0068] The memory 102 can be used to store computer programs, for example, software programs and modules of application software, such as the computer programs corresponding to the model training method or the method for predicting the number of rechargeable berths in this embodiment. The processor 101 executes various functional applications and data processing by running the computer programs stored in the memory 102, that is, to implement the above method. The memory 102 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 102 may further include a memory remotely arranged relative to the processor 101, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0069] The transmission device 103 is used to receive or send data via a network. The above network includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 103 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 103 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0070] Most of the related technologies use machine learning models such as long short-term memory networks and deep residual neural networks to predict the actual usage rate of charging stations. These models are based on obtaining some deterministic factors that have a greater impact on the prediction results in the past, and through continuous automatic learning of the model, obtain the relationship between the usage rate of charging stations and deterministic factors to predict the actual usage rate of charging stations. The models of related technologies can often only predict the actual usage rate of charging stations in the short term in the future, and the effect of predicting the next few days or a long time is poor.

[0071] Research has found that most current methods for predicting charging station occupancy rates only consider deterministic factors to make predictions. However, for some emergencies, such as car accidents on the road, concerts, charging station discounts and other non-deterministic factors, they will affect the prediction results. Moreover, even if these uncertain factors are included in the sample, if the relationship between these factors is not considered, the trained model will not be able to improve the prediction accuracy if the unprocessed samples are directly used to train the model.

[0072] Based on the analysis of the above problems, in one embodiment, Figure 2 As shown in Figure 1, a model training method is provided to improve the prediction accuracy of the charging berth prediction model. Figure 1 The terminal in is used as an example to illustrate the process, including the following steps:

[0073] Step S201, collecting historical data of the charging station as a sample, the historical data includes a first factor and a second factor that affect the number of charging berths; wherein the relationship between the first factor and the number of charging berths is deterministic, and the relationship between the second factor and the number of charging berths is uncertain.

[0074] The first factor is deterministic. For example, the first factor includes but is not limited to the number of charging berths in each time period (assuming that one berth corresponds to one charging gun), the power of the charging station, and whether the charging berth is indoors. The second factor is uncertain. For example, the second factor includes but is not limited to the weather conditions in each time period (sunny, cloudy, rainy, snowy), the operation of the charging station (for example, whether there are discounts), whether an event is being held (such as a concert, exhibition), whether it is a holiday, and the number of charging gun failures.

[0075] Step S202: cluster the samples to obtain a plurality of different types of clustering results.

[0076] The clusters generated by clustering are a collection of data objects that are similar to objects in the same cluster and different from objects in other clusters. Multiple different types of clustering results are multiple different data types. These clustering results can be used as input variables to train subsequent charging berth prediction models (referred to as prediction models) to fully explore the relationships in the data. By determining the input variables of different types of prediction models, prediction models under different categories can be constructed. Optionally, this step can use a hierarchical clustering algorithm to cluster the samples.

[0077] Step S203, inputting a plurality of different types of clustering results into a preset charging berth prediction model to obtain a trained charging berth prediction model corresponding to different types of clustering results; wherein the charging berth prediction model is constructed based on a long short-term memory neural network.

[0078] Since the Long Short-Term Memory (LSTM) neural network can extract information from long time series and solve the gradient explosion and vanishing problems that occur during long time series training, this step uses LSTM to build a prediction model, and uses different types of clustering results as input variables to train the prediction model to obtain prediction models corresponding to different types of clustering results. The output of the prediction model can be the number of used charging berths or the utilization rate of charging berths.

[0079] In the above steps S201 to S203, on the basis of deterministic factors, uncertain factors are incorporated into the sample to improve the richness of the factors in the sample; and the samples are clustered to obtain multiple different types of clustering results, and the relationship between the samples can be obtained; using multiple different types of clustering results to train the prediction model is helpful to fully explore the relationship between the factors in the sample, and finally obtain a more accurate relationship between the number of used charging berths or the charging berth utilization rate and various types of data, thereby improving the accuracy of the prediction model in predicting the charging berth occupancy situation.

[0080] In one embodiment, Figure 3 As shown, step S201, collecting historical data of charging stations as samples, can be achieved by the following method:

[0081] Step S301, collecting historical data of charging stations in the past N days, where N is a natural number greater than 1.

[0082] Step S302: divide the historical data of each day into M time periods according to a preset time length, and obtain N×M samples. Where N and M are natural numbers greater than or equal to 1. The historical data of the charging station in the past N days can be collected. For example, according to the division rule of 30 minutes per period, each day can be divided into 48 time periods, and the historical data of N days can obtain N×48 samples.

[0083] Step S303: divide the N×M samples into a training set and a test set. For example, randomly select 80% of the N×48 samples as a training set and 20% as a test set.

[0084] Furthermore, after the historical data of the charging station is collected, the collected historical data can be encoded to obtain a sample. Taking a certain time period of a certain day as an example, the specific encoding is shown in the following Table 1:

[0085] Table 1 Historical data coding table

[0086]

[0087] In one embodiment, Figure 4 As shown, step S202, clustering the samples to obtain a plurality of different types of clustering results, can be achieved by the following method: including:

[0088] Step S401: Select samples in the same period of time in the past N days from the training set, and cluster the selected samples according to different cluster numbers to obtain N clusters. Figure 5 As shown, this step can be specifically implemented by the following method:

[0089] Step S501, calculate the Euclidean distance between every two samples in the same time period in the past N days. The Euclidean distance is used to calculate the similarity between data.

[0090] Step S502: merge the two classes that meet the minimum Euclidean distance between the classes as the current new class. Calculate the minimum distance between each pair of data to obtain a distance matrix. For example, suppose there are N initial data, each of which is a class. Initially, N classes can be established, that is, , where the subscript is the category and the superscript is the number of cluster merges. Then, by calculating the distances between the categories, we get an N×N dimensional distance matrix D0. The two categories that meet the minimum Euclidean distance between the categories are merged into a new category. The distance matrix D obtained from the previous clustering operation is obtained. n The smallest element in , add this element, and we get The distance between the two categories will be Combine into one category , to create a new category: .

[0091] Step S503, loop through the following steps until there is one class left: calculate the Euclidean distance between the current new class and the other classes; merge the class with the smallest Euclidean distance with the current new class to obtain the next new class. Compared with other current The distance between them is D n+1 . Repeat the above steps until they are finally merged into one category.

[0092] Step S402, among the N classes, select the target class as the final clustering result in the same period according to the DBI value; wherein the DBI value is the ratio of the sum of the average distances within any two classes to the distances between the centers of the two classes. By setting different numbers of clusters and according to the DBI value, the best clustering effect can be obtained. In this step, DBI (Davidson-Botting Index) is used as the performance indicator of clustering, and its calculation formula is as follows:

[0093]

[0094] In the above steps S401 to S402, samples of the same time period are clustered according to the above method in N×48 samples, and the best clustering effect is obtained by setting different clustering numbers n and according to the DBI value, thereby obtaining the final clustering result X tn This setting can more clearly reveal the hierarchical structure of historical data, obtain the relationship between various influencing factors, and improve the training efficiency of the model.

[0095] In one embodiment, Figure 6 A schematic diagram of the structure of a charging berth prediction model is provided, the prediction model includes: an input layer 601, a fully connected layer 602, a hidden layer 603 and an output layer 604. The hidden layer includes a forget gate unit, an input gate unit, an output gate unit and an output unit. Figure 7 As shown, the above step S203, inputting a plurality of different types of clustering results into a preset charging berth prediction model for training, and obtaining a trained charging berth prediction model corresponding to different types of clustering results, can be implemented by the following method:

[0096] Step S701, input multiple different types of clustering results into the input layer respectively, and transmit the multiple different types of clustering results to the fully connected layer via the input layer; wherein each clustering result corresponds to a different time period of the day, and the number of neurons in the input layer is consistent with the number of types of clustering results.

[0097] In this step, different types of clustering results may be preprocessed, such as performing averaging processing on them to remove some dimensionless effects.

[0098] Step S702: The fully connected layer integrates multiple different types of clustering results to obtain an input sequence X with time attributes =﹛X t1 , X t2 , X t3 , …, X tn ﹜, and then pass the input sequence X to the hidden layer.

[0099] Step S703, based on the clustering result at time 𝑡 in the input sequence, adjust the values ​​of the forget gate unit, the input gate unit, and the output gate unit; based on the values ​​of the forget gate unit, the input gate unit, and the output gate unit, calculate the value of the output unit; and determine the state value of the hidden layer according to the value of the output unit. The state of the hidden layer is , then at time t we have:

[0100]

[0101] in, They are forget gate unit, input gate unit and output gate unit respectively; is the weight of the recursive connection; is the state of the hidden layer; To input information; are the biases of the functions respectively; is the output unit of the hidden layer.

[0102] Step S704: the output layer generates a final output according to the state value of the hidden layer, wherein the number of neurons in the output layer is consistent with the number of types of the clustering result.

[0103] Optionally, after step S704, the root mean square error or the mean absolute error can be used as a loss function to evaluate the prediction performance of the prediction model. If the current prediction performance does not meet the preset requirements, an optimizer (such as the Adam Optimizer algorithm) is used to optimize the current prediction model to reduce the value of the loss function, thereby improving the prediction performance of the prediction model.

[0104] The root mean square error formula is as follows:

[0105]

[0106] The mean absolute error is as follows:

[0107]

[0108] Where N is the number of samples, α is the measured value, and β is the predicted value. The number of charging berths available at the charging station is obtained by subtracting the predicted number of charging berths at time t from the total number of charging berths at time t.

[0109] In one embodiment, Figure 8 A flowchart of a method for predicting the number of charging berths is provided, which can be applied to Figure 1 For the terminal shown, the process includes the following steps:

[0110] Step S801: input data including a first factor and a second factor associated with a target time point in a target charging station into a charging berth prediction model to predict the number of used charging berths, wherein the charging berth prediction model is trained by the model training method of any of the above embodiments.

[0111] For a certain charging station, when predicting the number of charging berths available at a certain time point, first collect the data containing the first factor and the second factor that will appear at the target time point. Input the collected data into the trained prediction model to obtain the number of charging berths used at the charging station in a certain period of time in the future. The training method of the prediction model can refer to the above embodiment and will not be repeated here.

[0112] Step S802 : subtract the predicted number of used charging berths from the actual total number of charging berths at the charging station to obtain the predicted number of available charging berths.

[0113] Because the scale of a charging station may be expanded (increase the total number of charging bays) or reduced (reduce the number of charging guns) at any time, in order to avoid model failure caused by the expansion or reduction of the charging station, this step uses the number of used charging bays as the model output, and then deducts the predicted number of used charging bays from the actual total number of charging bays of the charging station to indirectly obtain the number of charging bays, thereby avoiding model failure caused by the expansion or reduction of the charging station.

[0114] In the above steps S801 to S802, the number of used charging berths is predicted by the trained charging berth prediction model, and the number of available charging berths is calculated based on the predicted number of used charging berths, thereby improving the accuracy of the prediction of the number of available charging berths.

[0115] In one embodiment, Fig. 9 An interactive schematic diagram of a system for predicting the number of rechargeable parking spaces is provided. The system for predicting the number of rechargeable parking spaces includes a user terminal, a prediction server, and an application server, wherein the user terminal is in communication connection with the prediction server, and the prediction server is in communication connection with the application server. The user terminal is on the user side for the user to input instructions. The prediction server is used to receive instructions initiated by the user terminal and predict the number of rechargeable parking spaces. The application server is used to provide charging station data query services. The application server can be various third-party software or servers, such as a location query server.

[0116] Combination Fig. 9 , Fig.10A flow chart of a method for predicting the number of charging berths is provided for the system. In step S801, before inputting data including a first factor and a second factor associated with a target time point in a target charging station into a charging berth prediction model, the method further includes:

[0117] Step S901, receiving a query instruction sent by a user terminal, the query instruction including the geographical location of the user terminal. The user terminal can be a mobile phone, a tablet, a vehicle-mounted terminal, or other electronic devices. The user can issue instructions through a mobile phone, a tablet, a vehicle-mounted terminal, or other electronic devices, and these instructions reach the application server through the prediction server, and the location information of the charging stations along the way is queried through the application server. Among them, the geographical location of the user terminal can be obtained through the GPS (Global Positioning System) built into the user terminal.

[0118] Step S902: determine a target charging station according to the geographical location of the user terminal.

[0119] The target charging station may be at least one charging station within a preset distance from the user terminal.

[0120] In one embodiment, in order to protect user privacy, the real geographical location of the user terminal may be obtained first, and the real geographical location may be preprocessed to obtain an alternative geographical location of the real geographical location; and a charging station within a preset distance from the alternative geographical location may be used as a target charging station. Fig.11 As shown, the calculation steps of the alternative geographical location of the user terminal are as follows:

[0121] Step S1001, obtain the first location area where the real geographical location is located, the distinguishability level parameter, and the privacy parameter, and calculate the privacy budget value according to the first location area where the real geographical location is located, the distinguishability level parameter, and the privacy parameter. Specifically, input the real location of the user, obtain the location area A where the real location of the user is located (find the real location replacement point from this area), the distinguishability level parameter of the geographical indistinguishability mechanism and privacy parameters , adjust the privacy budget according to these values , the calculation formula is as follows:

[0122]

[0123] Among them, the privacy parameters The privacy parameter is used to characterize the user's expected degree of privacy protection. The smaller the value, the stronger the expected privacy protection. is the side length of the square of the location area, q>5.

[0124] Step S1002: Determine the preset range according to the privacy budget value, and draw a second location area around the real geographical location with the value within the preset range as the radius. ,angle Draw a small circle B, the actual position point of the user within the small circle B and the corresponding replacement point are indistinguishable.

[0125] Step S1003: If the generated current candidate replacement point is outside the first location area, then find the location point closest to the current candidate replacement point in the intersection of the first location area and the second location area, and use the location point as the new current candidate replacement point. Specifically, if the generated replacement point point is outside location area A, then find the replacement point closest to the replacement point point in the intersection of location area A and small circle B, assign it to point, and repeat step S1002.

[0126] Step S1004: If the generated current candidate replacement point is within the first location area, the location of the current candidate replacement point is used as the replacement geographic location. Specifically, if the generated replacement point point is within location area A, point is directly returned.

[0127] In the above steps S1001 to S1004, the real data input by the user is location-blurred through the geographic indistinguishability mechanism, so that the attacker cannot identify the user's real location within the user's protected area, thereby avoiding the leakage of the user's private location when the user queries available charging stations through various trusted third-party software, thereby greatly protecting the user's privacy security.

[0128] Step S903: determine the target time point according to the query instruction or the geographical location of the user terminal.

[0129] Solution 1: the query instruction includes the geographical location of the user terminal and the target time point, that is, the user enters the time point to be queried in the user terminal, and the geographical location and the target time point of the user terminal can be directly determined according to the query instruction.

[0130] Solution 2: If the query instruction only contains the geographical location of the user terminal, that is, the user does not enter the time point that he wants to query in the user terminal, then the target time point is calculated based on the geographical location of the user terminal. Specifically, the distance from the alternative geographical location to the target charging station is determined; based on the distance and the current speed of the vehicle where the user terminal is located, the time point from the alternative geographical location to the target charging station is calculated, and this time point is used as the target time point.

[0131] The above steps S901 to S903 give prediction results based on whether the user enters a future time point, which greatly ensures that there are available charging berths when the user arrives at the charging station. If the user enters a future time point, the number of available charging berths at each charging station at the future time point is predicted, and the specific location information is returned; if the user does not enter a specific time point, the distance from the user's location to each charging station is calculated, the time to arrive at each charging station is calculated based on the current vehicle speed, and then the number of available charging berths at the charging station at that time point is predicted and returned to the user.

[0132] Furthermore, the user's real location is replaced by point and input into various application servers. Through the geographic indistinguishability mechanism, the real data entered by the user is location-blurred, making it impossible for attackers to identify the user's real location within the user's protected area. This avoids the leakage of private location when the user queries available charging stations through various trusted third-party software, greatly protecting the user's privacy and security.

[0133] In this embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0134] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0135] In one embodiment, the processor may be configured to perform the following steps through a computer program:

[0136] Collect historical data of charging stations as samples, the historical data including a first factor and a second factor that affect the number of available charging berths; wherein the relationship between the first factor and the number of available charging berths is deterministic, and the relationship between the second factor and the number of available charging berths is uncertain;

[0137] Cluster the samples to obtain multiple different types of clustering results;

[0138] A plurality of different types of clustering results are input into a preset charging berth prediction model to obtain a trained charging berth prediction model corresponding to different types of clustering results; wherein the charging berth prediction model is constructed based on a long short-term memory neural network.

[0139] In one embodiment, the processor may be configured to perform the following steps through a computer program:

[0140] Inputting data including the first factor and the second factor associated with the target time point in the target charging station into a charging berth prediction model to predict the number of used charging berths, wherein the charging berth prediction model is trained by the model training method provided in the above embodiment;

[0141] The predicted number of available charging berths is obtained by subtracting the predicted number of used charging berths from the actual number of charging berths at the charging station.

[0142] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.

[0143] In addition, in combination with the method provided in the above embodiments, a storage medium may be provided in this embodiment to implement the method. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the methods in the above embodiments is implemented.

[0144] In one embodiment, when the above computer program is executed by a processor, the following steps are implemented:

[0145] Collect historical data of charging stations as samples, the historical data including a first factor and a second factor that affect the number of available charging berths; wherein the relationship between the first factor and the number of available charging berths is deterministic, and the relationship between the second factor and the number of available charging berths is uncertain;

[0146] Cluster the samples to obtain multiple different types of clustering results;

[0147] A plurality of different types of clustering results are input into a preset charging berth prediction model to obtain a trained charging berth prediction model corresponding to different types of clustering results; wherein the charging berth prediction model is constructed based on a long short-term memory neural network.

[0148] In one embodiment, when the above computer program is executed by a processor, the following steps are implemented:

[0149] Inputting data including the first factor and the second factor associated with the target time point in the target charging station into a charging berth prediction model to predict the number of used charging berths, wherein the charging berth prediction model is trained by the model training method provided in the above embodiment;

[0150] The predicted number of available charging berths is obtained by subtracting the predicted number of used charging berths from the actual number of charging berths at the charging station.

[0151] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.

[0152] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.12 As shown. The computer device includes a processor, a memory and a network interface connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store historical data of the charging station. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a model training method or a method for predicting the number of chargeable berths is implemented.

[0153] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0154] It should be understood that the specific embodiments described above are only used to explain the relevant applications, rather than to limit them. According to the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.

[0155] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.

[0156] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.

[0157] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. The acquisition, storage, use, and processing of data involved in the embodiments of this application are in compliance with the relevant provisions of national laws and regulations.

[0158] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0159] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. A method for predicting the number of charging berths, characterized in that: include: Inputting data including the first factor and the second factor associated with the target time point in the target charging station into the charging berth prediction model to predict the number of used charging berths; Subtract the predicted number of used charging berths from the actual total number of charging berths of the charging station to obtain the predicted number of available charging berths; The charging berth prediction model is obtained by training using a model training method, and the model training method includes: Collecting historical data of the charging station as a sample, the historical data includes a first factor and a second factor that affect the number of chargeable berths; wherein the relationship between the first factor and the number of chargeable berths is deterministic, and the relationship between the second factor and the number of chargeable berths is uncertain; Clustering the samples to obtain multiple different types of clustering results; Inputting the plurality of different types of clustering results into a preset charging berth prediction model to obtain a trained charging berth prediction model corresponding to the different types of clustering results; wherein the charging berth prediction model is constructed based on a long short-term memory neural network; Before inputting the data including the first factor and the second factor associated with the target time point in the target charging station into the charging berth prediction model, the method further includes: receiving a query instruction sent by a user terminal, wherein the query instruction includes a geographical location of the user terminal; Determining the target charging station according to the geographical location of the user terminal; Determine the target time point according to the query instruction or the geographical location of the user terminal; Wherein, determining the target charging station according to the geographical location of the user terminal includes: Acquire the real geographical location of the user terminal, pre-process the real geographical location, and obtain a replacement geographical location for the real geographical location; Taking a charging station within a preset distance from the alternative geographical location as the target charging station; The step of acquiring the real geographical location of the user terminal and preprocessing the real geographical location to obtain a replacement geographical location for the real geographical location includes: Obtaining a first location area where the real geographic location is located, a distinguishability level parameter, and a privacy parameter, and calculating a privacy budget value according to the first location area where the real geographic location is located, the distinguishability level parameter, and the privacy parameter; Determine a preset range according to the privacy budget value, and draw a second location area around the real geographical location with a value falling within the preset range as a radius; If the generated current candidate replacement point is outside the first location area, searching for a location point closest to the current candidate replacement point in the intersection of the first location area and the second location area, and using the location point as a new current candidate replacement point; If the generated current candidate replacement point is within the first location area, the location of the current candidate replacement point is used as the replacement geographic location.

2. The method for predicting the number of chargeable berths according to claim 1, characterized in that: Collect historical data of charging stations as samples, including: Collecting the historical data of the charging station in the past N days; Divide the historical data of each day into M time periods according to a preset time length to obtain N×M samples; The N×M samples are divided into a training set and a test set.

3. The method for predicting the number of chargeable berths according to claim 2, characterized in that: The samples are clustered to obtain multiple different types of clustering results, including: Select samples in the same period of the past N days from the training set, cluster the selected samples according to different cluster numbers to obtain N clusters; Among the N classes, a target class is selected as the final clustering result in the same time period according to the DBI value; wherein the DBI value is the ratio of the sum of the average intra-class distances of any two classes to the distances between the centers of the two classes.

4. The method for predicting the number of chargeable berths according to claim 3, characterized in that: Select samples in the same period of time in the past N days from the training set, cluster the selected samples according to different cluster numbers, and obtain N classes, including: Calculate the Euclidean distance between every two samples in the same period in the past N days; Merge the two classes with the smallest Euclidean distance between classes as the current new class; Loop through the following steps until only one class remains: Calculate the Euclidean distance between the current new class and other current classes; The class corresponding to the smallest Euclidean distance is merged with the current new class to obtain the next new class.

5. The method for predicting the number of chargeable berths according to claim 1, characterized in that: The charging berth prediction model includes: an input layer, a fully connected layer, a hidden layer and an output layer, wherein the hidden layer includes a forget gate unit, an input gate unit, an output gate unit and an output unit; the plurality of different types of clustering results are input into a preset charging berth prediction model for training, and a trained charging berth prediction model corresponding to different types of clustering results is obtained, including: Inputting the plurality of different types of clustering results into the input layer respectively, and transmitting the plurality of different types of clustering results to the fully connected layer via the input layer; wherein each of the clustering results corresponds to a different time period of a day, and the number of neurons in the input layer is consistent with the number of types of the clustering results; The fully connected layer integrates the multiple different types of clustering results to obtain an input sequence X with time attributes =﹛X t1 , X t2 , X t3 , …, X tn ﹜, then pass the input sequence X to the hidden layer; Based on the clustering result at time t in the input sequence, the values ​​of the forget gating unit, the input gating unit and the output gating unit are adjusted; based on the values ​​of the forget gating unit, the input gating unit and the output gating unit, the value of the output unit is calculated; and the state value of the hidden layer is determined according to the value of the output unit; The output layer generates a final output according to the state value of the hidden layer, wherein the number of neurons in the output layer is consistent with the number of types of the clustering results.

6. The method for predicting the number of chargeable berths according to claim 5, characterized in that: The state of the hidden layer is , then at time t we have: ; in, They are respectively the forget gating unit, the input gating unit and the output gating unit; is the weight of the recursive connection; is the state of the hidden layer; To input information; are the biases of the functions respectively; is the output unit of the hidden layer.

7. The method for predicting the number of chargeable berths according to claim 1, characterized in that: Determining the target time point according to the geographical location of the user terminal includes: determining a distance from the alternative geographic location to the target charging station; The time point from the alternative geographical location to the target charging station is calculated according to the distance and the current speed of the vehicle where the user terminal is located, and the time point is used as the target time point.

8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.