Passenger flow prediction method, system and device based on open source honkong system and storage medium
Patent Information
- Application Number
- CN202611260024.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-10-27
Smart Images

Figure CN122986382A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of traffic management technology, and in particular relates to a passenger flow prediction method, system, device and storage medium based on the open source HarmonyOS system. Background Technology
[0002] As a core component of the urban public transportation system, the subway plays a crucial role in the efficient operation of the city. Traditional statistical models, such as ARIMA (Autoregressive Integrated Moving Average Model) and ES (Exponential Smoothing), can capture data trends and seasonal variations to some extent, but they are difficult to accurately and in real-time predict when faced with highly complex and uncertain data such as subway passenger flow, which seriously affects passenger travel experience and subway operation efficiency. Summary of the Invention
[0003] In view of this, the present invention provides a passenger flow prediction method, system, device and storage medium based on the open source HarmonyOS system, which is used to improve the accuracy and real-time performance of subway passenger flow prediction, so as to improve the passenger travel experience and subway operation efficiency.
[0004] The first aspect of this invention provides a passenger flow prediction method based on the open-source HarmonyOS system, comprising: Through the distributed soft bus of the open-source HarmonyOS system, passenger flow data and first auxiliary information for each time period in the past first time period are synchronously obtained from multiple heterogeneous devices deployed in the target subway station, and second auxiliary information for the future second time period is obtained; the first auxiliary information and the second auxiliary information are information related to passenger flow data. For each unit time period within the first time period, a complete historical sequence is constructed based on the corresponding passenger flow data and the first auxiliary information; For each unit time period within the second time period, a future mask sequence is constructed based on the corresponding second auxiliary information, wherein the feature dimensions corresponding to the passenger flow data are filled with mask values; The complete historical sequence and the future mask sequence are concatenated along the time dimension to obtain the input feature sequence; The input feature sequence is input into the trained time series prediction model to obtain the passenger flow data of the target subway station in each unit time period within the second time period.
[0005] A second aspect of the present invention provides a passenger flow prediction system based on the open-source HarmonyOS system, comprising: The information acquisition module is used to synchronously acquire passenger flow data and first auxiliary information for each time period in the past first time period from multiple heterogeneous devices deployed in the target subway station through the distributed soft bus of the open-source HarmonyOS system, and to acquire second auxiliary information for the future second time period; the first auxiliary information and the second auxiliary information are information related to passenger flow data; The historical complete sequence construction module is used to construct a historical complete sequence for each unit time period within the first time period based on the corresponding passenger flow data and the first auxiliary information. The future mask sequence construction module is used to construct a future mask sequence for each unit time period within the second time period based on the corresponding second auxiliary information, wherein the feature dimension corresponding to the passenger flow data is filled with mask values. The splicing module is used to splice the complete historical sequence and the future mask sequence along the time dimension to obtain the input feature sequence; The prediction module is used to input the input feature sequence into the trained time series prediction model to obtain the passenger flow data of the target subway station in each unit time period within the second time period.
[0006] A third aspect of the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the passenger flow prediction method based on the open-source HarmonyOS system as described in the first aspect above.
[0007] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the passenger flow prediction method based on the open-source HarmonyOS system as described in the first aspect above.
[0008] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: This invention achieves low-latency synchronous acquisition of multi-source heterogeneous data by introducing the distributed soft bus of the open-source HarmonyOS system, constructing a unified input feature that includes complete historical sequences and future masked sequences. Based on this input, the time-series prediction model can learn the spatiotemporal correlation patterns between historical passenger flow and auxiliary information, and directly generate future passenger flow predictions. On the one hand, by integrating auxiliary data, it can effectively overcome the prediction blind spots of single data sources for sudden passenger flow (such as large-scale events or sudden weather changes); on the other hand, it can perform real-time prediction of passenger flow data for future time periods, enabling management based on the predicted passenger flow data, thereby improving passenger travel experience and subway operation efficiency. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a schematic diagram of a passenger flow prediction method based on the open-source HarmonyOS system provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a time series prediction model training method provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a passenger flow prediction system based on the open-source HarmonyOS system provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0011] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the present invention. However, those skilled in the art will recognize that the present application may be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted to avoid unnecessary detail that could obscure the description of the present application.
[0012] The technical solution of the present invention will be illustrated below through specific embodiments.
[0013] Reference Figure 1 This illustration shows a schematic diagram of a passenger flow prediction method based on the open-source HarmonyOS system provided by an embodiment of the present invention. This method can be executed by a passenger flow prediction system based on the open-source HarmonyOS system. This passenger flow prediction system based on the open-source HarmonyOS system can be implemented in hardware and / or software, and can be configured in an electronic device. For example... Figure 1 As shown, the method may specifically include the following steps: S101. Through the distributed soft bus of the open-source HarmonyOS system, synchronously obtain passenger flow data and first auxiliary information for each unit time period in the past first time period from multiple heterogeneous devices deployed in the target subway station, and obtain second auxiliary information for the future second time period.
[0014] Among them, the first auxiliary information and the second auxiliary information are information related to passenger flow data. The open-source HarmonyOS is a distributed intelligent operating system for all scenarios. Its core features include a distributed soft bus (1Gbps bandwidth), a low-latency kernel (scheduling latency <10ms), and hardware cooperation, providing underlying technical support for edge deployment and multi-interface collaboration in this solution.
[0015] After being powered on, various heterogeneous devices deployed in the target subway station, such as automatic fare collection system (AFC) turnstiles, surveillance cameras, environmental sensors, and station information systems, automatically complete device registration and discovery through the distributed soft bus protocol of the open-source HarmonyOS system. The system platform uniformly identifies these devices and the data types they provide (such as passenger flow, video, and weather).
[0016] Among them, AFC data acquisition adopts a real-time incremental acquisition mode. Every time the gate completes a card swipe transaction, it immediately uploads the transaction data to the edge gateway through a distributed soft bus, with an acquisition frequency of milliseconds.
[0017] Computer Vision (CV) Data Acquisition: The camera acquires video streams at a frequency of 10 frames per second, and the edge computing module analyzes passenger flow characteristic data (such as density and speed) in real time, and uploads it to the platform layer at a frequency of 3 seconds per upload, reducing the bandwidth pressure of the original video transmission.
[0018] When data at a certain time t is needed, the platform sends a synchronous acquisition command to all relevant devices through a distributed soft bus. Due to the low latency of the bus (which can usually be controlled at the millisecond to second level), data packets with a unified timestamp from different devices are aggregated to the data processing node in almost real time.
[0019] The passenger flow data and primary auxiliary information for each time unit within the first time period are historical data. Specifically, the actual passenger flow data (such as the number of passengers entering and exiting the station) and primary auxiliary information are obtained for each time unit (such as 5 minutes) within a continuous period (such as the past 4 hours) from the current time t. The primary auxiliary information is the known context related to passenger flow, which may include, but is not limited to: passage transaction details within this time period, surveillance video stream, weather conditions (weather type, temperature), date type (weekday, weekend, holiday), etc.
[0020] The second set of auxiliary information for the next time period is also known or obtainable in advance, typically including forecastable weather information and known date types. However, the actual future passenger flow data is unknown, so it is not obtained in this step and needs to be predicted in subsequent steps.
[0021] Optionally, after obtaining the above data, data preprocessing is required, specifically including data cleaning and data standardization.
[0022] 1. Data cleaning: AFC data: Remove invalid card swipes (such as duplicate swipes, non-exit records) and abnormal data caused by equipment failure, and use interpolation to complete missing transaction records.
[0023] CV data: Filter out misidentified data caused by camera obstruction and changes in lighting, and smooth passenger flow density time series data through Kalman filtering.
[0024] 2. Data standardization: Time alignment: AFC data and CV data are uniformly converted into a standardized format of "second-level timestamp + 15-minute time window" to ensure consistency in the time dimension.
[0025] Spatial alignment: Divide the station area into spatial units (entrance, exit, transfer passage, concourse, platform) and associate and match AFC gate data with CV camera data in the corresponding area.
[0026] S102. For each unit time period within the first time period, construct a complete historical sequence based on the corresponding passenger flow data and the first auxiliary information.
[0027] This step aims to transform historical data into a consistent feature sequence that the model can understand. For each unit time period Ti (historical) within the first time period, feature extraction is performed first. Based on the actual passenger flow data and first auxiliary information corresponding to Ti, a series of features are extracted or constructed. For example: directly extracting the number of passengers entering and leaving the station from the passenger flow data; extracting features such as transaction frequency and average ticket price from the passage transaction data; analyzing the surveillance video stream to extract video features such as crowd density and movement speed; converting weather information (such as "sunny" and "rainy") into numerical codes using a lookup table method and concatenating them with temperature values to form weather features; and converting date types (such as "Monday" and "National Day") into unique thermal codes.
[0028] Then, serialization is performed. Specifically, all features of Ti (passenger flow features + various auxiliary features) are arranged in a predetermined order to form a feature vector Vi. Finally, the feature vectors [V1, V2, ..., Vn] of all historical time periods are arranged in chronological order to form a complete historical sequence. This sequence fully records the passenger flow situation and all its contextual information at each historical moment.
[0029] S103. For each unit time period within the second time period, construct a future mask sequence based on the corresponding second auxiliary information, wherein the feature dimension corresponding to the passenger flow data is filled with mask values.
[0030] For each unit time period Fj (future) within the second time period, feature extraction is first performed (based solely on known information): Since the actual future passenger flow is unknown, features are constructed only based on the second auxiliary information corresponding to Fj (such as weather and date type). The processing method is strictly consistent with the processing method for similar information in S102 (e.g., using the same weather coding table).
[0031] Then, masking is performed. For feature dimensions that should contain future passenger flow data and other unknown information (traffic transaction data, video data, etc.), specific mask values are used to fill in the space. Commonly used mask values include 0, -999, or a special [MASK] flag.
[0032] The extracted features are then serialized. Specifically, the feature vector Mj containing the mask values Fj is arranged in chronological order to form the future mask sequence [M1, M2, ..., Mm]. This sequence has the same dimensionality as the complete historical sequence, but the core passenger flow information is filled with mask values. These mask values are used to handle variable-length inputs and optimize training efficiency. By using mask values, the time-series prediction model can ignore the padding, avoiding irrelevant information from interfering with the attention mechanism.
[0033] S104. Concatenate the complete historical sequence and the future masked sequence along the time dimension to obtain the input feature sequence.
[0034] The complete historical sequence and the future masked sequence are concatenated end-to-end on the timeline to form a longer, continuous input feature sequence. For example, if there are 12 time periods in the past (totaling 1 hour) and 24 time periods in the future (totaling 2 hours), the total length of the concatenated input sequence is 36. The first 12 positions of this input sequence are the actual historical data, and the last 24 positions are the future data containing the mask.
[0035] S105. Input the input feature sequence into the trained time series prediction model to obtain the passenger flow data of the target subway station in each unit time period in the second time period.
[0036] The generated input feature sequence is fed into a pre-trained time series prediction model (e.g., a model based on the Transformer architecture). The model first reads the entire input sequence and, based on its ability to be trained on massive amounts of data, understands historical patterns, infers future data, and outputs results.
[0037] Understanding historical patterns: For example, learning the spatiotemporal correlation between passenger flow and various auxiliary information from the first 12 historical locations.
[0038] Inferring future data: For example, by combining learned patterns and observing known auxiliary information (weather, date) and the structure of the masked locations in the last 24 locations, the system can automatically infer and fill in the values that should be present for the masked future passenger flow data.
[0039] Output: The model finally outputs the predicted passenger flow data for each unit time period Fj in the second time period, such as [predicted inbound volume F1, predicted outbound volume F1, predicted inbound volume F24, predicted outbound volume F24].
[0040] Through the above embodiments, this invention utilizes the open-source HarmonyOS system to achieve real-time fusion of multi-source data, and through a unique mask sequence input method, enables the prediction model to more robustly and accurately infer future passenger flow, providing reasonable technical support for subway operation.
[0041] This invention achieves low-latency synchronous acquisition of multi-source heterogeneous data by introducing the distributed soft bus of the open-source HarmonyOS system, constructing a unified input feature that includes both historical complete sequences and future masked sequences. Based on this input, the time-series prediction model can learn the spatiotemporal correlation patterns between historical passenger flow and auxiliary information, and directly generate future passenger flow predictions. On the one hand, by integrating auxiliary information, it effectively overcomes the prediction blind spots of single data sources for sudden passenger flow events (such as large-scale events or sudden weather changes); on the other hand, it can perform real-time prediction of passenger flow data for future time periods, enabling management based on the predicted passenger flow data, thereby improving passenger travel experience and subway operation efficiency.
[0042] Furthermore, leveraging the distributed collaborative capabilities of the HarmonyOS system, data acquisition and transmission latency is reduced from the traditional minute level to the second level, ensuring real-time prediction. In addition, the model learns robust inference capabilities under missing data during training through a masking mechanism, and the HarmonyOS-based architecture allows for the integration of new types of sensors without modifying the core system, greatly improving the deployment adaptability of the solution in different subway stations.
[0043] In an optional embodiment, such as Figure 2 The diagram illustrates a training method for a time series prediction model. The time series prediction model is trained in the following way: S201. From historical passenger flow data, construct sample sequences using a sliding window. Each sample sequence consists of consecutive time steps.
[0044] From historical passenger flow data, a sliding window technique is used to extract continuous segments, each of which is considered a sample sequence. Each sample sequence consists of a series of continuous time steps, such as a sequence of 100 hours (one week) in length, with a time step granularity of 15 minutes or 1 hour.
[0045] S202. Apply a mask to a portion of the observations in each sample sequence, and use the masked time step with the real passenger flow value as the target time step.
[0046] For each constructed sample sequence, a subset of time steps containing passenger flow observations are randomly selected and masked (i.e., hidden or replaced with special labels). These masked time steps, which originally contained real passenger flow values, are defined as the target time steps for this training. This operation simulates scenarios where data is missing or prediction is required, forcing the model to learn to infer the hidden values based on contextual information.
[0047] In an optional embodiment, to further enhance the model's generalization ability under diverse time series structures, this embodiment employs a self-supervised pre-training approach. Each training sample will randomly mask part of its observations, forming a training target pair with the original training sample itself. Specifically, this method uses three different masking strategies: Random time point mask: Randomly select several time points in the time series at a specified ratio, and set the observation values at the corresponding positions as missing to simulate the scenario of missing sporadic data.
[0048] Sliding time window mask: By setting a portion of the data in a time series to be missing with a specified sliding step size and masking length, the model's ability to model discontinuous positions in the time series is enhanced, simulating scenarios of periodic missing data.
[0049] Continuous time block mask: Masks data of a specified length at the end of a time series to simulate a scenario where recent data intervals are missing.
[0050] During training, the three masking methods mentioned above are used in combination with a certain probability to generate training samples with diverse structures. This allows the model to be exposed to various data missing scenarios during the training phase, learn robust and generalized time series representations, and improve its robustness and generalization ability in prediction tasks.
[0051] In addition, to improve the model's adaptability to different input lengths and missing patterns, online masking is used during training. New masks are dynamically generated in each iteration, which further increases the learning difficulty of the model and makes the model more capable of modeling.
[0052] S203. A quantile regression loss function is used to learn the conditional distribution of passenger flow values at different quantiles at each masked time step.
[0053] The model training employs a quantile regression loss function. Unlike ordinary regression, which only predicts a single expected value, quantile regression aims to learn the conditional distribution of the actual passenger flow at different quantiles (e.g., 10%, 50%, 90%) at each masked target time step. This allows the model to not only predict the most probable value (e.g., the median) but also estimate the range of uncertainty in the prediction, such as the prediction interval.
[0054] S204. For each sample sequence, calculate the quantile regression loss only at the target time step in that sample sequence to obtain the loss at each target time step.
[0055] For each sample sequence, the model outputs a set of quantile predictions for each target time step based on its context (the unmasked portion). Loss calculation is performed only for these target time steps. The model compares the predicted quantiles with the actual values at locations where the true values are known, and calculates the loss for each target time step using the quantile loss function. The unmasked portions of the sequence are not included in the loss calculation, thus focusing on the model's data completion or prediction capabilities.
[0056] S205. Solve for the model loss value based on the loss of all quantiles, all sample sequences, and all target time steps.
[0057] The losses at all target time steps are aggregated across all quantiles and all sample sequences to obtain a global model loss value. Optionally, the model loss value is obtained by summing and averaging the losses at all quantiles, all sample sequences, and all target time steps.
[0058] The final loss value is obtained by summing and averaging over all quantiles, all samples, and time steps, as shown in the following formula, where I(⋅) is an indicator function, which is 1 if the condition is met, and 0 otherwise.
[0059] ; Where R is the model loss value, , Let be the actual value and predicted value of the passenger flow data for sample i at time step t, respectively; N be the total number of training samples (sample sequences); i be the sample index; Q be the preset total number of quantiles; q be the quantile index; and τ be the quantile index. q t represents the level value of the q-th quantile; L represents the total number of time steps in a single sample sequence, and t represents the time step index. Let be the binary mask indicator function for sample i at time step t.
[0060] S206. Determine whether the model loss value is less than the preset loss threshold.
[0061] If the value is below the threshold, it means the model training is sufficient, and proceed to step S207; if the value is not below the threshold, return to step S202, regenerate the mask in the next round of training, and continue iterative optimization until the model performance meets the requirements (the model loss value is less than the loss threshold).
[0062] S207. Update the model parameters of the time series base model based on the model loss value.
[0063] Based on the calculated model loss value, the gradient is calculated using a backpropagation algorithm (such as stochastic gradient descent and its variants), and all trainable parameters of the time series pedestal model are updated accordingly. Through numerous such iterations, the model gradually learns to robustly infer the overall sequence pattern and its probability distribution from partial observations.
[0064] This embodiment drives the model to learn deep features of passenger flow sequences through a self-supervised task of mask reconstruction; and through a loss design of quantile regression, the model is equipped with the ability to output uncertain predictions.
[0065] In an optional embodiment, the first auxiliary information includes passage transaction data, surveillance video streams, date type, and weather information; for each unit time period within the first time period, a complete historical sequence is constructed based on the corresponding passenger flow data and the first auxiliary information, including: For each unit time period within the first time period, extract passage transaction features from the corresponding passage transaction data; generate video features related to passenger flow changes based on the corresponding monitoring video stream; obtain weather features based on weather information; obtain date type features based on date type; and construct the complete historical sequence corresponding to the current unit time period based on passenger flow data, passage transaction features, video features, weather features, and date type features.
[0066] Toll Transaction Feature Extraction: For each unit time period within the first time period, the corresponding toll transaction data is analyzed. The toll transaction data comes from the automatic fare collection system. By aggregating and statistically analyzing all transaction records within this time period, indicators such as the total number of transactions, total transaction amount, average transaction interval, and the usage ratio of various types of tickets (such as single-journey tickets, stored-value cards, and QR codes) are extracted to form a multi-dimensional toll transaction feature vector.
[0067] Video Feature Generation: For the same time period, the corresponding surveillance video stream is processed. First, raw video streams are acquired using cameras deployed in key areas of the station (such as entrances, concourses, platforms, and transfer passages). Then, pre-trained computer vision models (e.g., deep learning-based crowd density estimation models and optical flow methods) are used to analyze the video streams in real time, extracting the following spatial situational features: crowd density (people / square meter) in each area, average passenger movement speed (meters / second), queue length (estimated number of people) at key locations (such as in front of turnstiles), and statistical information on passenger flow direction. These features from different areas are then fused (e.g., through weighted averaging or taking the maximum value) to form a comprehensive video feature vector representing the dynamics of passenger flow within the station.
[0068] Weather feature calculation: Obtain the weather information corresponding to the unit time period. In an optional embodiment, the weather information includes weather type, minimum temperature, and maximum temperature. Obtaining weather features based on the weather information includes: converting the weather type in the weather information into a numerical code according to a preset weather type-code mapping table to obtain a weather type code; concatenating the weather type code with the minimum and maximum temperatures in the weather information to obtain the weather feature. The weather information includes at least the weather type (e.g., sunny, rainy, snow), maximum temperature, and minimum temperature. By querying a preset "weather type-code mapping table," discrete weather types are converted into fixed numerical codes (e.g., using unique thermal coding). Finally, the weather type code, maximum temperature, and minimum temperature are concatenated in a predetermined order to form a weather feature vector.
[0069] Date type feature determination: Based on the date to which the unit time period belongs, its date type is determined. Date types may include, but are not limited to: weekdays, weekends, public holidays, special event days, etc. Each date type corresponds to a unique category label, which is converted into a date type feature vector through one-hot encoding or embedding encoding.
[0070] For the current processing time unit, the original passenger flow data (such as the number of passengers entering and exiting the station) is combined with the passage transaction feature vector, video feature vector, weather feature vector, and date type feature vector generated in the previous steps. Specifically, all these features are concatenated along their feature dimensions to form a unified, high-dimensional comprehensive feature vector, which represents the complete state of the current time unit. Finally, the comprehensive feature vectors of all time units within the first time unit, arranged in chronological order, are combined to form a complete historical sequence.
[0071] In an optional embodiment, video features related to changes in passenger flow are generated based on the corresponding surveillance video stream, including: For each time period within the first time period, the number of people entering the station is obtained from the corresponding monitoring video stream; based on the number of people entering the station, the entry count feature representing the rate of change of the entry passenger flow is calculated; the spatial situation features of each area within the target subway station are extracted from the monitoring video stream, including passenger flow density, queue length and movement speed; the spatial situation features of each area are aggregated to obtain the station situation features representing the macroscopic state within the target subway station; the entry count feature and the station situation features are fused to generate video features.
[0072] For each unit time period within the first time period, the video stream collected by the surveillance cameras deployed at the entrance of the station entrance is analyzed, and a pre-trained visual counting model (e.g., a crowd counting model based on a convolutional neural network) is used for real-time analysis to obtain the total number of people entering the station during that time period, Ct.
[0073] Based on this count, the entry count characteristics are further calculated. These entry count characteristics are not a single numerical value, but rather a feature vector, which includes at least: The original value of the number of people entering the station is Ct; Instantaneous rate of change ΔCt = Ct / C{t-1} (the ratio of the count in the current time period to that in the previous time period); Trend indicators, such as the ratio of the current Ct to the average of the past N time periods, or the slope of the short-term ingress trend calculated by linear regression.
[0074] In an optional embodiment, based on the number of people entering the station, an entry count feature characterizing the rate of change in passenger flow is calculated, including: The ratio of the number of people entering the station in the current time period to the number of people entering the station in the previous time period is calculated and used as the entry count feature.
[0075] In-station spatial situational awareness and aggregation: Simultaneously, for the same time period, surveillance video streams deployed in key areas within the station (such as the concourse, platforms, transfer passages, and exit gates) are processed. The video stream for each area is analyzed separately, extracting the spatial situational feature vector for that area. This vector typically includes: Passenger density: The estimated number of people per unit area.
[0076] Queue length: The estimated number of people queuing or the physical length of the queue at bottleneck points (such as security checkpoints or ticket vending machines).
[0077] Passenger movement speed: The average movement speed of people in this area.
[0078] Next, multiple spatial situation feature vectors from all regions are aggregated to form a station situation feature that represents the overall macroscopic state of the station. Aggregation methods include weighted average, key area selection, and statistical summaries.
[0079] Finally, the entry count feature vector and the site status feature vector are fused to generate the final video feature vector, which is essentially a concatenation of the two vectors into a longer feature vector. For example, if the entry count feature is 3-dimensional and the site status feature is 4-dimensional, the fused video feature will be 7-dimensional. Optionally, an attention mechanism can be introduced during vector fusion, allowing the model to dynamically learn whether to focus more on entry information or site status information when predicting different targets.
[0080] In an optional embodiment, the second auxiliary information includes weather information and date type; For each unit time segment within the second time segment, a future mask sequence is constructed based on the corresponding second auxiliary information, including: For each unit time period within the second time period, date type features are obtained based on date type; weather features are obtained based on weather information; and a future mask sequence corresponding to the current unit time period is constructed based on the date type features and weather features. The feature dimensions corresponding to passenger flow data, passage transaction data, and monitoring video stream are all filled with mask values.
[0081] The processing of the second auxiliary information and the construction of the future mask sequence are similar to the processing of the first auxiliary information and the historical mask sequence, but only include known weather and date features, and mask filling is performed on unknown features such as passenger flow, transactions, and video. For details, please refer to the description of the processing of the first auxiliary information and the historical mask sequence, which will not be repeated here.
[0082] For example, if the feature vector of a time step of a complete historical sequence is: [passenger flow (2-dimensional), transaction features (3-dimensional), video features (4-dimensional), weather features (3-dimensional), date features (2-dimensional)], a total of 14 dimensions.
[0083] The feature vector of a time step of the corresponding future mask sequence is: [[0,0], [0,0,0], [0,0,0,0], weather features (3-dimensional), date features (2-dimensional)], where the first 9 dimensions are mask values.
[0084] It's important to note that the feature structure, encoding method, and order of the future sequence are exactly the same as those of the historical sequence. This is a prerequisite for the model to correctly understand and process the masked sequence. Furthermore, the masking is applied to three categories of unknown information—passenger flow data, traffic transaction characteristics, and video features (or other categories as defined in practice)—to concretize the objects being manipulated. The mask value is essentially a "placeholder," filling in "mask values" that clearly distinguish it from valid data.
[0085] In an optional embodiment, the method further includes: constructing passenger flow prediction results with different time granularities based on passenger flow data for each unit time period within the second time period, the passenger flow prediction results including inbound passenger flow and outbound passenger flow; and generating a train schedule and / or station traffic management instructions based on the passenger flow prediction results with different time granularities within the second time period.
[0086] Based on the previously obtained high-precision passenger flow forecast data (including inbound and outbound passenger flow) for the smallest unit time period (e.g., 5 minutes) within the second time period, aggregated forecast results at different time granularities are generated according to actual business needs. For example: 15-minute granularity: used for short-term fine-tuning of transport capacity and deployment of station staff.
[0087] 30-minute or 60-minute granularity: used to assess medium-term passenger flow trends and assist in adjusting schedules.
[0088] Total capacity for the entire journey (e.g., the next 2 hours): used for overall capacity assessment and pre-allocation of emergency resources.
[0089] The system provides a standardized data interface, outputting the aforementioned structured, multi-granularity passenger flow forecast reports. Finally, the multi-granularity passenger flow forecast results, especially the passenger flow forecasts for the next 15-60 minutes, are input into the subway train operation simulation and optimization engine. This engine performs demand matching analysis, comparing the predicted passenger flow demand (e.g., a surge in exit passenger flow at a station in the next 30 minutes) with the current train schedule's capacity supply, identifying capacity gaps or redundant periods, and making adjustments to the schedule, including increasing train frequency, adding empty trains, and optimizing routes. The optimized train operation plan (or adjustment instructions) is then output in a standard format (e.g., charts or control instruction sets), which can be automatically or manually confirmed before being sent to the automatic train monitoring system for execution.
[0090] Multi-granularity passenger flow forecasts, especially the forecasts of passenger flow entering and exiting the station and internal congestion for the next 15-30 minutes at specific stations, are input into the station passenger flow simulation and diversion strategy model. This model provides bottleneck warnings and generates corresponding diversion instructions. The generated diversion instructions are automatically or, after confirmation, sent to the appropriate terminal devices for execution through the station equipment management system or communication system.
[0091] Optionally, the open-source HarmonyOS also adopts a heterogeneous device interconnection solution, specifically: Distributed registration and discovery: After AFC devices and CV devices are connected to the network, they complete device identity registration through the distributed soft bus protocol of the open-source HarmonyOS system. The platform layer automatically discovers and identifies the device type and functional parameters, realizing seamless interconnection of heterogeneous devices. Standardized Modeling: For AFC and CV devices, we sort out their full lifecycle operation data and business interaction requirements, formulate unified modeling specifications, and clarify input and output parameters. At the same time, through the object model management tool of the open source HarmonyOS system, the modeling results are converted into machine-recognizable JSON-LD format to achieve standardized storage and sharing of models.
[0092] Unified data protocol: Define a standardized data transmission format (JSON structure), clarify the field meanings and encoding rules of AFC data and CV data, and avoid transmission delays caused by data format incompatibility; Equipment status coordination: The platform layer monitors the operating status of equipment in real time. When a certain AFC gate or CV camera fails, it automatically switches to the backup equipment for data acquisition to ensure the continuity of data transmission.
[0093] The open-source HarmonyOS system also employs data latency optimization strategies, specifically manifested in: Edge computing offloading: Deploy a lightweight data processing module on the edge gateway to complete the initial filtering of AFC data and real-time parsing of CV data, reducing the amount of data uploaded to the platform layer and reducing transmission latency; Priority transmission scheduling: Based on the queue management mechanism of the open-source HarmonyOS system, key data such as real-time passenger flow density and congestion warning of CV are set as high priority, while AFC historical transaction summary data is set as ordinary priority to ensure the rapid transmission of core data; Dynamic network bandwidth allocation: Based on real-time data transmission volume, the network management module of the open-source HarmonyOS system dynamically adjusts the bandwidth usage of devices to avoid network congestion caused by multiple devices transmitting simultaneously, and ensures that data transmission latency is stable within 3 seconds.
[0094] It should be noted that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0095] Reference Figure 3 The diagram illustrates a passenger flow prediction system based on the open-source HarmonyOS system provided by an embodiment of the present invention, which may specifically include the following modules: The information acquisition module 301 is used to synchronously acquire passenger flow data and first auxiliary information for each unit time period in the past first time period from multiple heterogeneous devices deployed in the target subway station through the distributed soft bus of the open source HarmonyOS system, and to acquire second auxiliary information for the future second time period; the first auxiliary information and the second auxiliary information are information related to passenger flow data; The historical complete sequence construction module 302 is used to construct a historical complete sequence for each unit time period within the first time period based on the corresponding passenger flow data and the first auxiliary information. The future mask sequence construction module 303 is used to construct a future mask sequence for each unit time period within the second time period based on the corresponding second auxiliary information, wherein the feature dimension corresponding to the passenger flow data is filled with mask values. The splicing module 304 is used to splice the historical complete sequence and the future mask sequence along the time dimension to obtain the input feature sequence; The prediction module 305 is used to input the input feature sequence into the trained time series prediction model to obtain the passenger flow data of the target subway station in each unit time period within the second time period.
[0096] Optionally, the first auxiliary information includes passage transaction data, surveillance video stream, date type, and weather information; The historical complete sequence construction module 302, for each unit time period within the first time period, is used for: For each unit time period within the first time period, extract passage transaction features from the corresponding passage transaction data; Generate video features related to changes in passenger flow based on the corresponding surveillance video stream; Weather characteristics are obtained based on the aforementioned weather information; The date type characteristics are obtained based on the date type; Construct a complete historical sequence corresponding to the current unit time period based on passenger flow data, traffic transaction characteristics, video characteristics, weather characteristics, and date type characteristics.
[0097] Optionally, when generating video features related to changes in passenger flow based on the corresponding monitoring video stream, the historical complete sequence construction module 302 is used to: For each time period within the first time period, the number of people entering the station is counted based on the corresponding monitoring video stream; Based on the number of people entering the station, an entry count feature representing the rate of change of the passenger flow is calculated. The spatial situation features of each area within the target subway station are extracted from the surveillance video stream. The spatial situation features include passenger flow density, queue length, and movement speed. The spatial situation features of each region are aggregated to obtain the station situation features that characterize the macroscopic state within the target subway station. The video features are generated by fusing the station entry count features with the station situation features.
[0098] Optionally, when the historical complete sequence construction module 302 calculates the entry count feature representing the rate of change of entry passenger flow based on the entry passenger count, it is used to: The ratio of the number of people entering the station in the current time period to the number of people entering the station in the previous time period is calculated and used as the entry count feature.
[0099] Optionally, the second auxiliary information includes weather information and date type; The future mask sequence construction module 303 is used for: For each unit time period within the second time period, the date type characteristics are obtained based on the date type; Weather characteristics are obtained based on the aforementioned weather information; A future mask sequence corresponding to the current unit time period is constructed based on date type features and weather features, where the feature dimensions corresponding to passenger flow data, passage transaction data, and surveillance video stream are all filled with mask values.
[0100] Optionally, the weather information includes weather type, minimum temperature, and maximum temperature; The future mask sequence construction module 303 and the historical complete sequence construction module 302 are further used for: According to the preset weather type-encoding mapping table, the weather type in the weather information is converted into a numerical code to obtain the weather type code; The weather feature is obtained by concatenating the weather type code with the minimum and maximum temperatures in the weather information.
[0101] Optionally, the passenger flow prediction system based on the open-source HarmonyOS system also includes an execution module, which is used for: Based on the passenger flow data of each unit time period within the second time period, passenger flow prediction results with different time granularities are constructed, and the passenger flow prediction results include inbound passenger flow and outbound passenger flow. Based on the passenger flow forecast results at different time granularities within the second time period, a driving plan and / or station traffic management instructions are generated.
[0102] The present invention provides a passenger flow prediction system based on the open-source HarmonyOS system. By applying the passenger flow prediction system based on the open-source HarmonyOS system, the various steps in the aforementioned passenger flow prediction method embodiments based on the open-source HarmonyOS system can be implemented.
[0103] It should be noted that the module division in the various passenger flow prediction systems based on the open-source HarmonyOS provided in the above embodiments is illustrative and only represents one logical functional division. In actual implementation, other division methods may also be used. Furthermore, the functional modules in the various embodiments of this invention can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0104] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the technical solution of the embodiments of the present invention can be embodied in the form of a computer program product, which is stored in a computer storage medium and includes several instructions to cause an electronic device or processor to execute all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned computer storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0105] Furthermore, the passenger flow prediction system based on the open-source HarmonyOS provided in the above embodiments and the passenger flow prediction method based on the open-source HarmonyOS belong to the same concept. For details of its specific implementation process, please refer to the method embodiments, which will not be repeated here.
[0106] Reference Figure 4 The diagram illustrates an electronic device according to an embodiment of the present invention. Figure 4 As shown, the electronic device in this embodiment of the invention includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the above-described embodiment of the passenger flow prediction method based on the open-source HarmonyOS system. Alternatively, when the processor executes the computer program, it implements the functions of each module in the above-described embodiment of the passenger flow prediction system based on the open-source HarmonyOS system.
[0107] For example, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete this application. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which can be used to describe the execution process of the computer program in the electronic device.
[0108] The electronic device may be a desktop computer, a cloud server, or other computing device. The electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 4 This is merely one example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.
[0109] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0110] The memory can be an internal storage unit of the electronic device, such as a hard drive or RAM. Alternatively, it can be an external storage device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. Furthermore, the memory can include both internal and external storage units. The memory is used to store the computer program and other programs and data required by the electronic device. The memory can also be used to temporarily store data that has been output or will be output.
[0111] This invention also discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the passenger flow prediction method based on the open-source HarmonyOS system as described in the foregoing embodiments.
[0112] This invention also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the passenger flow prediction method based on the open-source HarmonyOS system as described in the foregoing embodiments.
[0113] This invention also discloses a computer program product that, when run on a computer, causes the computer to execute the passenger flow prediction method based on the open-source HarmonyOS system described in the foregoing embodiments.
[0114] The embodiments described above are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A passenger flow prediction method based on the open-source HarmonyOS system, characterized in that, include: Through the distributed soft bus of the open-source HarmonyOS system, passenger flow data and first auxiliary information for each time period in the past first time period are synchronously obtained from multiple heterogeneous devices deployed in the target subway station, and second auxiliary information for the future second time period is obtained; the first auxiliary information and the second auxiliary information are information related to passenger flow data; For each unit time period within the first time period, a complete historical sequence is constructed based on the corresponding passenger flow data and the first auxiliary information; For each unit time period within the second time period, a future mask sequence is constructed based on the corresponding second auxiliary information, wherein the feature dimensions corresponding to the passenger flow data are filled with mask values; The complete historical sequence and the future mask sequence are concatenated along the time dimension to obtain the input feature sequence; The input feature sequence is input into the trained time series prediction model to obtain the passenger flow data of the target subway station in each unit time period within the second time period.
2. The method according to claim 1, characterized in that, The first auxiliary information includes passage transaction data, surveillance video streams, date type, and weather information; The step of constructing a complete historical sequence for each unit time period within the first time period, based on the corresponding passenger flow data and the first auxiliary information, includes: For each unit time period within the first time period, extract passage transaction features from the corresponding passage transaction data; Generate video features related to changes in passenger flow based on the corresponding surveillance video stream; Weather characteristics are obtained based on the aforementioned weather information; The date type characteristics are obtained based on the date type; Construct a complete historical sequence corresponding to the current unit time period based on passenger flow data, traffic transaction characteristics, video characteristics, weather characteristics, and date type characteristics.
3. The method according to claim 2, characterized in that, The step of generating video features related to changes in passenger flow based on the corresponding surveillance video stream includes: For each time period within the first time period, the number of people entering the station is counted based on the corresponding monitoring video stream; Based on the number of people entering the station, an entry count feature representing the rate of change of the passenger flow is calculated. The spatial situation features of each area within the target subway station are extracted from the surveillance video stream. The spatial situation features include passenger flow density, queue length, and movement speed. The spatial situation features of each region are aggregated to obtain the station situation features that characterize the macroscopic state within the target subway station. The video features are generated by fusing the station entry count features with the station situation features.
4. The method according to claim 3, characterized in that, The method of calculating the entry count feature, which characterizes the rate of change in entry passenger flow, based on the entry passenger count includes: The ratio of the number of people entering the station in the current time period to the number of people entering the station in the previous time period is calculated and used as the entry count feature.
5. The method according to claim 2, characterized in that, The second auxiliary information includes weather information and date type; The step of constructing a future mask sequence based on the corresponding second auxiliary information for each unit time period within the second time period includes: For each unit time period within the second time period, the date type characteristics are obtained based on the date type; Weather characteristics are obtained based on the aforementioned weather information; A future mask sequence corresponding to the current unit time period is constructed based on date type features and weather features, where the feature dimensions corresponding to passenger flow data, passage transaction data, and surveillance video stream are all filled with mask values.
6. The method according to claim 2 or 5, characterized in that, The weather information includes weather type, minimum temperature, and maximum temperature; The step of obtaining weather characteristics based on the weather information includes: According to the preset weather type-encoding mapping table, the weather type in the weather information is converted into a numerical code to obtain the weather type code; The weather feature is obtained by concatenating the weather type code with the minimum and maximum temperatures in the weather information.
7. The method according to claim 1, characterized in that, Also includes: Based on the passenger flow data of each unit time period within the second time period, passenger flow prediction results with different time granularities are constructed, and the passenger flow prediction results include inbound passenger flow and outbound passenger flow. Based on the passenger flow forecast results at different time granularities within the second time period, a driving plan and / or station traffic management instructions are generated.
8. A passenger flow prediction system based on the open-source HarmonyOS system, characterized in that, include: The information acquisition module is used to synchronously acquire passenger flow data and first auxiliary information for each time period in the past first time period from multiple heterogeneous devices deployed in the target subway station through the distributed soft bus of the open-source HarmonyOS system, and to acquire second auxiliary information for the future second time period; the first auxiliary information and the second auxiliary information are information related to passenger flow data; The historical complete sequence construction module is used to construct a historical complete sequence for each unit time period within the first time period based on the corresponding passenger flow data and the first auxiliary information. The future mask sequence construction module is used to construct a future mask sequence for each unit time period within the second time period based on the corresponding second auxiliary information, wherein the feature dimension corresponding to the passenger flow data is filled with mask values. The splicing module is used to splice the complete historical sequence and the future mask sequence along the time dimension to obtain the input feature sequence; The prediction module is used to input the input feature sequence into the trained time series prediction model to obtain the passenger flow data of the target subway station in each unit time period within the second time period.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the passenger flow prediction method based on the open-source HarmonyOS system as described in any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the passenger flow prediction method based on the open-source HarmonyOS system as described in any one of claims 1-7.