Prediction Method and Device for Waiting Time, and Training Method for Machine Learning Model
Through the machine learning model combined with electronic map user behavior trajectory data, and using multi-task model and attention mechanism, the existing problem of high estimated cost and low accuracy of waiting time is solved, low-cost and high-accuracy waiting time prediction is achieved, and user experience and travel efficiency are improved.
Patent Information
- Application Number
- CN202210422728.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-21
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-04-21
AI Technical Summary
The existing method of waiting time is costly and has low accuracy, which cannot effectively meet users' real-time understanding of bus arrival time.
Using machine learning models combined with electronic map user behavior trajectory data, we use feature library training to predict vehicle time, and use multi-task model and attention mechanism to improve prediction accuracy and reduce costs.
It realizes low-cost and high-accuracy waiting time prediction, improves user experience, reduces waiting time, and improves bus travel efficiency.
Smart Images

Figure CN114781719B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and particularly to the field of deep learning. Background Art
[0002] As the largest public transportation facility, buses have become one of the essential tools for people to travel. With the accelerating pace of life, people's demand for knowing when the bus will arrive at the station is increasing.
[0003] Existing methods for estimating waiting time can be roughly divided into two types. One is to estimate the bus departure time based on multiple data sources, then improve the performance of bus travel time estimation by fusing heterogeneous data, and finally estimate the bus waiting time at any bus stop in the city based on the bus departure time and the user's travel time. The other is based on hardware devices, such as station sensors and mobile terminal devices, to estimate the bus waiting time through positioning and distance estimation. Summary of the Invention
[0004] The present disclosure provides a method, apparatus, device, and storage medium for predicting waiting time.
[0005] According to one aspect of the present disclosure, a method for predicting waiting time is provided, including: obtaining feature data from an electronic map, where the feature data includes: the time feature at the current moment and the station information of the target station, and the current moment is the moment when the target object retrieves the target station through the electronic map; determining the waiting duration based on the feature data, where the waiting duration is the duration from the current moment until the target vehicle arrives at the target station.
[0006] According to another aspect of the present disclosure, another method for predicting waiting time is provided, including: displaying an electronic map; receiving an instruction from the target object to retrieve the target station through the electronic map; in response to the instruction, determining the waiting duration based on the time feature at the current moment when the target object retrieves the target station through the electronic map and the station information of the target station, where the waiting duration is the duration from the current moment until the target vehicle arrives at the target station; and displaying the waiting duration.
[0007] According to another aspect of the present disclosure, a method for training a machine learning model is further provided, including: obtaining original data, where the original data at least includes: multiple stations retrieved by the target object through the electronic map and multiple vehicle driving routes, and information on each of the vehicle driving routes; performing data processing on the original data to obtain a feature library, where the feature library at least includes: positioning heat feature, station transfer heat feature, retrieval heat feature, historical vehicle arrival feature, and vehicle driving route feature; and training a machine learning model based on the feature library.
[0008] According to another aspect of the present disclosure, a waiting time prediction device is provided, including: a first acquisition module configured to acquire feature data from an electronic map, where the feature data includes: the time feature at the current moment and the station information of the target station, and the current moment is the moment when the target object retrieves the target station through the electronic map; a determination module configured to determine the waiting duration based on the feature data, where the waiting duration is the duration from the current moment until the target vehicle arrives at the target station.
[0009] According to another aspect of the present disclosure, an electronic device is provided, including: at least one processor; and a memory communicatively connected to the at least one processor; where the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above waiting time prediction method and the machine learning model training method.
[0010] According to still another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, where the computer instructions are used to cause a computer to execute the above waiting time prediction method and the machine learning model training method.
[0011] According to still another aspect of the present disclosure, a computer program product is provided, including a computer program that implements the above waiting time prediction method and the machine learning model training method when executed by a processor.
[0012] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:
[0014] Figure 1 is a flowchart of a waiting time prediction method according to an embodiment of the present disclosure;
[0015] Figure 2 is a flowchart of a waiting time prediction method according to an embodiment of the present disclosure;
[0016] Figure 3 is a flowchart of a machine learning model construction method according to an embodiment of the present disclosure;
[0017] Figure 4 is a flowchart of estimating the waiting time using a machine learning strategy according to an embodiment of the present disclosure;
[0018] Figure 5It is a flowchart of a method for predicting waiting time according to an embodiment of the present disclosure;
[0019] Figure 6a It is a schematic diagram of a display interface of an electronic map according to an embodiment of the present disclosure;
[0020] Figure 6b It is a schematic diagram of another display interface of an electronic map according to an embodiment of the present disclosure;
[0021] Figure 6c It is a schematic diagram of another display interface of an electronic map according to an embodiment of the present disclosure;
[0022] Figure 7 It is a flowchart of a method for training a machine learning model according to an embodiment of the present disclosure;
[0023] Figure 8 It is a structural block diagram of a device for predicting waiting time according to an embodiment of the present disclosure;
[0024] Figure 9 It shows a schematic block diagram of an exemplary electronic device 900 that can be used to implement the embodiments of the present disclosure. Detailed implementation manners
[0025] The following makes an explanation of the exemplary embodiments of the present disclosure in conjunction with the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted below.
[0026] For the first existing method for estimating waiting time mentioned in the background art, the implementation of each process requires data mining. Through the construction of data collection personnel, it still relies on a large amount of human resources, and it is necessary to reach the actual bus stop for recording and collection. Therefore, the traffic cost during the collection process is very high. At the same time, the update speed of this method is also very slow. The three parts of the waiting time are independent of each other, and there are errors in each evaluation result, which will form cumulative errors and further reduce the accuracy of the waiting time result. The second method requires the deployment of hardware devices at each bus stop, resulting in higher costs.
[0027] The technical solution provided by the present disclosure aims to utilize map user behavior trajectory data, and with the help of a machine learning model, estimate the waiting time of a user at a station end-to-end. It can not only reduce the cost of estimating waiting time, but also improve the accuracy of estimating waiting time, avoid users waiting at the bus stop for too long, and improve the user experience.
[0028] The technical solution provided by the present disclosure will be described below in conjunction with specific embodiments.
[0029] Figure 1 is a flowchart of a waiting time prediction method according to an embodiment of the present disclosure. As Figure 1 shown, the method includes the following steps:
[0030] Step S102, obtain feature data from an electronic map, where the feature data includes: the time feature at the current moment and the station information of the target station, and the current moment is the moment when the target object retrieves the target station through the electronic map.
[0031] It should be noted that the above electronic map is an application software running on a mobile terminal. Through this electronic map, navigation can be performed, and information such as bus stops or bus lines can also be searched.
[0032] In a specific application scenario, a user (i.e., the above target object) needs to take a bus from Station A. Therefore, the user needs to know in advance the duration required for the bus staying at Station A to reach Station A (i.e., the user's waiting time). At this time, the user searches for Station A through the electronic map, and the processor obtains the station information of Station A and the time information when the user searches for Station A through the electronic map.
[0033] The station information includes, but is not limited to, the distances of each bus line passing through the current station, the number of stations included in each bus line, and which station the current station belongs to in each bus line, etc. For example, there are 5 bus lines including Station A, and Station A belongs to the 3rd, 5th, 8th, 9th, and 13th stations in these 5 bus lines respectively.
[0034] Step S104, determine the waiting time based on the feature data, where the waiting time is the duration from the current moment until the target vehicle reaches the target station.
[0035] In this step, using the station information of Station A obtained in step S102 and the time information when the user searches for Station A through the electronic map, predict the duration required for the bus to reach Station A, and display this duration in the electronic map.
[0036] It should be noted that since there are multiple bus lines passing through Station A, the time required for the buses corresponding to all the bus lines passing through Station A to reach Station A is displayed simultaneously in the electronic map.
[0037] In an alternative embodiment, the user can also filter bus routes. For example, if the user needs to take a bus from Station A and get off at Station P, the user can input the names of Station A and Station P in the electronic map, and the bus routes passing through both Station A and Station P can be retrieved. For example, through the retrieval, among the above 5 bus routes, only two bus routes pass through both Station A and Station P. Then, in the electronic map, only the time required for the buses corresponding to these two bus routes passing through both Station A and Station P to reach Station A needs to be displayed.
[0038] Through the above method, using the map user behavior trajectory data, the waiting time of the user at a station is estimated end-to-end. It can not only reduce the cost of estimating the waiting time, but also improve the accuracy of estimating the waiting time, avoid the user waiting at the bus stop for too long, and improve the user's riding experience.
[0039] According to an alternative embodiment of the present application, step S104 of determining the waiting duration based on the feature data is implemented by the following method: input the feature data into a pre-trained machine learning model for prediction to obtain the waiting duration.
[0040] The obtained station information of the bus stop and the time information of the user searching for the bus stop through the electronic map are used as feature data and input into the trained neural network model for prediction to obtain the waiting time corresponding to each bus route.
[0041] By using the map user behavior trajectory data to estimate the waiting time of the user at a station end-to-end, the accuracy of estimating the waiting time can be improved, and the cost of estimating the waiting time can be reduced.
[0042] Figure 2 It is a flowchart of a method for predicting the waiting time according to an embodiment of the present disclosure. As Figure 2 shown, first, the original data is processed to generate a feature library, and then specific inference and mining strategies are applied to estimate the waiting time of the user at each station.
[0043] It should be noted that the above application of the specific inference strategy is the process of training a machine learning model using the feature library. Then, the trained machine learning model is used to estimate the waiting time at each station.
[0044] As an alternative embodiment, a machine learning model is trained and generated by the following method: obtaining original data, where the original data includes: multiple stations retrieved by a target object through an electronic map and multiple vehicle driving routes, as well as information on each vehicle driving route; performing data processing on the original data to obtain a feature library, where the feature library includes: location popularity features, station transfer popularity features, retrieval popularity features, historical vehicle arrival features, and vehicle driving route features; and training a machine learning model based on the feature library.
[0045] The original data includes the user's location trajectory in the electronic map (i.e., the user's bus ride trajectory data), the bus stops retrieved by the user, and the bus line (including the names of bus stops and bus lines), and the basic data of the bus line (e.g., the length of the bus line, the number of bus stops included in the bus line, the distance between each station, etc.).
[0046] Then, the original data is processed. In the data processing stage, the original data is filtered, transformed, and feature extracted in a predefined format, and finally a feature library is generated.
[0047] In an alternative embodiment, data warehouse technology (Extract-Transform-Load, ETL) is used to process the original data, and ETL is used to describe the process of extracting, transforming, and loading data from the source end to the destination end.
[0048] The generated feature library mainly includes: location popularity features, station transfer popularity features, retrieval (query) popularity features, historical estimated time of arrival (ETA) features, and route basic features
[0049] According to an alternative embodiment of the present application, the location popularity feature is the query popularity statistical value of each station and each vehicle driving route; the station transfer popularity feature is the number of transfers between different stations included in each vehicle driving route; the retrieval popularity feature is the display volume of each vehicle driving route retrieved; the historical vehicle arrival feature is the arrival information of each vehicle within a preset historical duration; and the vehicle driving route feature includes the number of stations included in each vehicle driving route and the length of each vehicle driving route.
[0050] The positioning heat feature is mainly based on user positioning data to calculate the positioning heat statistical values near each bus line and stop. The stop transfer heat feature is mainly based on user positioning data to extract bus trajectories and calculate the transfer times between the stops included in the corresponding lines. The retrieval heat feature is mainly based on the bus line retrievals of users on the electronic map to count the display quantities of each bus line retrieved. The historical vehicle arrival feature refers to the vehicle arrival conditions of each stop within a preset historical duration. The vehicle driving line feature mainly includes information such as the total number of stops and the total distance of the line.
[0051] By using a machine learning model to estimate the waiting time of users at each stop, the accuracy of the estimated waiting time can be improved, and the cost of estimating the waiting time can be reduced.
[0052] In some optional embodiments of the present application, the machine learning model is a multi-task model. The machine learning model is trained based on a feature library by the following method: input the feature library into a target neural network to obtain an interval truth value, where the interval truth value is the distance between the target vehicle and the target object. Perform an attention mechanism operation on the time feature, the stop information of the target station, and the interval truth value to obtain the waiting duration.
[0053] Figure 3 is a flowchart of a method for constructing a machine learning model according to an embodiment of the present disclosure. As Figure 3 shown, the machine learning model is a multi-task model, where the main task is to predict the waiting duration corresponding to each station, and the auxiliary task is to predict the interval truth value. It should be noted that the interval truth value is actually the distance between the target vehicle and the station retrieved by the user on the electronic map.
[0054] For example, a user expects to take a bus at Station A, but the user retrieves the duration required for the target vehicle to reach Station A through the electronic map before arriving at Station A. In this case, the result predicted by the auxiliary task of the machine learning model is the distance between the target vehicle and Station A. If the user retrieves the duration required for the target vehicle to reach Station A through the electronic map after arriving at Station A, in this case, the result predicted by the auxiliary task of the machine learning model is the distance between the target vehicle and the user (which is actually also the distance between the target vehicle and Station A).
[0055] As an optional embodiment, an end-to-end model based on a bidirectional long short-term memory network (LSTM) is used to determine the time dependence relationship between mobility data (such as geographical location and map query data) and the interval between people and buses, which significantly improves the interval estimation performance between people and buses.
[0056] LSTM is a type of time recurrent neural network and a special type of recurrent neural network (RNN), mainly designed to address the problems of vanishing gradients and exploding gradients during the training process of long sequences. Simply put, compared to ordinary RNNs, LSTMs can perform better in longer sequences.
[0057] The above content describes the training process of the auxiliary task in the machine learning model. During the training process of the main task, the attention mechanism network structure is adopted to encode the station information, time features, and the output result (interval feature) of the auxiliary task, and model the complex traffic factors and bus stop time patterns separately, which significantly improves the accuracy of predicting the waiting time.
[0058] The attention mechanism, also known as the attention technique, as the name implies, is a technique that enables the model to focus on and fully learn important information points. It is not a complete model but rather a technique that can be applied to any sequence model.
[0059] In some alternative embodiments of the present application, before performing the attention mechanism operation on the time feature, the station information of the target station, and the interval ground truth, the time feature and the station information of the target station are respectively input into the embedding layer for dimensionality reduction operations.
[0060] Before explaining the role of the embedding layer, first explain one-hot encoding. Suppose there is the following corresponding encoding relationship:
[0061] 0: This
[0062] 1: Is 2: A
[0064] 3: Tree
[0065] 4: Tree
[0066] Then, to represent a sentence, for example, "This is a tree" is represented as:
[0067] 0, 1, 4
[0068] One-hot encoding only has 0s and 1s. The length of each row of the one-hot encoding is as long as the number of words to be encoded. For example, if there are 5 words in the dictionary "This is a tree" encoded from 0 to 4, then each row of the one-hot encoding will have 5 positions represented by 0 or 1, even if the sentence to be expressed is very short, such as:
[0069] [1, 0, 0, 0, 0] This - 0
[0070] [0,1,0,0,0] is -1
[0071] [0,0,0,0,1] tree - 4
[0072] At the corresponding coding position of each sentence, it will be set to 1, and the rest are 0. That is to say, there will be only one 1 in each row.
[0073] The advantage of one - hot encoding is that it is convenient and fast to calculate and has strong expressive ability. Because for such a sparse matrix, when doing matrix calculations, only the numbers corresponding to the positions of 1 need to be multiplied and summed. However, the problem is also obvious that sparse matrices occupy more resources, especially in the processing of long texts.
[0074] To solve the above problems, the concept of an embedding layer is proposed. The principle of the embedding layer is to use matrix multiplication for dimensionality reduction, so as to achieve the purpose of solving the storage space problem.
[0075] As an optional embodiment, data processing on the original data further includes: updating the original data at a preset time interval.
[0076] As mentioned above, the original data includes the positioning trajectory of the user in the electronic map, the bus stops and bus lines retrieved by the user, and the basic data of the bus lines. During the process of processing the original data, it is updated according to a preset duration (for example, every 24 hours) and stored in the database.
[0077] By updating the original data for training machine learning on time, it is possible to avoid problems such as inaccurate feature libraries for training machine learning models caused by changes in bus lines or stations, and further reduce the prediction accuracy of machine learning models. Through this method, the technical effect of improving the prediction accuracy of machine learning models can be achieved.
[0078] In some other optional embodiments of the present application, the feature data is input into the pre - trained machine learning model for prediction to obtain the distance between the target vehicle and the target object.
[0079] As mentioned above, the machine learning model in the embodiments of the present disclosure is a multi - task model. The auxiliary task is used to predict the distance between the user and the target vehicle. By predicting the distance between the user and the target vehicle in real time, it can help the user more intuitively understand the distance between themselves and the vehicle.
[0080] Figure 4 It is a flowchart for estimating the waiting time using a machine learning strategy according to an embodiment of the present disclosure, as Figure 4As shown, the application of machine learning strategies includes two parts: model training and prediction. First, sample data is collected by certain means, and a certain neural network algorithm is applied to train and generate a specific machine learning model. Then, the feature data of the line to be predicted is input into the trained machine learning model to predict the waiting time at each station.
[0081] Accurately predicting the bus waiting time is very important for passengers. At the same time, it has a positive effect on increasing the usage frequency of electronic map users, can reduce the waiting cost of users, and further improve travel efficiency.
[0082] Figure 5 is a flowchart of a method for predicting waiting time according to an embodiment of the present disclosure. As Figure 5 shown, the method includes the following steps:
[0083] Step S502, display the electronic map.
[0084] It should be noted that the above electronic map is an application software running on a mobile terminal. Through this electronic map, navigation can be carried out, and information such as bus stops or bus lines can also be searched.
[0085] Step S504, receive an instruction from the target object to retrieve the target station through the electronic map.
[0086] Figure 6a is a schematic diagram of a display interface of an electronic map according to an embodiment of the present disclosure. As Figure 6a shown, bus stops or bus lines can be searched from the search dialog box of the electronic map display interface.
[0087] In a specific application scenario, the user (i.e., the above target object) needs to take a bus from Station A. Therefore, the user needs to know in advance the duration required for the bus staying at Station A to reach Station A (i.e., the user's waiting duration). At this time, the user searches for Station A through the electronic map, and the processor obtains the station information of Station A and the time information when the user searches for Station A through the electronic map.
[0088] The station information includes but is not limited to the distances of each bus line passing through the current station, the number of stations included in each bus line, and which station the current station belongs to in each bus line, etc. For example, there are 5 bus lines including Station A, and Station A belongs to the 3rd, 5th, 8th, 9th, and 13th stations in these 5 bus lines respectively.
[0089] Step S506, in response to the instruction, determine the waiting duration based on the time feature at the current moment when the target object retrieves the target station through the electronic map and the station information of the target station, where the waiting duration is the duration required for the target vehicle to reach the target station from the current moment.
[0090] In this step, using the obtained station information of Station A and the time information when the user searches for Station A through the electronic map, predict the duration required for the bus to reach Station A, and display this duration on the electronic map.
[0091] It should be noted that since there are multiple bus routes passing through Station A, therefore, the time required for the buses corresponding to all bus routes passing through Station A to reach Station A is displayed simultaneously on the electronic map.
[0092] Figure 6b is a schematic diagram of another display interface of the electronic map according to an embodiment of the present disclosure, as Figure 6b shown, the time required for the buses corresponding to all bus routes passing through Station A to reach Station A is displayed on the electronic map. For example, there are 5 buses passing through Station A, namely Route 1, Route 3, Route 5, Route 20, and Route 33. The time information of the buses closest to Station A among these five routes reaching Station A is displayed on the electronic map respectively. For example: The bus of Route 1 is expected to reach Station A in 5 minutes; the bus of Route 3 is expected to reach Station A in 2 minutes; the bus of Route 5 is expected to reach Station A in 7 minutes; the bus of Route 20 is expected to reach Station A in 5 minutes; the bus of Route 33 is expected to reach Station A in 8 minutes.
[0093] In an alternative embodiment, the user can also filter the bus routes. For example, if the user needs to take a bus from Station A and get off at Station P, the user enters the names of Station A and Station P in the electronic map, and the bus routes passing through both Station A and Station P can be retrieved. For example, through retrieval, among the above 5 bus routes, only two bus routes pass through both Station A and Station P. Then, only the time required for the buses corresponding to these two bus routes passing through both Station A and Station P to reach Station A needs to be displayed on the electronic map.
[0094] Figure 6c is a schematic diagram of another display interface of the electronic map according to an embodiment of the present disclosure, as Figure 6c shown, by respectively entering the names of Station A and Station P in the electronic map, after retrieval, only the time required for the buses corresponding to these two bus routes passing through both Station A and Station P to reach Station A is displayed on the display interface of the electronic map. For example, only the buses of Route 3 and Route 20 pass through both Station A and Station P. Then, only the time information of the buses of Route 3 and Route 20 closest to Station A reaching Station A needs to be displayed on the electronic map.
[0095] Step S508, display the waiting duration.
[0096] Through the above method, using the map user behavior trajectory data, the waiting time of the user at a station is estimated end to end. This can not only reduce the cost of estimating the waiting time, but also improve the accuracy of estimating the waiting time, avoid the user waiting at the bus stop for too long, and improve the user's riding experience.
[0097] It should be noted that Figure 5 For the preferred implementation manners of the illustrated embodiments, reference may be made to Figure 2 the relevant descriptions of the illustrated embodiments, which will not be elaborated herein.
[0098] Figure 7 is a flowchart of a method for training a machine learning model according to an embodiment of the present disclosure. As Figure 7 shown, the method includes the following steps:
[0099] Step S702, obtain raw data, where the raw data at least includes: multiple stations retrieved by the target object through the electronic map and multiple vehicle driving routes, and information on each vehicle driving route.
[0100] The raw data includes the user's positioning trajectory in the electronic map (i.e., the user's riding trajectory data), the bus stops and bus lines retrieved by the user (including the names of bus stops, bus line names, etc.), and the basic data of the bus lines (for example, the length of the bus line, the number of bus stops included in the bus line, the distance between each station, etc. data).
[0101] Step S704, perform data processing on the raw data to obtain a feature library, where the feature library at least includes: positioning heat feature, station transfer heat feature, retrieval heat feature, historical vehicle arrival feature, vehicle driving route feature.
[0102] In this step, the raw data is processed. In the data processing stage, the raw data is filtered, transformed, and feature extracted according to a predefined format, and finally a feature library is generated.
[0103] In an optional embodiment, data warehouse technology (Extract-Transform-Load, ETL) is used to process the raw data. ETL is used to describe the process of extracting, transforming, and loading data from the source end to the destination end.
[0104] The positioning heat feature is mainly based on user positioning data to calculate the positioning heat statistical values near each bus line and stop. The stop transfer heat feature is mainly based on user positioning data to extract bus trajectories and calculate the transfer times between stops included in the corresponding lines. The retrieval heat feature is mainly based on the retrieval of bus lines on the electronic map to count the display volume of each bus line retrieved. The historical vehicle arrival feature refers to the vehicle arrival situation at each stop within a preset historical duration. The vehicle driving route feature mainly includes information such as the total number of stops and the total distance of the route.
[0105] Step S706, training a machine learning model based on the feature library.
[0106] It should be noted that Figure 7 The preferred implementation of the illustrated embodiment can be referred to Figure 2 the relevant description of the illustrated embodiment, which will not be elaborated here.
[0107] In the technical solution of the present disclosure, the acquisition, storage, and application of user personal information involved all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0108] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0109] Figure 8 is a structural block diagram of a waiting time prediction device according to an embodiment of the present disclosure, as Figure 8 shown, the device includes:
[0110] The first acquisition module 80 is configured to acquire feature data from the electronic map, and the feature data includes: the time feature at the current moment and the stop information of the target stop, where the current moment is the moment when the target object retrieves the target stop through the electronic map.
[0111] It should be noted that the above-mentioned electronic map is an application software running on a mobile terminal, through which navigation can be performed, and information such as bus stops or bus lines can also be searched.
[0112] In a specific application scenario, a user (i.e., the above-mentioned target object) needs to take a bus from Station A. Therefore, the user needs to know in advance the duration required for the bus staying at Station A to reach Station A (i.e., the user's waiting time). At this time, the user searches for Station A through the electronic map, and the processor acquires the stop information of Station A and the time information when the user searches for Station A through the electronic map.
[0113] The station information includes, but is not limited to, the distances of each bus line passing through the current station, the number of stations included in each bus line, and which station the current station belongs to in each bus line, etc. For example, there are 5 bus lines including Station A, and Station A belongs to the 3rd station, the 5th station, the 8th station, the 9th station, and the 13th station in these 5 bus lines respectively.
[0114] The determination module 82 is configured to determine the waiting time based on the feature data, where the waiting time is the time required from the current moment until the target vehicle arrives at the target station.
[0115] Utilize the obtained station information of Station A and the time information when the user searches for Station A through the electronic map to predict the time required for the bus to reach Station A, and display this time in the electronic map.
[0116] It should be noted that since there are multiple bus lines passing through Station A, therefore, the time required for the buses corresponding to all the bus lines passing through Station A to reach Station A is simultaneously displayed in the electronic map.
[0117] In an optional embodiment, the user can also filter the bus lines. For example, if the user needs to take a bus from Station A and get off at Station P, the user inputs the names of Station A and Station P in the electronic map, and the bus lines that pass through both Station A and Station P can be retrieved. For example, through retrieval, among the above 5 bus lines, only two bus lines pass through both Station A and Station P. Then, only the time required for the buses corresponding to these two bus lines passing through both Station A and Station P to reach Station A needs to be displayed in the electronic map.
[0118] It should be noted that Figure 8 The preferred implementation manner of the illustrated embodiment can be referred to Figure 2 the relevant description of the illustrated embodiment, which will not be elaborated here.
[0119] According to an optional embodiment of the present application, the determination module 82 is configured to input the feature data into a pre-trained machine learning model for prediction to obtain the waiting time; the above device further includes: a second acquisition module configured to acquire raw data before acquiring the feature data, where the raw data includes: multiple stations retrieved by the target object through the electronic map and multiple vehicle driving routes, and the information of each vehicle driving route; a processing module configured to perform data processing on the raw data to obtain a feature library, where the feature library includes: positioning heat feature, station transfer heat feature, retrieval heat feature, historical vehicle arrival station feature, vehicle driving route feature; a training module configured to train the machine learning model based on the feature library.
[0120] According to another optional embodiment of the present application, the location popularity feature is the query popularity statistical value of each station and each vehicle driving route; the station transfer popularity feature is the number of transfers between different stations included in each vehicle driving route; the retrieval popularity feature is the display volume of each vehicle driving route retrieved; the historical vehicle arrival feature is the arrival information of each vehicle within a preset historical duration; the vehicle driving route features include the number of stations included in each vehicle driving route and the length of each vehicle driving route.
[0121] As an optional embodiment of the present application, the machine learning model is a multi-task model, and the training module includes: a first processing unit configured to input the feature library into a target neural network to obtain an interval true value, where the interval true value is the distance between the target vehicle and the target object; an operation unit configured to perform an attention mechanism operation on the time feature, the station information of the target station, and the interval true value to obtain the waiting time.
[0122] In some optional embodiments of the present application, the training module further includes: a second processing unit configured to, before performing an attention mechanism operation on the time feature, the station information of the target station, and the interval true value, input the time feature and the station information of the target station into an embedding layer respectively for dimensionality reduction operation.
[0123] In some other optional embodiments of the present application, the processing module is further configured to update the original data at a preset time interval.
[0124] As an optional embodiment, the above device further includes: a prediction module configured to input the feature data into a pre-trained machine learning model for prediction to obtain the distance between the target vehicle and the target object.
[0125] Figure 9 FIG. shows a schematic block diagram of an exemplary electronic device 900 that can be used to implement the embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0126] As Figure 9As shown, device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 909 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0127] Multiple components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a magnetic disk, an optical disc, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0128] The computing unit 901 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 901 executes the various methods and processes described above, such as the method for predicting the waiting time. For example, in some embodiments, the method for predicting the waiting time can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the method for predicting the waiting time described above can be executed. Alternatively, in other embodiments, the computing unit 901 can be configured to execute the method for predicting the waiting time in any other appropriate manner (e.g., by means of firmware).
[0129] The various embodiments of the systems and techniques described above in this specification can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems-on-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which may be a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage system, at least one input device, and at least one output device.
[0130] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on the remote machine or server.
[0131] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0132] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0133] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0134] A computer system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship between the client and the server is generated by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, or a server of a distributed system, or a server incorporating a blockchain.
[0135] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0136] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the protection scope of this disclosure.
Claims
1. A method for predicting waiting time, comprising: Obtaining feature data from an electronic map, wherein the feature data includes: time features at the current moment and station information of a target station, and the current moment is the moment when a target object retrieves the target station through the electronic map; Inputting the feature data into a pre-trained machine learning model for prediction to obtain the waiting duration, wherein the waiting duration is the duration required for a target vehicle to reach the target station from the current moment, the machine learning model is a multi-task model, the main task of the machine learning model is to predict the waiting duration corresponding to each station, the auxiliary task of the machine learning model is to predict the interval true value, and the interval true value is the distance between the target vehicle and the target object. The parameters for training the machine learning model include: positioning popularity feature, station transfer popularity feature, retrieval popularity feature, historical vehicle arrival feature, vehicle driving route feature; Wherein, the positioning popularity feature is the query popularity statistical value of each station and each vehicle driving route; the station transfer popularity feature is the number of transfers between different stations included in each vehicle driving route; the retrieval popularity feature is the display volume of each vehicle driving route retrieved; the historical vehicle arrival feature is the arrival information of each vehicle within a preset historical duration; the vehicle driving route feature includes the number of stations included in each vehicle driving route and the length of each vehicle driving route.
2. The method according to claim 1, wherein, The machine learning model is trained and generated by the following method: Obtaining original data, wherein the original data includes: multiple stations and multiple vehicle driving routes retrieved by the target object through the electronic map, and information of each vehicle driving route; Performing data processing on the original data to obtain a feature library; Training the machine learning model based on the feature library.
3. The method according to claim 2, the training of the machine learning model based on the feature library includes: Inputting the feature library into a target neural network to obtain an interval true value; Performing an attention mechanism operation on the time feature, the station information of the target station, and the interval true value to obtain the waiting duration.
4. The method according to claim 3, wherein The method further includes: Before performing the attention mechanism operation on the time feature, the station information of the target station, and the interval true value, respectively inputting the time feature and the station information of the target station into an embedding layer for dimensionality reduction operation.
5. The method according to claim 2, wherein, The data processing of the original data further includes: updating the original data at a preset time interval.
6. The method according to claim 2, wherein The method further includes: Inputting the feature data into the pre-trained machine learning model for prediction to obtain the distance between the target vehicle and the target object.
7. A method for predicting waiting time, comprising: Displaying an electronic map; Receiving an instruction for a target object to retrieve a target station through the electronic map; In response to the instruction, retrieve the time characteristics at the current moment of the target station and the station information of the target station through the electronic map according to the target object, and determine the waiting time, where the waiting time is the duration required for the target vehicle to reach the target station from the current moment; Display the waiting time; Among them, retrieving the time characteristics at the current moment of the target station and the station information of the target station through the electronic map according to the target object to determine the waiting time includes: Input the time characteristics and the station information of the target station into a pre-trained machine learning model for prediction to obtain the waiting time. Among them, the machine learning model is a multi-task model. The main task of the machine learning model is to predict the waiting time corresponding to each station, and the auxiliary task of the machine learning model is to predict the interval true value. The interval true value is the distance between the target vehicle and the target object. The parameters used to train the machine learning model include: positioning heat characteristics, station transfer heat characteristics, retrieval heat characteristics, historical vehicle arrival station characteristics, and vehicle driving route characteristics; Among them, the positioning heat characteristic is the query heat statistical value of each station and each vehicle driving route; the station transfer heat characteristic is the number of transfers between different stations included in each vehicle driving route; the retrieval heat characteristic is the display volume of each vehicle driving route retrieved; the historical vehicle arrival station characteristic is the arrival station information of each vehicle within a preset historical duration; the vehicle driving route characteristic includes the number of stations included in each vehicle driving route and the length of each vehicle driving route.
8. A training method for a machine learning model, including: Obtain original data, where the original data at least includes: multiple stations and multiple vehicle driving routes retrieved by a target object through an electronic map, and the information of each vehicle driving route; Perform data processing on the original data to obtain a feature library; Train a machine learning model based on the feature library. Among them, the machine learning model is a multi-task model. The main task of the machine learning model is to predict the waiting time corresponding to each station, and the auxiliary task of the machine learning model is to predict the interval true value. The interval true value is the distance between the target vehicle and the target object. The parameters used to train the machine learning model include: positioning heat characteristics, station transfer heat characteristics, retrieval heat characteristics, historical vehicle arrival station characteristics, and vehicle driving route characteristics; Among them, the positioning heat characteristic is the query heat statistical value of each station and each vehicle driving route; the station transfer heat characteristic is the number of transfers between different stations included in each vehicle driving route; the retrieval heat characteristic is the display volume of each vehicle driving route retrieved; the historical vehicle arrival station characteristic is the arrival station information of each vehicle within a preset historical duration; the vehicle driving route characteristic includes the number of stations included in each vehicle driving route and the length of each vehicle driving route.
9. A prediction device for waiting time, including: A first acquisition module, configured to acquire feature data from an electronic map, where the feature data includes: a time feature at the current moment and station information of a target station, and the current moment is the moment when a target object retrieves the target station through the electronic map; A determination module, configured to input the feature data into a pre-trained machine learning model for prediction to obtain the waiting time, where the waiting time is the time required for a target vehicle to reach the target station from the current moment, the machine learning model is a multi-task model, the main task of the machine learning model is to predict the waiting time corresponding to each station, the auxiliary task of the machine learning model is to predict the interval true value, and the interval true value is the distance between the target vehicle and the target object. The parameters used to train the machine learning model include: a positioning popularity feature, a station transfer popularity feature, a retrieval popularity feature, a historical vehicle arrival feature, and a vehicle driving route feature; Among them, the positioning popularity feature is a query popularity statistical value of each station and each vehicle driving route; the station transfer popularity feature is the number of transfers between different stations included in each vehicle driving route; the retrieval popularity feature is the display volume of each vehicle driving route retrieved; the historical vehicle arrival feature is the arrival information of each vehicle within a preset historical duration; the vehicle driving route feature includes the number of stations included in each vehicle driving route and the length of each vehicle driving route.
10. The device according to claim 9, wherein, The device further includes: A second acquisition module, configured to acquire original data before acquiring the feature data, where the original data includes: multiple stations and multiple vehicle driving routes retrieved by the target object through the electronic map, and information of each vehicle driving route; A processing module, configured to perform data processing on the original data to obtain a feature library, where; A training module, configured to train the machine learning model based on the feature library.
11. The training module of the device according to claim 10, includes: A first processing unit, configured to input the feature library into a target neural network to obtain an interval true value; An operation unit, configured to perform an attention mechanism operation on the time feature, the station information of the target station, and the interval true value to obtain the waiting time.
12. The apparatus according to claim 11, wherein, The training module further includes: A second processing unit, configured to perform a dimensionality reduction operation on the time feature and the station information of the target station by respectively inputting them into an embedding layer before performing an attention mechanism operation on the time feature, the station information of the target station, and the interval true value.
13. The apparatus according to claim 10, wherein, The processing module is further configured to update the original data at a preset time interval.
14. The device according to claim 10, wherein, The device further includes: A prediction module, configured to input the feature data into the pre-trained machine learning model for prediction to obtain the distance between the target vehicle and the target object.
15. An electronic device, including: At least one processor; And A memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the prediction method of the waiting time according to any one of claims 1 to 7 and the training method of the machine learning model according to claim 8.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are for causing the computer to execute the prediction method of the waiting time according to any one of claims 1 to 7 and the training method of the machine learning model according to claim 8.
17. A computer program product comprising a computer program which, when executed by a processor, implements the prediction method of the waiting time according to any one of claims 1 to 7 and the training method of the machine learning model according to claim 8.
Citation Information
Patent Citations
Bus arrival time query method and device
CN108986512A