City-level parking demand scale prediction method and system, electronic equipment and medium

Through multi-source data fusion based on deep learning model, multi-variable Tokenization and multi-frequency sliding window extract features, combined with natural language encoder and multi-head attention mechanism, the time-space consistency problem of urban-level parking demand prediction is solved, significantly improving the Prediction accuracy and reliability provide scientific management decision support.

CN119005453APending Publication Date: 2024-11-22QINGDAO SONLI SOFTWARE INFORMATION TECH +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411487051.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively capture the complexity and variability of urban transportation systems, resulting in limitations in urban-level parking demand prediction, especially when dealing with different data formats, data types, time scales, and spatial scales of multiple heterogeneous data sources. , it is difficult to ensure the spatiotemporal consistency of data fusion, affecting prediction accuracy.

Method used

Using a deep learning model based on multi-source city data, a numerical feature extraction module for multi-variable Tokenization and multi-frequency sliding window is designed, and aligned and weighted fusion of numerical variables and natural language features is combined with natural language encoder and multi-head attention mechanism. Generate urban-level parking demand scale forecast results.

Benefits of technology

Through the precise fusion of multi-source data, the potential correlation between various data is captured, the accuracy and reliability of parking demand prediction is improved, and scientific urban parking management decision support is provided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119005453A_ABST
    Figure CN119005453A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of smart traffic, and particularly relates to a city-level parking demand scale prediction method and system, electronic equipment and a medium, and the method comprises the steps: collecting city multi-source data, extracting numerical variable features through introducing multivariable Tokenization and a multi-frequency sliding window, extracting natural language features through combining with a natural language encoder, and carrying out the prediction of the city-level parking demand scale. The multi-head attention mechanism is used for carrying out alignment and weighted fusion on multiple features, and finally a prediction result is generated through a decoder, so that the obtained prediction result can be ensured to have higher precision and reliability, and accurate prediction of urban parking demands is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intelligent transportation technology, and in particular relates to a method, system, electronic equipment and medium for predicting the scale of city-level parking demand. Background Art

[0002] With the continuous advancement of global urbanization, the urban population and the number of motor vehicles have increased dramatically, resulting in an increasingly prominent contradiction between the supply and demand of parking spaces. The difficulty of parking not only affects the daily lives of citizens, but also aggravates urban traffic congestion, increases environmental pollution, and reduces the quality of life and operating efficiency of cities. The problem of city-level parking demand prediction has become an important issue that needs to be solved urgently in major cities. Since the problem of urban parking demand prediction is affected by spatiotemporal heterogeneity and a variety of external factors, existing methods are difficult to capture the complexity and variability of urban transportation systems, and have limitations in city-level parking demand prediction. The city-level parking demand prediction method based on multi-source data fusion can make full use of information from multiple data sources, explore the potential correlation of each data information, make up for the problem of missing information, and effectively improve the prediction accuracy.

[0003] The method based on multi-source data fusion fully integrates information from multiple data sources to comprehensively capture various factors that affect parking demand, including but not limited to historical urban parking scale data, urban demographic data, gross domestic product, industrial scale data, motor vehicle ownership, traffic flow, distribution and capacity of existing parking facilities, land use, transportation policies and planning, etc. However, facing the different data formats, data types, and data dimensions of multiple data sources, how to uniformly process and fuse these heterogeneous data, how to align the time scale and spatial scale of the data from each data source, and ensure the time and space consistency after data fusion, is a key challenge to improve prediction accuracy. Summary of the invention

[0004] In order to solve the above problems in the prior art, the present invention proposes a city-level parking demand scale prediction method, system, electronic device and medium. Based on a deep learning model of multi-source urban data, a numerical feature extraction module based on multivariate Tokenization and multi-frequency sliding window is designed, and a natural language encoder is used to extract natural language features. A multi-head attention mechanism is used to align and weightedly fuse multiple semantic features to predict the city-level parking demand scale.

[0005] In order to achieve the above object, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for predicting the scale of city-level parking demand, which specifically comprises the following steps: S1. Collect urban multi-source data, which includes numerical variables and natural language; S2, using multivariate Tokenization and multi-frequency sliding window methods, using numerical variable encoders to extract numerical variable features from numerical variables; S3, extracting natural language features of the natural language through a natural language encoder; S4, use the multi-head attention mechanism to align and weightedly fuse the features extracted in steps S2 and S3 to obtain multi-source fusion features; S5. Use the linear layer decoder to decode the multi-source fusion features and obtain the prediction results.

[0006] As a further technical solution of the present invention, the numerical variables described in step S1 include historical urban parking scale data, urban demographic data, gross domestic product, industrial scale data, motor vehicle ownership, traffic flow, distribution and capacity of existing parking facilities and land use conditions; natural language includes traffic policies, legal planning, urban planning and news reports.

[0007] As a further technical solution of the present invention, the specific process of step S2 is: S21. Construct a variable set for each different input variable , ,in L Represents the time slice length of the data source, P Represents the characteristic dimension of the variable, and uses a sliding window to L The time slice is based on the step size S To divide the entire time slice into N non-overlapping segments, where ; S22. Tokenization is performed on different variables. LSTM is used as the encoder of numerical variables. The LSTM unit includes: input gate , used to control the ratio of new information flowing into the memory unit, the forget gate , used to control the forgetting ratio of information in the memory unit, the output gate , used to control the ratio of memory unit information output to the next moment, memory unit , used to store information, with a direct linear transmission path; specifically, The output of the forget gate is determined by the current input and the hidden state at the previous moment Together, they decide to output a value between 0 and 1 through a sigmoid activation function to update the state of the memory cell: ,in, represents the sigmoid function, and They are the weight matrix and bias vector of the forget gate respectively; The input gate first passes through a sigmoid layer to determine which values ​​need to be updated, and then passes through a tanh layer to generate candidate values ​​to determine which new information will be added to the memory cell: , where tanh represents the tanh activation function, and are the weight matrix and bias vector of the input gate, respectively. , are the weights and biases of the linear layer in the tanh activation function, is the value of the candidate memory cell; Memory cell status The update is done by the memory state of the previous moment and the new candidate memory cell state The memory state of the previous moment is jointly determined by the forget gate, and the new candidate memory unit state is jointly updated by the input gate: ; The output gate outputs the hidden state of each numerical variable , thus obtaining the numerical variable characteristics .

[0008] As a further technical solution of the present invention, the specific process of step S3 is: using the BERT model as a natural language encoder, specifically: ,in Represent natural language from different data sources, Represents the obtained natural language features.

[0009] As a further technical solution of the present invention, the specific process of step S4 is: S41. Add position encoding to retain the temporal information in the feature. The position encoding matrix is ​​represented as PE and is calculated as follows: , ,in is the feature dimension, is the characteristic position, is the index of the feature dimension; add the position encoding to the feature embedding to obtain the embedded feature ; S42. Use a multi-head attention mechanism to capture the correlation between features. The calculation process of each attention head is: ,in By inputting data Linear transformation with different weight matrices yields: , , , is a learnable weight matrix, and then the outputs of multiple attention heads are connected and linearly transformed: ,in , is the learnable weight matrix; S43. For each time step, two linear transformations and a ReLU activation function are used to obtain deeper features: ,in The learned weights and biases are added with residual connections and layer normalization operations to add the input and output and perform layer normalization: , ,in, , in the middle feature Add ReLU activation function to obtain multi-source fusion features by using multi-head attention feature fusion .

[0010] As a further technical solution of the present invention, the result of the city-level parking demand scale prediction obtained in step S5 is: In the prediction process, the difference between the predicted output and the true value is measured by the mean square error loss. ,in Represents the true value of city-level parking demand.

[0011] In a second aspect, the present invention provides a city-level parking demand scale prediction system, comprising: Data collection module, used to collect multi-source urban data including numerical variables and natural language; A numerical variable feature extraction module, used to extract numerical variable features of numerical variables; Natural language feature extraction module, used for natural language features of natural language; The feature fusion module fuses multiple data features to obtain multi-source fusion features; The parking demand prediction module uses a linear layer decoder to obtain the prediction results.

[0012] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in the first aspect is performed.

[0013] In a fourth aspect, the present invention provides a computer-readable storage medium for storing computer instructions, wherein when the computer instructions are executed by a processor, the method described in the first aspect is performed.

[0014] Compared with the prior art, the present invention has the following beneficial effects: (1) A multi-source data fusion method is cleverly designed to achieve efficient and accurate prediction of city-level parking demand. The urban parking demand is regarded as a complex multi-factor system, in which various data sources (such as historical parking data, traffic flow data, weather data, holiday information, etc.) jointly affect the changes in parking demand. This fusion of multi-source data is manifested in the complementarity and correlation between different data sources in parking demand prediction. By applying a method based on multi-source data fusion, various types of data are effectively integrated to construct a comprehensive feature description.

[0015] (2) Multivariate Tokenization and multi-frequency sliding windows are introduced to extract numerical features. Natural language features are extracted by combining with a natural language encoder. A multi-head attention mechanism is used to align and weightedly fuse multiple features. Finally, the decoder is used to generate prediction results, capture the potential correlation between various types of data, and more accurately reflect the dynamic changes in parking demand. This ensures that the obtained prediction results have higher accuracy and reliability, achieves accurate prediction of city-level parking demand, and provides scientific decision-making support for urban parking management. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0017] Figure 1 This is a flow chart of the city-level parking demand scale prediction method provided by the present invention.

[0018] Figure 2 This is a flow chart of the city-level parking demand scale prediction system provided by the present invention. DETAILED DESCRIPTION

[0019] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0020] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0021] It should be noted that the terms used herein are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0022] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0023] Embodiment 1: like Figure 1 As shown, this embodiment provides a city-level parking demand scale prediction method, including: S1. Collect urban multi-source data, which include numerical variables and natural language. The numerical variables include historical urban parking scale data, urban demographic data, gross domestic product, industrial scale data, motor vehicle ownership, traffic flow, distribution and capacity of existing parking facilities and land use. The natural language includes transportation policies, legal planning, urban planning and news reports.

[0024] S2. Use multivariate Tokenization and multi-frequency sliding window methods, use a numerical variable encoder to extract numerical variable features from numerical variables; input the numerical variables into the numerical variable encoder to obtain numerical variable features, the numerical feature encoder is LSTM, in order to solve the problem of data sampling frequency and feature space differences from multiple data sources, this embodiment uses multivariate Tokenization and multi-frequency sliding window methods: First, construct a variable set for each different input variable , ,in L Represents the time slice length of the data source, P Represents the characteristic dimension of the variable, and uses a sliding window to L The time slice is based on the step size S To divide the entire time slice into N non-overlapping segments, where ; It should be noted that each variable has different feature dimensions and sampling frequencies, so it is necessary to map different numerical variables to a consistent high-dimensional feature space. This embodiment uses multivariate tokenization and multi-frequency sliding windows to achieve this. Different step sizes are used for different sampling frequencies of numerical variables. STo divide the time slice, different features are distinguished according to the sampling frequency, where a large step size is used for a high sampling frequency and a small step size is used for a low sampling frequency. Then, tokenization is performed on different variables. This embodiment uses LSTM as a numerical variable encoder, and one LSTM unit includes: input gate , used to control the ratio of new information flowing into the memory unit, the forget gate , used to control the forgetting ratio of information in the memory unit, the output gate , used to control the ratio of memory unit information output to the next moment, memory unit , used to store information, has a direct linear transmission path; the forget gate determines which information will be discarded, and its output is determined by the current input and the hidden state at the previous moment Together, they decide to output a value between 0 and 1 through a sigmoid activation function to update the state of the memory cell: ,in, represents the sigmoid function, and They are the weight matrix and bias vector of the forget gate respectively; the input gate determines which new information will be written into the memory cell. First, a sigmoid layer is used to determine which values ​​need to be updated, and then a tanh layer is used to generate candidate values ​​to determine which new information will be added to the memory cell: , where tanh represents the tanh activation function, and are the weight matrix and bias vector of the input gate, respectively. , are the weights and biases of the linear layer in the tanh activation function, is the value of the candidate memory cell; the memory cell state The update is done by the memory state of the previous moment and the new candidate memory cell state The memory state of the previous moment is jointly determined by the forget gate, and the new candidate memory unit state is jointly updated by the input gate: ; The output gate determines how the state of the memory cell will affect the hidden state at the current moment, and ultimately the hidden state of each numerical variable can be obtained , thus obtaining the numerical variable characteristics .

[0025] S3. Extract natural language features of natural language through a natural language encoder. In addition to numerical variables, there are also natural language information such as traffic policies and plans, news reports, etc. It is necessary to embed the natural language information into features and merge them with the numerical variable features. In this embodiment, the BERT model is used as the benchmark natural language encoder, and the specific implementation is as follows: ,in Represent natural language from different data sources, Represents the obtained natural language features.

[0026] S4: Use the multi-head attention mechanism to align and weightedly fuse the features extracted in steps S2 and S3 to obtain multi-source fusion features; obtain numerical variable features and natural language variable features Finally, this embodiment uses the attention mechanism to align and fuse the two features. The specific process is as follows: When fusion of features is performed, position encoding is added to retain the temporal information in the features. The position encoding matrix is ​​represented as PE and is calculated as follows: , ,in is the feature dimension, is the characteristic position, is the index of the feature dimension; add the position encoding to the feature embedding to obtain the embedded feature ; Then use the multi-head attention mechanism to capture the correlation between the features. The calculation process of each attention head is: ,in By inputting data Linear transformation with different weight matrices yields: , , , is a learnable weight matrix, and then the outputs of multiple attention heads are connected and linearly transformed: ,in , is a learnable weight matrix. In this embodiment, the number of attention heads is 8; Finally, for each time step, two linear transformations and a ReLU activation function are used to obtain deeper features: ,in By inputting data Linear transformation with different weight matrices yields: , , , is a learnable weight matrix. To ensure feature consistency, residual connection and layer normalization operations are added in this embodiment, the input and output are added, and layer normalization is performed: , ,in, , in the middle feature The ReLU activation function is added to the feature fusion of multi-head attention to combine the numerical variable features and natural language features, and obtain the fused multi-source fusion features. .

[0027] S5. Use the linear layer decoder to decode the multi-source fusion features to obtain the prediction results. The prediction results of the city-level parking demand scale are: In the prediction process, the difference between the predicted output and the true value is measured by the mean square error loss, thereby improving the accuracy of the prediction results. ,in Represents the true value of city-level parking demand.

[0028] This embodiment uses the public data set PEMS to conduct simulation experiments. The simulation experiments are measured using mean absolute error (MAE), root mean square error (RMSE) and mean absolute percentage error (MAPE). The accuracy results of this embodiment and the prior art algorithm are shown in Table 1. It can be seen from Table 1 that the method of this embodiment greatly improves the performance of urban parking demand prediction.

[0029] Table 1: Comparison of accuracy of this embodiment with other algorithms

[0030] Embodiment 2: like Figure 2 As shown, this embodiment provides a city-level parking demand scale prediction system, including: Data collection module, used to collect multi-source urban data including numerical variables and natural language; A numerical variable feature extraction module, used to extract numerical variable features of numerical variables; Natural language feature extraction module, used for natural language features of natural language; The feature fusion module fuses multiple data features to obtain multi-source fusion features; The parking demand prediction module uses a linear layer decoder to obtain the prediction results.

[0031] In further embodiments, there is also provided: An electronic device includes a memory and a processor, and is equipped with computer instructions running on the processor. When these instructions are executed by the processor, the method steps described in Example 1 can be accurately implemented. For the sake of simplicity, the detailed method content is not repeated here.

[0032] It should be clear that the processor in this embodiment is not limited to the central processing unit CPU, it can also be a general-purpose processor core, a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device PLD, a discrete gate circuit or transistor logic component, a discrete hardware module, etc. In addition, the general-purpose processor can be a microprocessor MPU, or any conventional computing core.

[0033] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0034] A computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the method described in Example 1 is completed.

[0035] The method in Example 1 can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it is not described in detail here.

[0036] The algorithms, systems, and network structures not described in detail in the present invention are all general technologies in the art.

[0037] Those skilled in the art will appreciate that the units, i.e., algorithm steps, of the various examples described in conjunction with this embodiment can be implemented in electronic hardware or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

Claims

1. A method for predicting the scale of city-level parking demand, characterized in that: The specific steps include: S1. Collect urban multi-source data, which includes numerical variables and natural language; S2, using multivariate Tokenization and multi-frequency sliding window methods, using numerical variable encoders to extract numerical variable features from numerical variables; S3, extracting natural language features of the natural language through a natural language encoder; S4, use the multi-head attention mechanism to align and weightedly fuse the features extracted in steps S2 and S3 to obtain multi-source fusion features; S5. Use the linear layer decoder to decode the multi-source fusion features and obtain the prediction results.

2. The method for predicting the scale of city-level parking demand according to claim 1, characterized in that: The numerical variables described in step S1 include historical urban parking scale data, urban population statistics, gross domestic product, industrial scale data, motor vehicle ownership, traffic flow, distribution and capacity of existing parking facilities and land use; natural language includes transportation policies, legal planning, urban planning and news reports.

3. The method for predicting the scale of city-level parking demand according to claim 2, characterized in that: The specific process of step S2 is: S21. Construct a variable set for each different input variable , ,in L Represents the time slice length of the data source, P Represents the characteristic dimension of the variable, and uses a sliding window to L The time slice is based on the step size S To divide the entire time slice into N non-overlapping segments, where ; S2. Tokenization is performed on different variables. LSTM is used as the encoder of numerical variables. The LSTM unit includes: input gate , used to control the ratio of new information flowing into the memory unit, the forget gate , used to control the forgetting ratio of information in the memory unit, the output gate , used to control the ratio of memory unit information output to the next moment, memory unit , used to store information, with a direct linear transmission path; specifically, The output of the forget gate is determined by the current input and the hidden state at the previous moment Together, they decide to output a value between 0 and 1 through a sigmoid activation function to update the state of the memory cell: ,in, represents the sigmoid function, and They are the weight matrix and bias vector of the forget gate respectively; The input gate first passes through a sigmoid layer to determine which values ​​need to be updated, and then passes through a tanh layer to generate candidate values ​​to determine which new information will be added to the memory cell: , where tanh represents the tanh activation function, and are the weight matrix and bias vector of the input gate, respectively. , are the weights and biases of the linear layer in the tanh activation function, is the value of the candidate memory cell; Memory cell status The update is done by the memory state of the previous moment and the new candidate memory cell state The memory state of the previous moment is jointly determined by the forget gate, and the new candidate memory unit state is jointly updated by the input gate: ; The output gate outputs the hidden state of each numerical variable , thus obtaining the numerical variable characteristics .

4. The method for predicting the scale of city-level parking demand according to claim 3 is characterized in that: The specific process of step S3 is: using the BERT model as a natural language encoder, specifically: ,in Represent natural language from different data sources, Represents the obtained natural language features.

5. The method for predicting the scale of city-level parking demand according to claim 4, characterized in that: The specific process of step S4 is: S41. Add position encoding to retain the temporal information in the feature. The position encoding matrix is ​​represented as PE and is calculated as follows: , ,in is the feature dimension, is the characteristic position, is the index of the feature dimension; add the position encoding to the feature embedding to obtain the embedded feature ; S42. Use a multi-head attention mechanism to capture the correlation between features. The calculation process of each attention head is: ,in By inputting data Linear transformation with different weight matrices gives: , , , is a learnable weight matrix, and then the outputs of multiple attention heads are connected and linearly transformed: ,in , is the learnable weight matrix; S43. For each time step, two linear transformations and a ReLU activation function are used to obtain deeper features: ,in The learned weights and biases are added with residual connections and layer normalization operations to add the input and output and perform layer normalization: , ,in, , in the middle feature Add ReLU activation function to obtain multi-source fusion features by using multi-head attention feature fusion .

6. The method for predicting the scale of city-level parking demand according to claim 5, characterized in that: The result of the city-level parking demand scale prediction obtained in step S5 is: In the prediction process, the difference between the predicted output and the true value is measured by the mean square error loss. ,in Represents the true value of city-level parking demand.

7. A city-level parking demand scale prediction system, characterized in that: The method according to any one of claims 1 to 6 comprises: Data collection module, used to collect multi-source urban data including numerical variables and natural language; A numerical variable feature extraction module, used to extract numerical variable features of numerical variables; Natural language feature extraction module, used for natural language features of natural language; The feature fusion module fuses multiple data features to obtain multi-source fusion features; The parking demand prediction module uses a linear layer decoder to obtain the prediction results.

8. An electronic device, characterized in that: The invention comprises a memory and a processor and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method according to any one of claims 1 to 6 is completed.

9. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Intelligent manufacturing equipment fault prediction method based on three gated towers

    CN113626597A

  • Multi-modal health management scheme generation method and system based on deep learning

    CN116933046A

  • Power loop short-term energy consumption prediction method and system based on multi-feature modeling and attention enhancement

    CN117293803A

  • Nuclear power equipment maintenance decision-making method and system based on intelligent technology

    CN118155227A

  • Large language model-based combat situation analysis and target action prediction method

    CN118277790A