Bus scheduling method based on contrastive learning and self-supervised time series clustering
By using comparative learning and self-supervised time series clustering, passenger flow characteristics are obtained, which solves the problem of low efficiency in bus scheduling in existing technologies and achieves more efficient and accurate bus scheduling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies are inefficient and have low information mining accuracy when processing large-scale population flow data, resulting in unsuitable bus scheduling.
A method based on contrastive learning and self-supervised time series clustering is adopted to obtain the intersecting subsequences of passenger flow time series, calculate the contrastive loss, reconstruction loss and clustering loss, optimize the network through backpropagation, obtain passenger flow characteristics and perform bus scheduling.
It improved the efficiency and accuracy of passenger flow characteristic information mining, and enhanced the suitability of bus scheduling.
Smart Images

Figure CN119378844B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent bus dispatching technology, and in particular to a bus dispatching method based on contrastive learning and self-supervised time series clustering. Background Technology
[0002] Smart public transport is an important direction for the development of urban public transport systems. By integrating advanced information technology, it enables intelligent scheduling and management of public transport vehicles, improves the utilization rate of public transport vehicles, and is of great significance for alleviating urban traffic congestion, improving the quality of public transport services, and enhancing the attractiveness of public transport.
[0003] Passenger flow on bus routes is a typical type of time-series data. In the construction of smart cities, intelligent bus dispatching is a key component. By predicting passenger flow trends, bus dispatching decisions can be assisted.
[0004] Time series clustering is an analytical method for time series data that aims to reveal the inherent structure of data changes over time by identifying similar behavioral patterns. This method is widely used in various fields, including but not limited to trend forecasting in financial markets, seasonal pattern recognition in climatology, gene expression analysis in biology, and fault detection in industrial monitoring. By clustering time series data, we can discover the regularities and periodic phenomena hidden behind the data, which is of great significance for understanding and predicting future development trends.
[0005] Deep learning models can automatically learn complex features from data, making them well-suited for handling highly nonlinear data. Among these, contrastive learning, a powerful self-supervised learning method, has proven effective in learning useful representations from unlabeled data. Through contrastive learning, models can learn to distinguish between similar and dissimilar samples, which is particularly useful for time series data as it can capture the implicit temporal dependencies within the data.
[0006] The invention patent with application number CN202011215298.X discloses a method for joint scheduling of urban public transportation resources. The method includes: constructing a demand flow map of people taking transportation over time based on the recorded data of people flow at different times and locations and the changes in the number of people carried by various means of transportation; then, taking the current station status and the predicted flow map as the current system status, and using reinforcement learning technology to coordinate and schedule the current multiple transportation systems in a coordinated and efficient manner.
[0007] However, the aforementioned existing technologies require data mining and analysis of the recorded passenger flow changes when constructing demand flow maps for transportation based on these changes. Traditional data mining methods suffer from low efficiency and low accuracy when processing large-scale passenger flow change data, and are also unsuitable for subsequent transportation scheduling.
[0008] In view of this, there is an urgent need for a bus scheduling method based on contrastive learning and self-supervised time series clustering to at least address the above-mentioned shortcomings. Summary of the Invention
[0009] One objective of this invention is to provide a bus scheduling method based on contrastive learning and self-supervised time series clustering. This method obtains intersecting subsequences of passenger flow from a passenger flow time series; calculates contrastive loss based on the latent representation of these intersecting subsequences; calculates reconstruction loss and clustering loss based on the latent representation of the original passenger flow time series; and optimizes the network through backpropagation using the combined contrastive loss, reconstruction loss, and clustering loss to obtain passenger flow characteristics corresponding to different time periods and perform bus scheduling. This improves the efficiency and accuracy of mining passenger flow characteristic information and enhances the suitability of subsequent bus scheduling.
[0010] The public transport scheduling method based on contrastive learning and self-supervised time series clustering provided in this invention includes:
[0011] Obtain passenger flow time series; the passenger flow time series includes: one-to-one corresponding historical time and number of passengers;
[0012] Randomly crop the passenger flow time series to obtain intersecting subsequences of passenger flow;
[0013] Input the passenger flow time series and the intersecting passenger flow subsequence into the encoder to obtain the latent representation of the original sequence and the latent representation of the subsequence;
[0014] Calculate the contrastive loss based on the latent representation of the subsequences;
[0015] Calculate the reconstruction loss based on the latent representation of the original sequence;
[0016] Cluster the latent representations of the original sequences and calculate the clustering loss;
[0017] The network is optimized by backpropagation using joint contrast loss, reconstruction loss, and clustering loss to obtain passenger flow clustering results; the passenger flow clustering results are: passenger flow characteristics corresponding to different time periods;
[0018] Bus scheduling is carried out based on passenger flow clustering results.
[0019] Preferably, the passenger flow time series is randomly pruned to obtain intersecting subsequences of passenger flow, including:
[0020] Randomly select the clipping length and starting position of the passenger flow time series;
[0021] Randomly select the start and end positions and offset of the extension;
[0022] After all selections are completed, a cropping index list is generated;
[0023] Based on the pruning index list, extract the passenger flow intersection subsequence from the passenger flow time series.
[0024] Preferably, the encoder performs the following operations:
[0025] Mask the latent vectors at randomly selected timestamps in the input sequence to obtain an enhanced contextual view;
[0026] Based on the context view, perform an independent FFT transformation on each channel of the time series to obtain the comprehensive frequency domain representation F;
[0027] Calculate the power spectrum in the synthesized frequency domain representation and determine the dominant frequency components;
[0028] Adaptive filtering of high-frequency components in the power spectrum to obtain F filtered ;
[0029] Based on global filter W G The first filtering feature is obtained by learning from the comprehensive frequency domain representation F;
[0030] Based on local filter W L From the adaptively filtered data F filtered Learn from the middle to obtain the second filter feature;
[0031] Integrate the first and second filter features to obtain frequency domain data;
[0032] The frequency domain data is converted back to the time domain using the inverse fast Fourier transform to obtain the renormalized time domain data;
[0033] The reshaped temporal data with enhanced representation is fed into the convolutional layer;
[0034] The output and input sequences of the convolutional layer are residually concatenated, and the number of output channels is adjusted by 1×1 convolution to output the latent representation of the input sequence. The convolutional layer consists of three layers of dilated one-dimensional convolution with an exponential dilation rate of 2, and each layer is followed by a ReLU activation function.
[0035] Preferably, the contrastive loss is calculated based on the latent representation of the subsequence, including:
[0036] The potential representations of the same timestamp in the subsequences from the same passenger flow time series are taken as the first positive pair, and the potential representations of different timestamps in the subsequences from the same passenger flow time series are taken as the first negative pair. The time contrast loss is calculated based on the first positive pair and the first negative pair.
[0037] The potential representations of subsequences from the same passenger flow time series at the same timestamp are taken as the second positive pair, and the potential representations of subsequences from different passenger flow time series at the same timestamp are taken as the second negative pair. The instance contrast loss is calculated based on the second positive pair and the second negative pair.
[0038] The comparison loss is determined based on the time comparison loss and the instance comparison loss.
[0039] Preferably, the reconstruction loss is calculated based on the latent representation of the original sequence, including:
[0040] The latent representation of the original sequence is processed through the GRU layer of the decoder to obtain the GRU output at each time step;
[0041] The GRU output is fed into the normalization layer to return the processed prediction sequence;
[0042] The reconstruction loss is calculated based on the passenger flow time series and the predicted series.
[0043] Preferably, clustering is performed based on the latent representation of the original sequence, and the clustering loss is calculated, including:
[0044] Fuzzy C-means clustering is performed on the target sequences after the encoder to obtain the cluster label and cluster center of each target sequence;
[0045] Based on the cluster labels and cluster centers, obtain the clustering loss based on the probability centroid.
[0046] Preferably, bus scheduling is performed based on passenger flow clustering results, including:
[0047] Based on the preset clustering result feature rules, passenger flow clustering features are obtained according to the passenger flow clustering results. The passenger flow clustering features include: date label, time period label, and passenger flow range.
[0048] Bus scheduling is carried out based on passenger flow clustering characteristics.
[0049] Preferably, bus scheduling is performed based on passenger flow clustering results, including:
[0050] Train a passenger flow prediction model based on passenger flow clustering characteristics;
[0051] Get the input time information;
[0052] Based on the input time information and passenger flow prediction model, the passenger flow of the first target is predicted;
[0053] Obtain the bus dispatch model;
[0054] Bus scheduling is carried out based on a bus dispatching model and the primary target passenger flow.
[0055] Preferably, the bus dispatching model is obtained, including:
[0056] Collect first-hand historical bus dispatch data; first-hand historical bus dispatch data includes: historical bus driving status information, historical passenger flow at target stations, and historical departure strategies;
[0057] Obtain passenger complaint information for the target station corresponding to the first historical bus dispatch data;
[0058] Analyze passenger complaint information to obtain the complaint type of the first passenger complaint item;
[0059] Based on the type of complaint, identify the second passenger complaint item for the target complaint type;
[0060] Based on the second passenger complaint item and the preset semantic analysis model, the level of dissatisfaction is obtained;
[0061] Obtain the historical complaint records of the target passenger corresponding to the second passenger complaint item;
[0062] Extract complaint behavior characteristics from historical complaint records;
[0063] Obtain a database to determine the degree of malicious complaints;
[0064] The database is determined based on the characteristics of complaint behavior and the degree of malicious complaints, and the degree of malicious complaints of the target passengers is obtained.
[0065] The level of malicious complaints corresponds to a downward adjustment in the level of dissatisfaction.
[0066] Based on the downward adjustment value and the level of dissatisfaction, the exclusion value is determined and then associated with the first historical bus dispatch data.
[0067] The removal score is obtained by summing the removal values associated with the first historical bus dispatch data.
[0068] Obtain second historical bus scheduling data with a rejection rate less than a preset rejection rate threshold;
[0069] Train a bus scheduling model based on the second historical bus scheduling data;
[0070] The database for determining the degree of malicious complaints includes:
[0071] Retrieve historical verification complaint records;
[0072] Analyze historical verification complaint records to determine the corresponding verification objects and values;
[0073] Based on the characteristic type of the object being verified, obtain the first verification strategy;
[0074] Obtain the actual second verification strategy for the verification object;
[0075] The verification standardization is determined based on the differences between the first and second verification strategies.
[0076] If the verification standardization degree is greater than or equal to the preset verification standardization degree threshold, the corresponding verification object and verification value will be used as the first item to be entered into the database.
[0077] If the verification standardization is less than the preset verification standardization threshold, obtain the verification experience of the verification subject;
[0078] If the verification experience is greater than or equal to the preset verification experience threshold, the verification object and verification value of the corresponding verification subject will be used as the second item to be entered into the database.
[0079] Integrate the first and second items to be added to the database to obtain a database for determining the degree of malicious complaints.
[0080] Preferably, bus scheduling is performed based on passenger flow clustering results, including:
[0081] Based on passenger flow clustering characteristics, a template for determining passenger flow is constructed;
[0082] Based on the input time information and passenger flow, determine the template and the second target passenger flow.
[0083] Based on the operational information corresponding to the input time information and the second target passenger flow, bus scheduling is carried out.
[0084] The beneficial effects of this invention are as follows:
[0085] This invention obtains intersecting subsequences of passenger flow from a time series of passenger flow; calculates contrast loss based on the latent representation of the subsequences of the intersecting subsequences; calculates reconstruction loss and clustering loss based on the latent representation of the original sequence of the time series of passenger flow; and optimizes the network by backpropagation using the combined contrast loss, reconstruction loss, and clustering loss to obtain passenger flow characteristics corresponding to different time periods and to perform bus scheduling, thereby improving the efficiency and accuracy of passenger flow characteristic information mining and enhancing the suitability of subsequent bus scheduling.
[0086] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in this application.
[0087] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0088] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0089] Figure 1 This is a schematic diagram of a bus scheduling method based on contrastive learning and self-supervised time series clustering in an embodiment of the present invention. Detailed Implementation
[0090] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0091] This invention provides a bus scheduling method based on contrastive learning and self-supervised time series clustering, such as... Figure 1 As shown, it includes:
[0092] Obtain passenger flow time series; the passenger flow time series includes: one-to-one corresponding historical time and number of passengers; wherein, the passenger flow time series is recorded in chronological order, and is determined by the historical passenger flow records of the target bus station for bus scheduling as needed. The historical passenger flow records are obtained by communicating with the network nodes of the target bus station.
[0093] The passenger flow time series is randomly pruned to obtain intersecting subsequences of passenger flow; wherein, the intersecting subsequences of passenger flow are: subsequences that are similar in features to the passenger flow time series obtained by random pruning;
[0094] The passenger flow time series and the intersecting subsequence of passenger flow are input into the encoder to obtain the latent representation of the original sequence and the latent representation of the subsequence. The latent representation of the original sequence is the internal feature representation obtained by the encoder after processing the passenger flow time series. The latent representation of the subsequence is the internal feature representation obtained by the encoder after processing the intersecting subsequence of passenger flow.
[0095] Based on the subsequence latent representations, the contrast loss is calculated; wherein, the contrast loss includes: temporal contrast loss and instance contrast loss; the temporal contrast loss is: the contrast loss between the subsequence latent representations of the same timestamp from the same passenger flow time series and the subsequence latent representations of different timestamps from the same passenger flow time series; the instance contrast loss is: the contrast loss between the subsequence latent representations of different passenger flow time series at the same timestamp;
[0096] The reconstruction loss is calculated based on the latent representation of the original sequence; where the reconstruction loss is the mean square error between the predicted sequence reconstructed from the latent representation of the original sequence and the passenger flow time series.
[0097] Cluster the latent representation of the original sequence and calculate the clustering loss; wherein, the clustering loss includes: the probabilistic centroid clustering loss based on the latent representation of the original sequence;
[0098] The network is optimized by backpropagation using joint contrast loss, reconstruction loss, and clustering loss to obtain passenger flow clustering results; the passenger flow clustering results are: passenger flow characteristics corresponding to different time periods;
[0099] Bus scheduling is carried out based on passenger flow clustering results.
[0100] The working principle and beneficial effects of the above technical solution are as follows:
[0101] This invention obtains intersecting subsequences of passenger flow from a time series of passenger flow; calculates contrast loss based on the latent representation of the subsequences of the intersecting passenger flow; calculates reconstruction loss and clustering loss based on the latent representation of the original sequence of the time series of passenger flow; and optimizes the clustering network by backpropagation using the combined contrast loss, reconstruction loss, and clustering loss to obtain passenger flow characteristics corresponding to different time periods and to perform bus scheduling, thereby improving the efficiency and accuracy of passenger flow characteristic information mining and enhancing the suitability of subsequent bus scheduling.
[0102] In one embodiment, randomly pruning the passenger flow time series to obtain intersecting passenger flow subsequences includes:
[0103] Randomly select the clipping length and starting position of the passenger flow time series;
[0104] Randomly select the start and end positions and offset of the extension;
[0105] After all selections are completed, a cropping index list is generated;
[0106] Based on the pruning index list, extract the passenger flow intersection subsequence from the passenger flow time series.
[0107] The working principle and beneficial effects of the above technical solution are as follows:
[0108] This invention randomly selects the length and starting position of a subsequence, generating two pruning index lists for each sample to extract two different segments. These pruning indexes are used to extract segments from the original data and then fed into an encoder for encoding. This facilitates subsequent analysis of passenger flow changes from different perspectives, contributing to a more comprehensive understanding of passenger flow patterns and trends.
[0109] In one embodiment, the encoder performs the following operation:
[0110] Mask the latent vectors at randomly selected timestamps in the input sequence to obtain an enhanced contextual view;
[0111] Based on the context view, perform an independent FFT transformation on each channel of the time series to obtain the comprehensive frequency domain representation F;
[0112] Calculate the power spectrum in the synthesized frequency domain representation and determine the dominant frequency components;
[0113] Adaptive filtering of high-frequency components in the power spectrum to obtain F filtered ;
[0114] Based on global filter W G The first filtering feature is obtained by learning from the original frequency domain data F;
[0115] Based on local filter W L From the adaptively filtered data F filtered Learn from the middle to obtain the second filter feature;
[0116] Integrate the first and second filter features to obtain frequency domain data;
[0117] The frequency domain data is converted back to the time domain using the inverse fast Fourier transform to obtain the renormalized time domain data;
[0118] The reshaped temporal data with enhanced representation is fed into the convolutional layer;
[0119] The output and input sequences of the convolutional layer are residually concatenated, and the number of output channels is adjusted by 1×1 convolution to output the latent representation of the input sequence. The convolutional layer consists of three layers of dilated one-dimensional convolution with an exponential dilation rate of 2, and each layer is followed by a ReLU activation function.
[0120] The working principle and beneficial effects of the above technical solution are as follows:
[0121] Latent vectors are masked at randomly selected timestamps to generate an enhanced contextual view. Then, an independent FFT transformation is performed on each channel of the time series to obtain a comprehensive frequency domain representation F, which encapsulates the spectral features of the original time series across all channels. Its expression is:
[0122]
[0123] in, This represents a 1D FFT operation, where S is the input time series, L′ is the length of the transformed sequence in the frequency domain, and C is the number of channels.
[0124] Calculate the power spectrum of F, P = |F| 2To identify the dominant frequency components, and then adaptively filter out high-frequency components in the power spectrum P, the expression is:
[0125] F filtered =F⊙(P>θ)
[0126] Where θ is a trainable threshold that is adjusted according to the spectral characteristics of the data, ⊙ represents element-wise multiplication, and P>θ is a binary mask in which frequencies with power higher than the threshold θ are retained and other frequencies are filtered out.
[0127] After adaptive filtering, two sets of learnable filters are used: a global filter W. G A local filter W is learned from the original frequency domain data F. L From the adaptively filtered data F filtered Learning in Chinese, the specific expression is:
[0128] F G =W G ⊙F
[0129] F L =W L ⊙F filtered
[0130] Then the filtering feature F integrated Integrate:
[0131] F integrated =F G +F L
[0132] The frequency domain data is converted back to the time domain using the inverse fast Fourier transform, expressed as:
[0133]
[0134] After the enhanced representation is passed into the convolutional layer, it is first processed by multiple layers of dilated one-dimensional convolution to expand the receptive field. The dilation rate increases exponentially by 2. Then it is activated by the ReLU activation function and residually connected with the original sequence. Finally, the number of output channels is adjusted by 1×1 convolution to output the result.
[0135] This invention combines the Fourier transform method and helps to capture periodic and trend patterns in time series, thereby improving the quality of feature representation.
[0136] In one embodiment, calculating the contrastive loss based on the latent representation of the subsequence includes:
[0137] The potential representations of the same timestamp in the subsequences from the same passenger flow time series are taken as the first positive pair, and the potential representations of different timestamps in the subsequences from the same passenger flow time series are taken as the first negative pair. The time contrast loss is calculated based on the first positive pair and the first negative pair.
[0138] The potential representations of subsequences from the same passenger flow time series at the same timestamp are taken as the second positive pair, and the potential representations of subsequences from different passenger flow time series at the same timestamp are taken as the second negative pair. The instance contrast loss is calculated based on the second positive pair and the second negative pair.
[0139] The comparison loss is determined based on the time comparison loss and the instance comparison loss.
[0140] The working principle and beneficial effects of the above technical solution are as follows:
[0141] Representations of the same timestamp from two views of the input time series are considered the first positive pair, while representations of different timestamps from the same time series are considered the first negative pair. Let i be the index of the input time series sample, and t be the timestamp. The latent representation r of two intersecting subsequences of the original sequence... i,t and r i ′ ,t The representation of the time-comparison loss at the same timestamp t is as follows:
[0142]
[0143] Where Ω is the set of timestamps of the overlapping portion of the two subsequences, and τ is an indicator variable, with a value of 1 when the event occurs and 0 otherwise. Representations of the same timestamps from two views of the input time series are taken as the second positive pair, while representations of the same timestamps from different time series are taken as the second negative pair. The expression for the instance contrastive loss is:
[0144]
[0145] Where B represents the batch size, r j,t and r j ′ ,t These represent the representations of other instances at the same time point, respectively. This considers both the comparison between positive samples and other samples, as well as the comparison between negative samples and other samples, thereby improving the stability and effectiveness of training. The total contrastive loss can then be obtained as:
[0146]
[0147] Where N is the batch size and T is the total number of timestamps.
[0148] This invention uses a contrastive learning method, which enables the model to learn more discriminative feature representations in unsupervised or weakly supervised environments. It can automatically learn features that distinguish different samples, thereby improving the robustness and generalization ability of the features.
[0149] In one embodiment, the reconstruction loss is calculated based on the latent representation of the original sequence, including:
[0150] The latent representation of the original sequence is processed through the GRU layer of the decoder to obtain the GRU output at each time step;
[0151] The GRU output is fed into the normalization layer to return the processed prediction sequence;
[0152] The reconstruction loss is calculated based on the passenger flow time series and the predicted series.
[0153] The working principle and beneficial effects of the above technical solution are as follows:
[0154] The unpruned sequence is input into the encoder to obtain the latent representation Z, which is then fed into the decoder. First, it is processed by the GRU layer to obtain the output of each time step. Then, the output of the GRU is fed into the normalization layer, and finally the processed prediction sequence is returned.
[0155] The formula for calculating the reconstruction loss is:
[0156]
[0157] Where, x i and x i These are the original sequence and the predicted sequence, respectively.
[0158] This invention introduces a GRU layer to calculate the reconstruction loss, which is more reasonable.
[0159] In one embodiment, clustering is performed based on the latent representation of the original sequence, and the clustering loss is calculated, including:
[0160] Fuzzy C-means clustering is performed on the target sequences after the encoder to obtain the cluster label and cluster center of each target sequence;
[0161] Based on the cluster labels and cluster centers, obtain the clustering loss based on the probability centroid.
[0162] The working principle and beneficial effects of the above technical solution are as follows:
[0163] Cluster the sequences processed by the encoder to obtain the cluster label and cluster center for each sequence;
[0164] The clustering loss based on probability centroids is calculated to measure the distance between the encoded representation of a sample and its corresponding cluster center. The expression for the distance metric is as follows:
[0165]
[0166] Among them, z i c is the encoded representation of the sample. j The cluster center is defined by the non-negative number w, which represents the non-linear part. ∈ represents the curvature of the non-linear region. C = ww·ln(1+w / ∈) is used to smoothly connect the linear and non-linear parts defined by the segmentation. The clustering loss is obtained by weighting all distances using a probability distribution.
[0167] This invention enables the model to share information across multiple tasks by jointly optimizing multiple loss functions, which helps the model better understand the data and improve the accuracy of clustering and overall performance.
[0168] In one embodiment, bus scheduling based on passenger flow clustering results includes:
[0169] Based on predefined clustering result feature rules, passenger flow clustering features are obtained according to the passenger flow clustering results. These features include date labels, time period labels, and passenger flow range. The clustering result feature rules are predefined rules for transforming passenger flow clustering results into passenger flow clustering features, specifying which data attributes are selected as the basis for clustering, and how these attributes are quantified. For example, the station flow at 8:30 AM on January 20th is 20 people, the date label is January 20th, the time period label is morning peak hour, and the passenger flow range is 20 people.
[0170] Bus scheduling is based on passenger flow clustering characteristics. This means developing and applying appropriate bus scheduling strategies based on passenger flow clustering characteristics. For example, determining the appropriate departure intervals and the number of buses per departure during the morning rush hour based on passenger flow ranges during winter.
[0171] The working principle and beneficial effects of the above technical solution are as follows:
[0172] Passenger flow at bus stops varies with different time rhythms. For example, passenger flow is significantly higher during the morning and evening peak hours than at other times, and passenger flow is lower in summer and winter than in spring and autumn. Therefore, setting a fixed bus dispatching plan cannot reasonably allocate public resources. Thus, passenger flow clustering results are characterized to obtain passenger flow clustering features. Bus dispatching is then adaptively carried out based on passenger flow clustering features, which improves the rationality of bus dispatching.
[0173] In one embodiment, bus scheduling based on passenger flow clustering results includes:
[0174] Based on passenger flow clustering characteristics, a passenger flow prediction model is trained; the passenger flow prediction model is an AI model that predicts passenger flow based on the input time.
[0175] Obtain input time information; where the input time information is: the time when the user inputs the passenger flow prediction model and wants to view the passenger flow;
[0176] Based on the input time information and the passenger flow prediction model, the first target passenger flow is predicted; wherein, the first target passenger flow is: the passenger flow corresponding to the input time predicted by the passenger flow prediction model;
[0177] Obtain the bus dispatch model; where the bus dispatch model is: an AI model for optimizing bus operation, which takes into account multiple factors such as passenger flow, vehicle resources and route arrangement to determine how to efficiently dispatch buses;
[0178] Bus scheduling is carried out based on a bus dispatching model and the primary target passenger flow.
[0179] The working principle and beneficial effects of the above technical solution are as follows:
[0180] This invention trains a passenger flow prediction model using passenger flow clustering features and simultaneously acquires input time information. Based on the input time information and the passenger flow prediction model, it predicts a first target passenger flow. It introduces a bus scheduling model that considers multiple factors such as passenger flow, vehicle resources, and route arrangements to determine how to efficiently schedule buses. Based on the bus scheduling model and the first target passenger flow, it performs bus scheduling, further improving the suitability of bus scheduling.
[0181] In one embodiment, obtaining the bus dispatching model includes:
[0182] Collect first-historical bus dispatch data; first-historical bus dispatch data includes: historical driving status information of buses, historical passenger flow of target stations, and historical departure strategies; among which, historical driving status information is: the driving status of buses that can be dispatched in the first-historical bus dispatch data, such as: currently driving, or: stopped for maintenance; historical passenger flow of target stations is: passenger flow data of each bus station; historical departure strategies are: departure interval and number of buses;
[0183] Obtain passenger complaint information for the target station corresponding to the first historical bus dispatch data; among which, passenger complaint information includes: complaint information within the dispatch time corresponding to the first historical bus dispatch data, such as: "The waiting time is too long", or "The driver's attitude is bad".
[0184] Analyze passenger complaint information to obtain the complaint type of the first passenger complaint item; the complaint type is: complaint category, such as: hygiene, service attitude, and waiting time;
[0185] Based on the complaint type, determine the second passenger complaint item of the target complaint type; where the target complaint type is: waiting time.
[0186] Based on the second passenger complaint item and the preset semantic analysis model, the level of dissatisfaction is obtained; wherein, the preset semantic analysis model is a model for parsing and understanding language, used to analyze the content of passenger complaint text and determine the passenger's level of dissatisfaction (degree of dissatisfaction);
[0187] Obtain the historical complaint records of the target passenger corresponding to the second passenger complaint item; wherein, the historical complaint records are: the complaint records recorded when the target passenger made a complaint in the past;
[0188] Extract complaint behavior characteristics from historical complaint records; where complaint behavior characteristics are: characteristic representations of complaint behavior, such as: complaint frequency and complaint appeal status, etc.
[0189] Obtain a database to determine the degree of malicious complaints;
[0190] Based on the characteristics of complaint behavior and the malicious complaint degree determination database, the malicious complaint degree of the target passenger is obtained; wherein, the malicious complaint degree determination database includes multiple one-to-one corresponding pre-selected complaint behavior characteristics and pre-selected malicious complaint degrees, and the malicious complaint degree indicates the degree of malice of the complainant in making a malicious complaint;
[0191] The level of malicious complaints corresponds to a reduction in the level of dissatisfaction; the higher the level of malicious complaints, the higher the reduction value.
[0192] Based on the downward adjustment value and the level of dissatisfaction, a rejection value is determined and then associated with the first historical bus dispatch data; the rejection value is the product of the downward adjustment value and the level of dissatisfaction.
[0193] The removal score is obtained by summing the removal values associated with the first historical bus dispatch data.
[0194] Acquire second historical bus dispatch data with a rejection rate less than a preset rejection rate threshold; wherein, the preset rejection rate threshold is manually set in advance;
[0195] Train a bus scheduling model based on the second historical bus scheduling data;
[0196] The database for determining the degree of malicious complaints includes:
[0197] Retrieve historical verification complaint records; these records include: records of how bus station staff handled passenger complaints.
[0198] Analyze historical complaint records to determine the corresponding verification objects and values; the verification objects are: historical complaint behavior characteristics; the verification values are: the degree of malice of the complainant corresponding to the historical complaint behavior characteristics as judged by bus station staff.
[0199] Based on the feature type of the verification object, obtain the first verification strategy; where the feature type is: type of behavioral feature; the first verification strategy is: the verification method corresponding to the feature type. For example, if the feature type is: complaint frequency, then the first verification strategy is: check whether the content of the complaints corresponding to the complaint frequency is true.
[0200] Obtain the actual second verification strategy for the verification object; the actual second verification strategy is: the verification strategy actually adopted by the bus station staff for the verification object, such as: without checking the content of the complaints corresponding to the complaint frequency, directly judging the maliciousness of historical complaints with high complaint frequency based on the complaint frequency.
[0201] The verification standardization is determined based on the difference between the first verification strategy and the second verification strategy; the smaller the difference between the strategies, the higher the corresponding verification standardization.
[0202] If the verification standardization degree is greater than or equal to the preset verification standardization degree threshold, the corresponding verification object and verification value will be used as the first item to be entered into the database; the preset verification standardization degree threshold is set manually in advance.
[0203] If the verification standardization is less than the preset verification standardization threshold, the verification experience of the verification subject is obtained; where verification experience refers to the number of years of work experience of the complaint handling personnel in handling complaints.
[0204] If the verification experience is greater than or equal to the preset verification experience threshold, the verification object and verification value of the corresponding verification subject will be used as the second item to be entered into the database; wherein, the preset verification experience threshold is set manually in advance;
[0205] Summarize the first and second items to be added to the database to obtain a database for determining the degree of malicious complaints.
[0206] The working principle and beneficial effects of the above technical solution are as follows:
[0207] This invention collects first historical bus dispatch data and obtains passenger complaint information corresponding to the first historical bus dispatch data; it parses the passenger complaint information to obtain the complaint type of the first passenger complaint item and determines the second passenger complaint item whose complaint type is waiting time; it introduces a semantic analysis model and obtains the target passenger's dissatisfaction level based on the second passenger complaint item. Considering the possibility of malicious complaints, it introduces the target passenger's historical complaint records, extracts the complaint behavior features of the historical complaint records, and simultaneously obtains a malicious complaint degree determination library. The complaint behavior features are matched with pre-selected complaint behavior features in the malicious complaint degree determination library to determine the malicious complaint degree.
[0208] When acquiring the malicious complaint determination database, historical verification complaint records are introduced. Based on the characteristic type of the verification object, a first verification strategy is obtained, and simultaneously, a second verification strategy actually adopted by the verification subject is acquired. The differences between the first and second verification strategies are compared to determine the verification standardization degree. The smaller the difference between the actual verification strategy and the standard verification strategy, the higher the corresponding verification standardization degree. Verification objects and verification values with a verification standardization degree greater than or equal to the verification standardization degree threshold are selected as the first items to be added to the database. When the verification standardization degree is less than the verification standardization degree threshold, the verification experience of the verification subject is introduced. When the verification experience is greater than the verification experience threshold, it indicates that the verification subject has the ability to subjectively determine the verification object, and the verification object and verification value verified by the corresponding verification subject are selected as the second items to be added to the database. The first and second items to be added to the database are integrated to obtain the malicious complaint determination database, which improves the rationality of the construction of the malicious complaint determination database.
[0209] Based on the principle that malicious complaints correspond to a decrease in dissatisfaction level, the dissatisfaction level is reduced to obtain a rejection value. These rejection values are then summed to obtain the rejection rate of the first historical bus scheduling data. Second historical bus scheduling data with rejection rates less than the rejection rate threshold are then used for model training to obtain the bus scheduling model. This more suitable training data further improves the scheduling accuracy of the bus scheduling model.
[0210] In one embodiment, bus scheduling based on passenger flow clustering results includes:
[0211] Based on passenger flow clustering characteristics, a passenger flow determination template is constructed; wherein, the passenger flow determination template is: a template for determining passenger flow within a specific time period based on passenger flow clustering characteristics;
[0212] Based on the input time information and passenger flow, a template is determined to identify the second target passenger flow; wherein, the second target passenger flow is the passenger flow corresponding to the input time, as determined by the template based on the input time information and passenger flow.
[0213] Bus dispatching is performed based on the operational information corresponding to the input time and the second target passenger flow. The current operational information includes the bus operating status at the input time. When dispatching buses based on the current operational information and the second target passenger flow, the second target passenger flow is displayed to the dispatcher, who then adjusts the dispatching strategy accordingly.
[0214] The working principle and beneficial effects of the above technical solution are as follows:
[0215] This invention constructs a passenger flow determination template based on passenger flow clustering features, and determines the second target passenger flow based on the input time information and the passenger flow determination template; dispatchers determine and apply dispatching strategies based on operational information and the second target passenger flow, making dispatching more flexible.
[0216] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A bus scheduling method based on contrastive learning and self-supervised time series clustering, characterized in that, The application comprises the following steps: obtaining a passenger flow time sequence; the passenger flow time sequence comprises a one-to-one correspondence between historical time and passenger flow; randomly cutting the passenger flow time sequence to obtain a passenger flow intersection subsequence; inputting the passenger flow time sequence and the passenger flow intersection subsequence into an encoder to obtain an original sequence latent representation and a subsequence latent representation; calculating a contrast loss according to the subsequence latent representation; calculating a reconstruction loss according to the original sequence latent representation; clustering the original sequence latent representation to calculate a clustering loss; jointly back-propagating the contrast loss, the reconstruction loss and the clustering loss to optimize the network to obtain a passenger flow clustering result; the passenger flow clustering result is passenger flow characteristics corresponding to different time periods; performing bus scheduling according to the passenger flow clustering result; wherein the encoder performs the following operations: masking the latent vector at a randomly selected timestamp of the input sequence to obtain an enhanced context view; According to the context view, each channel of the time series is independently transformed to obtain a comprehensive frequency domain representation ; calculating the power spectrum of the comprehensive frequency domain representation and determining the dominant frequency component; adaptively filtering high frequency components in the power spectrum to obtain ; Global filter based From a global filter Learning from a global filter Based on local filter From the adaptive filtered data Learning, get the second filter features; integrating the first filter feature and the second filter feature to obtain frequency domain data; converting the frequency domain data back to the time domain based on the inverse fast Fourier transform to obtain reorganized time domain data; inputting the reorganized time domain data of the enhanced representation into a convolutional layer; The output of the convolutional layer is connected in residual with the input sequence, and the output channel number is adjusted by the convolution of The convolutional layer is composed of three layers of dilated one-dimensional convolution, with exponential increase of dilated rate 2, and each layer is supplemented with ReLU activation function. wherein the contrast loss is calculated according to the subsequence latent representation, comprising: taking the latent representation of the same timestamp in the subsequence from the same passenger flow time sequence as the first positive pair, taking the latent representation of different timestamps in the subsequence from the same passenger flow time sequence as the first negative pair, and calculating the time contrast loss according to the first positive pair and the first negative pair; taking the latent representation of the same timestamp in the subsequence from the same passenger flow time sequence as the second positive pair, taking the latent representation of the same timestamp in the subsequence from different passenger flow time sequences as the second negative pair, and calculating the instance contrast loss according to the second positive pair and the second negative pair; determining the contrast loss according to the time contrast loss and the instance contrast loss; wherein the reconstruction loss is calculated according to the original sequence latent representation, comprising: processing the original sequence latent representation through the GRU layer of the decoder to obtain the GRU output of each time step; inputting the GRU output into the normalization layer to return the processed prediction sequence; calculating the reconstruction loss according to the passenger flow time sequence and the prediction sequence; wherein the clustering loss is calculated according to the original sequence latent representation, comprising: performing Fuzzy C-means clustering on the target sequence that has passed through the encoder to obtain the clustering label and the clustering center of each target sequence; obtaining the clustering loss based on the probabilistic centroid according to the clustering label and the clustering center.
2. The bus scheduling method based on contrastive learning and self-supervised time series clustering of claim 1, wherein, Randomly cutting the passenger flow time sequence to obtain the passenger flow intersection subsequence, comprising: randomly selecting the cutting length and the starting position of the passenger flow time sequence; randomly selecting the extension start and end positions and the offset; after the selection is completed, generating a cutting index list; extracting the passenger flow intersection subsequence from the passenger flow time sequence according to the cutting index list.
3. The bus scheduling method based on contrastive learning and self-supervised time series clustering of claim 1, wherein, Performing bus scheduling according to the passenger flow clustering result, comprising: According to the passenger flow clustering result, passenger flow clustering features are obtained based on preset clustering result featureization rules, and the passenger flow clustering features include a date label, a time period label, and a passenger flow range. According to the passenger flow clustering features, bus scheduling is performed.
4. The bus scheduling method based on contrastive learning and self-supervised time series clustering of claim 3, wherein, According to the passenger flow clustering result, bus scheduling is performed, including: According to the passenger flow clustering features, a passenger flow estimation model is trained; Obtain input time information; According to the input time information and the passenger flow estimation model, estimate the first target passenger flow; Obtain a bus scheduling model; According to the first target passenger flow, perform bus scheduling based on the bus scheduling model.
5. The bus scheduling method based on contrastive learning and self-supervised time series clustering of claim 4, wherein, Obtaining a bus scheduling model includes: Collecting first historical bus scheduling data; the first historical bus scheduling data includes historical driving state information of a bus, historical passenger flow of a target station, and historical departure strategy; Obtain passenger complaint information of the target station corresponding to the first historical bus scheduling data; Analyze the passenger complaint information to obtain the complaint type of the first passenger complaint item; According to the complaint type, determine the second passenger complaint item of the target complaint type; According to the second passenger complaint item and the preset semantic analysis model, obtain the dissatisfaction degree; Obtain the historical complaint record of the target passenger corresponding to the second passenger complaint item; Extract the complaint behavior features of the historical complaint record; Obtain a malicious complaint degree determination library; According to the complaint behavior features and the malicious complaint degree determination library, obtain the malicious complaint degree of the target passenger; Obtain the downshift value corresponding to the dissatisfaction degree of the malicious complaint degree; According to the downshift value and the dissatisfaction degree, determine the elimination value, and associate the elimination value with the first historical bus scheduling data corresponding to the elimination value; Cumulative elimination value of the first historical bus scheduling data associated with the elimination value, obtain the elimination degree; Obtain the second historical bus scheduling data whose elimination degree is less than the preset elimination degree threshold; Train the bus scheduling model based on the second historical bus scheduling data.
6. The bus scheduling method based on contrastive learning and self-supervised time series clustering of claim 3, wherein, According to the passenger flow clustering result, bus scheduling is performed, including: According to the passenger flow clustering features, construct a passenger flow determination template; According to the input time information and the passenger flow determination template, determine the second target passenger flow; According to the operation information corresponding to the input time information and the second target passenger flow, perform bus scheduling.
Citation Information
Patent Citations
A joint dispatching method based on urban public transportation resources
CN112417753B
Time sequence equipment fault diagnosis method based on comparison self-supervised learning
CN116070128A