Gas station queuing time prediction method and device

By combining an LSTM model with a fully connected layer, the dynamic changes in vehicle queues at gas stations are captured. Combined with a BP model, the queuing time outside the station is predicted, solving the problem that car owners cannot accurately predict gas station queuing time and improving prediction accuracy and resource utilization efficiency.

CN121503738APending Publication Date: 2026-02-10RICHFIT INFORMATION TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411084288.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Car owners cannot accurately predict gas station queue times, leading to wasted time and anxiety, and gas station queue conditions cannot be known remotely.

Method used

A method combining LSTM model and fully connected layer is used to capture dynamic changes based on vehicle feature vectors within gas stations and predict queuing time within the station. The BP model is used for simple regression tasks of vehicles outside the station to predict queuing time outside the station, and the prediction results are displayed in conjunction with an IoT platform.

Benefits of technology

It improves the accuracy and reliability of gas station queue time prediction, reduces computing resource consumption, provides decision support, and optimizes convenience for car owners and managers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121503738A_ABST
    Figure CN121503738A_ABST
Patent Text Reader

Abstract

The invention discloses a gas station queuing time prediction method and device. The generation method comprises the following steps: judging whether a to-be-analyzed vehicle is in a gas station; if yes, obtaining a plurality of adjacent preceding vehicles of the to-be-analyzed vehicle, a feature vector and real waiting time of each adjacent preceding vehicle, and a feature vector of the to-be-analyzed vehicle; splicing the feature vector and the real waiting time of each adjacent preceding vehicle to obtain a prior feature vector of the adjacent preceding vehicle; splicing the prior feature vectors of all adjacent preceding vehicles, and inputting the spliced prior feature vectors into a preset LSTM model to obtain prior knowledge features; and splicing the priori knowledge features with the feature vectors of the to-be-analyzed vehicle, and inputting the spliced feature vectors into a full connection layer to obtain the predicted queuing time of the to-be-analyzed vehicle. According to the method, the accuracy and reliability of predicting the queuing time of the gas station can be remarkably improved, and important decision support and convenience are provided for vehicle owners and gas station managers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method and apparatus for predicting queuing time at gas stations. Background Technology

[0002] In modern society, refueling has become an indispensable part of daily life for car owners. However, congestion and long queues at gas stations frequently plague many drivers. Whether commuting to work or traveling, when their fuel is low, drivers must head to the nearest gas station. However, once they arrive, especially during peak hours, they often face long queues. Vehicles often form long lines, sometimes even extending off the road, with the waiting time depending on traffic flow and the gas station's service efficiency. This situation not only wastes time, but the uncertainty of the waiting time also makes drivers anxious and impatient, especially when time is tight. Summary of the Invention

[0003] To obtain more accurate gas station queue times, this invention provides a gas station queue time prediction method and apparatus.

[0004] In a first aspect, embodiments of the present invention provide a method for predicting queuing time at gas stations, which may include:

[0005] Determine whether the vehicle to be analyzed is inside the gas station;

[0006] If so, obtain multiple adjacent vehicles of the vehicle to be analyzed, as well as the feature vector and actual waiting time of each adjacent vehicle, and the feature vector of the vehicle to be analyzed; the feature vector of the vehicle to be analyzed includes the queue number of the vehicle to be analyzed, the average waiting time of multiple adjacent vehicles, the number of vehicles that have been called but have not yet refueled, the average waiting time of vehicles that have been called but have not yet refueled, the number of vehicles currently refueling, the average refueling time of vehicles, and the average refueling time of multiple vehicles that have already refueled.

[0007] The feature vector of each adjacent preceding vehicle is concatenated with the actual waiting time to obtain the prior feature vector of the adjacent preceding vehicle.

[0008] The prior feature vectors of all adjacent prior vehicles are concatenated and then input into a preset LSTM model to obtain prior knowledge features;

[0009] The prior knowledge features are concatenated with the feature vector of the vehicle to be analyzed, and then input into a fully connected layer to obtain the predicted queuing time of the vehicle to be analyzed.

[0010] In one or more optional embodiments of this application, the following further includes:

[0011] If it is determined that the vehicle to be analyzed is outside the gas station, obtain the queuing times of multiple preceding vehicles;

[0012] The queuing times of the multiple preceding vehicles are input into a preset BP model to obtain the predicted queuing time of the vehicle to be analyzed.

[0013] In one or more optional embodiments of this application, the queuing time of the preceding vehicle is obtained in the following manner:

[0014] Determine whether the preceding vehicle has finished queuing outside the station and obtained a queue number;

[0015] If so, the actual waiting time outside the station for the preceding vehicle will be used as the queuing time for the preceding vehicle.

[0016] If not, obtain the queuing time of multiple vehicles whose queuing positions are ahead of the preceding vehicle;

[0017] The queuing times of multiple vehicles whose queuing positions are ahead of the preceding vehicle are input into the preset BP model to obtain the predicted waiting time of the preceding vehicle.

[0018] The predicted waiting time of the preceding vehicle is used as the queuing time of the preceding vehicle.

[0019] In one or more optional embodiments of this application, the preset BP model includes an input layer, a hidden layer, and an output layer;

[0020] The step of inputting the queuing times of the multiple preceding vehicles into a preset BP model to obtain the predicted queuing time of the vehicle to be analyzed includes:

[0021] The queuing times of the multiple preceding vehicles are input into the input layer, and multiple hidden layer units in the hidden layer are calculated based on the following formula to form a hidden feature:

[0022]

[0023] In the formula, h j N represents the j-th hidden layer unit in the hidden layer. input Hw represents the total number of input layer units. k For the k-th input layer unit, This represents the weights between the k-th input layer unit and the j-th hidden layer unit, where b represents the threshold value of 1. The weights for the threshold b;

[0024] The predicted queuing time of the vehicle to be analyzed is calculated based on the hidden features using the following formula:

[0025]

[0026] In the formula, pw represents the predicted queuing time of the vehicle to be analyzed, and N hidden h represents the total number of hidden layer units. k For the k-th hidden layer unit in the hidden layer, W k b1 represents the weight between the k-th input layer unit and the output layer, and b2 represents the threshold value of 1. The weight is the threshold b2.

[0027] In one or more optional embodiments of this application, the following further includes:

[0028] Acquire image data of the intersection closest to the entrance of the gas station;

[0029] Based on the image data, the real-time road speed, real-time traffic flow, road length, and maximum speed limit are obtained.

[0030] Speed ​​and traffic flow indicators are calculated based on the real-time speed, real-time traffic flow, road length, and maximum speed limit of the road.

[0031] Multiplying the speed index and traffic flow index yields the degree of congestion outside the station;

[0032] The level of congestion outside the station will be displayed on an IoT platform or on the electronic display screen of the gas station.

[0033] In one or more optional embodiments of this application, after obtaining the predicted queuing time of the vehicle to be analyzed, the method further includes:

[0034] The predicted queuing time of the vehicles to be analyzed is displayed on an IoT platform or on the electronic display screen of the gas station.

[0035] Secondly, embodiments of the present invention provide a gas station queuing time prediction device, which may include:

[0036] The first judgment module is used to determine whether the vehicle to be analyzed is inside the gas station.

[0037] The first acquisition module is used to acquire, if the first judgment module determines that the vehicle to be analyzed is inside the gas station, multiple adjacent vehicles of the vehicle to be analyzed, as well as the feature vector and actual waiting time of each adjacent vehicle, and the feature vector of the vehicle to be analyzed; the feature vector of the vehicle to be analyzed includes the queue number of the vehicle to be analyzed, the average waiting time of multiple adjacent vehicles, the number of vehicles that have been called but have not been refueled, the average waiting time of vehicles that have been called but have not been refueled, the number of vehicles currently being refueled, the average refueling time of vehicles, and the average refueling time of multiple vehicles that have been refueled.

[0038] The first splicing module is used to splice the feature vector and the actual waiting time of each adjacent preceding vehicle to obtain the prior feature vector of the adjacent preceding vehicle.

[0039] The first prediction module is used to concatenate the prior feature vectors of all the adjacent prior vehicles and input them into a preset LSTM model to obtain prior knowledge features.

[0040] The second prediction module is used to concatenate the prior knowledge features with the feature vector of the vehicle to be analyzed, and input the concatenation into a fully connected layer to obtain the predicted queuing time of the vehicle to be analyzed.

[0041] The first acquisition module is further configured to acquire the queuing time of multiple preceding vehicles if the first judgment module determines that the vehicle to be analyzed is outside the gas station.

[0042] The third prediction module is used to input the queuing time of the multiple preceding vehicles into a preset BP model to obtain the predicted queuing time of the vehicle to be analyzed.

[0043] Thirdly, embodiments of the present invention provide a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the gas station queuing time prediction method described above.

[0044] Fourthly, embodiments of the present invention provide a computer program product, including a computer program / instruction, which, when executed by a processor, implements the gas station queuing time prediction method described above.

[0045] Fifthly, embodiments of the present invention provide a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the gas station queuing time prediction method as described above.

[0046] The beneficial effects of the above-described technical solutions provided in the embodiments of the present invention include at least the following:

[0047] This invention provides a method for predicting queuing time at gas stations. The method targets a vehicle to be analyzed within the gas station, acquiring the feature vector of the vehicle to be analyzed, the feature vectors of multiple adjacent vehicles, and the actual waiting time. The feature vectors of the multiple adjacent vehicles and the actual waiting time are concatenated to obtain the prior feature vectors of the adjacent vehicles. A pre-defined LTSM model is used to capture the dynamic changes in the short-term and long-term queuing process from the prior feature vectors, extracting high-level prior knowledge features. These prior knowledge features are then concatenated with the feature vector of the vehicle to be analyzed, and the predicted queuing time is calculated through a fully connected layer. This method implements different prediction approaches for vehicles inside and outside gas stations. Based on a pre-defined LSTM model and a fully connected layer, an in-station queuing time prediction model is constructed. Comprehensive data collection is performed on the vehicles to be analyzed within the gas station, enabling the queuing time prediction model to better understand queuing dynamics. Simultaneously, by concatenating feature vectors and actual waiting times, the pre-defined LSTM model can capture historical patterns and regularities of queuing vehicles from prior feature vectors. By combining prior knowledge features with the feature vectors of the vehicles to be analyzed, more comprehensive information data is formed, allowing the fully connected layer to perform integrated processing and output accurate predicted queuing times. This significantly improves the accuracy and reliability of gas station queuing time prediction, providing important decision support and convenience for car owners and gas station managers.

[0048] This method predicts queuing times inside and outside gas stations using pre-defined LSTM and BP models, respectively, with significant benefits. The LSTM model excels at processing time-series data, capturing the dynamic changes in waiting and refueling times of vehicles inside the station based on their feature vectors, providing more accurate predictions. The BP model, on the other hand, is suitable for simple regression tasks, quickly predicting queuing times for vehicles outside the station based on known queuing times, thus reducing computational resource consumption. This method ensures both prediction accuracy and optimized computational resource usage.

[0049] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.

[0050] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0051] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0052] Figure 1 This is a schematic diagram illustrating the steps of the gas station queuing time prediction method provided in an embodiment of the present invention;

[0053] Figure 2 This is a schematic diagram of the inside and outside of a gas station provided in an embodiment of the present invention;

[0054] Figure 3 This is a schematic diagram of the structure of the station queuing time prediction model provided in an embodiment of the present invention;

[0055] Figure 4 This is a schematic diagram of the structure of a preset BP model provided in an embodiment of the present invention;

[0056] Figure 5 This is a schematic diagram of the off-site queuing time prediction process provided in an embodiment of the present invention;

[0057] Figure 6 A schematic diagram illustrating the framework of the gas station queuing time prediction method provided in an embodiment of the present invention;

[0058] Figure 7 This is a schematic diagram illustrating the method for predicting queuing time provided in an embodiment of the present invention;

[0059] Figure 8 This is a schematic diagram of the gas station queuing time prediction device provided in an embodiment of this application. Detailed Implementation

[0060] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0061] The inventors discovered that in existing technologies, when drivers arrive at gas stations and queue for refueling, they often cannot accurately know their waiting time. Furthermore, they sometimes encounter queue-jumping, further extending the waiting time and potentially leading to disputes and accidents. In addition, due to the large number of gas stations, drivers cannot remotely determine the waiting time for each station using maps. When a gas station has a long queue, drivers can only judge the queue situation based on road congestion, without knowing the specific waiting time. Based on this, the inventors, through further research and development, created this invention, providing a method and device for predicting gas station queue times.

[0062] Example 1

[0063] Embodiment 1 of the present invention provides a method for predicting queuing time at gas stations, referring to... Figure 1As shown, the method may include the following steps S101-S105:

[0064] S101: Determine whether the vehicle to be analyzed is inside the gas station: if yes, proceed to steps S102-S105; if no, proceed to steps S201-S202.

[0065] S102: Obtain multiple adjacent vehicles of the vehicle to be analyzed, as well as the feature vector and actual waiting time of each adjacent vehicle, and the feature vector of the vehicle to be analyzed; the feature vector of the vehicle to be analyzed includes the queue number of the vehicle to be analyzed, the average waiting time of multiple adjacent vehicles, the number of vehicles that have been called but have not yet refueled, the average waiting time of vehicles that have been called but have not yet refueled, the number of vehicles currently refueling, the average refueling time of vehicles, and the average refueling time of multiple vehicles that have already refueled.

[0066] S103: Concatenate the feature vector of each adjacent preceding vehicle with the actual waiting time to obtain the prior feature vector of the adjacent preceding vehicle.

[0067] S104: Concatenate the prior feature vectors of all adjacent prior vehicles and input them into the preset LSTM model to obtain prior knowledge features.

[0068] S105: Concatenate the prior knowledge features with the feature vector of the vehicle to be analyzed, and input the concatenation into the fully connected layer to obtain the predicted queuing time of the vehicle to be analyzed.

[0069] S201: Obtain the queue times of multiple preceding vehicles.

[0070] S202: Input the queuing times of multiple preceding vehicles into the preset BP model to obtain the predicted queuing time of the vehicle to be analyzed.

[0071] This invention provides a method for predicting queuing time at gas stations. The method targets a vehicle to be analyzed within the gas station, acquiring the feature vector of the vehicle to be analyzed, the feature vectors of multiple adjacent vehicles, and the actual waiting time. The feature vectors of the multiple adjacent vehicles and the actual waiting time are concatenated to obtain the prior feature vectors of the adjacent vehicles. A pre-defined LTSM model is used to capture the dynamic changes in the short-term and long-term queuing process from the prior feature vectors, extracting high-level prior knowledge features. These prior knowledge features are then concatenated with the feature vector of the vehicle to be analyzed, and the predicted queuing time is calculated through a fully connected layer. This method implements different prediction approaches for vehicles inside and outside gas stations. Based on a pre-defined LSTM model and a fully connected layer, an in-station queuing time prediction model is constructed. Comprehensive data collection is performed on the vehicles to be analyzed within the gas station, enabling the queuing time prediction model to better understand queuing dynamics. Simultaneously, by concatenating feature vectors and actual waiting times, the pre-defined LSTM model can capture historical patterns and regularities of queuing vehicles from prior feature vectors. By combining prior knowledge features with the feature vectors of the vehicles to be analyzed, more comprehensive information data is formed, allowing the fully connected layer to perform integrated processing and output accurate predicted queuing times. This significantly improves the accuracy and reliability of gas station queuing time prediction, providing important decision support and convenience for car owners and gas station managers.

[0072] This method predicts queuing times inside and outside gas stations using pre-defined LSTM and BP models, respectively, with significant benefits. The LSTM model excels at processing time-series data, capturing the dynamic changes in waiting and refueling times of vehicles inside the station based on their feature vectors, providing more accurate predictions. The BP model, on the other hand, is suitable for simple regression tasks, quickly predicting queuing times for vehicles outside the station based on known queuing times, thus reducing computational resource consumption. This method ensures both prediction accuracy and optimized computational resource usage.

[0073] In step S101 above, it is determined whether the vehicle to be analyzed is inside the gas station: if yes, then the queuing time inside the station is predicted, including steps S102-S105; if no, then the queuing time outside the station is predicted, including steps S201-S202. Specifically, it can be determined whether the vehicle to be analyzed is inside the gas station through GPS signals or information provided by the user. If yes, it means the user has already taken a number, and the queuing time inside the station can be predicted, estimating how long it will take for the vehicle to be analyzed to refuel; if no, it means the user is still outside the station, and the queuing time outside the station can be predicted, estimating how long it will take for the vehicle to be analyzed to enter the station.

[0074] To facilitate understanding by those skilled in the art, the specific implementation of step S101 provided in the embodiments of this application will be described more clearly and completely below, referring to... Figure 2As shown in the figure, the road diagonally to the right of the gas station is the queuing area inside the gas station. When a vehicle enters this queuing area, it can take a queue number and then the queuing time inside the station can be predicted. In the figure, the lane closest to the gas station below the gas station is the detection section. The section of this detection section from the gas station entrance to the nearest intersection is the queuing area outside the gas station, and the queuing time outside the station can be predicted.

[0075] In step S102 above, for the case where the vehicle to be analyzed is inside the station, multiple adjacent vehicles of the vehicle to be analyzed, the feature vector and actual waiting time of each adjacent vehicle, and the feature vector of the vehicle to be analyzed are obtained.

[0076] The feature vector of the vehicle to be analyzed includes the queue number of the vehicle to be analyzed, the average waiting time of multiple adjacent vehicles ahead, the number of vehicles that have been called but have not yet refueled, the average waiting time of vehicles that have been called but have not yet refueled, the number of vehicles currently refueling, the average refueling time of a vehicle, and the average refueling time of multiple vehicles that have already refueled.

[0077] The feature vector of adjacent vehicles includes the queue number of adjacent vehicles, the average waiting time of multiple vehicles with queue numbers preceding adjacent vehicles, the number of vehicles whose numbers have been called but have not yet refueled, the average waiting time of vehicles whose numbers have been called but have not yet refueled, the number of vehicles currently refueling, the average refueling time of vehicles, and the average refueling time of multiple vehicles that have already refueled.

[0078] The method for obtaining the feature vector of the vehicle to be analyzed and the feature vector of its adjacent preceding vehicles is basically the same. The following will focus on the vehicle to be analyzed and introduce the method for obtaining the feature vector of the vehicle to be analyzed, specifically including steps S1021-S1027:

[0079] S1021: Based on the queue number of the vehicle to be analyzed, obtain the queuing information of multiple adjacent vehicles that precede it.

[0080] Specifically, it's important to clarify that all vehicles entering the gas station are assigned a queue number. Information such as each vehicle's queue number, actual waiting time, and current status can be obtained through the gas station management system. Therefore, once the vehicle to be analyzed enters the gas station and receives its queue number, the gas station management system can retrieve the queuing information of multiple adjacent vehicles preceding it. For example, if the vehicle to be analyzed has queue number 55, and the preset total number of adjacent vehicles is 5, then the queuing information for vehicles with queue numbers 50-55 can be retrieved.

[0081] S1022: Calculate the average waiting time based on the actual waiting time in the queuing information of multiple adjacent vehicles.

[0082] S1023: Obtain the number of vehicles that have been called but have not yet started refueling through the gas station management system, and use this number as the total number of vehicles that have been called but have not yet refueled.

[0083] S1024: Obtain the actual waiting time from the queue information of all vehicles that have been called but have not yet refueled through the gas station management system, calculate the average waiting time of the vehicles that have been called but have not yet refueled.

[0084] S1025: Obtain the number of vehicles currently refueling through the gas station management system, and use this number as the total number of vehicles refueling.

[0085] S1026: Obtain the average refueling time of vehicles that completed refueling within a preset time period through the gas station management system. For example, the average refueling time of vehicles that completed refueling within the last 2 hours is used as the average vehicle refueling time. Here, refueling time refers to the time spent from obtaining a queue number to completing refueling.

[0086] S1027: Obtain the average refueling time of the most recently refueled vehicles through the gas station management system. For example, if the queue numbers of the five most recently refueled vehicles are 30, 31, 33, 34, and 35, then obtain the refueling time of these five vehicles, calculate the average, and obtain the average refueling time of the vehicles that have refueled earlier.

[0087] In step S103 above, the feature vector of each adjacent vehicle preceding it can be concatenated with the actual waiting time to obtain the prior feature vector of the adjacent vehicle preceding it. Specifically, the feature vector of the adjacent vehicle preceding it obtained in step S102 includes 7 values, so the feature vector of an adjacent vehicle preceding it is a 7-dimensional vector with a data shape of 1×7. Concatenating the feature vector of an adjacent vehicle preceding it with the actual waiting time results in an 8-dimensional vector with a data shape of 1×8.

[0088] In step S104 above, the prior feature vectors of all adjacent vehicles can be concatenated and input into a preset LSTM model to obtain prior knowledge features. Specifically, firstly, the prior feature vectors of all adjacent vehicles obtained in step S103 above are concatenated to obtain historical information input. In a specific embodiment, the time step of the preset LSTM model and the total number of adjacent vehicles are both equal to 5. The data shape of the prior feature vector of an adjacent vehicle is 1×8, so the data shape of the historical information input is 5×8.

[0089] Next, the historical information is input into a preset LSTM model to obtain the output prior knowledge features. In one specific embodiment, the data shape of the prior knowledge features is 1×3.

[0090] In step S105 above, the prior knowledge features can be concatenated with the feature vector of the vehicle to be analyzed and input into the fully connected layer to obtain the predicted queuing time of the vehicle to be analyzed. Specifically, the prior knowledge features obtained in step S104 are concatenated with the feature vector of the vehicle to be analyzed obtained in step S102 to obtain the comprehensive information input. In a specific embodiment, the data shape of the prior knowledge features is 1×3, and the data shape of the concatenated feature vector of the vehicle to be analyzed is 1×7, so the data shape of the concatenated comprehensive information input is 1×10.

[0091] Next, the comprehensive information is input into the fully connected layer to obtain the predicted queuing time of the vehicle to be analyzed. In one specific embodiment, the unit of the predicted queuing time of the vehicle to be analyzed is minutes (min).

[0092] To facilitate understanding of this solution by those skilled in the art, the following specific embodiment will be used to summarize the steps S105 and the model prediction steps composed of steps S105 provided in this application embodiment. It should be clear that the model used for station queuing time prediction is the station queuing time prediction model, which is composed of the preset LSTM model in step S104 and the fully connected layer in step S105.

[0093] Reference Figure 3 As shown, the structure of the station queuing time prediction model is displayed from top to bottom. First, the historical information input consists of x 8-dimensional vectors, indicating that the shape of the historical information input data is x×8, where x represents the total number of adjacent vehicles preceding it.

[0094] Next, the historical information is input into the LSTM model to obtain a 10-dimensional hidden feature, which is the 10 neurons in the third row of the diagram. This hidden feature is then input into an embedded fully connected layer to obtain a 3-dimensional prior knowledge feature, which is the three neurons on the left of the fourth layer of data in the diagram. The LSTM model and the embedded fully connected layer correspond to the preset LSTM model mentioned above.

[0095] The 3D prior knowledge features and the current information input are concatenated to obtain a comprehensive information input, which is then passed through a fully connected layer to obtain the output result. Here, the current information input corresponds to the feature vector of the vehicle to be analyzed mentioned above, and the output result corresponds to the predicted queuing time of the vehicle to be analyzed mentioned above.

[0096] Those skilled in the art can train a model to predict queuing time within a station based on the detailed description of the prior art. In one specific embodiment, the training process may include:

[0097] The first step is to collect historical queuing data within the gas station based on the gas station management system, including the actual waiting time and feature vector of each vehicle at each moment, and obtain the historical queuing dataset after preprocessing.

[0098] The second step is to select a suitable deep learning framework to build an LSTM-Linear model as the in-station queuing time prediction model, such as the TensorFlow deep learning framework or the PyTorch deep learning framework.

[0099] The third step is to divide the historical queuing dataset into a training set and a test set.

[0100] The fourth step is to define the loss function (such as cross-entropy loss function, mean squared error loss function, etc.) and the optimization algorithm (such as Adam, SGD, etc.).

[0101] The fifth step is to train the initial LSTM model using the training set of the historical queuing dataset to obtain the updated LSTM model.

[0102] Repeat the LSTM model training process described above until the preset conditions are met, then stop training to obtain the preset LSTM model. The preset conditions can be set to reach a fixed number of iterations, achieve a certain accuracy threshold, or ensure that the accuracy remains unchanged within a preset number of iterations. No specific limitations are required here.

[0103] In S201 above, for the case where the vehicle to be analyzed is outside the station, the queuing time of multiple preceding vehicles is obtained.

[0104] The queuing time for each preceding vehicle is obtained through the following steps S2011-S2015:

[0105] S2011: Determine whether the preceding vehicle has finished queuing outside the station and obtained a queue number: if yes, proceed to step S2012; if no, proceed to steps S2013-S2015.

[0106] Specifically, it can be determined whether the preceding vehicle is inside the gas station using GPS signals or information provided by the user. If so, it means the preceding vehicle has finished queuing outside the station and obtained a queue number, and the actual waiting time outside the station can be determined, including step S2012. If not, it means the preceding vehicle is still queuing outside the station. In this case, the preceding vehicle does not have an actual waiting time outside the station, and the queuing time needs to be predicted using an algorithm, including steps S2013-S2015.

[0107] S2012: The actual waiting time outside the station for the preceding vehicles will be used as the queuing time for the preceding vehicles.

[0108] S2013: Get the queuing time of multiple vehicles whose queuing position is ahead of the vehicle in front.

[0109] S2014: Input the queuing times of multiple vehicles whose queuing positions are ahead of the preceding vehicle into the preset BP model to obtain the predicted waiting time of the preceding vehicle. Specifically, this includes the following steps S20141-S20142:

[0110] The default BP model includes an input layer, a hidden layer, and an output layer.

[0111] S20141: Input multiple vehicles whose queuing positions are before the preceding vehicle into the input layer, and calculate multiple hidden layer units in the hidden layer based on the following formula 1 to form hidden features:

[0112]

[0113] In the formula, h j N represents the j-th hidden layer unit in the hidden layer. input Hw represents the total number of input layer units. k For the k-th input layer unit, This represents the weights between the k-th input layer unit and the j-th hidden layer unit, where b represents the threshold value of 1. The weight is the threshold b.

[0114] The hidden layer may also include an activation function. In one specific embodiment, the Sigmoid function is used as the activation function, and the activated hidden features are shown in Equation 2:

[0115]

[0116] In the formula, h j This represents the j-th hidden layer unit in the hidden layer.

[0117] S20142: The predicted queuing time of preceding vehicles is calculated based on the hidden features using the following formula 3:

[0118]

[0119] In the formula, pw represents the predicted queuing time of the preceding vehicles, and N hidden h represents the total number of hidden layer units. k W is the k-th hidden layer unit in the hidden layer. k b1 represents the weights between the k-th input layer unit and the output layer, and b2 represents the threshold, which has a value of 1. The weight is the threshold b2.

[0120] The output layer may also include an activation function. In one specific embodiment, the Sigmoid function is used as the activation function, and the activated hidden features are shown in Equation 4:

[0121] z pw=1 / 1+e -pw Formula 4

[0122] In the formula, h j This represents the j-th hidden layer unit in the hidden layer.

[0123] S2015: The predicted waiting time of the preceding vehicle will be used as the queuing time for the preceding vehicle.

[0124] To facilitate understanding of this solution by those skilled in the art, the following specific embodiment provides a clearer and more complete explanation of the detailed implementation process of the method for predicting queuing time based on a preset BP model provided in this application. (Refer to...) Figure 4 As shown, from left to right, these are the input layer, hidden layer, and output layer of the preset BP model. The total number of input layer units is 6, and the total number of hidden layer units is 13. b and b2 correspond to the thresholds of the input layer and hidden layer mentioned above.

[0125] Those skilled in the art can train a pre-defined BP model based on the detailed description of the prior art. In one specific embodiment, the training process may include:

[0126] The first step is to collect historical off-site queuing data, including the actual waiting time for each vehicle outside the station, and then preprocess it to obtain the historical off-site queuing dataset.

[0127] The second step is to choose a suitable deep learning framework to build the initial backpropagation (BP) model, such as the TensorFlow deep learning framework or the PyTorch deep learning framework.

[0128] The third step is to divide the historical off-site queuing dataset into a training set and a test set.

[0129] The fourth step is to define the loss function (such as cross-entropy loss function, mean squared error loss function, etc.) and the optimization algorithm (such as Adam, SGD, etc.).

[0130] The fifth step is to train the initial BP model using the training set of the historical off-site queuing dataset to obtain the updated BP model.

[0131] Repeat the training process of the BP model described above until the preset conditions are met, then stop training to obtain the preset BP model. The preset conditions can be set to reach a fixed number of iterations, achieve a certain accuracy threshold, or ensure that the accuracy remains unchanged within a preset number of iterations. No specific limitations are required here.

[0132] In step S202 above, the queuing times of multiple preceding vehicles are input into a preset BP model to obtain the predicted queuing time of the vehicle to be analyzed. The specific process of inputting the queuing times of multiple preceding vehicles into the preset BP model to obtain the predicted queuing time of the vehicle to be analyzed is the same as step S2014 above, and will not be repeated here.

[0133] To facilitate understanding of this solution by those skilled in the art, the specific implementation process of the off-site queuing time prediction method in steps S201-S202 provided in the embodiments of this application will be explained more clearly and completely below, referring to... Figure 5 As shown, the first step is information input, which identifies multiple vehicles in the queue. The second step is to determine whether the top y vehicles have actual waiting times. If so, the actual waiting time is taken as the queuing time; otherwise, the predicted waiting time is taken as the queuing time, corresponding to steps S2011-S2015 above. The third step is to input the queuing times of multiple vehicles in the queue into the BP model and output the predicted time, corresponding to step S202 above. Here, the BP model corresponds to the preset BP model mentioned above, and the predicted time corresponds to the predicted queuing time mentioned above.

[0134] In this embodiment of the application, the congestion level of the queuing area outside the station can also be calculated, and the congestion level outside the station can be provided to the user along with the predicted queuing time. In a specific embodiment, the step of calculating the congestion level outside the station specifically includes the following steps S2021-S2025:

[0135] S2021: Obtain video data of the intersection closest to the gas station entrance using a video detector.

[0136] S2022: Based on image data, real-time road speed, real-time traffic flow, road length, and maximum speed limit are obtained.

[0137] S2023: The speed index is calculated based on the following formula 5, according to real-time road speed, real-time traffic flow, road length, and maximum speed limit:

[0138] T = S2 / S1 (Formula 5)

[0139] In the formula, T is the speed index, S2 is the maximum speed limit of the road, and S1 is the real-time speed of the road.

[0140] The traffic flow index is calculated based on real-time road speed, real-time traffic volume, road length, and maximum speed limit using the following formula:

[0141] V=Q*D Formula 6

[0142] In the formula, V is the traffic flow index, Q is the real-time traffic flow, and D is the road length.

[0143] S2024: Multiply the speed index and the traffic flow index to obtain the degree of congestion outside the station, as shown in Formula 7 below:

[0144] H = T * V Formula 7

[0145] In the formula, H represents the degree of congestion outside the station, T represents the speed index, and V represents the traffic flow index.

[0146] S2025: Display the level of congestion outside the station on an IoT platform or on the electronic display screen at the gas station.

[0147] To facilitate understanding of this solution by those skilled in the art, the specific implementation process of the gas station queuing time prediction method provided in the embodiments of this application will be described more clearly and completely below, with reference to... Figure 6 As shown, the gas station queuing time prediction method includes in-station queuing time prediction and out-of-station queuing time prediction. Out-of-station queuing time prediction includes calculating congestion level and out-of-station queuing time prediction. In-station queuing time prediction corresponds to the above steps S101-S105, out-of-station queuing time prediction corresponds to the above steps S201-S202, and calculating congestion level corresponds to the above steps S2021-S2025.

[0148] In this embodiment of the application, after obtaining the predicted queuing time of the vehicle to be analyzed by executing the gas station queuing time prediction method, the predicted queuing time of the vehicle to be analyzed can also be displayed on the Internet of Things platform or the electronic display screen of the gas station. For details, please refer to... Figure 7 As shown, after obtaining the predicted queuing time inside the station, the queuing time outside the station, and the degree of congestion outside the station, this data is uploaded to the gas station terminal, namely the gas station management system mentioned above. Then, the gas station management system displays the predicted queuing time inside the station, the queuing time outside the station, and the degree of congestion outside the station on the electronic display screen of the gas station. This data can also be uploaded to the Internet of Things platform and displayed in the electronic management system of the vehicle to be analyzed, or on public electronic map software such as Gaode Map and Baidu Map.

[0149] Furthermore, the level of congestion outside gas stations can be displayed as additional information on public electronic map software. When users haven't decided which gas station to go to, they can see the congestion levels of all gas stations on the public electronic map software. Users can then choose a less congested gas station to refuel, effectively preventing users from queuing at congested gas stations due to insufficient information and ignoring nearby empty gas stations. This can effectively reduce waiting time, reduce road congestion, and thus improve overall travel efficiency.

[0150] Example 2

[0151] Based on the same inventive concept, embodiments of the present invention also provide a gas station queuing time prediction device, referring to... Figure 8 As shown, the device includes:

[0152] The first judgment module 101 is used to determine whether the vehicle to be analyzed is inside the gas station.

[0153] The first acquisition module 102 is used to acquire, if the first judgment module determines that the vehicle to be analyzed is inside the gas station, multiple adjacent vehicles of the vehicle to be analyzed, as well as the feature vector and actual waiting time of each adjacent vehicle, and the feature vector of the vehicle to be analyzed; the feature vector of the vehicle to be analyzed includes the queue number of the vehicle to be analyzed, the average waiting time of multiple adjacent vehicles, the number of vehicles that have been called but have not been refueled, the average waiting time of vehicles that have been called but have not been refueled, the number of vehicles currently being refueled, the average refueling time of vehicles, and the average refueling time of multiple vehicles that have been refueled.

[0154] The first splicing module 103 is used to splice the feature vectors and actual waiting times of each adjacent preceding vehicle to obtain the prior feature vectors of the adjacent preceding vehicles.

[0155] The first prediction module 104 is used to concatenate the prior feature vectors of all the prior vehicles and input them into a preset LSTM model to obtain prior knowledge features.

[0156] The second prediction module 105 is used to concatenate the prior knowledge features with the feature vector of the vehicle to be analyzed, and input the concatenation into a fully connected layer to obtain the predicted queuing time of the vehicle to be analyzed.

[0157] In this embodiment of the application, the first acquisition module is further configured to acquire the queuing time of multiple preceding vehicles if the first judgment module determines that the vehicle to be analyzed is outside the gas station.

[0158] The third prediction module is used to input the queuing time of the multiple preceding vehicles into a preset BP model to obtain the predicted queuing time of the vehicle to be analyzed.

[0159] Example 3

[0160] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium storing a computer program / instruction thereon, which, when executed by a processor, implements the gas station queuing time prediction method as described in Embodiment 1 above.

[0161] Example 4

[0162] Based on the same inventive concept, embodiments of the present invention also provide a computer program product, including a computer program / instruction, which, when executed by a processor, implements the gas station queuing time prediction method as described in Embodiment 1 above.

[0163] Example 5

[0164] Based on the same inventive concept, this embodiment of the invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory. When the processor executes the computer program, it implements the gas station queuing time prediction method as described in Embodiment 1 above.

[0165] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.

[0166] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0167] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0168] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0169] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for predicting queuing time at gas stations, characterized in that, include: Determine whether the vehicle to be analyzed is inside the gas station; If so, obtain multiple adjacent vehicles of the vehicle to be analyzed, as well as the feature vector and actual waiting time of each adjacent vehicle, and the feature vector of the vehicle to be analyzed; the feature vector of the vehicle to be analyzed includes the queue number of the vehicle to be analyzed, the average waiting time of multiple adjacent vehicles, the number of vehicles that have been called but have not yet refueled, the average waiting time of vehicles that have been called but have not yet refueled, the number of vehicles currently refueling, the average refueling time of vehicles, and the average refueling time of multiple vehicles that have already refueled. The feature vector of each adjacent preceding vehicle is concatenated with the actual waiting time to obtain the prior feature vector of the adjacent preceding vehicle. The prior feature vectors of all adjacent prior vehicles are concatenated and then input into a preset LSTM model to obtain prior knowledge features; The prior knowledge features are concatenated with the feature vector of the vehicle to be analyzed, and then input into a fully connected layer to obtain the predicted queuing time of the vehicle to be analyzed.

2. The method according to claim 1, characterized in that, Also includes: If it is determined that the vehicle to be analyzed is outside the gas station, obtain the queuing times of multiple preceding vehicles; The queuing times of the multiple preceding vehicles are input into a preset BP model to obtain the predicted queuing time of the vehicle to be analyzed.

3. The method according to claim 2, characterized in that, The queuing time of the preceding vehicles is obtained in the following way: Determine whether the preceding vehicle has finished queuing outside the station and obtained a queue number; If so, the actual waiting time outside the station for the preceding vehicle will be used as the queuing time for the preceding vehicle. If not, obtain the queuing time of multiple vehicles whose queuing positions are ahead of the preceding vehicle; The queuing times of multiple vehicles whose queuing positions are ahead of the preceding vehicle are input into the preset BP model to obtain the predicted waiting time of the preceding vehicle. The predicted waiting time of the preceding vehicle is used as the queuing time of the preceding vehicle.

4. The method according to claim 2, characterized in that, The preset BP model includes an input layer, a hidden layer, and an output layer; The step of inputting the queuing times of the multiple preceding vehicles into a preset BP model to obtain the predicted queuing time of the vehicle to be analyzed includes: The queuing times of the multiple preceding vehicles are input into the input layer, and multiple hidden layer units in the hidden layer are calculated based on the following formula to form a hidden feature: In the formula, h j N represents the j-th hidden layer unit in the hidden layer. input Hw represents the total number of input layer units. k For the k-th input layer unit, This represents the weights between the k-th input layer unit and the j-th hidden layer unit, where b represents the threshold value of 1. The weights for the threshold b; The predicted queuing time of the vehicle to be analyzed is calculated based on the hidden features using the following formula: In the formula, pw represents the predicted queuing time of the vehicle to be analyzed, and N hidden h represents the total number of hidden layer units. k For the k-th hidden layer unit in the hidden layer, W k b1 represents the weight between the k-th input layer unit and the output layer, and b2 represents the threshold value of 1. The weight is the threshold b2.

5. The method according to claim 2, characterized in that, Also includes: Acquire image data of the intersection closest to the entrance of the gas station; Based on the image data, the real-time road speed, real-time traffic flow, road length, and maximum speed limit are obtained. Speed ​​and traffic flow indicators are calculated based on the real-time speed, real-time traffic flow, road length, and maximum speed limit of the road. Multiplying the speed index and traffic flow index yields the degree of congestion outside the station; The level of congestion outside the station will be displayed on an IoT platform or on the electronic display screen of the gas station.

6. The method according to claim 1, characterized in that, After obtaining the predicted queuing time for the vehicle to be analyzed, the following is also included: The predicted queuing time of the vehicles to be analyzed is displayed on an IoT platform or on the electronic display screen of the gas station.

7. A gas station queue time prediction device, characterized in that, include: The first judgment module is used to determine whether the vehicle to be analyzed is inside the gas station. The first acquisition module is used to acquire, if the first judgment module determines that the vehicle to be analyzed is inside the gas station, multiple adjacent vehicles of the vehicle to be analyzed, as well as the feature vector and actual waiting time of each adjacent vehicle, and the feature vector of the vehicle to be analyzed; the feature vector of the vehicle to be analyzed includes the queue number of the vehicle to be analyzed, the average waiting time of multiple adjacent vehicles, the number of vehicles that have been called but have not been refueled, the average waiting time of vehicles that have been called but have not been refueled, the number of vehicles currently being refueled, the average refueling time of vehicles, and the average refueling time of multiple vehicles that have been refueled. The first splicing module is used to splice the feature vector and the actual waiting time of each adjacent preceding vehicle to obtain the prior feature vector of the adjacent preceding vehicle. The first prediction module is used to concatenate the prior feature vectors of all the adjacent prior vehicles and input them into a preset LSTM model to obtain prior knowledge features. The second prediction module is used to concatenate the prior knowledge features with the feature vector of the vehicle to be analyzed, and input the concatenation into a fully connected layer to obtain the predicted queuing time of the vehicle to be analyzed.

8. The apparatus according to claim 7, characterized in that, The device also includes a third prediction module; The first acquisition module is further configured to acquire the queuing time of multiple preceding vehicles if the first judgment module determines that the vehicle to be analyzed is outside the gas station. The third prediction module is used to input the queuing time of the multiple preceding vehicles into a preset BP model to obtain the predicted queuing time of the vehicle to be analyzed.

9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instruction is executed by the processor, it implements the gas station queuing time prediction method according to any one of claims 1-6.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the gas station queuing time prediction method according to any one of claims 1-6.

11. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the gas station queue time prediction method according to any one of claims 1-6.