CN115271833A - Shared bicycle demand prediction method and prediction system - Google Patents

Shared bicycle demand prediction method and prediction system Download PDF

Info

Publication number
CN115271833A
CN115271833A CN202211191739.6A CN202211191739A CN115271833A CN 115271833 A CN115271833 A CN 115271833A CN 202211191739 A CN202211191739 A CN 202211191739A CN 115271833 A CN115271833 A CN 115271833A
Authority
CN
China
Prior art keywords
demand
shared bicycle
matrix
station
historical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211191739.6A
Other languages
Chinese (zh)
Other versions
CN115271833B (en
Inventor
徐博
唐懋然
彭凯
胡梦兰
徐晓慧
谢江山
彭聪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hubei Chutianyun Co ltd
Huazhong University of Science and Technology
Original Assignee
Hubei Chutianyun Co ltd
Huazhong University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hubei Chutianyun Co ltd, Huazhong University of Science and Technology filed Critical Hubei Chutianyun Co ltd
Priority to CN202211191739.6A priority Critical patent/CN115271833B/en
Publication of CN115271833A publication Critical patent/CN115271833A/en
Application granted granted Critical
Publication of CN115271833B publication Critical patent/CN115271833B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • G06Q30/0202Market predictions or forecasting for commercial activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Development Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Computational Linguistics (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Game Theory and Decision Science (AREA)
  • Molecular Biology (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • General Business, Economics & Management (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)

Abstract

The invention provides a method and a system for forecasting demand of a shared bicycle, wherein the method comprises the following steps: acquiring historical demand data of each shared bicycle station to obtain a historical demand characteristic matrix, and generating an adjacency matrix representing station adjacency relation according to historical order data; inputting the historical demand characteristic matrix and the adjacent matrix into a graph convolution neural network, acquiring a characteristic matrix containing neighbor station demand information, inputting the characteristic matrix into a depth self-attention network, and extracting a shared bicycle demand time domain information matrix; and inputting the time domain information matrix of the shared bicycle demand into the convolutional neural network, the residual error structure and the full connection layer, and outputting the demand predicted value of each shared bicycle station in the next time period. According to the deep self-attention network original multi-head attention mechanism, the time domain characteristics and the target interest characteristics in the space domain characteristics are better learned, the accuracy of demand forecasting is improved to a certain extent, and the problem of forecasting the demand of a short-time shared bicycle is better solved.

Description

Shared bicycle demand prediction method and prediction system
Technical Field
The invention relates to the field of traffic prediction, in particular to a method and a system for predicting demand of a shared bicycle.
Background
Specific difficulties and important points to be considered when an enterprise operates a sharing single-vehicle system are many, wherein an important consideration is how to realize an efficient sharing single-vehicle supply and demand balance network. Therefore, the traditional management method mainly balances the supply and demand requirements of the shared bicycle at different stations at different times through deploying a manual monitoring system and different transportation tools. However, in the method, the number of shared vehicles at a certain station in a future period of time is determined by a driver of a transport shared vehicle according to historical experience in most scenes, and the method often causes imbalance of supply and demand due to errors in estimation of the number of shared vehicles caused by error estimation and unexpected flow of a vehicle transport driver, so that not only is great inconvenience brought to consumers and great loss brought to enterprises, but also more importantly, due to unreasonable estimation of the number of required shared vehicles at the station, the number of shared vehicles at the certain station can be increased sharply, and great negative effects are brought to traffic and city management. Therefore, because of the uncertainty in the number of vehicles rented and flown at any station, it is important to accurately predict the number of bicycles available to the user at any time and place by taking a more aggressive approach.
Due to the advantages of long and short term memory networks in processing time sequence models and the advantages of the convolutional neural networks in extracting time domain features, a plurality of models based on the long and short term memory networks and the convolutional neural networks are proposed to solve the prediction problem of the shared bicycle demand. However, the long-term and short-term memory network model is not good at spatial domain features, and meanwhile, the long-term and short-term memory network cannot efficiently extract interesting features in data input by a user, so that a spatio-temporal based graph volume model is proposed, but the model still has some defects, and the problem of attention mechanism processing still lacks consideration and optimization, how to introduce attention mechanism is fused with multi-source data features, and the like.
Disclosure of Invention
The invention provides a method and a system for predicting the demand of a shared bicycle, aiming at the technical problems in the prior art.
According to a first aspect of the present invention, there is provided a shared-bicycle demand prediction method including:
acquiring historical demand data of each shared bicycle station, splicing the historical demand data to obtain a historical demand characteristic matrix, and generating an adjacency matrix representing station adjacency relation according to historical order data;
inputting the historical demand characteristic matrix and the adjacency matrix into a graph convolution neural network to obtain the shared bicycle demand space and topological information characteristics in each time period to obtain a characteristic matrix containing the demand information of the neighbor stations;
inputting the characteristic matrix containing the demand information of the neighbor stations into a depth self-attention network, and extracting a shared bicycle demand time domain information matrix through multi-head attention mechanism calculation and a feedforward neural network;
inputting the shared bicycle demand time domain information matrix into a convolutional neural network, performing dimensionality increase on the shared bicycle demand time domain information matrix, connecting the dimensionality increased shared bicycle demand time domain information matrix with the historical demand characteristic matrix through a residual error structure, and outputting a demand predicted value of each shared bicycle station in the next time period through a full connection layer.
According to a second aspect of the present invention, there is provided a shared-bicycle demand prediction system including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring historical demand data of each shared bicycle station, splicing the historical demand data to obtain a historical demand characteristic matrix, and acquiring a generated adjacency matrix representing station adjacency relation according to historical order data;
the second acquisition module is used for inputting the historical demand characteristic matrix and the adjacency matrix into a graph convolution neural network so as to acquire the shared bicycle demand space and topological information characteristics in each time period and obtain a characteristic matrix containing the demand information of the neighbor stations;
the extraction module is used for inputting the characteristic matrix containing the demand information of the neighbor stations into a depth self-attention network and extracting a shared bicycle demand time domain information matrix through multi-head attention mechanism calculation and a feedforward neural network;
and the prediction output module is used for inputting the shared bicycle demand time domain information matrix into a convolutional neural network, performing dimensionality increase on the shared bicycle demand time domain information matrix, connecting the dimensionality increased shared bicycle demand time domain information matrix with the historical demand characteristic matrix through a residual error structure, and outputting a demand predicted value of each shared bicycle station in the next time period through a full connection layer.
According to a third aspect of the present invention, there is provided an electronic device comprising a memory, a processor for implementing the steps of the shared bicycle demand prediction method when executing a computer management like program stored in the memory.
According to a fourth aspect of the present invention, there is provided a computer readable storage medium having stored thereon a computer management-like program, which when executed by a processor, performs the steps of the shared-bicycle demand prediction method.
According to the shared bicycle demand forecasting method and the shared bicycle demand forecasting system, the original multi-head attention mechanism of the deep self-attention network can better learn the time domain characteristics and the target interest characteristics in the airspace characteristics, the accuracy of demand forecasting is improved to a certain extent, and the problem of short-time shared bicycle demand forecasting is better solved.
Drawings
FIG. 1 is a flow chart of a method for forecasting demand for shared vehicles according to the present invention;
FIG. 2 is a schematic diagram of various network data flows;
FIG. 3 is a schematic diagram illustrating selection of loss values corresponding to different hyper-parameters from the deep attention network;
FIG. 4 is a schematic diagram of a shared bicycle demand prediction system according to the present invention;
FIG. 5 is a schematic diagram of a hardware structure of a possible electronic device provided in the present invention;
fig. 6 is a schematic diagram of a hardware structure of a possible computer-readable storage medium according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention. In addition, technical features of various embodiments or individual embodiments provided by the present invention may be arbitrarily combined with each other to form a feasible technical solution, and such combination is not limited by the sequence of steps and/or the structural composition mode, but must be realized by a person skilled in the art, and when the technical solution combination is contradictory or cannot be realized, such a technical solution combination should not be considered to exist and is not within the protection scope of the present invention.
Based on the problems in the background art, the invention firstly proposes the scene of introducing a depth self-attention network model into demand prediction and the like of a shared bicycle, provides a new breakthrough for the current situation of the field, and has important innovation. Meanwhile, the demand prediction of the shared bicycle is predicted by combining the deep self-attention network and the graph convolution neural network model, and experiments prove that the method has strong practical operability. Therefore, the method not only has innovation and breakthrough in theoretical significance, but also has important practical significance in more important fields related to shared single vehicle information, such as income operation of specific shared single vehicle enterprises, policies of related market capacity, and the like.
Fig. 1 is a flowchart of a method for predicting demand of a shared vehicle according to the present invention, and as shown in fig. 1, the method mainly includes:
s1, obtaining historical demand data of each shared bicycle station, splicing the historical demand data to obtain a historical demand characteristic matrix, and generating an adjacency matrix representing station adjacency relation according to historical order data.
It can be understood that historical demand data of all shared bicycle stations are obtained, and the historical demand characteristic matrix X is obtained after the historical demand data are spliced N*M Wherein N represents the station number, M represents the time step, namely the historical demand data is divided into time periods by the time step, and the historical demand data of each shared single-vehicle station is counted. And calculating the station of the initial position of each track according to the end position and the initial position of the order, and generating an adjacency matrix A representing the adjacency relation of the stations.
And S2, inputting the historical demand characteristic matrix and the adjacency matrix into a graph convolution neural network to obtain the shared bicycle demand space and topological information characteristics in each time period, and obtaining a characteristic matrix containing the demand information of the neighbor stations.
It will be appreciated that to better represent the historical demand data for each shared bicycle site and the adjacency between sites, it may be represented by a graph structure, one graph structure being defined as
Figure 346337DEST_PATH_IMAGE001
Wherein
Figure 340838DEST_PATH_IMAGE002
Representing a matrix of vertices of size N, each vertex representing a site,
Figure 950811DEST_PATH_IMAGE003
is a vector representation of each vertex representing the shared single-car demand for a single station.
Figure 714367DEST_PATH_IMAGE004
The method is characterized in that a set of edges is represented, the existence of the edges represents that a connection relationship exists between a station and orders of the station, and the values of the demand of the single cars have a mutual influence relationship.
Figure 17173DEST_PATH_IMAGE005
Representing an adjacency matrix, wherein the elements in the A matrix are only 0 and 1,1 representing the connection of edges existing between two sites, and the setting of specific values is manually set after resolving the adjacency relation of the global edges, wherein A ij Representing the connection relationship between vertex i and vertex j.
And the demand vector representation of each vertex of the feature matrix obtained after two times of graph convolution calculation contains the demand information of the adjacent matrix, so that the extraction of the demand space information is realized. Namely, after the graph convolution neural network is used, the space and topological information characteristics of the shared bicycle demand in each time period can be obtained, and a characteristic matrix containing the demand information of the neighbor stations is obtained.
And S3, inputting the characteristic matrix containing the demand information of the neighbor stations into a depth self-attention network, and extracting a shared single-vehicle demand time domain information matrix through multi-head attention mechanism calculation and a feedforward neural network.
As an embodiment, the deep self-attention network includes a plurality of coding layers, each coding layer includes a multi-head attention mechanism layer and a feedforward neural network layer, the plurality of coding layers are connected in series, the feature matrix including the demand information of the neighbor stations is input into the deep self-attention network, and a shared bicycle demand time domain information matrix is extracted through multi-head attention mechanism calculation and the feedforward neural network, including: dividing the feature matrix containing the demand information of the neighbor stations into shared single-vehicle demand vectors of all stations according to time step length, wherein each shared single-vehicle demand vector of each station represents the demand of each station shared single vehicle in a corresponding time period, and the length of each shared single-vehicle demand vector is the number of stations; inputting the shared bicycle demand vector of each station into a plurality of coding layers which are connected in series, and carrying out multi-head attention operation through a multi-head attention mechanism layer in each coding layer to obtain a corresponding operation result; and calculating to obtain a shared bicycle demand time domain information matrix through the feedforward neural network layer based on the calculation results of the multiple multi-head attention mechanism layers.
It can be understood that, referring to fig. 2, the depth self-attention network includes a plurality of coding layers, each coding layer includes a multi-head attention mechanism layer and a feedforward neural network layer, each multi-head attention mechanism layer includes a plurality of head attention mechanisms, after inputting the feature matrix including the demand information of the neighboring stations into the transform coding layer of the depth self-attention network, the feature matrix is divided into the demand vectors of the stations according to time step length, and the length of the vector is the number of the stations to be predicted. Taking the vectors as Q, K and V in a transform coding layer at the same time to carry out multi-head attention calculation:
Figure 498970DEST_PATH_IMAGE006
q, K and V respectively represent a query, a key and a value in the attention mechanism, wherein the weight of the V value is calculated by querying Q and the key K, and after the weight is calculated, the weighted sum of the V value is calculated. It should be noted that, for each coding layer, the values of Q, K, and V are the same, and for different coding layers, the values of Q, K, and V are different, and the specific calculation of the attention mechanism is shown in the following formula:
Figure 647054DEST_PATH_IMAGE007
wherein the content of the first and second substances,
Figure 61855DEST_PATH_IMAGE008
representing the dimensions of the key, in the multi-head attention mechanism, the head of the ith head attention mechanism is calculated as follows:
Figure 801141DEST_PATH_IMAGE009
in the formula (I), the compound is shown in the specification,
Figure 504655DEST_PATH_IMAGE010
Figure 722009DEST_PATH_IMAGE011
and
Figure 259826DEST_PATH_IMAGE012
respectively, the linear changes of Q, K, V in the head of the ith head attention mechanism. The operation process of the multi-head attention mechanism is as follows: the attention calculation results of each head are connected in parallel, the calculated output is consistent with the dimensionality of the Q, K and V of the original input through projection with the linear layer, and the attention calculation of the Q, K and V can be carried out in different projection modes through a multi-head attention mechanism. In the calculation of the specific formula, if the number of heads in the attention mechanism is represented by n, W 0 Representing the weight of the projected linear layer. In a specific formula calculation, if n is used to represent the number of heads in a multi-head attention mechanism, the multi-head attention can be represented as shown in the following formula:
Figure 638854DEST_PATH_IMAGE013
through multi-head attention calculation, vectors which have large influence on the demand in the input time step are subjected to large weighted calculation, and then the demand can be predicted in the time dimension. After passing through a multi-head attention mechanism layer, outputting a demand characteristic matrix, and entering a Transformer feedforward neural network for nonlinear transformation to obtain a final characteristic matrix.
Wherein, the formula of the feedforward neural network in the transform coding layer can be defined as:
Figure 829664DEST_PATH_IMAGE014
wherein, W 1 ,W 2 And b 1 ,b 2 Respectively the weight and the bias of two linear layers in the feedforward neural network.
In the present invention, an Exponential Linear Unit activation function (ELU) is used as the activation function of the feedforward neural network. The ELU activation function is defined in the following way:
Figure 585131DEST_PATH_IMAGE015
where a is an adjustable constant, the ELU activation function-based feed-forward neural network can be expressed as:
Figure 974524DEST_PATH_IMAGE016
as an embodiment, the parameters of the depth self-attention network include a time slot length, a number of heads in a multi-head attention mechanism, and a batch processing data amount, wherein the number of heads in each head attention mechanism layer is the same; and for a plurality of parameters in the deep self-attention network, changing one parameter and keeping the other parameters unchanged, so that the parameter with the minimum loss function loss is an optimal parameter, and acquiring a plurality of optimal parameters of the deep self-attention network.
It is understood that the hyper-parameters specifically referred to by the deep self-attention network in the present invention include the time slot length, the number of heads in a multi-head attention mechanism, and the amount of data processed in a batch. In a particular experiment, the time slot length was set from 5 to 15, and the range of data volume for batch processing included (4, 8, 12, 16, 20, 24, 28, 32).
The number of heads of each multi-head attention mechanism in the depth self-attention network layer is the same, and the specific range setting is from 2 to 10. In the specific adjustment process of the hyper-parameter, the rule of the control variable method is used, only the parameter value to be adjusted in the experiment of the current round is changed, and other variables except the variable are kept unchanged.
Specifically, in the process of adjusting the hyper-parameters, a value is randomly selected from the range values of each parameter to be adjusted as an initialized parameter, and the adjustment of the data volume of batch processing is started from the second experiment, and meanwhile, the values of other hyper-parameters are kept unchanged. By such a method, the invention can determine the corresponding loss function value
Figure 790033DEST_PATH_IMAGE017
The value of the hyperparameter of the data amount of the batch processing at the minimum is set as the optimum value of the hyperparameter. At the same time, this value will be fixed during subsequent experiments and will not be adjusted. By analogy, the control variable adjusting method with the same quantity of batch processing is used, and the super parameters such as the time slot length, the quantity of heads in each multi-head attention mechanism and the like are continuously adjusted in sequence in the experiment. After the specific adjustment of the hyper-parameter values is completed, the combination of the values of each optimal hyper-parameter is the value of the optimal hyper-parameter of the deep self-attention network.
In the present invention, referring to fig. 3, the corresponding losses of various hyper-parameters of the deep self-attention network at different values are shown, and MAE and RMSE are respectively used as loss functions, wherein, in order to make the significant effect of the RMSE and MAE with the hyper-parameter tuning result, the values of RMSE and MAE in fig. 3 are the result of multiplying the values of RMSE and MAE by 100 in the experimental result. From fig. 3, the query Q, key K, and V values in the model for predicting the shared bicycle demand based on the combination of the deep self-attention network transducer coding layer and the graph convolution neural network GCN are set to 12, the number of heads in the multi-head attention mechanism is set to 4, the time slot length is set to 12, and the data amount per batch in the batch processing is set to 4.
And S4, inputting the shared bicycle demand time domain information matrix into a convolutional neural network, performing dimension increasing on the shared bicycle demand time domain information matrix, connecting the dimension-increased shared bicycle demand time domain information matrix with the historical demand characteristic matrix through a residual error structure, and outputting a demand predicted value of each shared bicycle station in the next time period through a full connection layer.
It can be understood that the feature matrix output by the transform coding layer is used as the input of a 1 × 1 convolutional neural network, the dimension of the feature matrix is increased, the input channel of the convolutional layer is 1, and the output channel is 8, so that aggregation of depth time-space domain features is realized, the feature matrix after dimension increase is connected with the original feature matrix through a residual structure, the situation that the gradient disappears in the previous learning process is prevented, and finally, a full connection layer is connected to project the tensor into a predicted value, namely, the predicted value Yt of the single vehicle demand of each station in the next time period.
Referring to fig. 2, for the data processing flow chart of each network, the bicycle history demand matrix of each station and the adjacency matrix between stations are input into the graph convolution neural network, and the feature matrix containing the demand information of the neighboring stations is output. And then inputting the characteristic matrix containing the demand information of the neighbor stations into a deep self-attention network, wherein the deep self-attention network comprises a multi-head attention mechanism layer and a feedforward neural network layer, and extracting a shared bicycle demand time domain information matrix through multi-head attention calculation and the feedforward neural network. Inputting the shared single vehicle demand time domain information matrix into two 1 x 1 convolutional neural networks, performing dimension increasing on the shared single vehicle demand time domain information matrix, connecting the dimension increased shared single vehicle demand time domain information matrix with the historical demand characteristic matrix through a residual error structure, and outputting a demand predicted value of each shared single vehicle station in the next time period through a full connection layer.
The shared bicycle demand forecasting method based on the GCN-Transformer combined model is operated by using a python-based deep learning framework PyTorch. The data set source is travel order data of single vehicles from Ha, city of Fujian province, and the data volume is 9336117 in total, wherein the track situation of 310867 single vehicles is total. In the experimental comparison between the baseline model and the model provided by the invention, the station demand after 15 minutes, 30 minutes, 45 minutes and 60 minutes is predicted, and the results of the comparative experiments of the nine baseline models of SVR, XGBoost, LSTM, CNN-1d, CNN-2d, resNet, GCN _ LSTM, tansformer and the shared single-vehicle demand prediction method based on the GCN-Transformer combined model provided by the invention are shown in tables 1 and 2.
TABLE 1
Figure 733718DEST_PATH_IMAGE018
TABLE 2
Figure 558455DEST_PATH_IMAGE019
As can be seen from tables 1 and 2, the loss is minimized by predicting the vehicle demand at each station using various models, and table 1 using MAE as the loss evaluation. Similarly, table 2 uses RMSE as the loss evaluation, and it can be seen that the loss is the smallest when the vehicle demand at each station is predicted based on the GCN _ fransformer model. Therefore, as can be seen from tables 1 and 2, the GCN _ fransformer model predicts the individual vehicle demand of each station with higher accuracy.
Referring to fig. 4, the shared bicycle demand prediction system provided by the present invention includes a first obtaining module 401, a second obtaining module 402, an extracting module 403, and a prediction output module 404, where:
the first obtaining module 401 is configured to obtain historical demand data of each shared bicycle station, splice the historical demand data to obtain a historical demand characteristic matrix, and obtain a generated adjacency matrix representing station adjacency according to historical order data;
a second obtaining module 402, configured to input the historical demand characteristic matrix and the adjacency matrix into a graph convolutional neural network, so as to obtain a space of the shared bicycle demand and a topological information characteristic in each time period, and obtain a characteristic matrix including demand information of a neighboring station;
an extraction module 403, configured to input the feature matrix including the demand information of the neighboring station into a deep self-attention network, and extract a time domain information matrix of the shared bicycle demand through multi-head attention calculation and a feed-forward neural network;
and the prediction output module 404 is configured to input the shared bicycle demand time domain information matrix into a convolutional neural network, upgrade the shared bicycle demand time domain information matrix, connect the upgraded shared bicycle demand time domain information matrix with the historical demand characteristic matrix through a residual structure, and output a demand prediction value of each shared bicycle station in the next time period through a full connection layer.
It can be understood that the system for predicting the demand of the shared bicycle provided by the present invention corresponds to the method for predicting the demand of the shared bicycle provided in the foregoing embodiments, and the relevant technical features of the system for predicting the demand of the shared bicycle may refer to the relevant technical features of the method for predicting the demand of the shared bicycle, which are not described herein again.
Referring to fig. 5, fig. 5 is a schematic view of an embodiment of an electronic device according to an embodiment of the invention. As shown in fig. 5, an embodiment of the present invention provides an electronic device 500, which includes a memory 510, a processor 520, and a computer program 511 stored in the memory 510 and executable on the processor 520, wherein the processor 520 implements the steps of the shared bicycle demand prediction method when executing the computer program 511.
Referring to fig. 6, fig. 6 is a schematic diagram of an embodiment of a computer-readable storage medium according to the present invention. As shown in fig. 6, the present embodiment provides a computer-readable storage medium 600 having a computer program 611 stored thereon, the computer program 611, when executed by a processor, implementing the steps of the shared-bicycle demand prediction method.
According to the method and the system for forecasting the shared bicycle demand, the original multi-head attention mechanism of the deep self-attention network can better learn the time domain characteristics and the target interest characteristics in the space domain characteristics, the accuracy of demand forecasting is improved to a certain extent, and the problem of forecasting the short-time shared bicycle demand is better solved.
It should be noted that, in the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to relevant descriptions of other embodiments for parts that are not described in detail in a certain embodiment.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A shared bicycle demand prediction method is characterized by comprising the following steps:
acquiring historical demand data of each shared bicycle station, splicing the historical demand data to obtain a historical demand characteristic matrix, and generating an adjacency matrix representing station adjacency relation according to historical order data;
inputting the historical demand characteristic matrix and the adjacency matrix into a graph convolution neural network to obtain the shared bicycle demand space and topological information characteristics in each time period and obtain a characteristic matrix containing neighbor station demand information;
inputting the characteristic matrix containing the neighbor station demand information into a depth self-attention network, and extracting a shared bicycle demand time domain information matrix through multi-head attention mechanism calculation and a feedforward neural network;
inputting the shared bicycle demand time domain information matrix into a convolutional neural network, performing dimensionality increase on the shared bicycle demand time domain information matrix, connecting the dimensionality increased shared bicycle demand time domain information matrix with the historical demand characteristic matrix through a residual error structure, and outputting a demand predicted value of each shared bicycle station in the next time period through a full connection layer.
2. The shared bicycle demand prediction method of claim 1, wherein the historical demand characteristic matrix is represented as X N*M Wherein N represents the number of the shared bicycle stations, M represents a time step, and the time period is divided according to the time step;
generating an adjacency matrix representing site adjacency relation according to historical order data, wherein the adjacency matrix comprises the following steps:
and calculating the site where the initial position of each track is located according to the end position and the initial position in each piece of historical order data, and generating an adjacency matrix A representing the site adjacency relation.
3. The method according to claim 1, wherein the deep self-attention network comprises a plurality of coding layers, each coding layer comprises a multi-head attention mechanism layer and a feedforward neural network layer, the plurality of coding layers are connected in series, the feature matrix containing the demand information of the neighbor stations is input into the deep self-attention network, and the multi-head attention mechanism calculation and feedforward neural network are used for extracting a time domain information matrix of the demand of the shared bicycle, and the method comprises the following steps:
dividing the feature matrix containing the demand information of the neighbor stations into shared single-vehicle demand vectors of all stations according to time step length, wherein each shared single-vehicle demand vector of each station represents the demand of each station shared single vehicle in a corresponding time period, and the length of each shared single-vehicle demand vector is the number of stations;
inputting the sharing bicycle demand vector of each station into a plurality of coding layers which are connected in series, and carrying out multi-head attention operation through a multi-head attention mechanism layer in each coding layer to obtain a corresponding operation result;
and calculating to obtain a shared bicycle demand time domain information matrix through the feedforward neural network layer based on the calculation results of the multiple multi-head attention mechanism layers.
4. The method according to claim 3, wherein the obtaining of the corresponding operation result by performing the multi-head attention operation through the multi-head attention mechanism layer in each coding layer comprises:
Figure 898998DEST_PATH_IMAGE001
q, K and V respectively represent query, key and value in the multi-head attention mechanism layer, wherein the weight of the value V is calculated by querying Q and key K, and after the weight of Q and key V is calculated, the weighted sum of the value V is calculated;
Figure 707817DEST_PATH_IMAGE002
wherein the content of the first and second substances,
Figure 690816DEST_PATH_IMAGE003
a dimension representing a key;
in the multi-head attention mechanism, the head of the ith attention mechanism layer is calculated as follows:
Figure 289288DEST_PATH_IMAGE004
wherein, the first and the second end of the pipe are connected with each other,
Figure 821769DEST_PATH_IMAGE005
Figure 113073DEST_PATH_IMAGE006
and
Figure 583369DEST_PATH_IMAGE007
respectively representing the linear changes of Q, K and V in the head of the ith attention mechanism layer;
the output of the multi-head attention mechanism layer is as follows:
Figure 251111DEST_PATH_IMAGE008
wherein, W 0 Representing the weight of the projected linear layer.
5. The method for predicting the demand of the shared bicycle according to claim 4, wherein the obtaining of the time domain information matrix of the demand of the shared bicycle through the calculation of the feedforward neural network layer based on the calculation results of the calculation of the plurality of multi-head attention mechanism layers comprises:
and taking the output of the multi-head attention mechanism layer as the input of the feedforward neural network layer to obtain a shared single-vehicle demand characteristic matrix of each station after nonlinear transformation in different time periods.
6. The method of predicting demand for shared bicycles of claim 1, wherein the formula of the feedforward neural network layer is expressed as:
Figure 876914DEST_PATH_IMAGE009
the ELU activation function is defined in the following mode:
Figure 73540DEST_PATH_IMAGE010
wherein, W 1 ,W 2 And b 1 ,b 2 Respectively, the weight and the offset of two linear layers in the feedforward neural network, and a is an adjustable constant.
7. The method of claim 1, wherein the parameters of the deep self-attention network include a time slot length, a number of heads in a head attention mechanism, and an amount of data for batch processing, wherein the number of heads in each head attention mechanism layer is the same;
and for a plurality of parameters in the deep self-attention network, changing one parameter and keeping the other parameters unchanged, so that the parameter with the minimum loss function loss is an optimal parameter, and acquiring a plurality of optimal parameters of the deep self-attention network.
8. The method of claim 7, wherein the time slot length is 12, the number of heads in the head attention mechanism is 4, and the volume of data processed in a batch is 4.
9. A shared-bicycle demand prediction system, comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring historical demand data of each shared bicycle station, splicing the historical demand data to obtain a historical demand characteristic matrix, and acquiring a generated adjacency matrix representing station adjacency relation according to historical order data;
the second acquisition module is used for inputting the historical demand characteristic matrix and the adjacency matrix into a graph convolution neural network so as to acquire the shared bicycle demand space and topological information characteristics in each time period and obtain a characteristic matrix containing the demand information of the neighbor stations;
the extraction module is used for inputting the characteristic matrix containing the neighbor station demand information into a depth self-attention network and extracting a shared bicycle demand time domain information matrix through multi-head attention mechanism calculation and a feedforward neural network;
and the prediction output module is used for inputting the shared bicycle demand time domain information matrix into a convolutional neural network, performing dimensionality increase on the shared bicycle demand time domain information matrix, connecting the dimensionality increased shared bicycle demand time domain information matrix with the historical demand characteristic matrix through a residual error structure, and outputting a demand predicted value of each shared bicycle station in the next time period through a full connection layer.
10. A computer-readable storage medium, having stored thereon, a computer management-like program that, when executed by a processor, performs the steps of the shared bicycle demand prediction method of any one of claims 1-8.
CN202211191739.6A 2022-09-28 2022-09-28 Method and system for predicting demand of shared bicycle Active CN115271833B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211191739.6A CN115271833B (en) 2022-09-28 2022-09-28 Method and system for predicting demand of shared bicycle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211191739.6A CN115271833B (en) 2022-09-28 2022-09-28 Method and system for predicting demand of shared bicycle

Publications (2)

Publication Number Publication Date
CN115271833A true CN115271833A (en) 2022-11-01
CN115271833B CN115271833B (en) 2023-08-25

Family

ID=83756068

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211191739.6A Active CN115271833B (en) 2022-09-28 2022-09-28 Method and system for predicting demand of shared bicycle

Country Status (1)

Country Link
CN (1) CN115271833B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116629464A (en) * 2023-07-25 2023-08-22 阿里健康科技(中国)有限公司 Method, device, equipment and medium for generating flow chart data of goods
CN117635216A (en) * 2023-12-22 2024-03-01 华南理工大学 Shared bicycle demand prediction method based on improved GCN (generalized communication network)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111161535A (en) * 2019-12-23 2020-05-15 山东大学 Attention mechanism-based graph neural network traffic flow prediction method and system
US20210064999A1 (en) * 2019-08-29 2021-03-04 Nec Laboratories America, Inc. Multi-scale multi-granularity spatial-temporal traffic volume prediction
CN112990594A (en) * 2021-03-30 2021-06-18 上海海事大学 Traffic flow prediction model and method based on multi-head self-attention mechanism
CN113344240A (en) * 2021-04-26 2021-09-03 山东师范大学 Shared bicycle flow prediction method and system
CN113852492A (en) * 2021-09-01 2021-12-28 南京信息工程大学 Network flow prediction method based on attention mechanism and graph convolution neural network
CN114169632A (en) * 2021-12-15 2022-03-11 中国科学院深圳先进技术研究院 Passenger flow distribution prediction method and device based on multi-view passenger flow change trend modeling
CN114330868A (en) * 2021-12-27 2022-04-12 西北工业大学 Passenger flow prediction method based on self-attention personalized enhanced graph convolution network
CN115081717A (en) * 2022-06-27 2022-09-20 北京建筑大学 Rail transit passenger flow prediction method integrating attention mechanism and graph neural network

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210064999A1 (en) * 2019-08-29 2021-03-04 Nec Laboratories America, Inc. Multi-scale multi-granularity spatial-temporal traffic volume prediction
CN111161535A (en) * 2019-12-23 2020-05-15 山东大学 Attention mechanism-based graph neural network traffic flow prediction method and system
CN112990594A (en) * 2021-03-30 2021-06-18 上海海事大学 Traffic flow prediction model and method based on multi-head self-attention mechanism
CN113344240A (en) * 2021-04-26 2021-09-03 山东师范大学 Shared bicycle flow prediction method and system
CN113852492A (en) * 2021-09-01 2021-12-28 南京信息工程大学 Network flow prediction method based on attention mechanism and graph convolution neural network
CN114169632A (en) * 2021-12-15 2022-03-11 中国科学院深圳先进技术研究院 Passenger flow distribution prediction method and device based on multi-view passenger flow change trend modeling
CN114330868A (en) * 2021-12-27 2022-04-12 西北工业大学 Passenger flow prediction method based on self-attention personalized enhanced graph convolution network
CN115081717A (en) * 2022-06-27 2022-09-20 北京建筑大学 Rail transit passenger flow prediction method integrating attention mechanism and graph neural network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
许淼: "基于AM-LSTM模型的共享单车时空需求预测", 《湖南大学学报(自然科学版)》, vol. 47, no. 12 *
郭佳;余永斌;杨晨阳;: "基于全注意力机制的多步网络流量预测", 信号处理, no. 05 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116629464A (en) * 2023-07-25 2023-08-22 阿里健康科技(中国)有限公司 Method, device, equipment and medium for generating flow chart data of goods
CN116629464B (en) * 2023-07-25 2023-09-29 阿里健康科技(中国)有限公司 Method, device, equipment and medium for generating flow chart data of goods
CN117635216A (en) * 2023-12-22 2024-03-01 华南理工大学 Shared bicycle demand prediction method based on improved GCN (generalized communication network)
CN117635216B (en) * 2023-12-22 2024-04-30 华南理工大学 Shared bicycle demand prediction method based on improved GCN (generalized communication network)

Also Published As

Publication number Publication date
CN115271833B (en) 2023-08-25

Similar Documents

Publication Publication Date Title
CN115271833A (en) Shared bicycle demand prediction method and prediction system
US8909575B2 (en) Method and apparatus for modeling neural resource based synaptic placticity
EP3574453A1 (en) Optimizing neural network architectures
CN107545301B (en) Page display method and device
Yu et al. The combinatorial brain surgeon: pruning weights that cancel one another in neural networks
CN114331542A (en) Method and device for predicting charging demand of electric vehicle
CN111310828B (en) Target detection model fine-tuning method and device for ADAS scene
CN111046188A (en) User preference degree determining method and device, electronic equipment and readable storage medium
WO2022116862A1 (en) Information pushing method and system, model training method, and related devices
Mu et al. Triple-level model inferred collaborative network architecture for video deraining
Laaroussi et al. Deep learning framework for forecasting tourism demand
Wang et al. Transworldng: Traffic simulation via foundation model
CN115392548A (en) Travel demand prediction method, device and storage medium for travel site
CN115867919A (en) Graph structure aware incremental learning for recommendation systems
Hou et al. A deep reinforcement learning real-time recommendation model based on long and short-term preference
CN116502774B (en) Time sequence prediction method based on time sequence decomposition and Legend projection
CN112165402A (en) Method and device for predicting network security situation
CN109461012A (en) A kind of Products Show method, apparatus and terminal
CN112541556A (en) Model construction optimization method, device, medium, and computer program product
Maskooki et al. A bi-criteria moving-target travelling salesman problem under uncertainty
CN116976393A (en) Neural network forecasting method for navigation satellite clock error data
CN116795720A (en) Unmanned driving system credibility evaluation method and device based on scene
JP7306432B2 (en) Information processing method, information processing device and program
Lupo Pasini et al. Fast and accurate predictions of total energy for solid solution alloys with graph convolutional neural networks
Ban et al. Application of extreme learning machine on large scale traffic congestion prediction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant