Shared single traffic flow prediction method

Through the STAN model combined with the spatial and temporal attention mechanism, the problem of shared bicycle traffic prediction error caused by independent analysis of time and space in the existing technology is solved, and more accurate spatio-temporal data analysis and traffic resource optimization are achieved.

CN120123841APending Publication Date: 2025-06-10ANHUI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510186155.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-20
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

The existing shared bicycle flow prediction method analyzes time and space as two independent dimensions, resulting in large prediction errors.

Method used

The STAN model is adopted, combining the spatial attention mechanism and time series modeling, the spatial information in the data is extracted through the spatial attention mechanism, and the time characteristics are captured through the temporal attention mechanism, and the prediction results are finally output through the fully connected layer.

Benefits of technology

Effectively process spatiotemporal data, improve the performance and effect of the model in spatiotemporal data analysis tasks, accurately predict the demand and usage of shared bicycles at different times and places, optimize the allocation of urban transportation resources, and improve overall operational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123841A_ABST
    Figure CN120123841A_ABST
Patent Text Reader

Abstract

The invention discloses a shared bicycle traffic flow prediction method. The method comprises the following steps: S1, collecting shared bicycle passenger flow data; s2, creating an STAN model, processing the data by using a spatial attention mechanism, and extracting spatial information; s3, dynamically adjusting the weights of different spatial positions according to the spatial distribution condition of the data; s4, modeling is carried out for the time sequence, and the STAN model inputs the data processed in the above steps into a time sequence modeling module for processing; s5, performing weighting processing on the time sequence data output in the step S4 by using a time attention mechanism; the weight is dynamically adjusted according to the importance of the input data in time, and time features in the data are captured; and S6, the STAN model combines the data after space and time processing, and outputs a final result through a full connection layer. The method can accurately predict the demands and use conditions of the shared bicycles at different time and places, thereby optimizing the urban traffic resource configuration, and improving the overall operation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of shared bicycles, and particularly to a method for predicting the traffic flow of shared bicycles. Background Art

[0002] In view of the continuous growth of urban traffic pressure, as a green and convenient travel mode, the utilization efficiency and distribution optimization of shared bicycles are particularly important. Most existing studies on traffic flow prediction analyze time and space as two independent dimensions. Such prediction errors tend to be relatively large. Summary of the Invention

[0003] To solve the existing problems, the present invention provides a method for predicting the traffic flow of shared bicycles, and the specific solution is as follows:

[0004] A method for predicting the traffic flow of shared bicycles includes the following steps:

[0005] S1, collecting the passenger flow data of shared bicycles;

[0006] S2, creating a STAN model, and using a spatial attention mechanism to process the input passenger flow data of shared bicycles to extract the spatial information in the data;

[0007] S3, dynamically adjusting the weights of different spatial positions according to the spatial distribution of the data, so as to capture the spatial characteristics of the passenger flow of shared bicycles;

[0008] S4, modeling the time series, and the STAN model inputs the data processed through the above steps into a time series modeling module for processing;

[0009] S5, using a time attention mechanism to perform weighted processing on the time series data output in step S4; dynamically adjusting the weights according to the importance of the input data in time, and capturing the time characteristics in the data;

[0010] S6, the STAN model combines the data processed in space and time, and outputs the final result through a fully connected layer.

[0011] Preferably, the passenger flow data of shared bicycles in step S1 is collected by using web crawler technology, including historical data and real-time data.

[0012] Preferably, an LSTM time series modeling module is adopted in step S4. LSTM is a neural network structure that can effectively capture the long-term dependence relationship in time series data, and effectively models the passenger flow data through LSTM.

[0013] Preferably, the present invention also discloses a computer-readable storage medium storing a computer program, which, when run, executes the method described in any one of the above.

[0014] Preferably, the present invention also discloses a computer system, including a processor and a storage medium storing a computer program, wherein the processor reads and runs the computer program from the storage medium to execute the method described in any one of the above.

[0015] The beneficial effects of the present invention are as follows:

[0016] By combining the spatial attention mechanism and time series modeling, the STAN model of the present invention can effectively process spatio-temporal data and weight important information through the attention mechanism, thereby improving the performance and effect of the model in spatio-temporal data analysis tasks. By analyzing historical and real-time data, it can accurately predict the demand and usage status of shared bicycles at different times and locations, and then optimize the allocation of urban traffic resources and improve the overall operation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0018] Figure 1 It is a flowchart of the method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.

[0020] The objective of the present invention is to design a shared bicycle flow prediction model by integrating multi-source data and spatio-temporal analysis techniques. The model aims to accurately predict the demand and usage status of shared bicycles at different times and locations by analyzing historical and real-time data, and then optimize the allocation of urban traffic resources and improve the overall operation efficiency. The STAN model can integrate the two dimensions of time and space to more comprehensively capture the dynamic changes in the use of shared bicycles.

[0021] Such as Figure 1, a method for predicting the traffic flow of shared bicycles, comprising the following steps:

[0022] S1, collect the passenger flow data of shared bicycles.

[0023] Among them, in terms of data collection, rich weather data is obtained from the official websites of multiple city governments by using web crawler technology to enhance the generalization ability of the model in different urban environments and reduce prediction errors. The passenger flow data of shared bicycles includes historical data and real-time data.

[0024] S2, create a STAN model. Use the Spatial Attention mechanism to process the input passenger flow data of shared bicycles and extract the spatial information in the data.

[0025] Specifically, the STAN model (Spatial Temporal Attention Networks), that is, the attention network mechanism, is a neural network model that combines the spatial attention mechanism and time series modeling, mainly used to process spatio-temporal data. The main feature of the STAN model is its ability to effectively capture the spatial and time information in the data and use the attention mechanism to weight the important information, thereby improving the performance of the model in spatio-temporal data analysis tasks.

[0026] S3, dynamically adjust the weights of different spatial positions according to the spatial distribution of the data to capture the spatial characteristics of the passenger flow of shared bicycles.

[0027] S4, perform Temporal Modeling on the time series. The STAN model inputs the data processed through the above steps into the time series modeling module for processing.

[0028] Among them, the time series modeling module adopts the LSTM (Long Short-Term Memory) time series modeling module. LSTM is a neural network structure that can effectively capture the long-term dependencies in time series data, and effectively model the passenger flow data through LSTM.

[0029] S5, use the Temporal Attention mechanism to weight the time series data output in step S4. The Temporal Attention mechanism can dynamically adjust the weights according to the importance of the input data in time, so as to better capture the time characteristics in the data.

[0030] S6, the STAN model combines the data processed in space and time and outputs the final result through structures such as fully connected layers. The model can better predict or classify spatio-temporal data according to the fusion of spatial and time information.

[0031] The STAN model of the present invention can effectively process spatio-temporal data by combining spatial attention mechanism and time series modeling, and weight important information through the attention mechanism, thereby improving the performance and effectiveness of the model in spatio-temporal data analysis tasks. By analyzing historical and real-time data, it can accurately predict the demand and usage status of shared bicycles at different times and locations, and then optimize the allocation of urban traffic resources and improve the overall operation efficiency.

[0032] The present invention also discloses a computer-readable storage medium and a computer system. The computer-readable storage medium stores a computer program, and after the computer program runs, it executes the method described in any one of the above. A computer system includes a processor and a storage medium. The storage medium stores a computer program, and the processor reads and runs the computer program from the storage medium to execute the method described in any one of the above.

[0033] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability of hardware and software, the various illustrative components, blocks, modules, circuits, and steps are described above in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and the design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.

[0034] The various illustrative logical blocks, modules, and circuits described in connection with the embodiments disclosed herein can be implemented using a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors cooperating with a DSP core, or any other such configuration.

[0035] The steps of a method or algorithm described in connection with the embodiments disclosed in this specification can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read from, and write to, the storage medium. In an alternative, the storage medium may be integrated into the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and the storage medium may reside as discrete components in a user terminal.

[0036] In one or more exemplary embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software as a computer program product, the functions may be stored on or transmitted via a computer-readable medium as one or more instructions or code. The computer-readable medium includes both a computer storage medium and a communication medium including any medium that facilitates transfer of a computer program from one place to another. A storage medium may be any available medium that can be accessed by a computer. By way of example and not limitation, such a computer-readable medium may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. Any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a web site, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable medium.

[0037] The previous description of the present disclosure is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to the present disclosure will be apparent to those skilled in the art, and the general principles defined herein can be applied to other variations without departing from the spirit or scope of the present disclosure. Thus, the present disclosure is not intended to be limited to the examples and designs described herein, but should be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0038] Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements 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 the present invention.

Claims

1. A method for predicting shared bicycle traffic, characterized in that: The following steps are involved: S1, collects shared bicycle passenger flow data; S2, create the STAN model, use the spatial attention mechanism to process the input shared bicycle passenger flow data, and extract the spatial information in the data; S3, dynamically adjusts the weights of different spatial locations according to the spatial distribution of the data in order to capture the spatial characteristics of shared bicycle passenger flow; S4, for time series modeling, the STAN model inputs the data processed by the above steps into the time series modeling module for processing; S5, using the temporal attention mechanism to perform weighted processing on the time series data output in step S4; dynamically adjusting the weights according to the temporal importance of the input data to capture the temporal features in the data; S6, the STAN model combines the spatially and temporally processed data and outputs the final result through a fully connected layer.

2. The method according to claim 1, characterized in that: The shared bicycle passenger flow data in step S1 is collected using crawler technology, including historical data and real-time data.

3. The method according to claim 1, characterized in that: In step S4, an LSTM time series modeling module is used. LSTM is a neural network structure that can effectively capture long-term dependencies in time series data. The passenger flow data is effectively modeled through LSTM.

4. A computer-readable storage medium, characterized in that: A computer program is stored on the medium, and after the computer program is run, the method according to any one of claims 1 to 3 is executed.

5. A computer system, characterized in that: The method comprises a processor and a storage medium, wherein a computer program is stored in the storage medium, and the processor reads and runs the computer program from the storage medium to execute the method as claimed in any one of claims 1 to 3.