Parking lot parking space prediction method and device

By using machine learning models to predict the number of vehicles entering the parking lot and the parking duration, the problem of not being able to know the parking space occupancy status in advance has been solved, enabling accurate prediction of the number of available parking spaces and reducing road and parking lot congestion.

CN121459627APending Publication Date: 2026-02-03HANGZHOU LIFANG DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511629149.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Current technology cannot predict parking space occupancy in advance, leading to congestion at entrances and exits during specific time periods, making it difficult for drivers to choose appropriate travel times and methods.

Method used

By inputting the time, weather, and parking information of a preset parking lot within a target time period into a machine learning model as a multi-dimensional dataset, the model predicts the number of vehicles entering the parking lot and the parking duration, and calculates the change in available parking spaces.

Benefits of technology

Accurately predict changes in the number of available parking spaces to prevent road congestion, help car owners plan their travel time and mode of transportation, and reduce parking lot and road congestion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121459627A_ABST
    Figure CN121459627A_ABST
Patent Text Reader

Abstract

The invention provides a parking lot parking space prediction method and device, and the method comprises the steps: obtaining a multi-dimensional data set corresponding to a preset parking lot at a target time, the multi-dimensional data set is used for indicating time information of each first preset duration in a first preset time period corresponding to the target time, weather information and parking lot information of a preset parking lot; inputting the multi-dimensional data set into a pre-trained first machine learning model to predict the predicted number of entering vehicles of the preset parking lot at the target time; inputting the target time and the multi-dimensional data set into a pre-trained second machine learning model to predict a prediction probability that the vehicle parking duration is within each second preset duration within a second preset time period after the target time; and according to the prediction probability of each second preset time length and the predicted number of vehicles entering the parking lot, the free parking space variation of each second preset time length is calculated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of parking management technology, and in particular to a parking space prediction method and device. Background Technology

[0002] Currently, due to the increase in the number of vehicles, some popular commercial complexes, scenic spots, and venues experience traffic congestion at entrances during certain periods due to a lack of parking spaces, and congestion at exits is caused by concentrated departures. Because parking lots cannot predict future parking space availability, drivers are unable to choose their travel time and mode of transportation accordingly, easily leading to parking lot congestion. Summary of the Invention

[0003] In view of this, the purpose of this application is to provide at least one parking space prediction method and device. By inputting time, weather and parking information related to each first preset duration within a first preset time period corresponding to a target time of a preset parking lot as a multi-dimensional dataset into a first machine learning model, the predicted number of vehicles entering the parking lot at the target time is predicted. Then, the multi-dimensional dataset and the target time are input into a second machine learning model to predict the predicted probability of vehicle parking duration falling within each second preset duration. Thus, the change in the number of available parking spaces during each second preset duration can be predicted based on the predicted probability of each second preset duration and the predicted number of vehicles entering the parking lot. This solves the technical problem in the prior art of not being able to know whether there are available parking spaces, and achieves the technical effect of accurately predicting the change in the number of available parking spaces to prevent road congestion.

[0004] This application mainly includes the following aspects: In a first aspect, embodiments of this application provide a parking space prediction method, the method comprising: acquiring a multi-dimensional dataset corresponding to a preset parking lot at a target time, the multi-dimensional dataset being used to indicate time information, weather information, and parking information of the preset parking lot for each first preset duration within a first preset time period corresponding to the target time; inputting the multi-dimensional dataset into a pre-trained first machine learning model to predict the predicted number of vehicles entering the preset parking lot at the target time; inputting the target time and the multi-dimensional dataset into a pre-trained second machine learning model to predict the predicted probability of vehicle parking time falling within each second preset duration within a second preset time period after the target time; and calculating the change in available parking spaces for each second preset duration based on the predicted probability of each second preset duration and the predicted number of vehicles entering the parking lot.

[0005] Optionally, the first machine learning model is trained by: obtaining a multi-dimensional historical dataset corresponding to the parking lot samples at each historical time; using the multi-dimensional historical dataset as training samples, and using the number of historical vehicles entering each parking lot sample at each historical time as training labels, to train the first machine learning model.

[0006] Optionally, the second machine learning model is trained by: obtaining the historical entry time and historical exit time of each historical vehicle in the parking lot sample, as well as the multi-dimensional historical dataset corresponding to each historical entry time; using the multi-dimensional historical dataset and the historical entry time and historical exit time of each historical vehicle as training samples to train the second machine learning model, so that the second machine learning model predicts the probability that the parking time of the vehicle will fall within each of the second preset time periods after the entry time.

[0007] Optionally, the time information includes the date status of each first preset duration within the first preset time period, the number of consecutive days the date is in the same date status, the order of the date in the consecutive days, the length of the rest day before the date, and the length of the rest day after the date.

[0008] Optionally, the weather information includes at least one of the following information for each first preset duration within the first preset time period: temperature, humidity, wind speed, rainfall, and snowfall.

[0009] Optionally, the parking information includes the venue information of the parking lot and the activity information of the venue. The venue information includes the venue type, venue popularity and city popularity of the parking lot for each first preset duration within the first preset time period. The activity information includes the activity organization and activity popularity of the venue.

[0010] Optionally, the first machine learning model includes a long short-term memory network model, and / or the second machine learning model includes a K-nearest neighbor algorithm model.

[0011] Secondly, embodiments of this application also provide a parking space prediction device, the device comprising: an acquisition module for acquiring a multi-dimensional dataset corresponding to a preset parking lot at a target time, the multi-dimensional dataset being used to indicate time information, weather information, and parking information of the preset parking lot for each first preset duration within a first preset time period corresponding to the target time; a first prediction model for inputting the multi-dimensional dataset into a pre-trained first machine learning model to predict the predicted number of vehicles entering the preset parking lot at the target time; a second prediction model for inputting the target time and the multi-dimensional dataset into a pre-trained second machine learning model to predict the predicted probability of vehicle parking duration falling within each second preset duration within a second preset time period after the target time; and a calculation model for calculating the change in available parking spaces for each second preset duration based on the predicted probability of each second preset duration and the predicted number of vehicles entering the parking lot.

[0012] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory through the bus, and the machine-readable instructions are executed by the processor to perform the steps of the method described in the first aspect or any possible implementation of the first aspect.

[0013] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the method described in the first aspect or any possible implementation of the first aspect.

[0014] This application provides a parking space prediction method and apparatus. The method includes: acquiring a multi-dimensional dataset corresponding to a preset parking lot at a target time, wherein the multi-dimensional dataset is used to indicate time information, weather information, and parking information of the preset parking lot for each first preset duration within a first preset time period corresponding to the target time; inputting the multi-dimensional dataset into a pre-trained first machine learning model to predict the predicted number of vehicles entering the preset parking lot at the target time; inputting the target time and the multi-dimensional dataset into a pre-trained second machine learning model to predict the predicted probability of vehicle parking time falling within each second preset duration within a second preset time period after the target time; and calculating the change in available parking spaces for each second preset duration based on the predicted probability of each second preset duration and the predicted number of vehicles entering the parking lot. By inputting the time, weather, and parking information of each first preset duration within the first preset time period corresponding to the target time of the preset parking lot into a first machine learning model as a multi-dimensional dataset, the predicted number of vehicles entering the parking lot at the target time is predicted. Then, the multi-dimensional dataset and the target time are input into a second machine learning model to predict the predicted probability that the parking duration of each vehicle falls within each second preset duration. Thus, the change in the number of available parking spaces during each second preset duration can be predicted based on the predicted probability of each second preset duration and the predicted number of vehicles entering the parking lot. This solves the technical problem in the prior art of not being able to know whether there are available parking spaces, and achieves the technical effect of accurately predicting the change in the number of available parking spaces to prevent road congestion.

[0015] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 A flowchart of a parking space prediction method provided in an embodiment of this application is shown.

[0018] Figure 2 This paper illustrates a functional block diagram of a parking space prediction device provided in an embodiment of this application.

[0019] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0021] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0022] In existing technologies, with the rapid increase in the number of motor vehicles in cities, public parking lots often experience congestion during peak hours. Especially during rush hour or when events are organized, popular commercial complexes, scenic spots, and venues may experience congestion at their entrances due to a lack of parking spaces, or at their exits due to concentrated departures. Furthermore, parking lots cannot predict the number of available spaces in advance, preventing drivers from informing them and thus hindering their ability to choose appropriate travel times and modes of transportation.

[0023] Based on this, this application provides a parking space prediction method and apparatus. By inputting time, weather, and parking-related information for each first preset duration within a first preset time period corresponding to a target time of a preset parking lot as a multi-dimensional dataset into a first machine learning model, the predicted number of vehicles entering the parking lot at the target time is predicted. Then, the multi-dimensional dataset and the target time are input into a second machine learning model to predict the probability that the parking duration of each vehicle falls within each second preset duration. Thus, based on the predicted probability of each second preset duration and the predicted number of vehicles entering the parking lot, the change in available parking spaces for each second preset duration can be predicted. This solves the technical problem in the prior art of not being able to determine whether there are available parking spaces, achieving the technical effect of accurately predicting the change in the number of available parking spaces to prevent road congestion. Specifically, as follows: Please see Figure 1 , Figure 1 This is a flowchart illustrating a parking space prediction method provided in an embodiment of this application. Figure 1 As shown in the embodiment of this application, the parking space prediction method includes the following steps: S101: Obtain the multi-dimensional dataset corresponding to the preset parking lot at the target time.

[0024] The multi-dimensional dataset is used to indicate time information, weather information, and parking information of the preset parking lot for each first preset duration within the first preset time period corresponding to the target time.

[0025] Here, the target time refers to a certain time in the future, and the first preset time period refers to a time period that includes the target time. That is to say, the first preset time period is the time covered from the first moment to the second moment, where the first moment can be a moment before the target time and the second moment can be a moment after the target time; or, the first moment can be the target time and the second moment can be a moment after the target time.

[0026] Specifically, the first preset time period is divided according to the first preset duration, and the time information, weather information and parking information of the preset parking lot for each first preset duration are used as a multi-dimensional dataset corresponding to the target time.

[0027] For example, the time information includes the date status of each first preset duration within the first preset time period, the number of consecutive days the date is in the same date status, the order of the date in the consecutive days, the length of the rest day before the date, and the length of the rest day after the date.

[0028] For each first preset duration, the date status refers to whether the specified time of the first preset duration falls on a weekday or a public holiday, including statutory holidays and weekends; the consecutive days refer to the number of consecutive days that are adjacent to the specified time of the first preset duration and are in the same date status; the order refers to which day of the consecutive days the specified time of the first preset duration falls on; the length of rest days before the date refers to the length of consecutive rest days before the specified time of the first preset duration, if the day before the date is a weekday, then the length of rest days before the date is 0; the length of rest days after the date refers to the length of consecutive rest days after the specified time of the first preset duration, if the day after the date is a weekday, then the length of rest days after the date is 0.

[0029] For example, the specified time refers to the start or end time of the first preset duration, and the date status, consecutive days, sequence, length of rest days before the date, and length of rest days after the date all correspond to the same specified time. That is, the date status, consecutive days, sequence, length of rest days before the date, and length of rest days after the date are all relative to the date on which the start time of the first preset duration is located, or the date status, consecutive days, sequence, length of rest days before the date, and length of rest days after the date are all relative to the date on which the end time of the first preset duration is located.

[0030] For example, if the target time is 10:00 AM on October 3, 2025, the length of the first preset time period is 24 hours, and the first preset time period refers to the time covered by 24 hours starting from the target time. Therefore, the first preset time period is from 10:00 AM on October 3, 2025 to 10:00 AM on October 4, 2025, and the first preset duration is 30 minutes. Furthermore, each first preset duration within the first preset time period includes 10:00 AM to 10:30 AM on October 3, 2025, 10:30 AM to 11:00 AM on October 3, 2025, ..., 9:00 AM to 9:30 AM on October 4, 2025, and 9:30 AM to 10:00 AM on October 4, 2025, thus dividing the first preset time period into multiple time periods at intervals of the first preset duration. Therefore, for the period from 10:00 AM to 10:30 AM on October 3, 2025, and with the specified time being the start time of the first preset duration, the date of this time period is October 3, 2025, which is the third day of the National Day holiday. Thus, the date status is a holiday. Since October 3 is within the National Day holiday, and the National Day holiday in 2025 lasts for 8 days, the number of consecutive days with this date in the same status is 8. October 3 is the third day of the eight-day National Day holiday, therefore, the date's order in the consecutive days is 3. The consecutive rest days before October 3 are October 1 and 2, so the length of the rest days before this date is 2. The consecutive rest days after October 3 are October 4 to 8, so the length of the rest days after this date is 5.

[0031] For example, if the target time is 10:00 AM on December 27, 2025, the length of the first preset time period is 24 hours, and the first preset time period refers to the time covered by 24 hours starting from the target time. Therefore, the first preset time period is from 10:00 AM on December 27, 2025 to 10:00 AM on December 28, 2025, and the first preset duration is 30 minutes. Furthermore, each first preset duration within the first preset time period includes 10:00 AM to 10:30 AM on December 27, 2025, 10:30 AM to 11:00 AM on December 27, 2025, ..., 9:00 AM to 9:30 AM on December 28, 2025, and 9:30 AM to 10:00 AM on December 28, 2025, thus dividing the first preset time period into multiple time periods at intervals of the first preset duration. Therefore, for the period from 10:00 AM to 10:30 AM on December 27, 2025, and the specified time being the start time of the first preset duration, the date of this time period is December 27, 2025, which is a Saturday. Therefore, the date status is a public holiday. Since December 27 is a Saturday, the number of consecutive days that can be rested around December 27 is Saturday and Sunday, and the number of consecutive days with the same date status is 2. December 27 is the first day of a two-day consecutive rest period, and therefore, the date's order in the consecutive days is 1. The day before December 27 is a Friday, so the length of the rest day before that date is 0; the day after December 27 is a Sunday, so the length of the rest day after that date is 1.

[0032] Specifically, the weather information includes at least one of the following information for each first preset duration within the first preset time period: temperature, humidity, wind speed, rainfall, and snowfall.

[0033] In other words, for each preset duration, at least one of the following weather parameters—temperature, humidity, wind speed, rainfall, and snowfall—is used as the weather information for that preset duration. This weather information can be directly obtained from weather software. Since the preset duration is a time range, the temperature for that preset duration can be the temperature value at a specified time within that preset duration, the temperature value at any time within that preset duration, or the average of the temperature values ​​at various times within that preset duration. Furthermore, the temperature for the preset duration can be a predicted temperature value or an actual temperature value, depending on whether the time corresponding to the temperature for the preset duration is a future time or a historical time. The same applies to humidity, wind speed, rainfall, and snowfall, which will not be elaborated upon here.

[0034] Specifically, the parking information includes the venue information of the parking lot and the activity information of the venue. The venue information includes the venue type, venue popularity and city popularity of the parking lot for each first preset duration within the first preset time period. The activity information includes the activity organization status and activity popularity of the venue.

[0035] In other words, venue information describes the relevant information of the venue where the parking lot is located, while event information describes the events held at the venue. For example, venue types include residential, commercial complexes, office buildings, scenic spots, hospitals, and others. Different venue types are represented by different numbers. Venue popularity can be represented by any number from 0 to 1. City popularity refers to the popularity of the city where the venue is located, which can also be represented by any number from 0 to 1.

[0036] For example, the event organization status of a venue can be categorized as having events or not having events; 1 can represent having events, and 0 can represent not having events. Event popularity can be measured by the number of registered participants. For instance, multiple popularity levels can be defined, each corresponding to a range of registered participants. The event's popularity can be determined by the range of registered participants that the actual number falls into. Alternatively, event popularity can be measured by at least one of the likes, comments, and shares of the event's online promotional information; this application does not impose any restrictions.

[0037] For example, if a parking lot is scheduled to hold an event from 11:00 AM to 1:00 PM on December 27, 2025, then for the first preset time period from 10:00 AM to 10:30 AM on December 27, 2025, there will be no event and therefore no event popularity. The event information for this first preset time period can be represented by [0, 0]. If an event is held during the first preset time period from 11:00 AM to 11:30 AM on December 27, 2025, and the event popularity is 5, then the event information for this preset time period can be represented by [1, 5].

[0038] For residential parking lots, most vehicles enter between 7 and 9 PM on weekdays, and the parking duration is mostly around 11 hours, meaning they leave between 6 and 9 AM the following day. On the last working day (e.g., Friday or the working day before a public holiday), 90% of vehicles entering between 7 and 9 PM will park for around 60 hours, leaving between 6 and 9 AM on the first working day after the holiday, showing a clear pattern. For office building parking lots, most vehicles enter between 7 and 9 AM on weekdays, and the parking duration is mostly around 10 hours, leaving between 6 and 7 PM (when employees leave work). If vehicles enter between 10 AM and 3 PM on weekdays, the parking duration is mostly around 2 hours (possibly for meetings or visits), also showing a clear pattern.

[0039] In other words, parking lot traffic exhibits significant periodicity, regularity, and event correlation. For example, office buildings, residential communities, commercial complexes, and scenic spots show clear periodicity and regularity on weekdays and holidays, and the venues where parking lots are located and the activities held there show strong correlation and regularity. Therefore, we can use the relevant information on weather, time, parking lot venues, and activities within a first preset time period covered by a multi-dimensional dataset to predict vehicle data in parking lots at a target time.

[0040] S102: Input the multi-dimensional dataset into a pre-trained first machine learning model to predict the number of vehicles entering the preset parking lot at the target time.

[0041] Specifically, the first machine learning model is trained by: obtaining a multi-dimensional historical dataset corresponding to the parking lot samples at various historical times; using the multi-dimensional historical dataset as training samples, and using the number of historical vehicles entering each parking lot sample at each historical time as training labels to train the first machine learning model.

[0042] Among them, the parking lot sample can select multiple parking lots, or in order to improve the prediction accuracy of the first machine learning model, the parking lot sample can select the actual parking data of the preset parking lot in historical time, and then obtain the historical number of vehicles entering the preset parking lot at each historical time and the multi-dimensional historical dataset corresponding to each historical time.

[0043] For example, the first machine learning model can be trained using a multi-dimensional historical dataset corresponding to multiple parking lots, and then trained a second time using a multi-dimensional historical dataset corresponding to a preset parking lot, thereby increasing the accuracy of the model.

[0044] For example, if the target time is 10:00 AM on December 27, 2025, the historical time can be a randomly selected time within one month prior to the target time, or 10:00 AM every day within one month prior to the target time. Furthermore, the historical number of vehicles entering the parking lot at each historical time should be based on actual and usable data.

[0045] For example, historical vehicle entry data refers to the number of vehicles entering the parking lot at various historical times, excluding vehicles that did not leave within a second preset time period. Thus, each vehicle in the historical vehicle entry data leaves the parking lot within a second preset time period after its initial entry time, thereby removing long-term parking or abnormal parking data. The second preset time period is typically set to 24 hours.

[0046] Specifically, for each historical time, time information, weather information, venue information of the parking lot sample, and event information of each first preset duration within the first preset time period corresponding to that historical time are used to construct a multi-dimensional historical dataset for each historical time. In other words, the construction method of the multi-dimensional historical dataset is the same as that of the multi-dimensional dataset corresponding to the aforementioned target time, and will not be repeated here.

[0047] Furthermore, the multi-dimensional historical datasets corresponding to each historical time are used as training samples for training the first machine learning model, and the actual number of vehicles entering the parking lot at each historical time is used as training labels. In this way, the first machine learning module can predict the number of vehicles entering the parking lot at the historical time based on the multi-dimensional historical dataset corresponding to the input historical time. By modifying the model parameters of the first machine learning model, the predicted number of vehicles entering the parking lot can be made closer to the historical number of vehicles entering the parking lot. 80% of the multi-dimensional historical datasets and historical vehicle data at each historical time can be used as the training set, and the remaining 20% ​​can be used as the test set to complete the training of the first machine learning model.

[0048] For example, the first machine learning model includes a Long Short-Term Memory (LSTM) network model. Specifically, the first machine learning model is described by the following formula: (1) In formula (1), This refers to the predicted number of vehicles entering the site at the t-th historical time. This refers to the Long Short-Term Memory (LSTM) network model. This refers to the multi-dimensional historical dataset within the first preset time period corresponding to the t-th historical time. This refers to feature splicing. This refers to the weight parameters that a Long Short-Term Memory (LSTM) network model can learn. This refers to the time information of the multi-dimensional historical dataset corresponding to the t-th historical time. This refers to the activity information of the multi-dimensional historical dataset corresponding to the t-th historical time. This refers to the weather information of the multi-dimensional historical dataset corresponding to the t-th historical time. This refers to the venue information in the multi-dimensional historical dataset corresponding to the t-th historical time. This refers to vector concatenation. This refers to the Multilayer Perceptron (MLP) mapping multiple pieces of information from a multidimensional historical dataset to a low-dimensional embedding vector.

[0049] In other words, the multi-dimensional dataset corresponding to the target time is input into the trained first machine learning model, and the first machine learning model predicts the number of vehicles entering the preset parking lot at the target time.

[0050] S103: Input the target time and the multi-dimensional dataset into a pre-trained second machine learning model to predict the probability that the vehicle parking time falls within each of the second preset time periods after the target time.

[0051] The multi-dimensional historical dataset refers to the multi-dimensional dataset corresponding to each historical vehicle at its historical entry time. In other words, it is constructed by combining the time information, weather information, and parking information of each historical vehicle within a first preset time period corresponding to its historical entry time. The construction of the multi-dimensional dataset is the same as that described above and will not be repeated here.

[0052] In other words, for multiple target vehicles entering the parking lot at the target time, predict the probability that the parking duration of each vehicle will fall within a certain second preset time period after the target time. Alternatively, the predicted probability refers to the probability that the parking duration of each vehicle entering the parking lot at the target time falls within a certain second preset time period, where the second preset time period is evenly divided to obtain each second preset time period.

[0053] Specifically, the second machine learning model is trained in the following way: obtain the historical entry time and historical exit time of each historical vehicle in the parking lot sample, as well as the multi-dimensional historical dataset corresponding to each historical entry time; use the multi-dimensional historical dataset and the historical entry time and historical exit time of each historical vehicle as training samples to train the second machine learning model, so that the second machine learning model can predict the probability that the parking time of the vehicle will be within each of the second preset time periods after the entry time.

[0054] In other words, the parking lot sample can be multiple parking lots, or only a preset parking lot can be considered. The historical entry time and historical exit time of each historical vehicle are determined in the parking lot sample. For each historical vehicle, the difference between the historical exit time and the historical entry time is not greater than the second preset time period.

[0055] For example, the historical entry time and historical exit time of each historical vehicle in a preset parking lot are obtained. The difference between the historical exit time and historical entry time of each historical vehicle is no greater than a second preset time period (e.g., 24 hours). Vehicles that have not left after 24 hours are not considered. That is, if a historical vehicle enters the parking lot at historical time i, then historical time i is taken as the historical entry time of that historical vehicle. If the historical vehicle leaves at i+30 minutes, then the historical exit time of that historical vehicle is i+30.

[0056] The second preset time period can be divided into various second preset durations according to preset intervals. If the preset interval is 30 minutes, then the various second preset durations within the second preset time period include parking durations of 0 minutes to 30 minutes, parking durations of 30 minutes to 1 hour, ..., parking durations of 23.5 hours to 24 hours. Furthermore, the second preset duration to which the actual parking duration of each historical vehicle belongs can be determined according to the historical departure time of each historical vehicle. That is, for vehicles whose historical departure time is from the historical entry time to the historical entry time + 30 minutes, the actual parking duration of the vehicle falls into the second preset duration of parking durations of 0 minutes to 30 minutes; for vehicles whose historical departure time is from the historical entry time + 30 minutes to the historical entry time + 1 hour, the actual parking duration of the vehicle falls into the second preset duration of parking durations of 30 minutes to 1 hour, and so on. Thus, the second preset duration within the second preset time period to which the actual parking duration of each historical vehicle belongs can be determined.

[0057] In practical applications, users may check the availability of parking spaces before leaving home, and generally do not need to check the availability of parking spaces too far in advance. Therefore, this application sets the second preset time period to 24 hours to improve the adaptability to practical applications.

[0058] For example, the second machine learning model can be trained for the first time using the historical entry and exit times of each historical vehicle in multiple other parking lots, as well as the multi-dimensional historical dataset corresponding to each historical entry time. The other parking lots are those other than the preset parking lot. Then, the second machine learning model can be trained for the second time using the historical entry and exit times of each historical vehicle in the preset parking lot, as well as the multi-dimensional historical dataset corresponding to each historical entry time, in order to increase the accuracy of the model.

[0059] Therefore, the historical entry and exit times of each historical vehicle, as well as the multi-dimensional historical dataset corresponding to each historical entry time, are used as training samples for the second machine learning model. This allows the second machine learning model to predict the probability that the parking time of a historical vehicle belongs to a certain second preset duration based on the input multi-dimensional historical dataset and historical entry time. The predicted probability should be the same as the second preset duration to which the actual parking time of the historical vehicle belongs, thus determining that the model training is complete.

[0060] For example, the second machine learning model includes a K-nearest neighbor algorithm model (KNN model). Specifically, the second machine learning model is described by the following formula: (2) In formula (2), This refers to the probability that the actual parking time of the i-th historical vehicle belongs to the j-th second preset time, and ensures that the sum of the probabilities that the actual parking time of the i-th historical vehicle belongs to each second preset time is 1; This refers to the weighted distance between the k-th historical vehicle and the prediction of the q-th historical vehicle; This refers to the indicator function, which represents the actual parking time of the q-th historical vehicle. If it falls within the j-th second preset duration, then ,otherwise ; This represents the distance between the historical entry time and the multi-dimensional historical dataset of the k-th historical vehicle and the q-th historical vehicle. This represents the historical arrival time of the q-th historical vehicle to be predicted, and the multi-dimensional historical dataset of that historical arrival time. This refers to the historical entry time of the k-th historical vehicle in the training samples and the multi-dimensional historical dataset of that historical entry time. This represents the distance between the historical entry times of the selected q-th and k-th historical vehicles after they are mapped to a coordinate system. For example, the historical entry time of 22:00 is projected onto the coordinate system as (0, 22), and the historical entry time of 23:00 is projected onto the coordinate system as (0, 23), so the distance between the two is 1. This example is only for explanation. This indicates the distance between the selected q-th and k-th historical vehicle multidimensional historical datasets mapped to a single coordinate system. λ is the weight of the multidimensional historical dataset, which defaults to 0.5.

[0061] In other words, the target time and the corresponding multi-dimensional dataset are input into the trained second machine learning model, which then predicts the probability of the vehicle parking time for each of the second preset durations within a second preset time period after the target time.

[0062] S104: Based on the predicted probability of each second preset duration and the predicted number of vehicles entering the parking lot, calculate the change in available parking spaces for each second preset duration within the second preset time period after the target time.

[0063] In other words, for each second preset duration, the predicted probability of that second preset duration is multiplied by the predicted number of vehicles entering the parking lot to obtain the change in available parking spaces corresponding to that second preset duration. The change in available parking spaces refers to the number of vehicles that entered the preset parking lot within the target time and whose parking time was within that second preset duration. That is, a vehicle's parking time being within that second preset duration can be understood as the vehicle leaving the parking lot within the time range of the target time plus the second preset duration.

[0064] Therefore, the change in available parking spaces corresponding to each second preset duration can be understood as the increase in available parking spaces in the preset parking lot during that second preset duration. Thus, for each second preset duration, if the change in available parking spaces is greater than 0, it means that there is a predicted probability that vehicles entering the preset parking lot within the target time will leave within that second preset duration.

[0065] For example, since the product of the predicted probability and the predicted number of vehicles entering the parking lot may contain decimals, it is necessary to perform data normalization processing on the product of the predicted probability and the predicted number of vehicles entering the parking lot to obtain an integer change in the number of available parking spaces. For example, the data normalization processing can be carried out in any of the following ways: rounding, rounding up, or rounding down, and this application does not limit this.

[0066] Therefore, the change in available parking spaces for each second preset time period after the target time can be predicted. This can be provided through parking lot mini-programs or other means, allowing users to choose whether to park in the preset parking lot or during which time period, thereby reducing congestion in the preset parking lot.

[0067] For example, changes in the number of available parking spaces in a parking lot can be used to predict whether nearby roads will become congested. For instance, a low number of available parking spaces may indicate congestion. Separate models can also be trained specifically for high-risk vehicles (blacklisted vehicles, vehicles with outstanding fees, etc.) to predict their parking duration. When a blacklisted vehicle is detected entering the parking lot, its parking duration can be inferred, and a countdown timer can be used. As the countdown nears its end, the administrator is alerted to check at the parking lot exit to see if the vehicle has left and paid. Furthermore, KNN probability models can be used to assist in clearing vehicles from the parking lot. For example, if a vehicle has left without a record due to an anomaly, the probability of each vehicle entering the parking lot within various parking time ranges can be predicted. If the probability for a certain parking time range is 0, and the vehicle has exceeded the upper limit of that range, the administrator can be alerted to check if the vehicle has left without a record, allowing for timely data calibration and maintaining accurate parking space availability.

[0068] Based on the same application concept, this application also provides a parking space prediction device corresponding to the parking space prediction method provided in the above embodiments. Since the principle of the device in this application is similar to the parking space prediction method in the above embodiments of this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0069] Please see Figure 2 , Figure 2 A flowchart illustrating a parking space prediction device provided in an embodiment of this application. Figure 2As shown, a parking space prediction device 10 includes: an acquisition module 101, which acquires a multi-dimensional dataset corresponding to a preset parking lot at a target time, wherein the multi-dimensional dataset is used to indicate time information, weather information, and parking information of the preset parking lot for each first preset duration within a first preset time period corresponding to the target time; a first prediction model 102, which inputs the multi-dimensional dataset into a pre-trained first machine learning model to predict the predicted number of vehicles entering the preset parking lot at the target time; a second prediction model 103, which inputs the target time and the multi-dimensional dataset into a pre-trained second machine learning model to predict the predicted probability that the parking time of vehicles will fall within each second preset duration within a second preset time period after the target time; and a calculation model 104, which calculates the change in available parking spaces for each second preset duration according to the predicted probability of each second preset duration and the predicted number of vehicles entering the parking lot.

[0070] Based on the same application concept, see [link / reference] Figure 3 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this application. The electronic device 20 includes a processor 201, a memory 202, and a bus 203. The memory 202 stores machine-readable instructions that can be executed by the processor 201. When the electronic device 20 is running, the processor 201 and the memory 202 communicate through the bus 203. When the machine-readable instructions are executed by the processor 201, the steps of the parking space prediction method described in any of the above embodiments are executed.

[0071] Specifically, when the machine-readable instructions are executed by the processor 201, the following processing can be performed: obtaining a multi-dimensional dataset corresponding to a preset parking lot at a target time, wherein the multi-dimensional dataset is used to indicate time information, weather information, and parking information of the preset parking lot for each first preset duration within a first preset time period corresponding to the target time; inputting the multi-dimensional dataset into a pre-trained first machine learning model to predict the predicted number of vehicles entering the preset parking lot at the target time; inputting the target time and the multi-dimensional dataset into a pre-trained second machine learning model to predict the predicted probability that the parking duration of vehicles will fall within each second preset duration within a second preset time period after the target time; and calculating the change in available parking spaces for each second preset duration according to the predicted probability of each second preset duration and the predicted number of vehicles entering the parking lot.

[0072] Based on the same concept, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when run by a processor, executes the steps of the parking space prediction method provided in the above embodiments.

[0073] Specifically, the storage medium can be a general-purpose storage medium, such as a portable disk or hard disk. When the computer program on the storage medium is run, it can execute the above-mentioned parking space prediction method. By inputting the time, weather, and parking information of each first preset duration within a first preset time period corresponding to the target time of the preset parking lot as a multi-dimensional dataset into a first machine learning model, the predicted number of vehicles entering the parking lot at the target time is predicted. Then, the multi-dimensional dataset and the target time are input into a second machine learning model to predict the predicted probability of the vehicle parking duration falling within each second preset duration. Thus, the change in the number of available parking spaces for each second preset duration can be predicted according to the predicted probability of each second preset duration and the predicted number of vehicles entering the parking lot. This solves the technical problem in the prior art of not being able to know whether there are available parking spaces, and achieves the technical effect of accurately predicting the change in the number of available parking spaces to prevent road congestion.

[0074] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0075] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0076] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0077] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0078] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A parking lot space prediction method, characterized in that, The method includes: Obtain a multi-dimensional dataset corresponding to a preset parking lot at a target time. The multi-dimensional dataset is used to indicate the time information, weather information, and parking information of the preset parking lot for each first preset duration within a first preset time period corresponding to the target time. The multi-dimensional dataset is input into a pre-trained first machine learning model to predict the number of vehicles entering the preset parking lot at the target time. The target time and the multi-dimensional dataset are input into a pre-trained second machine learning model to predict the probability that the vehicle parking time falls within each of the second preset time periods after the target time. The change in available parking spaces for each second preset duration is calculated based on the predicted probability of each second preset duration and the predicted number of vehicles entering the parking area.

2. The method according to claim 1, characterized in that, The first machine learning model is trained in the following manner: Obtain multi-dimensional historical datasets of parking lot samples at various historical times; The multi-dimensional historical dataset is used as a training sample, and the number of vehicles entering each parking lot sample at each historical time is used as a training label to train the first machine learning model.

3. The method according to claim 1, characterized in that, The second machine learning model is trained in the following manner: Obtain the historical entry time and historical exit time of each historical vehicle in the parking lot sample, as well as the multi-dimensional historical dataset corresponding to each historical entry time; The second machine learning model is trained using the multi-dimensional historical dataset and the historical entry and exit times of each historical vehicle as training samples, so that the second machine learning model can predict the probability that the vehicle's parking time falls within each of the second preset time periods after the entry time.

4. The method according to claim 1, characterized in that, The time information includes the date status of each first preset duration within the first preset time period, the number of consecutive days the date is in the same date status, the order of the date in the consecutive days, the length of the rest day before the date, and the length of the rest day after the date.

5. The method according to claim 1, characterized in that, The weather information includes at least one of the following information for each first preset duration within the first preset time period: temperature, humidity, wind speed, rainfall, and snowfall.

6. The method according to claim 1, characterized in that, The parking information includes the venue information of the venue where the parking lot is located and the event information of the venue. The venue information includes the venue type, venue popularity, and city popularity of the parking lots for each first preset duration within the first preset time period. The activity information includes the activity organization status and activity popularity of the venue.

7. The method according to claim 1, characterized in that, The first machine learning model includes a long short-term memory network model, and / or the second machine learning model includes a K-nearest neighbor algorithm model.

8. A parking space prediction device, characterized in that, The device includes: The acquisition module acquires a multi-dimensional dataset corresponding to a preset parking lot at a target time. The multi-dimensional dataset is used to indicate the time information, weather information, and parking information of the preset parking lot for each first preset duration within a first preset time period corresponding to the target time. The first prediction model inputs the multi-dimensional dataset into a pre-trained first machine learning model to predict the number of vehicles entering the preset parking lot at the target time. The second prediction model inputs the target time and the multi-dimensional dataset into a pre-trained second machine learning model to predict the probability that the vehicle parking time falls within each of the second preset time periods after the target time. The calculation model calculates the change in available parking spaces for each second preset time period based on the predicted probability of each second preset time period and the predicted number of vehicles entering the parking area.

9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the machine-readable instructions are executed by the processor to perform the steps of the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method as described in any one of claims 1 to 7.