Training method, system and device for predicting demand for shared bicycles
By using the combination of LSTM and GCN models, considering the impact of traffic on the demand for shared bicycles and updating the model parameters, the problem of low prediction accuracy in the existing technology is solved, and more accurate demand prediction is achieved.
Patent Information
- Application Number
- CN202210402008.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-18
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-04-18
Smart Images

Figure CN114757418B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a training method, system, and device for a shared bicycle demand prediction model. Background Technology
[0002] In today's society, people have various modes of transportation, and most advocate for low-carbon travel. Therefore, many people choose shared bicycles for the "last mile" or "last two kilometers." Thus, how to correctly deploy an appropriate number of shared bicycles in different parts of the city is a problem that must be solved. Existing technologies often use bicycle prediction systems that analyze historical bicycle usage records and station distribution information to analyze factors affecting bicycle demand, thereby constructing a demand prediction model to forecast the demand for shared bicycles. While these models can predict the demand for shared bicycles, they only consider historical usage records and station distribution information. In reality, the amount of traffic in a region often has a significant impact on the demand for shared bicycles in the vicinity. Traditional models neglect the need to consider the traffic flow at the current station, resulting in low prediction accuracy. Summary of the Invention
[0003] The purpose of this invention is to provide a training method, system, and device for a shared bicycle demand prediction model. The model is trained based on the traffic conditions within a region, so that the trained demand model can accurately predict the demand for shared bicycles in the current region, ensuring that there is neither an oversupply nor a shortage of bicycles in each region.
[0004] To achieve the above objectives, embodiments of the present invention provide a method for constructing a predictive model for the demand of shared bicycles, comprising:
[0005] At preset time intervals, the traffic flow data of a preset area is collected in advance and input into the first model so that the first model outputs traffic flow prediction results;
[0006] At preset time intervals, the shared bicycle usage records of the preset areas collected in advance are input into the second model so that the second model can output the preliminary prediction results of the demand for shared bicycles.
[0007] The traffic flow prediction results and the preliminary prediction results of shared bicycle demand are sent to the shared bicycle demand prediction model so that the shared bicycle demand prediction model establishes a relationship between the traffic flow parameters and the bicycle demand parameters and outputs a first update parameter and a second update parameter; wherein, the first update parameter is used to update the parameters of the first model, and the second update parameter is used to update the parameters of the second model.
[0008] Output the trained shared bicycle demand prediction model.
[0009] As an improvement to the above scheme, the first model is an LSTM model, the first model is stored on a first server, and the first update parameter is the parameter in the gating of each cell in the LSTM.
[0010] As an improvement to the above scheme, the second model is a GCN model, which is stored on a second server, and the update parameters are the parameters of each element of the convolutional layer in the GCN.
[0011] As an improvement to the above solution, the shared bicycle demand prediction model includes an LSTM model and a GCN model mounted on the Pysyft framework, and the shared bicycle demand prediction model is stored on a third server.
[0012] As an improvement to the above scheme, the GCN model has several topologies of highway networks corresponding to different regions. The topology includes several nodes and connecting lines connecting the nodes. Each node represents a highway, and the connecting lines between the nodes indicate that two highways intersect.
[0013] To achieve the above objectives, embodiments of the present invention also provide a training system for a shared bicycle demand prediction model, comprising:
[0014] The traffic flow prediction result generation module is used to input the traffic flow of a preset area collected in advance into the first model at preset time intervals, so that the first model outputs the traffic flow prediction result;
[0015] The demand preliminary forecast result generation module is used to input the shared bicycle usage records of the preset area collected in advance into the second model at preset time intervals, so that the second model outputs the preliminary forecast result of the demand for shared bicycles.
[0016] The parameter generation module is used to send the traffic flow prediction result and the preliminary prediction result of shared bicycle demand to the shared bicycle demand prediction model, so that the shared bicycle demand prediction model can establish a relationship between the traffic flow parameter and the bicycle demand parameter and output a first update parameter and a second update parameter; wherein, the first update parameter is used to update the parameters of the first model, and the second update parameter is used to update the parameters of the second model.
[0017] The prediction model output module is used to output the trained prediction model for the demand of shared bicycles.
[0018] As an improvement to the above scheme, the first model is an LSTM model, which is stored on a first server, and the first update parameter is the parameter in the gating of each cell in the LSTM; the second model is a GCN model, which is stored on a second server, and the update parameter is the parameter of each element of the convolutional layer in the GCN.
[0019] As an improvement to the above solution, the shared bicycle demand prediction model includes an LSTM model and a GCN model mounted on the Pysyft framework, and the shared bicycle demand prediction model is stored on a third server.
[0020] As an improvement to the above scheme, the GCN model has several topologies of highway networks corresponding to different regions. The topology includes several nodes and connecting lines connecting the nodes. Each node represents a highway, and the connecting lines between the nodes indicate that two highways intersect.
[0021] To achieve the above objectives, embodiments of the present invention also provide a training device for a shared bicycle demand prediction model, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the training method for the shared bicycle demand prediction model as described in any of the above embodiments.
[0022] Compared to existing technologies, the training method, system, and device for a shared bicycle demand prediction model disclosed in this invention predicts traffic flow and shared bicycle demand using separate models. The prediction results are then uniformly input into the shared bicycle demand prediction model. This allows the model to establish a relationship between traffic flow and bicycle demand parameters, outputting updated parameters resulting from their mutual influence. Finally, these updated parameters are used to update the parameters of the two separate models, resulting in a more accurate fit to the actual situation. This invention trains the shared bicycle demand prediction model based on regional traffic conditions, ensuring that the trained model accurately predicts the current demand for shared bicycles in the region, preventing both oversupply and undersupply in each area. Attached Figure Description
[0023] Figure 1 This is a flowchart of a training method for a shared bicycle demand prediction model provided in an embodiment of the present invention;
[0024] Figure 2 This is a topology diagram of a highway network provided in an embodiment of the present invention;
[0025] Figure 3This is a structural block diagram of a training system for a shared bicycle demand prediction model provided in an embodiment of the present invention;
[0026] Figure 4 This is a structural block diagram of a training device for a shared bicycle demand prediction model provided in an embodiment of the present invention. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] See Figure 1 , Figure 1 This is a flowchart illustrating a training method for a shared bicycle demand prediction model provided in an embodiment of the present invention. The training method for the shared bicycle demand prediction model includes:
[0029] S1. At preset time intervals, the traffic flow data of the preset area collected in advance is input into the first model so that the first model outputs the traffic flow prediction result;
[0030] S2. At preset time intervals, the pre-collected shared bicycle usage records of the preset area are input into the second model so that the second model outputs the preliminary prediction result of the demand for shared bicycles.
[0031] S3. Send the traffic flow prediction result and the preliminary prediction result of shared bicycle demand to the shared bicycle demand prediction model, so that the shared bicycle demand prediction model establishes a relationship between the traffic flow parameter and the bicycle demand parameter and outputs a first update parameter and a second update parameter; wherein, the first update parameter is used to update the parameters of the first model, and the second update parameter is used to update the parameters of the second model.
[0032] S4. Output the trained shared bicycle demand prediction model.
[0033] Specifically, in step S1, the first model is an LSTM model, and the first model is stored on the first server. The preset time period can be 12 hours, and the preset area can be divided according to a location with relatively concentrated pedestrian traffic, such as a 100-meter radius around a subway station. The traffic flow data for the preset time period can be obtained in advance through the vehicle network.
[0034] For example, a city's transportation department possesses a massive dataset recording traffic conditions over the past few days, making it crucial to uncover the hidden temporal characteristics within these time series. An LSTM model (a machine learning method with powerful temporal processing capabilities) is used to explore the temporal correlations hidden in historical data. Specifically, at each time step, the model uses various gates to filter and retain important information from the previous time step.
[0035] The most significant characteristic of the LSTM model is that each cell in the LSTM represents a time step. When a cell receives input from a time step, it not only incorporates the current time characteristics but also analyzes which information from past historical cells should be retained. For example, using 12 hours of historical data to predict traffic conditions for the next hour, the LSTM in this embodiment is set to 12 cells. The LSTM identifies potential patterns and passes them through the gates in the cells, while features without time relevance are discarded in the forget gate. The operation of the various gates in the LSTM, as well as the direction and generation of data, can be clearly represented by the following nonlinear function, as shown in the following formula:
[0036] i t =σ(W xi X i t +W hi h t-1 +W ci c t-1 +b i (1);
[0037] f t =σ(W xf X i t +W hf h t-1 +W cf c t-1 +b f (2);
[0038] c t =f t c t-1 +i t tanh(W xc X i t +W hc h t-1 +b c (3);
[0039] ot =σ(W xo X i t +W ho h t-1 +W co c t-1 +b o (4);
[0040] h t =o t ·tanh(c t (5);
[0041] Among them, W xi W refers to the weight of the input data at time point t in the input gate. hi W refers to the weight W of the hidden state at time t in the input gate. ci W refers to the weight of the cell state at time t in the input gate. xf W refers to the weight of the input data at time point t in the forget gate. hf W refers to the weight of the hidden state at time t in the forget gate. cf W refers to the weight of the cell state at time t in the forget gate. xc W refers to the weight of the input data at time point t in the cell update gate. hc W refers to the weight of the hidden state at time t in the cell update gate. xo W refers to the weight of the input data at time point t in the output gate. ho W refers to the weight of the hidden state at time t in the output gate. co This refers to the weight of the cell state at time point t in the output gate, i t This refers to the update result of the input gate, f t This refers to the update result of the forget gate, c t This refers to the update result of the cell state, o t This refers to the update result of the output gate, h. t This refers to the update result of the hidden state, X i t This refers to the traffic flow value of region i at time point t, b i b f b c b o These correspond to the update parameter offsets of the input gate, forget gate, cell update gate, and output gate in a cell, respectively.
[0042] It's worth noting that gates f and i determine how information is transmitted in the LSTM, and which information should be retained and which should be discarded. Therefore, each cell in the LSTM not only receives the input of the current time slice, but also absorbs the temporal hiding properties that have already been learned.
[0043] Specifically, in step S2, the second model is a GCN model, and the second model is stored on a second server. The shared bicycle usage records for the preset time period can be obtained through the shared bicycle usage software. These usage records are based on the user unlocking the bicycle, and each unlock increments the record by 1.
[0044] For example, GCN is a graph convolutional network. A city department responsible for shared bicycles works based on a demand dataset to efficiently dispatch shared bicycles. Each shared bicycle station is highly connected to its surrounding area, so the GCN model is used to understand how many connections a region has with its neighbors. Unlike traditional convolutional operations, graph convolutions do not mechanically learn features from all neighboring regions. Doing so might cause the model to indiscriminately consider features with potentially weak connections, thus impacting performance. Therefore, GCN benefits from the adjacency matrix of the graph structure, which reflects the true spatial connections. GCN only performs convolution operations on regions with spatial connectivity to uncover these connections. The specific formula is as follows:
[0045] Rt = W t ·A t ·X t (6);
[0046] Among them, W t A is the weight parameter at time point t. t X is the adjacency matrix parameter at time t. t It is the input feature at time point t.
[0047] Optionally, the GCN model constructs several topologies of highway networks corresponding to different regions. The topology includes several nodes and connecting lines connecting the nodes; wherein each node represents a highway, and the connecting lines between the nodes indicate that two highways intersect.
[0048] For example, unlike traditional convolutional neural networks, graph convolutional neural networks are designed as an undirected graph g = (V, A), where V represents the set of all nodes, and A is the adjacency matrix representing the relationships between nodes. The adjacency matrix A is constructed based on the location field in the dataset; elements in A are either 1 or 0, with 1 indicating that the corresponding row and column nodes are connected. For instance, a cycling record might contain the starting and ending intersections of the route, as well as the road segment connected to the next intersection. From this information, it can be assumed that the route in the record is connected to the road segment connected to the next intersection, so the corresponding element in the adjacency matrix should be set to 1. The topology diagram of the aforementioned road network can be found in [reference needed]. Figure 2 , Figure 2 R1 to R7 in the diagram represent nodes, and there are connecting lines between the nodes.
[0049] Specifically, in step S3, the shared bicycle demand prediction model includes an LSTM model and a GCN model built on the Pysyft framework, and the shared bicycle demand prediction model is stored on a third server. The first update parameter is the parameter in the gating of each cell in the LSTM. The update parameter is the parameter of each element in the convolutional layer of the GCN.
[0050] For example, the shared bicycle demand prediction model needs to link traffic conditions with bicycle demand. It requires a combination of two models (LSTM+GCN) to predict traffic flow and bicycle demand separately, and then updates the parameters based on data errors in the federated server. Specifically, it first learns from traffic flow data, and then learns from the bicycle dataset while keeping the traffic flow dataset confidential or unloaded. The reason the shared bicycle demand prediction model needs to send the updated parameters back to the first and second servers after updating them is that the updated parameters are generated by the interaction between GCN and LSTM, and the model composed of these parameters will better fit the actual situation.
[0051] For example, to ensure the secure training of datasets involved in all experiments, datasets from different departments are protected. The shared bicycle demand prediction model uses a federated learning framework. Its core is that the server can receive updated parameters from independent model servers in real time. The final parameters are then used by the federated server to update the learning parameters to a better set. Federated learning has many implementations, among which Pysyft can effectively handle various processes.
[0052] For example, each dataset is trained on its own server (assuming the server can handle the entire training process). The primary goal of federated learning is to store datasets from different departments separately to prevent them from being leaked to different departments. The three servers correspond to the traffic flow server, the vehicle demand server, and the server for jointly training the model, respectively. Secondly, the first server (traffic flow server) and the second server (vehicle demand server) send the parameters obtained from each training cycle to the third server. A training cycle refers to one epoch in machine learning. Finally, the third server updates the two different parameters to obtain new parameters. This update involves a trade-off between the correlation between the two datasets, and the parameters are ultimately sent back to the corresponding first and second servers.
[0053] Compared to existing technologies, the training method for the shared bicycle demand prediction model disclosed in this invention uses separate models to predict traffic flow and shared bicycle demand, and then inputs the prediction results into the shared bicycle demand prediction model. This allows the shared bicycle demand prediction model to establish a relationship between traffic flow parameters and bicycle demand parameters, and output updated parameters resulting from their mutual influence. Finally, these updated parameters are used to update the parameters of the two separate models, resulting in a model that better fits the actual situation. This invention trains the shared bicycle demand prediction model based on the traffic conditions within a region, thereby accurately predicting the current demand for shared bicycles in the region, ensuring that there is neither an oversupply nor a shortage of bicycles in each region.
[0054] In this embodiment of the invention, for data protection, multiple servers are connected through a federated learning framework. Communication between servers relies on parameters trained by each model in each cycle. This aims to store data from different departments on their respective model servers for training without exposing it to other servers. Traffic flow data and bicycle demand data are linked on the federated learning cloud server. The combined model on the cloud server simultaneously receives parameters from different servers for training. Furthermore, the performance of the joint model on the cloud server is improved by learning the parameters of the two models. This is because, in real life, traffic flow and the number of shared bicycles are proportional to a certain extent within a region. In machine learning, this is reflected in the GCN, where the parameters representing different regions differ with the LSTM's updates on traffic flow at different time steps, and the parameters of the two models are complementary. Conversely, if the parameters of a certain region in the GCN haven't changed significantly over the past few hours, it also indicates that the traffic flow in that region hasn't changed significantly over the past few hours.
[0055] In this embodiment of the invention, the Pysyft implementation can be used not only to deploy LSTM and GCN models, but also other machine learning models, even more complex ones. Because only parameters are transmitted on the server, without exposing the entire model structure to other models, the transmission cost is relatively low. Furthermore, deploying various models and their datasets within the Pysyft federated learning framework follows fixed procedures, eliminating the need to write different code for different models, thus simplifying implementation.
[0056] See Figure 3 , Figure 3 This is a structural block diagram of a training system 100 for a shared bicycle demand prediction model provided in an embodiment of the present invention. The training system 100 for the shared bicycle demand prediction model includes:
[0057] The traffic flow prediction result generation module 101 is used to input the traffic flow of a preset area collected in advance into the first model at preset time intervals, so that the first model outputs the traffic flow prediction result;
[0058] The demand preliminary forecast result generation module 102 is used to input the shared bicycle usage records of the preset area collected in advance into the second model at preset time intervals, so that the second model outputs the preliminary forecast result of the demand for shared bicycles.
[0059] The parameter generation module 103 is used to send the traffic flow prediction result and the preliminary prediction result of the shared bicycle demand to the shared bicycle demand prediction model, so that the shared bicycle demand prediction model establishes a relationship between the traffic flow parameter and the bicycle demand parameter and outputs a first update parameter and a second update parameter; wherein, the first update parameter is used to update the parameters of the first model, and the second update parameter is used to update the parameters of the second model.
[0060] The prediction model output module 104 is used to output the trained prediction model for the demand of shared bicycles.
[0061] Specifically, the first model is an LSTM model, and it is stored on a first server. The preset time period can be 12 hours, and the preset area can be divided based on a location with relatively high pedestrian traffic, such as a 100-meter radius around a subway station. The traffic flow data for the preset time period can be obtained in advance through a vehicle-to-everything (V2X) network.
[0062] For example, a city's transportation department possesses a massive dataset recording traffic conditions over the past few days, making it crucial to uncover the hidden temporal characteristics within these time series. An LSTM model (a machine learning method with powerful temporal processing capabilities) is used to explore the temporal correlations hidden in historical data. Specifically, at each time step, the model uses various gates to filter and retain important information from the previous time step.
[0063] The most significant characteristic of the LSTM model is that each cell in the LSTM represents a time step. When a cell receives input from a time step, it not only incorporates the current time characteristics but also analyzes which information from past historical cells should be retained. For example, using 12 hours of historical data to predict traffic conditions for the next hour, the LSTM in this embodiment is set to 12 cells. The LSTM identifies potential patterns and passes them through the gates in the cells, while features without time relevance are discarded in the forget gate. The operation of the various gates in the LSTM, as well as the direction and generation of data, can be clearly represented by the following nonlinear function, as shown in the following formula:
[0064] i t =σ(W xi X i t +W hi h t-1 +W ci c t-1 +b i (1);
[0065] f t =σ(W xf X i t +W hf h t-1 +W cf c t-1 +b f (2);
[0066] c t =f t c t-1 +i t tanh(W xc X i t +W hc h t-1 +b c (3);
[0067] ot =σ(W xo X i t +W ho h t-1 +W co c t-1 +b o (4);
[0068] h t =o t ·tanh(c t (5);
[0069] Among them, W xi W refers to the weight of the input data at time point t in the input gate. hi W refers to the weight W of the hidden state at time t in the input gate. ci W refers to the weight of the cell state at time t in the input gate. xf W refers to the weight of the input data at time point t in the forget gate. hf W refers to the weight of the hidden state at time t in the forget gate. cf W refers to the weight of the cell state at time t in the forget gate. xc W refers to the weight of the input data at time point t in the cell update gate. hc W refers to the weight of the hidden state at time t in the cell update gate. xo W refers to the weight of the input data at time point t in the output gate. ho W refers to the weight of the hidden state at time t in the output gate. co This refers to the weight of the cell state at time point t in the output gate, i t This refers to the update result of the input gate, f t This refers to the update result of the forget gate, c t This refers to the update result of the cell state, o t This refers to the update result of the output gate, h. t This refers to the update result of the hidden state.
[0070] It's worth noting that gates f and i determine how information is transmitted in the LSTM, and which information should be retained and which should be discarded. Therefore, each cell in the LSTM not only receives the input of the current time slice, but also absorbs the temporal hiding properties that have already been learned.
[0071] Specifically, the second model is a GCN model, and the second model is stored on a second server. The shared bicycle usage records for the preset time period can be obtained through the shared bicycle usage software. These usage records are based on the user unlocking the bicycle, and each unlock increments the record by 1.
[0072] For example, GCN is a graph convolutional network. A city department responsible for shared bicycles works based on a demand dataset to efficiently dispatch shared bicycles. Each shared bicycle station is highly connected to its surrounding area, so the GCN model is used to understand how many connections a region has with its neighbors. Unlike traditional convolutional operations, graph convolutions do not mechanically learn features from all neighboring regions. Doing so might cause the model to indiscriminately consider features with potentially weak connections, thus impacting performance. Therefore, GCN benefits from the adjacency matrix of the graph structure, which reflects the true spatial connections. GCN only performs convolution operations on regions with spatial connectivity to uncover these connections. The specific formula is as follows:
[0073] Rt = W t ·A t ·X t (6);
[0074] Among them, W t A is the weight parameter at time point t. t X is the adjacency matrix parameter at time t. t It is the input feature at time point t.
[0075] Optionally, the GCN model constructs several topologies of highway networks corresponding to different regions. The topology includes several nodes and connecting lines connecting the nodes; wherein each node represents a highway, and the connecting lines between the nodes indicate that two highways intersect.
[0076] For example, unlike traditional convolutional neural networks, graph convolutional neural networks are designed as an undirected graph g = (V, A), where V represents the set of all nodes, and A is the adjacency matrix representing the relationships between nodes. The adjacency matrix A is constructed based on the position field in the dataset, and the elements in A are either 1 or 0, with 1 indicating that the corresponding row and column nodes are connected. For instance, a cycling record might contain the starting and ending intersections of the cycling route, as well as the road segment connected to the next intersection. From this information, we can assume that the cycling segment in the record is connected to the road segment connected to the next intersection, so the corresponding element in the adjacency matrix should be set to 1.
[0077] Specifically, the shared bicycle demand prediction model includes an LSTM model and a GCN model built on the Pysyft framework, and the shared bicycle demand prediction model is stored on a third server. The first update parameter is the parameter in the gating of each cell in the LSTM. The update parameter is the parameter of each element in the convolutional layer of the GCN.
[0078] For example, the shared bicycle demand prediction model needs to link traffic conditions with bicycle demand. It requires a combination of two models (LSTM+GCN) to predict traffic flow and bicycle demand separately, and then updates the parameters based on data errors in the federated server. Specifically, it first learns from traffic flow data, and then learns from the bicycle dataset while keeping the traffic flow dataset confidential or unloaded. The reason the shared bicycle demand prediction model needs to send the updated parameters back to the first and second servers after updating them is that the updated parameters are generated by the interaction between GCN and LSTM, and the model composed of these parameters will better fit the actual situation.
[0079] For example, to ensure the secure training of datasets involved in all experiments, datasets from different departments are protected. The shared bicycle demand prediction model uses a federated learning framework. Its core is that the server can receive updated parameters from independent model servers in real time. The final parameters are then used by the federated server to update the learning parameters to a better set. Federated learning has many implementations, among which Pysyft can effectively handle various processes.
[0080] For example, each dataset is trained on its own server (assuming the server can handle the entire training process). The primary goal of federated learning is to store datasets from different departments separately to prevent them from being leaked to different departments. The three servers correspond to the traffic flow server, the vehicle demand server, and the server for jointly training the model, respectively. Secondly, the first server (traffic flow server) and the second server (vehicle demand server) send the parameters obtained from each training cycle to the third server. A training cycle refers to one epoch in machine learning. Finally, the third server updates the two different parameters to obtain new parameters. This update involves a trade-off between the correlation between the two datasets, and the parameters are ultimately sent back to the corresponding first and second servers.
[0081] Compared to existing technologies, the training system for the shared bicycle demand prediction model disclosed in this invention uses separate models to predict traffic flow and shared bicycle demand, and then inputs the prediction results into the shared bicycle demand prediction model. This allows the shared bicycle demand prediction model to establish a relationship between traffic flow parameters and bicycle demand parameters, and output updated parameters resulting from their mutual influence. Finally, these updated parameters are used to update the parameters of the two separate models, resulting in a model that better fits the actual situation. This invention trains the shared bicycle demand prediction model based on the traffic conditions within a region, thereby accurately predicting the current demand for shared bicycles in the region, ensuring that there is neither an oversupply nor a shortage of bicycles in each region.
[0082] See Figure 4 , Figure 4 This is a structural block diagram of a training device 200 for a shared bicycle demand prediction model provided in an embodiment of the present invention. The training device 200 includes a processor 201, a memory 202, and a computer program stored in the memory 202 and executable on the processor 201. When the processor 201 executes the computer program, it implements the steps in the above-described training method embodiments for the shared bicycle demand prediction model. Alternatively, when the processor 201 executes the computer program, it implements the functions of each module / unit in the above-described system embodiments.
[0083] For example, the computer program can be divided into one or more modules / units, which are stored in the memory 202 and executed by the processor 201 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the training device 200 for the shared bicycle demand prediction model.
[0084] The training device 200 for the shared bicycle demand prediction model can be a computing device such as a desktop computer, laptop, PDA, or cloud server. The training device 200 may include, but is not limited to, a processor 201 and a memory 202. Those skilled in the art will understand that the schematic diagram is merely an example of the training device 200 for the shared bicycle demand prediction model and does not constitute a limitation on the device. It may include more or fewer components than illustrated, or combine certain components, or use different components. For example, the training device 200 may also include input / output devices, network access devices, buses, etc.
[0085] The processor 201 may 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. The general-purpose processor may be a microprocessor or any conventional processor. The processor 201 is the control center of the training device 200 for the shared bicycle demand prediction model, connecting all parts of the training device 200 using various interfaces and lines.
[0086] The memory 202 can be used to store the computer program and / or modules. The processor 201 implements various functions of the training device 200 for the shared bicycle demand prediction model by running or executing the computer program and / or modules stored in the memory 202 and calling the data stored in the memory 202. The memory 202 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 202 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0087] The modules / units integrated in the training device 200 for the shared bicycle demand prediction model, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by the processor 201, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable medium may be appropriately added to or subtracted from the content as required by the legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium may not include electrical carrier signals and telecommunication signals.
[0088] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0089] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A training method for a shared bicycle demand prediction model, characterized in that: include: Inputting the traffic flow of the preset area collected in advance into the first model at each preset time interval, so that the first model outputs a traffic flow prediction result; Inputting the pre-collected usage records of shared bicycles in a preset area into the second model at every preset time interval, so that the second model outputs a preliminary prediction result of the demand for shared bicycles; Sending the vehicle flow prediction result and the preliminary prediction result of the shared bicycle demand to a shared bicycle demand prediction model, so that the shared bicycle demand prediction model establishes a connection between the vehicle flow parameter and the bicycle demand parameter and outputs a first update parameter and a second update parameter; wherein the first update parameter is used to update the parameters of the first model, and the second update parameter is used to update the parameters of the second model; Output the trained shared bicycle demand prediction model; Among them, the first model is an LSTM model, which is stored in a first server; the second model is a GCN model, which is stored in a second server; the shared bicycle demand prediction model includes an LSTM model and a GCN model installed under the Pysyft framework, and the shared bicycle demand prediction model is stored in a third server.
2. The training method of the shared bicycle demand prediction model according to claim 1, characterized in that: The first update parameters are the parameters in the gates of each cell in the LSTM.
3. The training method of the shared bicycle demand prediction model according to claim 1, characterized in that: The second updated parameter is a parameter of each element of the convolutional layer in the GCN.
4. The training method of the shared bicycle demand prediction model according to claim 1, characterized in that: The GCN model is constructed with a plurality of topological structures of highway networks corresponding to different regions, and the topological structures include a plurality of nodes and connecting lines connecting the nodes; wherein each of the nodes represents a highway, and the connecting lines between the nodes represent the intersection of two highways.
5. A training system for a shared bicycle demand prediction model, characterized in that: include: A vehicle flow prediction result generating module, used for inputting the vehicle flow of a preset area collected in advance into the first model at every preset time interval, so that the first model outputs a vehicle flow prediction result; A module for generating preliminary demand forecast results, for inputting the pre-collected usage records of shared bicycles in a preset area into the second model at every preset time interval, so that the second model outputs preliminary demand forecast results of shared bicycles; An update parameter generation module is used to send the vehicle flow prediction result and the preliminary prediction result of the shared bicycle demand to the shared bicycle demand prediction model, so that the shared bicycle demand prediction model establishes a connection between the vehicle flow parameter and the bicycle demand parameter and outputs a first update parameter and a second update parameter; wherein the first update parameter is used to update the parameters of the first model, and the second update parameter is used to update the parameters of the second model; The prediction model output module is used to output the trained shared bicycle demand prediction model; Among them, the first model is an LSTM model, which is stored in a first server; the second model is a GCN model, which is stored in a second server; the shared bicycle demand prediction model includes an LSTM model and a GCN model installed under the Pysyft framework, and the shared bicycle demand prediction model is stored in a third server.
6. The training system for the shared bicycle demand prediction model according to claim 5, characterized in that: The first update parameter is the parameter in the gate of each cell in the LSTM; the second update parameter is the parameter of each element of the convolutional layer in the GCN.
7. The training system for the shared bicycle demand prediction model according to claim 5, characterized in that: The GCN model is constructed with a plurality of topological structures of highway networks corresponding to different regions, and the topological structures include a plurality of nodes and connecting lines connecting the nodes; wherein each of the nodes represents a highway, and the connecting lines between the nodes represent the intersection of two highways.
8. A training device for a shared bicycle demand prediction model, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the training method of the shared bicycle demand prediction model as described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Power prediction method and system of wind-solar hybrid off-grid system
CN111539573A
Prediction method and device of taxi-taking demand quantity and traffic flow combined prediction model
CN112819222A