On-road parking space occupation data generation method and device and electronic equipment
By time series classification and data generation model construction of on-street parking space occupancy data sets, the problem of not being able to obtain new on-street parking space occupancy data in a timely manner is solved, and the generation of new on-street parking space occupancy data is realized.
Patent Information
- Application Number
- CN202411988495.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-08
AI Technical Summary
When conducting on-street parking space occupancy research, the existing technology cannot obtain the parking space occupancy data of new on-street parking sections in a timely manner, resulting in the inability to determine the berth occupancy situation.
By classifying the berth occupancy data set in time series, determining the cluster number and multi-cluster berth occupancy feature data, a data generation model is constructed, including a berth occupancy data generation sub-model that is equal to the cluster number. The cluster number is determined based on the time series of the road to be processed, and the corresponding data generation sub-model is used to generate berth occupancy data.
The generation of berth occupancy data of new on-street parking sections has been achieved, and from nothing to something is solved, the problem of the inability to obtain berth occupancy data in the prior art is not available in time.
Smart Images

Figure CN119785591A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of big data analysis, and in particular to a method, device and electronic equipment for generating on-street parking space occupancy data. Background Art
[0002] Road traffic is the main source of carbon emissions in my country's transportation industry, accounting for 87%. With the continuous development of urbanization and the continuous increase in the number of motor vehicles, the carbon emissions of road traffic have a trend of continuous growth. However, the development planning of roads has not kept pace with it, and the parking space on the road is becoming increasingly tight, which not only aggravates traffic congestion, but also increases the carbon emissions of roads. The occupancy of on-street parking spaces directly affects the carbon emissions of road traffic. The study of the generation of parking space occupancy data not only helps to understand the urban parking pattern, but also provides more comprehensive data support for the calculation of road traffic carbon emissions.
[0003] At present, existing research focuses on predicting the real-time parking occupancy of sections where parking spaces have been set up, in order to provide a basis for parking guidance research. However, for sections where parking spaces will be set up, there is still a lack of relevant research on the production of parking occupancy data. In other words, for new on-street parking sections, it is difficult to determine their parking occupancy due to the lack of historical data as a reference, that is, it is impossible to obtain parking occupancy data for new on-street parking sections in a timely manner.
[0004] Therefore, in the process of conducting on-street parking space occupancy research in the prior art, there is a problem that the parking space occupancy data of new on-street parking sections cannot be obtained in a timely manner. Summary of the invention
[0005] In view of this, it is necessary to provide a method, device and electronic equipment for generating on-street parking space occupancy data to solve the problem that in the process of conducting on-street parking space occupancy research in the prior art, the parking space occupancy data of new on-street parking sections cannot be obtained in a timely manner.
[0006] In order to solve the above problems, the present invention provides a method for generating on-street parking space occupancy data, comprising: Classify the berth occupancy data set according to time series, determine the number of clusters and the corresponding multi-cluster berth occupancy feature data; constructing a data generation model, the data generation model comprising a plurality of berth occupancy data generation sub-models equal in number to the number of clusters; Obtaining a time series of roads to be processed, and determining a cluster number of roads to be processed according to the time series; The parking space occupancy data of the road to be processed is generated based on the fully trained target parking space occupancy data generation sub-model corresponding to the ordinal number of the road cluster to be processed.
[0007] In a possible implementation, the berth occupancy data set is classified according to the time series, and the number of clusters and the corresponding multi-cluster berth occupancy feature data are determined, including: Cluster the berth occupancy dataset according to time series to obtain the number of clusters of the berth occupancy dataset; The road section characteristics of the parking space occupancy dataset are classified based on the number of clusters, and multiple clusters of parking space occupancy feature data are determined.
[0008] In a possible implementation, the berth occupancy data set is clustered according to the time series to obtain the number of clusters of the berth occupancy data set, including: The time series are clustered according to the K-means clustering algorithm to obtain the number of clusters of the berth occupancy dataset.
[0009] In a possible implementation, the parking space occupancy data is classified into road section characteristics based on the number of clusters to determine multiple clusters of parking space occupancy characteristic data, including: The road segment features of the parking space occupancy dataset are captured using the extreme gradient boosting algorithm, and the cluster number is determined based on the road segment features; The berth occupancy data with the same cluster number are divided into the same cluster, and the berth occupancy data corresponding to each cluster is determined.
[0010] In a possible implementation, the parking space occupancy data generation sub-models each include an encoder and a decoder; before generating the parking space occupancy data of the road to be processed based on the trained target parking space occupancy data generation sub-model corresponding to the ordinal number of the road cluster to be processed, the following is also included: Obtain seasonal data and periodic trend data for a cluster of berth occupancy characteristic data; Encoding the cluster berth occupancy characteristic data according to the encoder, and transmitting the encoding result to the decoder; The decoder performs data analysis based on the encoding results, seasonal data, and periodic trend data to obtain multiple decoding results; The multiple decoding results are superimposed, and the berth occupancy data generation sub-model is repeatedly trained iteratively to a preset number of times to obtain a corresponding fully trained target berth occupancy data generation sub-model; Among them, the number of sub-models generated by the target berth occupancy data is equal to the number of clusters.
[0011] In a possible implementation, the encoder includes a first level correlation calculation module, a first sequence decomposition module, a first feedforward network module, and a second sequence decomposition module; encoding the cluster berth occupancy feature data according to the encoder includes: Calculate the first correlation feature of the cluster berth occupancy feature data according to the first level correlation calculation module and transmit it to the first sequence decomposition module; The first sequence decomposition module performs in-depth analysis based on the cluster berth occupancy feature data and the first correlation feature to obtain decomposition features of the cluster berth occupancy feature data; The first feed-forward network module extracts the temporal features of the decomposed features; The second sequence decomposition module determines the encoding result according to the time series characteristics and the decomposition characteristics.
[0012] In a possible implementation, the decoder includes a second level correlation calculation module, a third sequence decomposition module, a third level correlation calculation module, a fourth sequence decomposition module, a second feedforward network module, and a fifth sequence decomposition module; the plurality of decoding results include fused time series features and fused periodic trend features; the decoder performs data analysis according to the encoding results, seasonal data, and periodic trend data, including: The seasonal data are sequentially passed through the second-level correlation calculation module and the third-sequence decomposition module to obtain seasonal decomposition characteristics; The seasonal decomposition characteristics and coding results are sequentially passed through the third level correlation calculation module and the fourth sequence decomposition module to obtain the fused decomposition characteristics; The fused decomposition features are sequentially passed through the second feedforward network module and the fifth sequence decomposition module to obtain fused time series features; The periodic trend data are superimposed with seasonal decomposition features, fused decomposition features and fused time series features in sequence to obtain fused periodic trend features.
[0013] In one possible implementation, both the encoder and decoder use the Spearman correlation coefficient to capture the correlation between variables.
[0014] In order to solve the above problems, the present invention further provides an on-street parking space occupancy data generating device, comprising: A clustering module is used to classify the berth occupancy data according to the time series, determine the number of clusters and the corresponding multi-cluster berth occupancy characteristic data; A model building module, used for building a data generation model, the data generation model comprising a plurality of berth occupancy data generation sub-models equal in number to the number of clusters; A module for determining the sequence number of a road cluster to be processed, used for obtaining a time series of roads to be processed and determining the sequence number of the road cluster to be processed according to the time series; The parking space occupancy data generation module is used to generate the parking space occupancy data of the road to be processed based on the trained target parking space occupancy data generation sub-model corresponding to the ordinal number of the road cluster to be processed.
[0015] In order to solve the above problem, the present invention further provides an electronic device, including a memory and a processor, wherein: Memory, used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the method for generating on-street parking space occupancy data as described above.
[0016] The beneficial effects of adopting the above-mentioned embodiment are as follows: the on-street parking space occupancy data generation method provided by the present invention, firstly, by performing data analysis on the parking space occupancy data set in the database, all the parking space occupancy data are classified according to the time characteristics, thereby obtaining multiple clusters of parking space occupancy feature data and determining the corresponding number of clusters; then, for each cluster of data, a corresponding parking space occupancy data generation sub-model is specially constructed to perform data feature analysis, so as to facilitate the subsequent generation of new parking space occupancy data; finally, for any new on-street parking section, the cluster number of the road to be processed is first determined according to the to-be-processed time series of the road to be processed, that is, it is determined to which cluster the road to be processed specifically belongs, and then the parking space occupancy data of the road to be processed is generated according to the target parking space occupancy data generation sub-model corresponding to the to-be-processed road cluster number, thereby realizing the parking space occupancy data of the new on-street parking section from scratch. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A schematic diagram of a flow chart of an embodiment of a method for generating on-street parking space occupancy data provided by the present invention; Figure 2 A result schematic diagram of an embodiment of the clustering result of a berth occupancy data set provided by the present invention; Figure 3 A schematic diagram of a flow chart of an embodiment of determining the number of clusters and corresponding multi-cluster berth occupancy characteristic data provided by the present invention; Figure 4 A schematic diagram of a flow chart of an embodiment of training a berth occupancy data generation sub-model provided by the present invention; Figure 5 A schematic diagram of a process for constructing a brain function network according to an embodiment of the present invention; Figure 6 A schematic diagram of a flow chart of an embodiment of data parsing performed by a decoder provided by the present invention; Figure 7 A schematic diagram of the structure of an embodiment of a berth occupancy data generation sub-model provided by the present invention; Figure 8 A structural block diagram of an embodiment of a device for generating on-street parking space occupancy data provided by the present invention; Fig. 9 This is a structural block diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0018] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of the present invention and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0019] On-street parking spaces refer to parking spaces within the red line of urban roads, which are mainly composed of parking spaces, signs and markings, parking ancillary facilities, etc. On-street parking spaces are places specially designated for temporary parking of motor vehicles within the scope of urban roads, usually set up on sidewalks, non-motorized vehicle lanes, or green belts between motor and non-motorized vehicle lanes, etc., to meet the parking needs of citizens when needed and provide convenient parking services.
[0020] Obtaining on-street parking space data is of great significance for traffic management and planning, urban planning and construction, improving public travel experience, and promoting the development of smart transportation. Therefore, relevant departments should strengthen the collection, analysis and utilization of on-street parking space data to better serve urban traffic management and public travel needs.
[0021] XGBoost (Extreme Gradient Boosting) is an ensemble learning algorithm based on the Gradient Boosting Decision Tree (GBDT). It has made many improvements on the basis of GBDT, introducing regularization terms and second-order derivative information, thereby improving the performance and generalization ability of the model.
[0022] The Gap Statistic is a method used in cluster analysis to determine the optimal number of clusters.
[0023] Autoformer is a model designed for long-term time series prediction, which was proposed at the 2021 NeurIPS conference.
[0024] Currently, existing research focuses on predicting the future based on historical data. However, in the process of studying on-street parking space occupancy, it is difficult to determine the parking space occupancy of new on-street parking sections due to the lack of historical data as a reference. In other words, it is impossible to obtain parking space occupancy data of new on-street parking sections in a timely manner.
[0025] Therefore, in the process of conducting on-street parking space occupancy research in the prior art, there is a problem that the parking space occupancy data of new on-street parking sections cannot be obtained in a timely manner.
[0026] In order to solve the above problems, the present invention provides a method, device and electronic device for generating on-street parking space occupancy data, which are described in detail below.
[0027] Figure 1 This is a flow chart of an embodiment of a method for generating on-street parking space occupancy data provided by the present invention, such as Figure 1 As shown, the method for generating on-street parking space occupancy data includes: S101: classifying the berth occupancy data set according to the time series, determining the number of clusters and corresponding multi-cluster berth occupancy feature data; S102: constructing a data generation model, the data generation model including a plurality of berth occupancy data generation sub-models equal in number to the number of clusters; S103: Obtain a time sequence of the road to be processed, and determine a cluster number of the road to be processed according to the time sequence; S104: generating parking space occupancy data of the road to be processed based on a fully trained target parking space occupancy data generation sub-model corresponding to the ordinal number of the road cluster to be processed.
[0028] In this embodiment, firstly, by performing data analysis on the parking space occupancy data set in the database, all the parking space occupancy data are classified according to the time characteristics, thereby obtaining multiple clusters of parking space occupancy feature data and determining the corresponding number of clusters; then, for each cluster of data, a corresponding parking space occupancy data generation sub-model is specially constructed to perform data feature analysis, so as to facilitate the subsequent generation of new parking space occupancy data; finally, for any new on-street parking section, the cluster number of the road to be processed is first determined according to the to-be-processed time series of the road to be processed, that is, it is determined to which cluster the road to be processed specifically belongs, and then the parking space occupancy data of the road to be processed is generated according to the target parking space occupancy data generation sub-model corresponding to the to-be-processed road cluster number, thereby realizing the creation of parking space occupancy data for the new on-street parking section from scratch.
[0029] It should be noted that the time series of the roads to be processed can be predicted based on their location characteristics, environmental characteristics, etc., which will not be elaborated here.
[0030] In a specific embodiment, the berth occupancy data set is clustered into 4 clusters, such as Figure 2 As shown, Figure 2 This is a result schematic diagram of an embodiment of the clustering result of a berth occupancy dataset provided by the present invention.
[0031] By comparison, we found that cluster 1 has the least berth occupancy at around 8 o'clock. The occupancy of cluster 2 shows a step-down during the day, with the least berth occupancy at around 19 o'clock. Cluster 3 has two peaks and two troughs, with the least berth occupancy at around 8 o'clock and 19 o'clock. After cluster 4 reaches the lowest occupancy point at 8 o'clock, it continues to fluctuate around the lowest point, ranging from 7 o'clock to 19 o'clock during the day.
[0032] The changing pattern of each cluster is not consistent; in the night range, each cluster rises rapidly before 0:00, then rises slowly, reaching the highest occupancy point around 7:00, which shows that the occupancy rate of existing on-street parking spaces is higher at night and relatively lower during the day. In summary, the parking space occupancy data within each cluster is highly aggregated, and the changing patterns are very consistent, while the changing patterns of parking space occupancy data between different clusters are not consistent.
[0033] That is to say, each cluster of data has its own characteristics. After obtaining the time series to be processed of any road to be processed, by comparing the time series to be processed with clusters 1-4, the cluster number corresponding to the cluster with the highest time feature similarity is determined as the cluster number of the road to be processed. For example, when the prediction result of the time series to be processed is: the parking space occupancy is the least around 8 o'clock, and after 8 o'clock it shows an upward trend and fluctuates at a high level, then the road to be processed corresponds to cluster 1.
[0034] Obviously, the time series characteristics of roads may include more. In the process of classifying the parking space occupancy dataset by time series, the characteristics of each cluster have been clarified. The road to be processed only needs to be compared with each cluster for conformity to determine the cluster number of the road to be processed. When the cluster number of the road to be processed cannot be determined, it means that the classification result of the parking space occupancy dataset can no longer meet the needs, and the parking space occupancy dataset needs to be refined and reclassified.
[0035] Transfer Learning (TL) focuses on applying knowledge from different but related fields to new fields to solve problems in the target field when there is a lack of high-quality training data in the target field.
[0036] In this embodiment, by analyzing and grouping the existing parking space occupancy data set, and then training the parking space occupancy data generation sub-model corresponding to each cluster of data, it is possible to transfer the data features of the known parking space occupancy data set to unknown roads for data feature prediction, thereby obtaining the parking space occupancy data of unknown new on-street parking sections.
[0037] As a preferred embodiment, in S101, in order to classify the berth occupancy data set according to the time series, the number of clusters and the corresponding multi-cluster berth occupancy feature data are determined, such as Figure 3 As shown, Figure 3 A schematic diagram of a flow chart of an embodiment of determining the number of clusters and corresponding multi-cluster berth occupancy characteristic data provided by the present invention includes: S301: clustering the berth occupancy data set according to the time series to obtain the number of clusters of the berth occupancy data set; S302: Classifying the road section characteristics of the parking space occupancy data set based on the number of clusters to determine multiple clusters of parking space occupancy characteristic data.
[0038] In a specific embodiment, in S301, the time series is clustered according to the K-means clustering algorithm to obtain the number of clusters of the berth occupancy data set.
[0039] Specifically, this application uses the K-Means clustering algorithm to determine the optimal number of clusters. The algorithm input is to generate task labels, that is, the parking space occupancy time series of each road section. The algorithm steps of K-Means are: 1) Select k Samples are initialized as the initial cluster centers; 2) Calculate each sample separately x i arrive k The distance between the cluster centers is calculated, and then each sample is divided into the category corresponding to the cluster center closest to it; 3) Recalculate each classification result The cluster center is to calculate the centroid of all sample points in each category;
[0040] 4) Repeat steps 2 and 3 until a certain termination condition is reached, such as reaching a preset number of iterations or the centroid moving distance is less than a set threshold.
[0041] K-Means uses a random initialization method, and the algorithm can be run repeatedly under different initial conditions to ensure global convergence. In order to select the optimal number of clusters, this application uses the Gap Statistic method, and its calculation formula is as follows:
[0042] In the formula, represents the loss function, represents the expectation. This value is usually approximated by the Monte Carlo simulation method. In the area where the original sample is located, a random sample set is randomly generated according to a uniform distribution, and the number of samples in the sample set is guaranteed to be the same as that of the original sample. Then, these samples are clustered by K-Means to obtain a Repeat this process n times, and for this n Taking the average of the values, we get approximate value of , thereby calculating a series of The value of The K value when the value reaches the maximum is the optimal number of clusters.
[0043] In this embodiment, by performing cluster analysis on all berth occupancy data sets, it is possible to quantify the similarity of the data from a data perspective, and classify the data based on the data similarity.
[0044] In a specific embodiment, in S202, first, the road section features of the berth occupancy data are captured according to the extreme gradient boosting algorithm, and the cluster number is determined based on the road section features; then, the berth occupancy data with the same cluster number are divided into the same cluster, and the berth occupancy data corresponding to each cluster is determined.
[0045] The extreme gradient boosting algorithm (eXtreme Gradient Boosting, XGBoost) is an efficient gradient boosting framework based on the traditional gradient boosting decision tree. Compared with other decision tree algorithms, XGBoost speeds up the training process by parallel processing of tree node splitting when processing classification tasks. It is suitable for processing large-scale data sets and can automatically handle missing values. It is more robust when facing incomplete data sets and is suitable for classification problems in complex nonlinear scenarios in this application.
[0046] The algorithm uses CART as the basic classifier. During the classification process, a tree is first built, and a CART decision tree is added in each iteration. By continuously building new trees to fit the residual of the previous tree, a strong estimator of the integrated multi-tree model is realized. Finally, the scores of each tree are accumulated and summed to obtain the predicted value of the sample. , the calculation formula is:
[0047] Where K is the number of trees, is the leaf score of the kth tree, is the eigenvector corresponding to sample i, and F is the set space of trees.
[0048] XGBoost controls the complexity of the model by explicitly adding regularization terms to prevent overfitting and improve the generalization ability of the model. The calculation formula is:
[0049] Where T is the number of leaf nodes, is the score of the leaf node, Used to control the number of leaf nodes. Used to control the score of leaf nodes.
[0050] The XGBoost objective function is:
[0051] In the formula, Used to evaluate the training error between predicted values and actual values.
[0052] It should be noted that the CART classifier, namely the Classification and Regression Tree classifier, is a classification and regression method based on a tree structure.
[0053] In this embodiment, the extreme gradient boosting algorithm is used to capture features of the parking space occupancy data set and reclassify it, which can improve the reliability of the classification results of the parking space occupancy feature data, thereby reducing the negative impact of low-similarity road section features on the generation results.
[0054] As a preferred embodiment, in S102, after the parking space occupancy data set is classified, the accurate number of clusters can be determined, that is, all on-street parking sections can be divided into several categories according to time characteristics, and the data features within each category of parking space occupancy data are similar and have relevant characteristics.
[0055] Then, after the number of clusters is determined, a number of berth occupancy data generation sub-models equal to the number of clusters are correspondingly set to perform subsequent data prediction. It should be noted that the basic structures of the multiple berth occupancy data generation sub-models are exactly the same, and only the internal parameters of the models are different.
[0056] Next, taking any berth occupancy data generation sub-model as an example, the characteristics of the berth occupancy data generation sub-model are explained.
[0057] The berth occupancy data generation sub-models all include an encoder and a decoder; before applying the berth occupancy data generation sub-model for data prediction, model training is required, such as Figure 4 As shown, Figure 4 A flow chart of an embodiment of training a berth occupancy data generation sub-model provided by the present invention includes: S401: Obtain seasonal data and periodic trend data of a cluster of berth occupancy characteristic data; S402: Encode the cluster berth occupancy characteristic data according to the encoder, and transmit the encoding result to the decoder; S403: The decoder performs data analysis according to the encoding result, seasonal data and periodic trend data to obtain multiple decoding results; S404: superimposing multiple decoding results, and repeatedly iterating and training the berth occupancy data generation sub-model to a preset number of times, to obtain a corresponding fully trained target berth occupancy data generation sub-model; Among them, the number of sub-models generated by the target berth occupancy data is equal to the number of clusters.
[0058] In this embodiment, by encoding a cluster of berth occupancy feature data, and conducting a comprehensive analysis based on its seasonal characteristics and periodic trend characteristics, and then decoding the output data, it is possible to capture the characteristics of the berth occupancy feature data. By repeated iterative training, that is, iterating as many berth occupancy feature data as possible in the cluster into the berth occupancy data generation sub-model, it is possible to obtain the target berth occupancy data generation sub-model.
[0059] As a preferred embodiment, the encoder includes a first level correlation calculation module, a first sequence decomposition module, a first feedforward network module and a second sequence decomposition module; in S402, in order to encode the cluster berth occupancy feature data according to the encoder, such as Figure 5 As shown, Figure 5 A schematic diagram of a process for constructing a brain function network according to an embodiment of the present invention includes: S501: Calculate the first correlation feature of the cluster berth occupancy feature data according to the first level correlation calculation module and transmit it to the first sequence decomposition module; S502: a first sequence decomposition module performs in-depth analysis based on the cluster berth occupancy feature data and the first correlation feature to obtain decomposition features of the cluster berth occupancy feature data; S503: The first feedforward network module extracts the temporal features of the decomposed features; S504: The second sequence decomposition module determines the encoding result according to the timing characteristics and the decomposition characteristics.
[0060] Further, the decoder includes a second level correlation calculation module, a third sequence decomposition module, a third level correlation calculation module, a fourth sequence decomposition module, a second feedforward network module and a fifth sequence decomposition module; in S403, in order to perform data analysis according to the encoding result, seasonal data and periodic trend data, such as Figure 6 As shown, Figure 6 A schematic diagram of a flow chart of an embodiment of data parsing by a decoder provided by the present invention includes: S601: seasonal data is sequentially passed through the second level correlation calculation module and the third sequence decomposition module to obtain seasonal decomposition characteristics; S602: seasonal decomposition features and coding results are sequentially passed through the third level correlation calculation module and the fourth sequence decomposition module to obtain fused decomposition features; S603: The fused decomposition features are sequentially passed through the second feedforward network module and the fifth sequence decomposition module to obtain fused time series features; S604: The seasonal decomposition feature, the fused decomposition feature and the fused time series feature are sequentially superimposed on the periodic trend data to obtain a fused periodic trend feature.
[0061] In this embodiment, the encoder and decoder are used to extract and superimpose the characteristic data of the cluster berth occupancy, gradually and deeply extract the characteristics of the time series data, and mine the periodic characteristics, thereby improving the accuracy of subsequent predictions of the model.
[0062] In a specific embodiment, the berth occupancy data generation sub-model uses the Autoformer model as a framework. In addition, since the Autoformer model uses an autocorrelation calculation method based on the Pearson correlation coefficient to calculate the correlation between variables, and the Pearson correlation coefficient is mostly applicable to variables with linear correlation, and the traffic time series data has nonlinear long-term dependencies, therefore, in the berth occupancy data generation sub-model of the present application, both the encoder and the decoder use the Spearman correlation coefficient to capture the correlation between variables.
[0063] The Spearman correlation coefficient is more suitable for nonlinearly correlated time series. It focuses on the correlation between the levels of two variables rather than the correlation between the actual values of the variables. Therefore, it is robust to outliers and more suitable for nonlinearly correlated time series. The calculation formula is:
[0064] Where: R(X) and R(Y) are the levels of X and Y, calculated using the Pearson correlation coefficient. n is the total number of variables, is the Spearman correlation coefficient, which takes values between -1 and 1.
[0065] Furthermore, if Figure 7 As shown, Figure 7 The schematic diagram of the structure of an embodiment of the berth occupancy data generation submodel provided by the present invention is mainly composed of an encoder (Encoder) and a decoder (Decoder), the encoder is composed of N identical layers stacked, and the decoder is composed of M identical layers stacked. The encoder and decoder of each layer are composed of multiple multi-head correlation calculation modules (Correlation, C), sequence decomposition blocks (Series Decomp, SD) and feedforward network blocks (Feed Forword, FF). The algorithm output part combines the output of the last SD block with the periodic trend part in the decoder to obtain the final result.
[0066] The encoder extracts the seasonal component in the input data. The calculation process in one encoder layer is:
[0067] In the formula, is the seasonal component of the i-th series after decomposition block, is the seasonal component result of the current layer, is the seasonal component result of the previous layer.
[0068] The input of the decoder is the periodic trend component and seasonal component in the data. The calculation process in a decoder layer is:
[0069] In the formula, is the seasonal component after the i-th series decomposition block, is the periodic trend component after the i-th sequence decomposition block, , and are the training weights.
[0070] Assume that the input sequence length is I, the output length is O, and the model size is d. The data of the historical I steps in the sequence is the input of the encoder. The seasonal component input is padded with O zeros after the second half of the encoder input sequence. The periodic trend component input is filled with O in the second half of the encoder input sequence. The average value of , the corresponding relationship between the three inputs is:
[0071] The output is a combination of the seasonal component and the periodic trend component in the decoder: ,in Yes Trainable weights projected into the target dimension.
[0072] Through the above method, firstly, by performing data analysis on the parking space occupancy data set in the database, all the parking space occupancy data are classified according to the time characteristics, so as to obtain multiple clusters of parking space occupancy feature data and determine the corresponding number of clusters; then, for each cluster of data, a corresponding parking space occupancy data generation sub-model is specially constructed to perform data feature analysis, so as to facilitate the subsequent generation of new parking space occupancy data; finally, for any new on-street parking section, the cluster number of the road to be processed is first determined according to the to-be-processed time series of the road to be processed, that is, it is determined to which cluster the road to be processed specifically belongs, and then the parking space occupancy data of the road to be processed is generated according to the target parking space occupancy data generation sub-model corresponding to the to-be-processed road cluster number, thereby realizing the parking space occupancy data of the new on-street parking section from scratch.
[0073] In order to verify the effectiveness of the data generation model in this application, the commonly used evaluation indicators in the field of traffic flow data prediction were selected, including Mean Absolute Error (MAE), Root Mean Squared Error (RMSE) and R2 score. Compared with the basic generation model, the MAE and RMSE evaluation indicators of the data generation model in this application were reduced by 16.4% and 20.1% respectively, and the R2 value was increased from 0.921 to 0.944.
[0074] In order to solve the above problems, the present invention also provides a device for generating on-street parking space occupancy data. Figure 8 As shown, Figure 8 This is a structural block diagram of an embodiment of an on-street parking space occupancy data generating device provided by the present invention. The on-street parking space occupancy data generating device 800 includes: Clustering module 801, for classifying the berth occupancy data according to time series, and determining the number of clusters and corresponding multi-cluster berth occupancy characteristic data; A model building module 802 is used to build a data generation model, the data generation model includes a plurality of berth occupancy data generation sub-models equal to the number of clusters; The module 803 for determining the sequence number of the road cluster to be processed is used to obtain the time series of the road to be processed and determine the sequence number of the road cluster to be processed according to the time series; The parking space occupancy data generation module 804 is used to generate parking space occupancy data of the road to be processed based on the trained target parking space occupancy data generation sub-model corresponding to the sequence number of the road cluster to be processed.
[0075] like Fig. 9 As shown, the present invention also provides an electronic device 900. The electronic device 900 includes a processor 901, a memory 902 and a display 903. Figure 8 Only some components of the electronic device 900 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0076] In some embodiments, the processor 901 may be a central processing unit (CPU), a microprocessor or other data processing chip, which is used to run the program code or process data stored in the memory 902, such as the on-street parking space occupancy data generation method of the present invention.
[0077] In some embodiments, the processor 901 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 901 may be local or remote. In some embodiments, the processor 901 may be implemented in a cloud platform. In one embodiment, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.
[0078] In some embodiments, the memory 902 may be an internal storage unit of the electronic device 900, such as a hard disk or memory of the electronic device 900. In other embodiments, the memory 902 may also be an external storage device of the electronic device 900, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 900.
[0079] Furthermore, the memory 902 may include both an internal storage unit of the electronic device 900 and an external storage device. The memory 902 is used to store application software installed in the electronic device 900 and various data.
[0080] In some embodiments, the display 903 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 903 is used to display information of the electronic device 900 and to display a visual user interface. The components 901-903 of the electronic device 900 communicate with each other through a system bus.
[0081] In one embodiment, when the processor 901 executes the on-street parking space occupancy data generation program in the memory 902, the following steps may be implemented: Classify the berth occupancy data set according to time series, determine the number of clusters and the corresponding multi-cluster berth occupancy feature data; constructing a data generation model, the data generation model comprising a plurality of berth occupancy data generation sub-models equal in number to the number of clusters; Obtaining a time series of roads to be processed, and determining a cluster number of roads to be processed according to the time series; The parking space occupancy data of the road to be processed is generated based on the fully trained target parking space occupancy data generation sub-model corresponding to the ordinal number of the road cluster to be processed.
[0082] It should be understood that: when the processor 901 executes the on-street parking space occupancy data generation program in the memory 902, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.
[0083] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 900 mentioned, and the electronic device 900 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic device may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 900 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0084] Correspondingly, an embodiment of the present invention also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, it can implement the steps or functions of the on-street parking space occupancy data generation method provided in the above-mentioned method embodiments.
[0085] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0086] The above is a detailed introduction to the on-street parking space occupancy data generation method, device and electronic device provided by the present invention. In this application, specific examples are used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for generating on-street parking space occupancy data, characterized in that: include: Classify the berth occupancy data set according to time series, determine the number of clusters and the corresponding multi-cluster berth occupancy feature data; constructing a data generation model, the data generation model comprising a plurality of berth occupancy data generation sub-models equal in number to the number of clusters; Acquire a to-be-processed time series of the to-be-processed roads, and determine a to-be-processed road cluster number according to the to-be-processed time series; The parking space occupancy data of the road to be processed is generated based on the trained target parking space occupancy data generation sub-model corresponding to the ordinal number of the road cluster to be processed.
2. The method for generating on-street parking space occupancy data according to claim 1, characterized in that: The step of classifying the berth occupancy data set according to the time series and determining the number of clusters and the corresponding multi-cluster berth occupancy feature data includes: Clustering the berth occupancy data set according to the time series to obtain the number of clusters of the berth occupancy data set; The parking space occupancy data set is classified into road section characteristics based on the number of clusters to determine multiple clusters of parking space occupancy characteristic data.
3. The method for generating on-street parking space occupancy data according to claim 2, characterized in that: The clustering of the berth occupancy data set according to the time series to obtain the number of clusters of the berth occupancy data set includes: The time series is clustered according to a K-means clustering algorithm to obtain the number of clusters of the berth occupancy data set.
4. The method for generating on-street parking space occupancy data according to claim 2, characterized in that: The performing section characteristic classification on the berth occupancy data based on the number of clusters to determine multiple clusters of berth occupancy characteristic data includes: capturing the road section features of the parking space occupancy data set according to an extreme gradient boosting algorithm, and determining a cluster number based on the road section features; The berth occupancy data with the same cluster sequence number are divided into the same cluster, and the berth occupancy data corresponding to each cluster is determined.
5. The method for generating on-street parking space occupancy data according to claim 1, characterized in that: The parking space occupancy data generation sub-models each include an encoder and a decoder; before generating the parking space occupancy data of the road to be processed based on the trained target parking space occupancy data generation sub-model corresponding to the ordinal number of the road cluster to be processed, the method further includes: Obtaining seasonal data and periodic trend data of a cluster of berth occupancy characteristic data; encoding the cluster berth occupancy characteristic data according to the encoder, and transmitting the encoding result to the decoder; The decoder performs data parsing according to the encoding result, the seasonal data and the periodic trend data to obtain a plurality of decoding results; The plurality of decoding results are superimposed, and the berth occupancy data generation sub-model is repeatedly iterated and trained to a preset number of times to obtain a corresponding fully trained target berth occupancy data generation sub-model; The number of the target berth occupancy data generation sub-models is equal to the number of clusters.
6. The method for generating on-street parking space occupancy data according to claim 5, characterized in that: The encoder includes a first level correlation calculation module, a first sequence decomposition module, a first feedforward network module, and a second sequence decomposition module; encoding the cluster berth occupancy feature data according to the encoder includes: Calculate the first correlation feature of the cluster berth occupancy feature data according to the first level correlation calculation module and transmit it to the first sequence decomposition module; The first sequence decomposition module performs in-depth analysis based on the cluster berth occupancy feature data and the first correlation feature to obtain decomposition features of the cluster berth occupancy feature data; The first feedforward network module extracts the temporal features of the decomposed features; The second sequence decomposition module determines the encoding result according to the timing feature and the decomposition feature.
7. The method for generating on-street parking space occupancy data according to claim 5, characterized in that: The decoder includes a second rank correlation calculation module, a third sequence decomposition module, a third rank correlation calculation module, a fourth sequence decomposition module, a second feedforward network module and a fifth sequence decomposition module; The multiple decoding results include fused time series features and fused periodic trend features; The decoder performs data parsing according to the encoding result, the seasonal data and the periodic trend data, including: The seasonal data is sequentially passed through the second rank correlation calculation module and the third sequence decomposition module to obtain seasonal decomposition characteristics; The seasonal decomposition feature and the encoding result are sequentially passed through the third level correlation calculation module and the fourth sequence decomposition module to obtain a fused decomposition feature; The fused decomposition features are sequentially passed through the second feedforward network module and the fifth sequence decomposition module to obtain the fused time series features; The periodic trend data is sequentially superimposed with the seasonal decomposition feature, the fused decomposition feature and the fused time series feature to obtain the fused periodic trend feature.
8. The method for generating on-street parking space occupancy data according to claim 5, characterized in that: Both the encoder and the decoder use the Spearman correlation coefficient to capture the correlation between variables.
9. A device for generating on-street parking space occupancy data, characterized in that: include: A clustering module is used to classify the berth occupancy data according to the time series, determine the number of clusters and the corresponding multi-cluster berth occupancy characteristic data; A model building module, used for building a data generation model, wherein the data generation model includes a plurality of berth occupancy data generation sub-models equal in number to the number of clusters; A module for determining the ordinal number of a road cluster to be processed, used for obtaining a time series of roads to be processed and determining the ordinal number of the road cluster to be processed according to the time series; The parking space occupancy data generation module is used to generate the parking space occupancy data of the road to be processed based on the trained target parking space occupancy data generation sub-model corresponding to the ordinal number of the road cluster to be processed.
10. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the method for generating on-street parking space occupancy data as described in any one of claims 1 to 8 above.