A shared bicycle spatiotemporal data prediction model and method

By introducing the CNN-LSTM network into the shared bicycle prediction model, the spatial characteristics and timing characteristics of the placement point were captured, and the problem that the existing model failed to effectively capture the implicit characteristics of the timing was solved, the prediction accuracy was improved, and the operation of shared bicycles was optimized.

CN119691490BActive Publication Date: 2025-04-22ANHUI UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510185977.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-20
Publication Date
2025-04-22
Estimated Expiration
2045-02-20

AI Technical Summary

Technical Problem

The existing shared bicycle prediction model fails to effectively capture the implicit features of passenger flow in timing and the cross-period change patterns in the day, resulting in insufficient prediction accuracy.

Method used

The CNN-LSTM model is adopted to construct the spatiotemporal matrix of shared bicycle delivery points, and the k-means clustering algorithm is used to capture the spatial characteristics and passenger flow timing characteristics between delivery points in combination with the CNN and LSTM networks to make predictions.

Benefits of technology

The accuracy of short-term passenger flow prediction of shared bicycles is improved, and the changes in passenger flow at the delivery point can be more accurately reflected, and the scheduling and operation of shared bicycles is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691490B_ABST
    Figure CN119691490B_ABST
Patent Text Reader

Abstract

The present invention discloses a shared bicycle spatiotemporal data prediction model and method, wherein the method includes: constructing a spatiotemporal matrix of passenger flow at shared bicycle delivery points; clustering using k-means to obtain cluster labels; capturing spatial features between delivery points using a CNN network; capturing passenger flow temporal features through LSTM processing based on the spatial features between delivery points, and obtaining a trained network model; and predicting passenger flow at a target delivery point using the trained network model. The present invention proposes a CNN-LSTM model for short-term passenger flow prediction, uses Gap-statistic to determine the optimal number of clusters, uses the correlation coefficient to obtain the delivery point with the greatest correlation, and after feature fusion, uses CNN convolution to capture the spatial features between delivery points, and uses LSTM to capture the temporal features, which has higher prediction effect and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of shared bicycle deployment prediction, and in particular to a shared bicycle spatiotemporal data prediction model and method. Background Art

[0002] Low-carbon and environmental protection is the ideal development model for future ecological cities. Shared bicycles are easy to use, low-carbon, environmentally friendly, and convenient for transportation. They are not troubled by traffic congestion and are widely used for short-distance travel. Shared bicycles can effectively meet the public's short-distance travel needs, solve the "last mile" travel pain point, provide people with a variety of choices for daily short-distance travel, and promote the improvement of the public transportation system and the prosperity and development of the sharing economy.

[0003] At present, the number of shared bicycles at each distribution point is affected by various factors such as passenger flow, and often presents the characteristics of uneven distribution. When the passenger flow is large, it is easy to cause a shortage of vehicles at the distribution point; when the passenger flow is relatively small, it cannot meet the vehicle utilization rate of the distribution point. Reasonable use of spatiotemporal data to optimize the scheduling of shared bicycles and optimize the balance of supply and demand is inseparable from the accurate prediction of the demand for shared bicycles. Building a reliable spatiotemporal data prediction model for shared bicycles is of great significance to optimizing the operation of shared bicycles.

[0004] The existing prediction models for shared bicycles include single models such as BP (Back Propagation) neural network, support vector regression model SVR (Support Vactor Regression), long short-term memory network LSTM (Long Short Term Memory); and combined models such as LSTM combined with SVR model.

[0005] However, the above models often ignore the implicit temporal characteristics of shared bicycle passenger flow, and the above models mainly focus on the daily changes in shared bicycles, and fail to notice the changes in shorter time intervals reflected by the passenger flow across time periods during the day.

[0006] For example, the invention application with application number 202210402008.5 discloses a training method, system and device for a shared bicycle demand prediction model. The application scheme trains the shared bicycle demand prediction model according to the traffic conditions in the area, so that the trained demand model can accurately predict the shared bicycle demand in the current area, so that the bicycle usage in each area will not be excessive or in short supply. However, the scheme also has the problem of failing to notice the changing rules of shorter time intervals reflected by the cross-time passenger flow in a day.

[0007] For example: the invention application with application number 202110502533.X discloses a method and system for predicting short-term demand for shared bicycles based on an improved SGM (1,1) model. The application scheme establishes an SGM (1,1) model based on the original riding data of shared bicycles to obtain the initial short-term demand forecast value for shared bicycles; then the residual of the SGM (1,1) model is improved using the Markov model, the residual sequence is selected according to the principle of new information priority, and the residual of the initial forecast value is corrected using the expectation of the median of the state interval, thereby improving the prediction accuracy of the model; finally, the obtained results are presented in the form of a visualization system, which is conducive to improving the operational efficiency of the model, thereby providing an accurate and efficient reference for the actual short-term demand forecast for shared bicycles. However, it also has the problem that the implicit characteristics of shared bicycle passenger flow in time series are not considered, which is not conducive to accurate prediction. Summary of the invention

[0008] In view of the above-mentioned problems, the purpose of the present invention is to provide a shared bicycle spatiotemporal data prediction model and method, to mine the deep features of the data time series, to capture the spatial features between the delivery points using CNN convolution, to capture the time series features using LSTM, and to improve the prediction accuracy of shared bicycles.

[0009] The embodiments of the present invention provide a shared bicycle spatiotemporal data prediction model and method.

[0010] A first aspect: A method for predicting spatiotemporal data of shared bicycles, comprising:

[0011] S1. Based on historical operation data, construct a spatiotemporal matrix of passenger flow at shared bicycle deployment points;

[0012] S2. Use k-means to cluster the passenger flow of the delivery points across time periods and obtain cluster labels;

[0013] S3, after merging the spatiotemporal matrix and cluster labels, use the CNN network to capture the spatial features between the delivery points;

[0014] S4, based on the spatial features between the delivery points, the time series features of the passenger flow are captured through LSTM processing to obtain the predicted value;

[0015] S5, perform back propagation training on the error loss between the predicted value and the true value to obtain the trained network model;

[0016] S6. Use the trained network model to predict the passenger flow at the target delivery point.

[0017] Optionally, the passenger flow space-time matrix of the delivery point is expressed as:

[0018]

[0019] in,x t (i,j) express t The coordinates of the delivery point at time are (i,j) of passenger traffic, including 0≤i≤n,0≤j≤m .

[0020] Optionally, in S2, using gap statistics Gap-Statistic to determine the optimal clustering k value of k-means, the steps include:

[0021] S21. Calculate the centroid of the input sample and its cluster based on k-means cen c The sum of the distances W k , the formula is:

[0022]

[0023] in, is the n features of the mth period, is the centroid, EuclDist To calculate the Euclidean distance between the data feature and the centroid;

[0024] S22, Monte Carlo simulation B Second, obtain the uniformly distributed random samples rands that are as many as the number of input samples;

[0025] S23. Calculate the sum of the distances between the random sample and the centroid , the formula is:

[0026]

[0027] in, is the n features of the mth period, is the centroid of the random sample rands;

[0028] S24. Calculate the loss difference, the formula is:

[0029]

[0030] Among them, std is the standard deviation of the sampled values ​​after logarithmic processing;

[0031] S25. Obtain the minimum k value that meets the conditions. The formula is:

[0032]

[0033] Among them, the minimum k value is the optimal number of clusters.

[0034] Optionally, the CNN network is used in S3 to capture the spatial association between clustered delivery points, including:

[0035] To extract local features, the formula is expressed as:

[0036]

[0037] Among them, f() is a nonlinear activation function, conv1D represents a one-dimensional convolution operation, For input data, is the output data after convolution, l is the time series length, i and j represent the corresponding positions in the convolution process, is the weight value in the convolution kernel of this layer, Indicates the bias value of this layer;

[0038] The local features obtained by convolution are subsampled in the pooling layer. The formula is expressed as:

[0039]

[0040] in, polling For the pooling operation, is the output after resampling.

[0041] Optionally, the LSTM in S4 is represented as:

[0042]

[0043] In the formula, "express Hadamard Product, "[ ]" indicates numerical concatenation, W f ,W i ,W c ,b f ,b i ,b c are the weights and bias values ​​of the forget gate, input gate and memory unit respectively; σ is sigmoid function, tanh is the hyperbolic tangent function, o t is the output gate output, is the hidden layer output, W o is the weight of the output gate, b o is the bias value.

[0044] Optionally, S5 also includes evaluating the accuracy of prediction results of the trained network model, which is expressed as:

[0045]

[0046] Among them, is the predicted value of the passenger flow at the target shared bicycle delivery point, y i is the actual value of the passenger flow at the target shared bicycle delivery point, and n is the number of data divided by time period.

[0047] Aspect 2: A shared bicycle spatiotemporal data prediction model, comprising:

[0048] The space-time matrix module constructs the space-time matrix of passenger flow at the shared bicycle deployment points based on historical operation data;

[0049] The k-means clustering module uses k-means to cluster the passenger flow of delivery points across time periods and obtain cluster labels;

[0050] CNN module, after merging the spatiotemporal matrix and clustering labels, the CNN network is used to capture the spatial features between the delivery points;

[0051] The LSTM module uses LSTM processing to capture the temporal characteristics of passenger flow based on the spatial characteristics between the delivery points and obtain the predicted value.

[0052] A third aspect: An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method provided in the first aspect when executing the program.

[0053] A fourth aspect: A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in the first aspect.

[0054] Beneficial effects of the present invention:

[0055] In view of the fact that the existing shared bicycle passenger flow prediction only focuses on the time and space characteristics, but does not explore the deep feature problems in the time series, the present invention proposes a CNN-LSTM model for short-term passenger flow prediction, uses Gap-statistic to determine the optimal number of clusters, and uses the correlation coefficient to obtain the delivery points with the greatest correlation. After feature fusion, CNN convolution is used to capture the spatial features between the delivery points, and LSTM is used to capture the time series features, which has higher prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A schematic diagram of a flow chart of a method for predicting spatiotemporal data of a shared bicycle according to the present invention;

[0057] Figure 2 This is a schematic diagram of space-time acquisition of a shared bicycle according to the present invention;

[0058] Figure 3 This is a schematic diagram of the LSTM model structure of the present invention;

[0059] Figure 4 It is a schematic diagram of the structure of the electronic device of the present invention. DETAILED DESCRIPTION

[0060] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar symbols throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0061] The models used in existing methods ignore the implicit temporal characteristics of shared bicycle passenger flow and fail to notice the changing patterns of shorter time intervals reflected by passenger flow across time periods during the day.

[0062] In view of the above problems, the present invention provides a method for predicting spatiotemporal data of shared bicycles. Figure 1 A flow chart of a method for predicting spatiotemporal data of shared bicycles provided by an embodiment of the present invention, the method comprising the steps of:

[0063] S1. Based on historical operation data, construct a spatiotemporal matrix of passenger flow at shared bicycle deployment points.

[0064] The shared bicycle delivery points are passenger-intensive areas. The passenger flow at each delivery point is affected by the historical passenger flow of the delivery point and the passenger flow of adjacent delivery points. Therefore, passenger flow prediction for the target delivery point involves both the extraction of spatial features and the extraction of temporal features.

[0065] The present invention uses CNN-LSTM network to extract spatiotemporal features, such as Figure 2 As shown in the figure, in the spatial area, the delivery points of shared bicycles are mostly distributed in a grid shape. The shared bicycle passenger flow is counted using the grid division method, and the grid is guaranteed to be small enough so that there is at most one delivery point in each grid. The passenger flow of the grid location without a shared bicycle delivery point is defaulted to 0. The matrix with n rows and m columns can be obtained from the divided grid. x t (i,j) Indicates that at time t, the coordinates of the delivery point are (i,j) of passenger traffic, including 0≤i≤n,0≤j≤m In terms of time series, the present invention predicts the passenger flow of the current time period by using the passenger flow of the previous time periods to establish a time-space matrix, which is expressed as follows:

[0066]

[0067] Among them, the matrix datal middle, x t (i,j) express t The coordinates of the delivery point at time (i,j) of passenger traffic, including 0≤i≤n, 0≤j≤m ,in l is the number of time slot intervals.

[0068] S2. Use k-means to cluster the passenger flow of the delivery points across time periods and obtain cluster labels;

[0069] The passenger flow at a delivery point is not only affected by the passenger flow at nearby times, but also by the passenger flow across time periods. For example, the passenger flow at a delivery point from 7:00-8:00 to 8:00 has the same upward trend as that at 8:00-9:00, and the passenger flow at 9:00-10:00 to 10:00 has the same downward trend as that at 10:00-11:00.

[0070] In order to extract the similarities between passenger flows across time periods and improve the prediction accuracy of the model, the present invention uses the k-means clustering algorithm to cluster passenger flows across time periods. The traditional k-means clustering algorithm requires manual setting of the initial k value, and the initial centroid is randomly selected, which is prone to fall into local optimality.

[0071] The present invention uses gap statistics to determine the k value, by calculating the sum of squares of the Euclidean distances between two observations in each clustering period, and then adjusting the k value with reference to the clustering result obtained by zero mean uniform distribution to determine the optimal number of clusters. The process is exemplified as follows:

[0072] For example, if the coordinate position of the target delivery point is (a, b), the actual passenger flow of the target delivery point in all time periods is obtained as input. is the n features of the mth period, the total length of the data is l, and the optional number of clusters is {1,2,3,...,k}; k-means obtains the centroid , the cluster label is .

[0073] Calculate the input sample and its centroid cen c The sum of the distances W k , the formula is:

[0074]

[0075] in, EuclDist To calculate the Euclidean distance between the data feature and the centroid.

[0076] Then Monte Carlo simulation Btimes, obtain uniformly distributed random samples rands that are as many as the number of input samples.

[0077] Use k-means to get the centroid of random samples rands , the cluster label is .

[0078] Calculate the sum of the distances between random samples and the centroid , the formula is:

[0079]

[0080] Then calculate the loss difference gaps and sd k , the formula is:

[0081]

[0082] in, std To calculate the standard deviation of the sampling values ​​after logarithmic processing; gaps and sd k Get the minimum k value that meets the conditions. The formula is:

[0083]

[0084] Then the minimum k value is the optimal number of clusters.

[0085] S3. Use CNN network to capture the spatial features between placement points.

[0086] Convolutional Neural Networks (CNN), as a feedforward network, has achieved remarkable results in image classification, natural language processing and other fields. CNN, as a multi-layer supervised learning network, is used to process grid data, such as image data and time series data. Passenger flow data belongs to time series data, and one-dimensional CNN can extract the features of time series.

[0087] First, the spatial matrix and cluster labels are merged through the concatenation layer, and the spatiotemporal matrix is ​​reduced in dimension. It represents the passenger flow with the coordinates of the delivery point (i, j) at time t, and uses a one-dimensional CNN to capture the spatial correlation between the delivery points of shared bicycles.

[0088] The one-dimensional CNN flow chart is as follows Figure 1 As shown in the figure, CNN contains two special neural network layers: one is the convolutional layer, which is used to extract local features. The formula is:

[0089]

[0090] Among them, f( ) is a nonlinear activation function, conv1D represents a one-dimensional convolution operation, For input data, The output data after convolution ,l is the time series length, i and j Indicates the corresponding position during the convolution process, is the weight value in the convolution kernel of this layer, Indicates the bias value of this layer.

[0091] The second is the pooling layer, the formula is expressed as:

[0092]

[0093] in, polling For the pooling operation, The pooling layer can perform sub-sampling on the local features obtained by convolution as the output after sub-sampling. The pooling layer does not need to retain parameters, which is beneficial to reduce the amount of calculation and the number of features. Finally, the output result is obtained through a fully connected operation.

[0094] S4. Based on the spatial features between the delivery points, the time series features of the passenger flow are captured through LSTM processing to obtain the predicted value.

[0095] Although the traditional recurrent neural network (RNN) model can process time series, the memory period of RNN is short and it only passes through a single activation function. If the interval of time series data is long, the information transmission in RNN will gradually decay, and gradient vanishing and gradient exploding will occur.

[0096] The present invention adopts a long short-term memory network (LSTM). LSTM uses a forget gate, an input gate, and an output gate to avoid the above problems. The LSTM structure is as follows: Figure 3 shown.

[0097] The forget gate is used to selectively retain the memory unit at the previous moment The input gate is used to selectively retain the input data at the current moment. x t information and update the current memory unit c t , the output gate is used to output the hidden layer information of the next moment ; Forget Gate f t , Input Gate i t , and the input state of the memory cell ct and update memory cells c t , the formula is:

[0098]

[0099] In the formula, " represents Hadamard product, "[ ]" represents numerical concatenation, W f , W i , W c , b f , b i , b c are the weights and bias values ​​of the forget gate, input gate, and memory unit, respectively; σ is the sigmoid function, tanh is the hyperbolic tangent function, o t is the output gate output, is the hidden layer output, W o is the weight of the output gate, b o is the bias value.

[0100] S5. Perform back-propagation training on the error loss between the predicted value and the true value to obtain the trained network model.

[0101] The CNN-LSTM model structure of the present invention is as follows Figure 1 As shown: In the grid, enter the data ,in M=m*i+j , (i, j) is the location coordinate of the shared bicycle delivery point, t represents the time, That is, it is located in (i,j) The traffic flow of the shared bicycle delivery point at time t.

[0102] In order to capture the similarity between passenger flows across time periods, for example, taking one hour as a set of data, within one hour, the passenger flow of the target delivery point is counted every 15 minutes, and the maximum, minimum, average and standard deviation of the passenger flow within one hour are recorded. , and use it as the feature of this period during clustering.

[0103] The prediction process mainly includes:

[0104] by , i={0,1,2,3} As input data, Gap-Statistic is used to obtain the optimal cluster number k; k is used as the initial cluster number of the k-means clustering algorithm to perform clustering, and the cluster labels of the passenger flow across time periods of the target delivery point are obtained, and then The features are merged through the concatenate layer, and the merged data is processed by one-dimensional convolution to extract the spatial association between the shared bicycle delivery points, and then secondary sampling is performed through pooling; the pooled data is processed by LSTM to obtain the predicted value.

[0105] The error loss between the predicted value and the true value is back-propagated to update the network weights until the loss is stable and less than a certain threshold or the maximum number of training times is reached and the cycle is stopped.

[0106] S6. Use the trained network model to predict the passenger flow at the target delivery point.

[0107] The trained network model is used to predict the passenger flow of the target delivery point. In order to evaluate the accuracy of the prediction results of the model, the present invention uses the mean square error (MSE), the mean absolute error (MSE) and the symmetric mean absolute percentage error (MSE) to evaluate the prediction results. The formula is expressed as follows:

[0108]

[0109] Among them, is the predicted value of the passenger flow at the target shared bicycle delivery point, y i is the actual value of the passenger flow at the target shared bicycle delivery point, and n is the number of data divided by time period.

[0110] Furthermore, when analyzing passenger flow by spatial correlation, there is a spatial correlation between delivery points. The Pearson correlation coefficient is used to analyze the passenger flow similarity between delivery points in the grid. The Pearson correlation coefficient formula is:

[0111]

[0112] Among them, i represents the time, X i , Y i are the passenger flow of delivery point X and delivery point Y at time t, respectively, and n represents the total number of passengers in the time period. The passenger flow between all shared bicycle delivery points is analyzed. According to the value range of the Pearson correlation coefficient, delivery points with values ​​below 0.2 are considered to have no correlation, values ​​in the range of 0.2-0.4 are considered to be weakly correlated, values ​​in the range of 0.4-0.6 are considered to be moderately correlated, values ​​above 0.6-0.8 are considered to be strongly correlated, and values ​​above 0.8 are considered to be extremely strongly correlated.

[0113] The present invention also provides a shared bicycle spatiotemporal data prediction model, such as Figure 1 As shown, the model includes:

[0114] The space-time matrix module constructs the space-time matrix of passenger flow at the shared bicycle deployment points based on historical operation data;

[0115] The k-means clustering module uses k-means to cluster the passenger flow of delivery points across time periods and obtain cluster labels;

[0116] CNN module, after merging the spatiotemporal matrix and clustering labels, the CNN network is used to capture the spatial features between the delivery points;

[0117] The LSTM module uses LSTM processing to capture the temporal characteristics of passenger flow based on the spatial characteristics between the delivery points and obtain the predicted value.

[0118] The present invention also provides an electronic device, Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 4 As shown, the electronic device may include: a processor, a communications interface, a memory, and a communications bus, wherein the processor, the communications interface, and the memory communicate with each other via the communications bus. The processor may call the logic instructions in the memory, for example, to execute the following method:

[0119] S1. Based on historical operation data, construct a spatiotemporal matrix of passenger flow at shared bicycle deployment points;

[0120] S2. Use k-means to cluster the passenger flow of the delivery points across time periods and obtain cluster labels;

[0121] S3, after merging the spatiotemporal matrix and cluster labels, use the CNN network to capture the spatial features between the delivery points;

[0122] S4, based on the spatial features between the delivery points, the time series features of the passenger flow are captured through LSTM processing to obtain the predicted value;

[0123] S5, perform back propagation training on the error loss between the predicted value and the true value to obtain the trained network model;

[0124] S6. Use the trained network model to predict the passenger flow at the target delivery point.

[0125] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0126] An embodiment of the present invention further provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method provided in each of the above embodiments is implemented, for example, including:

[0127] S1. Based on historical operation data, construct a spatiotemporal matrix of passenger flow at shared bicycle deployment points;

[0128] S2. Use k-means to cluster the passenger flow of the delivery points across time periods and obtain cluster labels;

[0129] S3, after merging the spatiotemporal matrix and cluster labels, use the CNN network to capture the spatial features between the delivery points;

[0130] S4, based on the spatial features between the delivery points, the time series features of the passenger flow are captured through LSTM processing to obtain the predicted value;

[0131] S5, perform back propagation training on the error loss between the predicted value and the true value to obtain the trained network model;

[0132] S6. Use the trained network model to predict the passenger flow at the target delivery point.

[0133] The model embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0134] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for predicting spatiotemporal data of shared bicycles, characterized in that: include: S1. Based on historical operation data, construct a spatiotemporal matrix of passenger flow at shared bicycle deployment points; S2. Use k-means to cluster the passenger flow of the delivery points across time periods and obtain cluster labels; S3, after merging the spatiotemporal matrix and cluster labels, use the CNN network to capture the spatial features between the delivery points; S4, based on the spatial features between the delivery points, the time series features of the passenger flow are captured through LSTM processing to obtain the predicted value; S5, perform back propagation training on the error loss between the predicted value and the true value to obtain the trained network model; S6. Use the trained network model to predict the passenger flow at the target delivery point; In S2, the optimal clustering k value of k-means is determined using gap statistics, and the steps include: S21. Calculate the centroid of the input sample and its cluster based on k-means cen c The sum of the distances W k , the formula is: ; in, is the n features of the mth period, is the centroid, EuclDist To calculate the Euclidean distance between the data feature and the centroid; S22, Monte Carlo simulation B Second, obtain the uniformly distributed random samples rands that are as many as the number of input samples; S23. Calculate the sum of the distances between the random sample and the centroid Wlq , the formula is: ; in, is the n features of the mth period, is the centroid of the random sample rands; S24. Calculate the loss difference, the formula is: ; ; in, std To calculate the standard deviation of the sample values ​​after logarithmic processing; S25. Obtain the minimum k value that meets the conditions. The formula is: ; Among them, the minimum k value is the optimal number of clusters; The CNN network is used in S3 to capture the spatial association between clustering points, including: To extract local features, the formula is expressed as: ; Among them, f( ) is a nonlinear activation function, conv1D represents a one-dimensional convolution operation, For input data, is the output data after convolution, l is the time series length, i and j Indicates the corresponding position during the convolution process, is the weight value in the convolution kernel of this layer, Indicates the bias value of this layer; The local features obtained by convolution are subsampled in the pooling layer. The formula is expressed as: ; in, polling For the pooling operation, is the output after resampling.

2. A shared bicycle spatiotemporal data prediction method according to claim 1, characterized in that: The passenger flow space-time matrix of the delivery point is expressed as follows: ; in, x t (i,j) express t The coordinates of the delivery point at time are (i,j) of passenger traffic, including 0≤i≤n,0≤j≤m .

3. The method for predicting spatiotemporal data of a shared bicycle according to claim 1, characterized in that: The LSTM in S4 is represented as: ; ; The "*" in the formula indicates Hadamard product," [] " indicates numerical concatenation, W f ,W i ,W c ,b f ,b i ,b c are the weights and bias values ​​of the forget gate, input gate, and memory unit, respectively; σ is the sigmoid function, tanh is the hyperbolic tangent function, o t is the output gate output, is the hidden layer output, W o is the weight of the output gate, b o is the bias value.

4. The method for predicting spatiotemporal data of a shared bicycle according to claim 1, characterized in that: The S5 also includes evaluating the accuracy of the prediction results of the trained network model, which is expressed as follows: ; Among them, is the predicted value of the passenger flow at the target shared bicycle delivery point, y i is the actual value of the passenger flow at the target shared bicycle delivery point, n It is the number of data divided by time period.

5. A shared bicycle spatiotemporal data prediction model based on the method according to any one of claims 1 to 4, characterized in that: The model includes: The spatiotemporal matrix module constructs the spatiotemporal matrix of passenger flow at shared bicycle deployment points based on historical operation data; The k-means clustering module uses k-means to cluster the passenger flow of delivery points across time periods and obtain cluster labels; CNN module, after merging the spatiotemporal matrix and clustering labels, the CNN network is used to capture the spatial features between the delivery points; The LSTM module uses LSTM processing to capture the temporal characteristics of passenger flow based on the spatial characteristics between the delivery points and obtain the predicted value.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of a shared bicycle spatiotemporal data prediction method as described in any one of claims 1 to 4 are implemented.

7. A non-transitory 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 a shared bicycle spatiotemporal data prediction method as described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Shared bicycle short-time demand prediction method and system of improved SGM (1, 1) model

    CN113191560A

  • Shared bicycle demand prediction model training method, system and equipment

    CN114757418A

  • Rail transit passenger flow prediction method and device

    CN113177657A

  • Shared bicycle demand prediction and delivery scheduling method

    CN115936240A