Method and device for predicting vehicle carpooling demand, electronic equipment and storage medium

By constructing a feature tensor set and optimizing hyperparameters, the temporal dependence and spatial correlation of the carpooling demand prediction model are improved, solving the problem of insufficient prediction accuracy in existing technologies and achieving efficient prediction for unconventional scenarios.

CN122089545APending Publication Date: 2026-05-26TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610088591.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-22
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing carpooling demand prediction models fail to effectively couple the temporal and spatial dependencies of passenger travel demand, making them difficult to adapt to unconventional scenarios such as sudden weather events and holidays. Furthermore, they are sensitive to hyperparameters, resulting in insufficient prediction accuracy.

Method used

By constructing a feature tensor set, transforming it into high-dimensional semantic features and mapping it to an orthogonal subspace, the hyperparameters of the ensemble learning gradient boosting tree model are optimized, thereby improving the ability to capture temporal dependencies and spatial correlations.

Benefits of technology

It significantly improves the prediction accuracy of carpooling demand and the model's ability to generalize to unconventional scenarios, and solves the problem of the model's sensitivity to hyperparameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122089545A_ABST
    Figure CN122089545A_ABST
Patent Text Reader

Abstract

This application relates to the field of carpooling demand prediction technology, and particularly to a method, device, electronic device, and storage medium for predicting carpooling demand. The method includes: constructing a feature tensor set based on historical order data, meteorological parameters, and regional static feature data; transforming the target low-dimensional statistical features into target high-dimensional semantic features; and mapping the target high-dimensional semantic features to a target orthogonal subspace to generate a feature set that eliminates redundant temporal correlations. The feature set is then used to optimize the hyperparameters of a pre-constructed ensemble learning gradient boosting tree model until an iteration stopping condition is met, thus constructing a carpooling demand prediction model. This model outputs carpooling demand. This solves the problem that related technologies fail to couple the temporal and spatial dependencies of passenger travel demand, and that the prediction models are sensitive to hyperparameters, making it difficult to adapt to unconventional scenarios and output accurate carpooling demand.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of carpooling demand forecasting technology, and in particular to a method, apparatus, electronic device and storage medium for forecasting carpooling demand. Background Technology

[0002] As a key component of the urban transportation system, shared mobility is becoming increasingly popular. Among them, carpooling, as an emerging trend, effectively improves vehicle utilization efficiency, helps alleviate traffic congestion, and reduces fuel consumption, leading to the development of carpooling demand forecasting methods.

[0003] Among related technologies, there is a carpooling demand prediction and matching method based on neural networks. This method can input historical user travel data and weather impact data into a convolutional long short-term memory neural network model, and obtain a carpooling matching scheme based on G-Tree path planning and RTV (Residual-Time-Value) graph matching algorithm, while also obtaining an evaluation index of user carpooling waiting time.

[0004] However, in related technologies, passenger demand exhibits extremely strong nonlinear spatiotemporal dynamic characteristics. The lack of coupling between the long-term and short-term temporal dependencies and inter-regional spatial correlations of carpooling demand leads to insufficient model generalization ability, making it difficult to adapt to unconventional scenarios such as sudden weather and holidays. In addition, the prediction model is highly sensitive to hyperparameters, making it difficult to output accurate carpooling demand, which urgently needs to be addressed. Summary of the Invention

[0005] This application provides a method, apparatus, electronic device, and storage medium for predicting carpooling demand, in order to solve the problems that related technologies do not couple the temporal dependence and spatial correlation of passenger travel demand, and that the prediction model is sensitive to hyperparameters, making it difficult to adapt to unconventional scenarios and output accurate carpooling demand.

[0006] The first aspect of this application provides a method for predicting carpooling demand, comprising the following steps: determining the target spatiotemporal grid where the target vehicle is located based on historical order data, meteorological environmental parameters, and regional static feature data of at least one target vehicle, and constructing a feature tensor set of the target spatiotemporal grid; converting the target low-dimensional statistical features of the time series in the feature tensor set into target high-dimensional semantic features incorporating time series context information, and mapping the target high-dimensional semantic features to a target orthogonal subspace to generate a feature set that eliminates redundant time correlations; optimizing the hyperparameters of a pre-constructed ensemble learning gradient boosting tree model using the feature set until the iteration stopping condition is met, constructing a carpooling demand prediction model, and using the carpooling demand prediction model to output the carpooling demand of any vehicle.

[0007] Based on the above technical means, this application embodiment constructs a feature tensor set to provide a data foundation for coupling the long-term and short-term temporal dependencies and inter-regional spatial correlations of carpooling demand. Then, by transforming the target low-dimensional statistical features into target high-dimensional semantic features that incorporate time series context information, and mapping the target high-dimensional semantic features to the target orthogonal subspace, the ability to capture temporal dependencies is improved, and the long-term and short-term temporal dependencies and inter-regional spatial correlations of carpooling demand are effectively coupled. Furthermore, through hyperparameter optimization, the model's generalization ability to unconventional scenarios such as sudden weather and holidays is effectively improved, and the prediction accuracy of carpooling demand is significantly enhanced.

[0008] Optionally, in one embodiment of this application, determining the target spatiotemporal grid where the target vehicle is located and constructing the feature tensor set of the target spatiotemporal grid includes: obtaining the geospatial grid of the target city; constructing the target spatiotemporal grid using a sliding time window based on the geospatial grid and the order history data of the at least one target vehicle; and calculating the median value of at least one of the travel time, travel distance, and travel cost of multiple orders within the target spatiotemporal grid, as well as the carpooling rate, to construct the feature tensor set.

[0009] Based on the above technical means, the embodiments of this application construct a target spatiotemporal grid by using a sliding time window, which can transform historical order data without spatiotemporal affiliation into structured data divided by specific geographical regions and specific time periods. Then, by calculating the median values ​​of travel time, travel distance, and travel cost of multiple orders within the target spatiotemporal grid, interference from extreme value data is effectively avoided, and the carpooling rate of multiple orders is calculated to effectively capture carpooling demand characteristics.

[0010] Optionally, in one embodiment of this application, before transforming the target low-dimensional statistical features of the time series in the feature tensor set into target high-dimensional semantic features incorporating time series context information, the method further includes: extracting the time series from the feature tensor set; and encoding the time series into a combined tensor of feature index encoding, segment position identifier, and attention mask.

[0011] Based on the above technical means, the embodiments of this application extract time series from the feature tensor set, focusing on the temporal information of carpooling demand. Then, by encoding the time series into a combined tensor of feature index encoding, segment position identifier and attention mask, the original form that is difficult for the model to understand is effectively transformed into a standardized form that the model can understand, thus providing a guarantee for subsequent feature extraction and processing.

[0012] Optionally, in one embodiment of this application, the step of converting the target low-dimensional statistical features of the time series in the feature tensor set into target high-dimensional semantic features incorporating time series context information includes: obtaining the target low-dimensional statistical features at multiple time steps in the time series; projecting the target low-dimensional statistical features into query, key, and value vectors to determine the attention weights of the target low-dimensional statistical features between at least two time steps; and aggregating the time series context information based on the attention weights to obtain the target high-dimensional semantic features.

[0013] Based on the above technical means, the embodiments of this application calculate attention weights and aggregate time series context information to generate target high-dimensional semantic features. The temporal dependence is always directly guided by the embedded regional spatial features. It can adaptively adjust the temporal prediction logic according to the spatial attributes of different regions, effectively taking into account both long and short temporal dependence and inter-regional spatial correlation, and improving the accuracy of carpooling demand prediction in complex urban functional area scenarios.

[0014] Optionally, in one embodiment of this application, optimizing the hyperparameters of the pre-built ensemble learning gradient boosting tree model includes: mapping multiple candidate parameter sets of the ensemble learning gradient boosting tree model to the actual positions of multiple planets, and determining the planet with the target fitness as the Sun; calculating the Euclidean distance between the multiple planets and the Sun; calculating the gravitational strength of the Sun on the multiple planets based on the Euclidean distance and a nonlinear chaotic perturbation factor to generate candidate positions for the multiple planets; comparing the fitness of at least one planet's candidate position with the actual position; if the fitness of the candidate position is greater than the fitness of the actual position, then the at least one planet moves to the candidate position, and the Sun is optimized.

[0015] Based on the above technical means, the embodiments of this application map multiple candidate parameter groups to the positions of multiple planets and the sun, transforming the hyperparameter optimization process into a spatial position iteration process, thereby improving computational efficiency. Furthermore, by dynamically adjusting the step size in conjunction with the chaotic perturbation factor, the process avoids getting trapped in local extrema in the early stages of iteration and improves convergence accuracy, thus providing hyperparameter assurance for the subsequent construction of a carpooling demand prediction model.

[0016] A second aspect of this application provides a vehicle carpooling demand prediction device, comprising: a construction module, configured to determine the target spatiotemporal grid where the target vehicle is located based on order history data, meteorological environmental parameters, and regional static feature data of at least one target vehicle, and construct a feature tensor set of the target spatiotemporal grid; a generation module, configured to convert the target low-dimensional statistical features of the time series in the feature tensor set into target high-dimensional semantic features incorporating time series context information, and map the target high-dimensional semantic features to a target orthogonal subspace to generate a feature set that eliminates redundant time correlation; and a prediction module, configured to optimize the hyperparameters of a pre-constructed ensemble learning gradient boosting tree model using the feature set until the iteration stopping condition is met, construct a carpooling demand prediction model, and output the carpooling demand for any vehicle using the carpooling demand prediction model.

[0017] Based on the above technical means, this application embodiment constructs a feature tensor set to provide a data foundation for coupling the long-term and short-term temporal dependencies and inter-regional spatial correlations of carpooling demand. Then, by transforming the target low-dimensional statistical features into target high-dimensional semantic features that incorporate time series context information, and mapping the target high-dimensional semantic features to the target orthogonal subspace, the ability to capture temporal dependencies is improved, and the long-term and short-term temporal dependencies and inter-regional spatial correlations of carpooling demand are effectively coupled. Furthermore, through hyperparameter optimization, the model's generalization ability to unconventional scenarios such as sudden weather and holidays is effectively improved, and the prediction accuracy of carpooling demand is significantly enhanced.

[0018] Optionally, in one embodiment of this application, the construction module includes: an acquisition unit for acquiring the geospatial grid of the target city; a first construction unit for constructing the target spatiotemporal grid using a sliding time window based on the geospatial grid and the order history data of the at least one target vehicle; and a second construction unit for calculating the median value and carpooling rate of at least one of the travel time, travel distance, and travel cost of multiple orders within the target spatiotemporal grid, to construct the feature tensor set.

[0019] Based on the above technical means, the embodiments of this application construct a target spatiotemporal grid by using a sliding time window, which can transform historical order data without spatiotemporal affiliation into structured data divided by specific geographical regions and specific time periods. Then, by calculating the median values ​​of travel time, travel distance, and travel cost of multiple orders within the target spatiotemporal grid, interference from extreme value data is effectively avoided, and the carpooling rate of multiple orders is calculated to effectively capture carpooling demand characteristics.

[0020] Optionally, in one embodiment of this application, it further includes: an extraction module for extracting time series from the feature tensor set; and an encoding module for encoding the time series into a combined tensor of feature index encoding, segment position identifier, and attention mask.

[0021] Based on the above technical means, the embodiments of this application extract time series from the feature tensor set, focusing on the temporal information of carpooling demand. Then, by encoding the time series into a combined tensor of feature index encoding, segment position identifier and attention mask, the original form that is difficult for the model to understand is effectively transformed into a standardized form that the model can understand, thus providing a guarantee for subsequent feature extraction and processing.

[0022] Optionally, in one embodiment of this application, the generation module includes: an acquisition unit, configured to acquire the target low-dimensional statistical features at multiple time steps in the time series; a first determination unit, configured to project the target low-dimensional statistical features into a query, key, and value vector to determine the attention weights of the target low-dimensional statistical features between at least two time steps; and a generation unit, configured to aggregate the time series context information based on the attention weights to obtain the target high-dimensional semantic features.

[0023] Based on the above technical means, the embodiments of this application calculate attention weights and aggregate time series context information to generate target high-dimensional semantic features. The temporal dependence is always directly guided by the embedded regional spatial features. It can adaptively adjust the temporal prediction logic according to the spatial attributes of different regions, effectively taking into account both long and short temporal dependence and inter-regional spatial correlation, and improving the accuracy of carpooling demand prediction in complex urban functional area scenarios.

[0024] Optionally, in one embodiment of this application, the prediction module includes: a second determining unit, configured to map multiple candidate parameter sets of the ensemble learning gradient boosting tree model to the actual positions of multiple planets, and determine the planet with the target fitness as the Sun; a first calculation unit, configured to calculate the Euclidean distance between the multiple planets and the Sun; a second calculation unit, configured to calculate the gravitational strength of the Sun on the multiple planets based on the Euclidean distance and a nonlinear chaotic perturbation factor, to generate candidate positions for the multiple planets; a comparison unit, configured to compare the fitness of at least one planet's candidate position with the actual position; and a third determining unit, configured to move the at least one planet to the candidate position and optimize the Sun if the fitness of the candidate position is greater than the fitness of the actual position.

[0025] Based on the above technical means, the embodiments of this application map multiple candidate parameter groups to the positions of multiple planets and the sun, transforming the hyperparameter optimization process into a spatial position iteration process, thereby improving computational efficiency. Furthermore, by dynamically adjusting the step size in conjunction with the chaotic perturbation factor, the process avoids getting trapped in local extrema in the early stages of iteration and improves convergence accuracy, thus providing hyperparameter assurance for the subsequent construction of a carpooling demand prediction model.

[0026] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the program to implement the method for predicting carpooling demand as described in the above embodiments.

[0027] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for predicting carpooling demand.

[0028] A fifth aspect of this application provides a computer program product, including a computer program that, when executed, implements the above-described method for predicting carpooling demand.

[0029] This application's embodiments construct a feature tensor set to provide a data foundation for coupling the long-term and short-term temporal dependencies and inter-regional spatial correlations of carpooling demand. Then, by transforming the target low-dimensional statistical features into target high-dimensional semantic features incorporating time-series contextual information, and mapping these high-dimensional semantic features to a target orthogonal subspace, the ability to capture temporal dependencies is enhanced, effectively coupling the long-term and short-term temporal dependencies and inter-regional spatial correlations of carpooling demand. Furthermore, through hyperparameter optimization, the model's generalization ability to unconventional scenarios such as sudden weather events and holidays is effectively improved, and the prediction accuracy of carpooling demand is significantly increased. Thus, this solves the problem that related technologies fail to couple the temporal dependencies and spatial correlations of passenger travel demand, and that the prediction models are sensitive to hyperparameters, making it difficult to adapt to unconventional scenarios and output accurate carpooling demand data.

[0030] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0031] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 A flowchart illustrating a method for predicting carpooling demand according to an embodiment of this application; Figure 2 This is a schematic diagram of a publicly available dataset of information about a certain city area provided according to an embodiment of this application; Figure 3 This is a schematic diagram of an order dataset incorporating weather data according to an embodiment of this application; Figure 4 This is a schematic diagram of the structure of a Transformer-based encoder and decoder according to an embodiment of this application; Figure 5 This is a schematic diagram of an architecture for generating high-dimensional semantic features of a target according to an embodiment of this application; Figure 6 This is a flowchart illustrating the principle of an improved Kepler optimization algorithm according to an embodiment of this application. Figure 7 A flowchart illustrating the principle of a method for predicting carpooling demand according to an embodiment of this application; Figure 8 This is a block diagram of a vehicle carpooling demand prediction device provided according to an embodiment of this application; Figure 9 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application.

[0032] Figure label: 80 - Vehicle carpooling demand prediction device; 100 - Construction module, 200 - Generation module, 300 - Prediction module; 901 - Memory, 902 - Processor, 903 - Communication interface. Detailed Implementation

[0033] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0034] The following description, with reference to the accompanying drawings, outlines a method, apparatus, electronic device, and storage medium for predicting carpooling demand according to embodiments of this application. Addressing the issues mentioned in the background art, such as the failure to couple the temporal and spatial dependencies of passenger travel demand, and the sensitivity of prediction models to hyperparameters, leading to difficulties in adapting to unconventional scenarios and outputting accurate carpooling demand data, this application provides a method for predicting carpooling demand. This method constructs a feature tensor set to provide a data foundation for coupling the long-term and short-term temporal dependencies and inter-regional spatial dependencies of carpooling demand. Then, by transforming the target low-dimensional statistical features into target high-dimensional semantic features incorporating time-series contextual information, and mapping these high-dimensional semantic features to a target orthogonal subspace, the ability to capture temporal dependencies is enhanced, effectively coupling the long-term and short-term temporal dependencies and inter-regional spatial dependencies of carpooling demand. Furthermore, through hyperparameter optimization, the model's generalization ability to unconventional scenarios such as sudden weather events and holidays is effectively improved, and the prediction accuracy of carpooling demand is significantly enhanced. This solves the problem that related technologies are not coupled with the temporal and spatial dependencies of passengers' travel needs, and that the prediction models are sensitive to hyperparameters, making it difficult to adapt to unconventional scenarios and output accurate carpooling demand.

[0035] Specifically, Figure 1 This is a flowchart of a method for predicting carpooling demand according to an embodiment of this application.

[0036] like Figure 1 As shown, the method for predicting carpooling demand includes the following steps: In step S101, based on the order history data, meteorological environmental parameters, and regional static feature data of at least one target vehicle, the target spatiotemporal grid where the target vehicle is located is determined, and the feature tensor set of the target spatiotemporal grid is constructed.

[0037] In the embodiments of this application, the order history data of the target vehicle can be understood as the order dataset generated by the ride-hailing platform during its operation in the target city and after being anonymized. It may include, but is not limited to, the geographical coordinates of the pick-up point, the geographical coordinates of the drop-off point, the trip time, the trip distance, and the carpooling identifier of the order. This application does not impose any specific limitations.

[0038] Meteorological environmental parameters can be understood as meteorological observation data that matches the operating hours and operating areas of the ride-hailing platform, and may include, but are not limited to, temperature, precipitation, precipitation probability, and wind force level. This application does not impose specific restrictions.

[0039] Regional static feature data can be understood as geospatial feature data of the target city, which may include, but is not limited to, the distribution of POI (Point of Interest) (such as the number and type of business districts, residential areas, schools, and hospitals), road network density, and functional area labels (such as core business districts, residential communities, and industrial parks). This application does not impose specific restrictions.

[0040] The feature tensor set can be understood as a multi-dimensional dataset formed by integrating, aligning, and structuring the target vehicle's order history data, meteorological environmental parameters, and regional static feature data.

[0041] In some cases, such as Figure 2 As shown, a dataset of publicly available information for a certain city area is presented, such as... Figure 3 As shown, the order dataset after incorporating weather data is displayed. In this embodiment of the application, a feature tensor set can be constructed by integrating, aligning and structuring a basic data source table containing historical order data, meteorological environmental parameters and regional static feature data.

[0042] The following details how the embodiments of this application construct feature tensor sets.

[0043] Specifically, in one embodiment of this application, determining the target spatiotemporal grid where the target vehicle is located and constructing a feature tensor set of the target spatiotemporal grid includes: obtaining the geospatial grid of the target city; constructing the target spatiotemporal grid using a sliding time window based on the geospatial grid and the order history data of at least one target vehicle; and calculating the median value of at least one of the travel time, travel distance, and travel cost of multiple orders within the target spatiotemporal grid, as well as the carpooling rate, to construct a feature tensor set.

[0044] In the embodiments of this application, the geospatial grid of the target city can be understood as dividing the geospatial space of the target city into multiple non-overlapping geospatial units with clear boundaries according to certain rules (such as equidistant latitude and longitude ranges), for example, a 1 km × 1 km square geospatial grid of the target city. This application does not impose any specific limitations.

[0045] The target spatiotemporal grid can be understood as a two-dimensional grid unit constructed by integrating the time dimension on the basis of the geospatial grid. It is used to anchor order history data to a specific geographical area and a specific time period. For example, a 1 km × 1 km square geospatial grid can be combined with a 15-minute sliding time window to form target spatiotemporal grids such as 1 km × 1 km square geospatial grid -18:00-18:15 and 1 km × 1 km square geospatial grid -18:15-18:30. This application does not impose specific limitations.

[0046] The median value can be understood as the middle value obtained by selecting travel indicators from travel time, travel distance, and travel cost among multiple orders within a single target spatiotemporal grid, and arranging all the values ​​of the travel indicator in ascending (or descending) order. For example, if the travel times of 5 orders within a target spatiotemporal grid are 10 min, 12 min, 15 min, 20 min, and 30 min, then 15 min is the median value of the travel time of multiple orders within that target spatiotemporal grid.

[0047] The carpooling rate can be understood as the proportion of carpooling orders to the total number of orders within a single target spatiotemporal grid, and can be presented as a percentage.

[0048] In actual implementation, the embodiments of this application can perform deduplication, outlier removal, and missing value imputation on the historical order data of the target vehicle to obtain valid order data. Then, based on the geospatial grid of the target city, the valid order data is divided into regions and discretized and encoded. A sliding time window is used to map the valid order data to the discrete geospatial grid to obtain the target spatiotemporal grid. Then, for each target spatiotemporal grid, the travel time, travel distance, and travel cost of multiple orders are calculated to calculate the median value of the travel time, travel distance, and travel cost, and the carpooling rate of multiple orders is calculated.

[0049] In addition, the embodiments of this application perform time alignment and spatial interpolation processing on meteorological environmental parameters to obtain spatiotemporal fusion meteorological features. These features are then combined with the median values ​​of travel time, travel distance and travel cost, carpooling rate and regional static features to construct a feature tensor set containing regional static attributes, meteorological dynamic attributes and order time sequence attributes.

[0050] This application embodiment constructs a target spatiotemporal grid using a sliding time window, which can transform historical order data without spatiotemporal affiliation into structured data divided by specific geographical regions and specific time periods. Then, by calculating the median values ​​of travel time, travel distance, and travel cost of multiple orders within the target spatiotemporal grid, interference from extreme value data is effectively avoided, and the carpooling rate of multiple orders is calculated to effectively capture carpooling demand characteristics.

[0051] In step S102, the target low-dimensional statistical features of the time series in the feature tensor set are transformed into target high-dimensional semantic features that incorporate time series context information, and the target high-dimensional semantic features are mapped to the target orthogonal subspace to generate a feature set that eliminates redundant time correlations.

[0052] In the embodiments of this application, the time series can be understood as an ordered set of features extracted from the feature tensor set that integrates regional static attributes, meteorological dynamic attributes and order time series attributes, consisting of multiple consecutive time step features, where each time step corresponds to feature data of a specific time period (such as the travel time, travel distance, median travel cost, carpooling rate, temperature, etc. of a certain 15-minute period), and this application does not impose specific limitations.

[0053] The target low-dimensional statistical features can be understood as the low-dimensional basic features obtained statistically for each time step of the time series. They do not incorporate the contextual information of the time series and have limited information expression capabilities. For example, the median travel time, median travel distance, and carpooling rate at a certain time step. This application does not impose specific restrictions.

[0054] The target high-dimensional semantic features can be understood as high-dimensional features that incorporate time series contextual information based on the target low-dimensional statistical features at each time step. This application does not impose any specific limitations.

[0055] The target orthogonal subspace can be understood as a new feature space with lower dimensions and mutual orthogonality among the feature dimensions, constructed by PCA (Principal Component Analysis) technology. It is the space that carries the target's high-dimensional semantic features after dimensionality reduction, and is used to retain most of the key variation information of the target's high-dimensional semantic features while compressing the feature dimensions.

[0056] The feature set can be understood as the standardized, low-dimensional feature set obtained by mapping the high-dimensional semantic features of the target to the orthogonal subspace of the target through PCA technology. It is used as input data for optimizing the hyperparameters of the ensemble learning gradient boosting tree model and building a carpooling demand prediction model.

[0057] It is understandable that, since machine learning models have difficulty directly understanding the time-related information in the feature tensor set, the embodiments of this application can transform the time-related information in the feature tensor set, i.e., the time series, from the original form that the model has difficulty understanding into a standardized form that the model can understand.

[0058] Specifically, in one embodiment of this application, before transforming the target low-dimensional statistical features of the time series in the feature tensor set into target high-dimensional semantic features incorporating time series context information, the method further includes: extracting the time series from the feature tensor set; and encoding the time series into a combined tensor of feature index encoding, segment position identifier, and attention mask.

[0059] In the embodiments of this application, feature index encoding can be understood as converting temporal feature elements into a sequence of integer numbers that the model can recognize.

[0060] Fragment location identifiers can be understood as integer identifier sequences used to identify different time periods. Their sequence length can be consistent with the sequence length of the feature index encoding. For example, when the input contains a sequence of data from last week and data from today, fragment location identifiers can be used to indicate that the data from last week and data from today belong to different time periods.

[0061] An attention mask can be understood as a binary sequence used to indicate the location of valid data containing actual semantics during the computation of the model's attention mechanism. Its sequence length can be the same as the sequence length of the feature index encoding.

[0062] In some cases, embodiments of this application can extract time series data from a feature tensor set and perform temporal discretization processing on the time series, thereby dividing the continuous time series into multiple independent temporal feature elements, where each temporal feature element corresponds to a time step. Additionally, embodiments of this application can use position encoding to represent the position of the temporal feature element in the time series.

[0063] Furthermore, for feature index encoding, the embodiments of this application can employ a predefined or trained word segmenter to semantically split each temporal feature element to obtain indivisible fine-grained semantic units, such as year, month, day, hour, minute, etc., and then assign a unique integer number to each semantic unit, thereby obtaining the feature index encoding according to the order of the semantic units in the temporal feature elements. This feature index encoding can directly adapt to the input requirements of the model.

[0064] In addition, regarding the segment location identifier, when processing a single time series (such as a time series during the morning rush hour), this application embodiment identifies all locations as a certain integer (such as 0). However, when processing a time series spliced ​​from multiple time periods (such as a time series merging the morning and evening rush hours), it can assign different integer identifiers to different time periods (such as identifying the morning rush hour as 0 and the evening rush hour as 1), thereby achieving a clear distinction between different time periods.

[0065] Furthermore, regarding the attention mask, this embodiment sets the mask value to 1 for the positions of valid data in the time series and sets the mask value to 0 for the blank positions in the time series filled due to the format requirements of batch processing. This ensures that the model ignores the filled parts and focuses on the valid data during calculation.

[0066] This application embodiment extracts time series data from feature tensors, focusing on the temporal information of carpooling demand. Then, by encoding the time series data into a combined tensor of feature index encoding, segment location identifier, and attention mask, it effectively transforms the original form, which is difficult for the model to understand, into a standardized form that the model can understand, thus providing a guarantee for subsequent feature extraction and processing.

[0067] Furthermore, in one embodiment of this application, the target low-dimensional statistical features of the time series in the feature tensor set are transformed into target high-dimensional semantic features incorporating time series context information, including: obtaining target low-dimensional statistical features of multiple time steps in the time series; projecting the target low-dimensional statistical features into query, key, and value vectors to determine the attention weights of the target low-dimensional statistical features between at least two time steps; and aggregating time series context information based on the attention weights to obtain target high-dimensional semantic features.

[0068] In some cases, to capture the long-range dependencies of carpooling demand over time, embodiments of this application construct a multi-layer time-series coding module. This multi-layer time-series coding module is a stacked encoder based on the Transformer architecture, which achieves global modeling of the time series through a self-attention mechanism.

[0069] This multi-layer temporal coding module may include, but is not limited to, a location embedding layer and multiple multi-head self-attention sub-layers: the location embedding layer adds location information to each time step in the time series to help the model perceive the temporal order; the data flows through multiple cascaded multi-head self-attention sub-layers; in each sub-layer, the model projects features into query, key, and value vectors, and calculates the attention weight between features of any two time steps based on the query, key, and value vectors; then, it dynamically aggregates the contextual information of the entire sequence based on the attention weights, thereby transforming the isolated low-dimensional statistical features of each time step into high-dimensional semantic features of the target that are integrated with the contextual information of the entire sequence.

[0070] This process achieves a nonlinear mapping from the original N-dimensional time feature vector (containing multiple components such as region, timestamp, travel statistics, and weather conditions) to a higher-dimensional M-dimensional (M>N) feature vector with higher information density and stronger expressive power, thus constructing a total time feature set containing rich time series patterns.

[0071] It should be noted that the embodiments of this application do not simply splice temporal features with spatial features, but rather achieve deep coupling of spatiotemporal characteristics through feature fusion and attention weight allocation.

[0072] Specifically, the target low-dimensional statistical features at multiple time steps not only include current time-series data (such as order volume and speed), but also embed regional static features (such as POI distribution and functional area type).

[0073] In addition, the embodiments of this application are based on the target low-dimensional statistical features and use a self-attention mechanism to calculate the relevance matrix of the query and key vector, so that the model is directly guided by the regional spatial features when calculating the attention weight (reflecting the long and short time sequence dependence).

[0074] Therefore, temporal dependency becomes temporal dependency with spatial awareness, thus achieving deep coupling of spatiotemporal characteristics.

[0075] As can be understood from the description of other embodiments, the embodiments of this application complete the projection and attention weight calculation of query, key, and value vectors based on the target low-dimensional statistical features of the fused regional static features. This not only captures the long and short temporal dependencies of order data, but more importantly, it uses the embedded regional static features as a spatial context to dynamically adjust the attention mode of temporal dependencies.

[0076] Compared to related technologies that separate or simply splice spatiotemporal features, the embodiments of this application enable the model to adaptively adjust the temporal prediction logic according to the spatial attributes of different areas (such as commercial areas and residential areas). This effectively solves the technical defect of related technologies that are unable to simultaneously capture long and short temporal dependencies and spatial correlations between regions, resulting in insufficient generalization ability. It significantly improves the accuracy of carpooling demand prediction in complex urban functional area scenarios.

[0077] It is understandable that, such as Figure 4 The diagram illustrates the structure of a Transformer-based encoder and decoder. The encoder consists of multiple stacked identical layers, each containing a multi-head self-attention sublayer and a feedforward neural network sublayer. Residual connections and layer normalization connections are used between these sublayers, enabling the model to capture global dependencies in time series in parallel. Positional encoding is added to the input embedding (corresponding to the positional embedding layer) to give the model time-series awareness. The decoder structure is similar to the encoder but adds a masked multi-head attention sublayer to ensure the causality of the predictions. The encoder output is correlated with the encoder output through the encoder-decoder attention sublayer. Finally, the features are output after linear transformation and normalization.

[0078] Based on the description of other embodiments, it can be understood that the encoder part in the encoder and decoder structure based on Transformer can be used as the technical carrier of the multi-layer temporal coding module. However, since the target high-dimensional semantic features are subsequently reduced in dimensionality and input into the carpooling demand prediction model for prediction, the decoder part can be used without relying on it.

[0079] For example, such as Figure 5 The diagram illustrates the architecture for generating high-dimensional semantic features of the target. Specifically, the temporal data input can be a timestamp sequence extracted from the feature tensor set (e.g., ["2023-01-15 08:30:00", ...]). This timestamp sequence is converted into a combined tensor containing feature index encoding, fragment position identifiers, and attention masks (dimension example: [batch size, sequence length]) through data encoding (segmenter). This combined tensor is input to a Transformer Encoder module consisting of 12 identical stacked layers. Each layer contains a multi-head self-attention sublayer with 12 attention heads and a feedforward neural network sublayer (the intermediate hidden layer has a dimension of 3072). The sublayers are connected through residual connections and layer normalization connections. Finally, the module outputs a high-dimensional semantic feature of the target containing temporal context information. The dimension of this high-dimensional semantic feature corresponds to the size of the hidden layer, which is 768 dimensions (output shape example: [batch size, sequence length, 768]). This high-dimensional semantic feature of the target will be input to the subsequent orthogonal transformation dimensionality reduction module.

[0080] Furthermore, to address the computational redundancy and overfitting risks brought by high-dimensional feature vectors, the embodiment of this application sets up an orthogonal feature transformation and dimensionality reduction module. This orthogonal feature transformation and dimensionality reduction module adopts PCA technology: first, calculate the covariance matrix of the total time feature set to analyze the correlation between dimensions, then perform eigenvalue decomposition on this covariance matrix to obtain a set of eigenvalues arranged in descending order of variance contribution and the corresponding principal components, and then select the top k most important principal components to construct a projection matrix according to a certain dimension k, so as to use this projection matrix to map the target high-dimensional feature vector to a target orthogonal subspace with a lower dimension.

[0081] The "dimensionality reduction" here specifically refers to the process of projecting data from an M-dimensional high-dimensional feature space to a k-dimensional low-dimensional space (k << M) that retains most of the key information through linear transformation. This process not only significantly reduces the computational complexity and storage requirements of the subsequent model, but also improves the robustness of the features and the generalization ability of the model by eliminating the redundant correlation between features.

[0082] In step S103, use the feature set to optimize the hyperparameters of the pre-constructed ensemble learning gradient boosting tree model until the iteration stop condition is met, and construct a carpooling demand prediction model to output the carpooling demand of any vehicle using the carpooling demand prediction model.

[0083] In the embodiment of this application, the ensemble learning gradient boosting tree model can be understood as a prediction model that integrates multiple weak decision trees. The performance of this ensemble learning gradient boosting tree model is affected by the maximum depth of the tree, the learning rate, the number of basic learners, and the L2 regularization parameter.

[0084] The iteration stop condition can be understood as the judgment criterion for terminating the optimization during the hyperparameter optimization process of the ensemble learning gradient boosting tree model, which is used to avoid resource waste caused by invalid iterations and ensure the effect of hyperparameter optimization. For example, reaching the maximum number of iterations or the target fitness threshold, which is not specifically limited in this application.

[0085] The carpooling demand prediction model can be understood as a model that is constructed based on the ensemble learning gradient boosting tree model and is used to output the carpooling demand after hyperparameter optimization.

[0086] In practical implementation, this application embodiment can employ an ensemble learning gradient boosting tree model to predict passenger carpooling demand within a region. Specifically, to select a suitable carpooling demand prediction model, this application embodiment constructs four models—random forest, XGBoost, LightGBM, and CatBoost—in parallel for comparative experiments. These models all belong to the gradient boosting decision tree framework or its variants. By integrating the prediction results of multiple decision trees (weak learners), the accuracy and robustness of the overall model are improved, making it particularly suitable for the structured feature data processing scenarios in this application embodiment that integrate multi-dimensional features such as time series, region, and meteorology.

[0087] Since the performance of the model is highly dependent on the hyperparameter configuration, in order to optimize the prediction accuracy and improve the model's generalization ability (avoiding overfitting or underfitting), this application adopts an improved Kepler optimization algorithm to adaptively optimize the maximum tree depth, learning rate, number of basic learners and L2 regularization parameter among the hyperparameters.

[0088] The maximum depth of the tree can control the complexity of the growth of a single decision tree. If the depth is too small, the model's learning ability is insufficient; if the depth is too large, the model is prone to remembering noise, leading to overfitting. In this embodiment, the maximum depth of the tree can be adjusted within the range of [1, 10] based on the balance between model complexity and data scale.

[0089] In gradient boosting models (XGBoost, LightGBM, CatBoost), the learning rate controls the step size of each new tree's contribution to the final model update. A smaller learning rate usually requires more trees to achieve good performance, but it allows the model to converge more smoothly and robustly. In this embodiment, the learning rate can be set to the range of [0.001, 0.2].

[0090] The number of basic learners is the total number of decision trees in the ensemble model. Insufficient numbers lead to underfitting, while excessive numbers increase computational overhead and may cause overfitting. In this embodiment, the number of basic learners can be adjusted within the range of [1, 3000].

[0091] This application embodiment constrains model complexity by adding an L2 norm penalty term to the weight vector in the loss function to prevent overfitting. The adjustment range of the L2 regularization parameter can be set to [0.01, 50].

[0092] The following details how embodiments of this application optimize the hyperparameters of a pre-built ensemble learning gradient boosting tree model.

[0093] Specifically, in one embodiment of this application, optimizing the hyperparameters of a pre-built ensemble learning gradient boosting tree model includes: mapping multiple candidate parameter sets of the ensemble learning gradient boosting tree model to the actual positions of multiple planets, and determining the target fitness planet as the Sun; calculating the Euclidean distance between the multiple planets and the Sun; calculating the gravitational strength of the Sun on the multiple planets based on the Euclidean distance and a nonlinear chaotic perturbation factor to generate candidate positions for the multiple planets; comparing the fitness of at least one planet's candidate position with its actual position; if the fitness of the candidate position is greater than the fitness of the actual position, then at least one planet moves to the candidate position, and the Sun is optimized.

[0094] In the embodiments of this application, a candidate parameter set can be understood as a set of multiple hyperparameters set by those skilled in the art according to the performance requirements of the ensemble learning gradient boosting tree model, and a candidate parameter set can be mapped to the actual position of a planet.

[0095] Fitness can be understood as a metric that quantifies the quality of candidate parameter sets. Fitness can be calculated based on the performance of the ensemble learning gradient boosting tree model in the carpooling demand prediction task, such as the reciprocal of RMSE (Root Mean Square Error). The higher the fitness value, the better the corresponding candidate parameter set, and the lower the fitness value, the worse the corresponding candidate parameter set.

[0096] The target fitness can be understood as the fitness with the largest value in the current iteration of optimization, and the candidate parameter set of the target fitness can be mapped to the actual position of the sun.

[0097] The nonlinear chaotic perturbation factor can be understood as a parameter that dynamically decays with the number of iterations. It is used to perturb the position update of planets in the calculation of gravitational intensity, which avoids getting trapped in local extrema in the early stage of iteration and improves the convergence accuracy in the later stage of iteration.

[0098] Candidate positions can be understood as new positions obtained by planets under the influence of gravitational strength, corresponding to a new set of hyperparameter candidates.

[0099] The actual position can be understood as the position of the planet in the current iteration of optimization. It corresponds to a set of hyperparameters. The actual position is the final position determined after the previous iteration and is also the benchmark for generating candidate positions in this iteration.

[0100] In some cases, such as Figure 6 As shown, the embodiments of this application can use an improved Kepler optimization algorithm to optimize the above hyperparameters.

[0101] Step S601: Map the planets and the sun.

[0102] In this embodiment, multiple candidate parameter groups are randomly generated within the range of hyperparameter values, and the multiple candidate parameter groups are mapped to the actual positions of multiple planets. Then, the RMSE of each candidate parameter group is calculated, and the reciprocal of the RMSE is used as the fitness (the larger the value, the better the parameter). Thus, the candidate parameter group with the largest fitness value is mapped to the Sun.

[0103] Step S602: Generate candidate locations for planets.

[0104] In this embodiment, the Euclidean distances between multiple planets and the Sun are calculated. Then, based on the Euclidean distances and the chaotic perturbation factor that dynamically decreases with the number of iterations (the step size is large in the early stage of iteration to avoid local extrema, and the step size is small in the later stage of iteration to improve convergence accuracy), the gravitational strength of the Sun on multiple planets is calculated. Based on the gravitational strength, an orbital equation combining randomness and determinism is used to obtain the candidate positions of multiple planets.

[0105] It should be noted that the sun's influence on the first... The planet in the 1st Gravitational strength at the next iteration The calculation formula can be, but is not limited to, the following: , in, For the first The orbital eccentricity of each planet, For the normalized mass of the Sun, For the first The normalized mass of each planet, For the first The Euclidean distances between the planets and the Sun To prevent extremely small constants with a denominator of zero, For random disturbance terms, It is a nonlinear chaotic perturbation factor.

[0106] Chaotic perturbation factor The calculation formula can be, but is not limited to, the following: , in, Let g be the initial gravitational constant. To control the constant of the decay rate, t This represents the current iteration number. This represents the maximum number of iterations.

[0107] Understandable, In the early stages of iteration, the gravity intensity fluctuates significantly, thus increasing the search step size helps the algorithm escape local optima (chaotic perturbations). In the later stages of iteration... By gradually decreasing the size of the gravitational force, the gravitational strength tends to stabilize, thereby reducing the search step size and improving the convergence accuracy.

[0108] Step S603: Compare the fitness of the candidate positions with the fitness of the actual positions.

[0109] In this embodiment, the fitness of the candidate position and the actual position of each planet are compared. When the fitness of the candidate position is greater than the fitness of the actual position, the planet moves to the candidate position. When the fitness of the candidate position is less than or equal to the fitness of the actual position, the planet maintains the actual position.

[0110] Step S604: Output the hyperparameter optimization solution.

[0111] In this embodiment, the fitness of all planets is recalculated and the sun is updated. Then, the process of generating candidate positions, comparing the fitness of the candidate positions with the fitness of the actual positions, moving planets, and updating the sun is repeated until the iteration stopping condition is met, that is, the maximum number of iterations or the target fitness threshold is reached, thereby outputting the candidate parameter set corresponding to the sun as the hyperparameter optimization solution.

[0112] This application's embodiments map multiple candidate parameter sets to the positions of multiple planets and the sun, transforming the hyperparameter optimization process into a spatial position iteration process, thereby improving computational efficiency. Furthermore, by dynamically adjusting the step size using a chaotic perturbation factor, it avoids getting trapped in local extrema in the early stages of iteration and improves convergence accuracy, providing hyperparameter assurance for the subsequent construction of a carpooling demand prediction model.

[0113] like Figure 7 As shown below, the principle of the vehicle carpooling demand prediction method proposed in this application will be illustrated with a specific embodiment.

[0114] Step S701: Construct the feature tensor set.

[0115] In this embodiment, the order history data, meteorological environmental parameters, and regional static feature data of the target vehicle can be obtained to determine the target spatiotemporal grid where the target vehicle is located, and to construct the feature tensor set of the target spatiotemporal grid.

[0116] Step S702: Encode the time series.

[0117] In this embodiment, time series can be extracted from the feature tensor set, and then the time series can be encoded into a combined tensor of feature index encoding, segment position identifier and attention mask.

[0118] Step S703: Construct the total time feature set.

[0119] In this embodiment, the target low-dimensional statistical features of multiple time steps in the time series can be obtained through a multi-layer time series coding module. Then, the target low-dimensional statistical features are projected into query, key, and value vectors. Attention weights between features of at least two time steps are determined based on the query, key, and value vectors. Then, time series context information is aggregated based on the attention weights to obtain target high-dimensional semantic features, thereby constructing a total time feature set containing rich time series patterns.

[0120] Step S704: Generate a feature set that eliminates redundant time correlations.

[0121] In this embodiment, the covariance matrix of the total time feature set can be calculated by the orthogonal feature transformation dimensionality reduction module. Then, the covariance matrix is ​​decomposed into eigenvalues ​​to obtain eigenvalues ​​and principal components arranged in descending order of variance contribution. Then, a projection matrix is ​​constructed based on the principal components and the preset dimension. Finally, the projection matrix is ​​used to map the target high-dimensional semantic features to the target orthogonal subspace, thereby generating a feature set that eliminates redundant time correlation.

[0122] Step S705: Optimize hyperparameters and output carpooling requirements.

[0123] In this embodiment, four models—random forest, XGBoost, LightGBM, and CatBoost—can be constructed in parallel for comparative experiments. An improved Kepler optimization algorithm is used to adaptively optimize the hyperparameters, such as the maximum tree depth, learning rate, number of basic learners, and L2 regularization parameter. After obtaining the hyperparameter optimization solution, a carpooling demand prediction model is constructed to output the carpooling demand for any vehicle.

[0124] The method for predicting carpooling demand proposed in this application constructs a feature tensor set to provide a data foundation for coupling the long-term and short-term temporal dependencies and inter-regional spatial correlations of carpooling demand. Then, by transforming the target low-dimensional statistical features into target high-dimensional semantic features incorporating time-series contextual information, and mapping these high-dimensional semantic features to a target orthogonal subspace, the ability to capture temporal dependencies is improved, effectively coupling the long-term and short-term temporal dependencies and inter-regional spatial correlations of carpooling demand. Furthermore, through hyperparameter optimization, the model's generalization ability to unconventional scenarios such as sudden weather events and holidays is effectively improved, and the prediction accuracy of carpooling demand is significantly enhanced. This solves the problem that related technologies fail to couple the temporal dependencies and spatial correlations of passenger travel demand, and that the prediction model is sensitive to hyperparameters, making it difficult to adapt to unconventional scenarios and output accurate carpooling demand data.

[0125] Next, with reference to the accompanying drawings, a vehicle carpooling demand prediction device according to an embodiment of this application is described.

[0126] Figure 8 This is a block diagram of a vehicle carpooling demand prediction device provided according to an embodiment of this application.

[0127] like Figure 8 As shown, the vehicle carpooling demand prediction device 80 includes: a construction module 100, a generation module 200, and a prediction module 300.

[0128] The construction module 100 is used to determine the target spatiotemporal grid where the target vehicle is located based on the order history data, meteorological environmental parameters, and regional static feature data of at least one target vehicle, and to construct the feature tensor set of the target spatiotemporal grid.

[0129] The generation module 200 is used to transform the target low-dimensional statistical features of the time series in the feature tensor set into target high-dimensional semantic features that incorporate time series context information, and to map the target high-dimensional semantic features to the target orthogonal subspace to generate a feature set that eliminates redundant time correlations.

[0130] The prediction module 300 is used to optimize the hyperparameters of a pre-built ensemble learning gradient boosting tree model using the feature set until the iteration stopping condition is met, and to build a carpooling demand prediction model to output the carpooling demand for any vehicle.

[0131] Optionally, in one embodiment of this application, the construction module 100 includes: an acquisition unit, a first construction unit, and a second construction unit.

[0132] The acquisition unit is used to acquire the geospatial grid of the target city.

[0133] The first building unit is used to construct a target spatiotemporal grid based on a geospatial grid and order history data of at least one target vehicle, using a sliding time window.

[0134] The second building unit is used to calculate the median value of at least one of the travel time, travel distance, and travel cost of multiple orders within the target spatiotemporal grid, as well as the carpooling rate, to construct a feature tensor set.

[0135] Optionally, in one embodiment of this application, it further includes an extraction module and an encoding module.

[0136] The extraction module is used to extract time series data from the feature tensor set.

[0137] The encoding module is used to encode time series data into a combined tensor of feature index encoding, segment location identifiers, and attention masks.

[0138] Optionally, in one embodiment of this application, the generation module 200 includes: an acquisition unit, a first determination unit, and a generation unit.

[0139] The acquisition unit is used to acquire the target low-dimensional statistical features of multiple time steps in the time series.

[0140] The first determining unit is used to project the target low-dimensional statistical features into a query, key, and value vector to determine the attention weights of the target low-dimensional statistical features between at least two time steps.

[0141] The generation unit is used to aggregate time series contextual information based on attention weights to obtain high-dimensional semantic features of the target.

[0142] Optionally, in one embodiment of this application, the prediction module 300 includes: a second determining unit, a first calculation unit, a second calculation unit, a comparison unit, and a third determining unit.

[0143] The second determining unit is used to map multiple candidate parameter sets of the ensemble learning gradient boosting tree model to the actual positions of multiple planets, and to determine the planet of the target fitness as the sun.

[0144] The first calculation unit is used to calculate the Euclidean distances between multiple planets and the Sun.

[0145] The second computational unit is used to calculate the gravitational strength of the Sun on multiple planets based on Euclidean distance and nonlinear chaotic perturbation factors, in order to generate candidate locations for multiple planets.

[0146] A comparison unit is used to compare the fitness of candidate positions of at least one planet with their actual positions.

[0147] The third determining unit is used to move at least one planet to the candidate position and optimize the sun if the fitness of the candidate position is greater than the fitness of the actual position.

[0148] It should be noted that the explanation of the aforementioned method embodiment for predicting carpooling demand also applies to the carpooling demand prediction device of this embodiment, and will not be repeated here.

[0149] The vehicle carpooling demand prediction device proposed in this application constructs a feature tensor set to provide a data foundation for coupling the long-term and short-term temporal dependencies and inter-regional spatial correlations of carpooling demand. Then, by transforming the target low-dimensional statistical features into target high-dimensional semantic features incorporating time-series contextual information, and mapping these high-dimensional semantic features to a target orthogonal subspace, the device enhances its ability to capture temporal dependencies and effectively couples the long-term and short-term temporal dependencies and inter-regional spatial correlations of carpooling demand. Furthermore, through hyperparameter optimization, the device effectively improves its generalization ability to unconventional scenarios such as sudden weather events and holidays, and significantly improves the prediction accuracy of carpooling demand. This solves the problems of related technologies that fail to couple the temporal dependencies and spatial correlations of passenger travel demand, and whose prediction models are sensitive to hyperparameters, making it difficult to adapt to unconventional scenarios and output accurate carpooling demand data.

[0150] Figure 9 This is a schematic diagram of the structure of an electronic device provided according to an embodiment of this application. The electronic device may include: The memory 901, the processor 902, and the computer program stored on the memory 901 and capable of running on the processor 902.

[0151] When processor 902 executes the program, it implements the method for predicting carpooling demand provided in the above embodiments.

[0152] Furthermore, electronic devices also include: Communication interface 903 is used for communication between memory 901 and processor 902.

[0153] The memory 901 is used to store computer programs that can run on the processor 902.

[0154] The memory 901 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0155] If the memory 901, processor 902, and communication interface 903 are implemented independently, then the communication interface 903, memory 901, and processor 902 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 9 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0156] Optionally, in a specific implementation, if the memory 901, processor 902, and communication interface 903 are integrated on a single chip, then the memory 901, processor 902, and communication interface 903 can communicate with each other through an internal interface.

[0157] The processor 902 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0158] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for predicting carpooling demand.

[0159] This application also provides a computer program product, including a computer program that, when executed, implements the above-described method for predicting carpooling demand.

[0160] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0161] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0162] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0163] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0164] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination of the above tensors. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented using a combination of any one or more of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combination tensor logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0165] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0166] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0167] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.

Claims

1. A method for predicting carpooling demand, characterized in that, Includes the following steps: Based on the order history data, meteorological environmental parameters, and regional static feature data of at least one target vehicle, the target spatiotemporal grid where the target vehicle is located is determined, and the feature tensor set of the target spatiotemporal grid is constructed. The target low-dimensional statistical features of the time series in the feature tensor set are transformed into target high-dimensional semantic features that incorporate time series context information, and the target high-dimensional semantic features are mapped to the target orthogonal subspace to generate a feature set that eliminates redundant time correlations. The hyperparameters of the pre-built ensemble learning gradient boosting tree model are optimized using the feature set until the iteration stopping condition is met, thereby constructing a carpooling demand prediction model to output the carpooling demand for any vehicle.

2. The method according to claim 1, characterized in that, The step of determining the target spatiotemporal grid where the target vehicle is located and constructing the feature tensor set of the target spatiotemporal grid includes: Obtain the geospatial grid of the target city; Based on the geospatial grid and the order history data of the at least one target vehicle, the target spatiotemporal grid is constructed using a sliding time window; Calculate the median value of at least one of the travel time, travel distance, and travel cost, and the carpooling rate for multiple orders within the target spatiotemporal grid, in order to construct the feature tensor set.

3. The method according to claim 1, characterized in that, Before transforming the target low-dimensional statistical features of the time series in the feature tensor set into target high-dimensional semantic features incorporating time series context information, the method further includes: Extract time series from the feature tensor set; The time series is encoded as a combined tensor of feature index encoding, segment location identifier, and attention mask.

4. The method according to claim 1, characterized in that, The process of transforming the target low-dimensional statistical features of the time series in the feature tensor set into target high-dimensional semantic features incorporating time series contextual information includes: Obtain the target low-dimensional statistical features at multiple time steps in the time series; The target low-dimensional statistical features are projected into a query, key, and value vector to determine the attention weights of the target low-dimensional statistical features between at least two time steps; The time-series context information is aggregated based on the attention weights to obtain the target high-dimensional semantic features.

5. The method according to claim 1, characterized in that, The optimized hyperparameters of the pre-built ensemble learning gradient boosting tree model include: The multiple candidate parameter sets of the ensemble learning gradient boosting tree model are mapped to the actual positions of multiple planets, and the planet for the target fitness is determined to be the Sun. Calculate the Euclidean distances between the plurality of planets and the Sun; The gravitational strength of the Sun on the plurality of planets is calculated based on the Euclidean distance and a nonlinear chaotic perturbation factor to generate candidate locations for the plurality of planets. Compare the fit of at least one candidate planetary location with the actual location; If the fitness of the candidate position is greater than the fitness of the actual position, then the at least one planet moves to the candidate position and optimizes the sun.

6. A device for predicting carpooling demand, characterized in that, include: A construction module is used to determine the target spatiotemporal grid where the target vehicle is located based on the order history data, meteorological environmental parameters, and regional static feature data of at least one target vehicle, and to construct the feature tensor set of the target spatiotemporal grid; The generation module is used to transform the target low-dimensional statistical features of the time series in the feature tensor set into target high-dimensional semantic features that incorporate time series context information, and to map the target high-dimensional semantic features to the target orthogonal subspace to generate a feature set that eliminates redundant time correlations. The prediction module is used to optimize the hyperparameters of the pre-built ensemble learning gradient boosting tree model using the feature set until the iteration stopping condition is met, and to build a carpooling demand prediction model to output the carpooling demand for any vehicle.

7. The apparatus according to claim 6, characterized in that, The building module includes: The acquisition unit is used to acquire the geospatial grid of the target city; The first construction unit is used to construct the target spatiotemporal grid based on the geospatial grid and the order history data of the at least one target vehicle using a sliding time window; The second construction unit is used to calculate the median value of at least one of the travel time, travel distance, and travel cost of multiple orders within the target spatiotemporal grid, as well as the carpooling rate, in order to construct the feature tensor set.

8. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, the processor executing the program to implement the method for predicting carpooling demand as described in any one of claims 1-5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the method for predicting carpooling demand as described in any one of claims 1-5.

10. A computer program product, comprising a computer program, characterized in that, The computer program is executed to implement the method for predicting carpooling demand as described in any one of claims 1-5.