Traffic flow prediction method and apparatus, medium, and device
By building an initial prediction model in a central server and performing distributed collaborative training on the local client, combining federated learning quality screening and reputation calculation, the problems of data privacy and data sharing in traffic flow prediction are solved, and a high-precision and fair traffic flow prediction model is achieved.
Patent Information
- Application Number
- PCT/CN2024/116865
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-20
- Filing Date
- 2024-09-04
- Publication Date
- 2025-05-30
AI Technical Summary
The existing traffic flow prediction methods ignore the spatiotemporal characteristics and complex nonlinear relationships of the data when processing spatiotemporal data. Due to data privacy protection issues, it is difficult for cities or institutions to share data for joint training, resulting in insufficient training data for prediction models and low prediction accuracy.
Using the federated learning method, an initial prediction model including graph convolutional neural network and gated recurrent units is constructed in a central server, and the model is trained in distributed collaboratively on the local client. Through quality screening and reputation calculation, the model is aggregated and weight parameters are customized to form a traffic flow prediction model.
Without sharing the original data, the accuracy and generalization ability of traffic flow prediction is improved, the privacy of users is protected, and the weight is distributed fairly among multiple local clients, improving the fairness of the prediction model.
Smart Images

Figure CN2024116865_30052025_PF_FP_ABST
Abstract
Description
Traffic flow prediction method, device, medium and equipment Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a traffic flow prediction method, device, medium and equipment. Background Art
[0002] Traffic flow prediction is a crucial issue in urban traffic management and planning. It aims to accurately predict future traffic flow distribution, congestion, and travel patterns on road networks. Traffic flow prediction plays a key role in intelligent connected transportation (ICT). By providing real-time, accurate traffic information, it contributes to the realization of a smarter, more efficient, safer, and more sustainable transportation system. This is crucial for improving urban transportation, reducing congestion, and enhancing the travel experience, and it will help promote the development and application of ICT technologies. Traffic flow prediction requires processing large amounts of spatiotemporal data, including historical traffic flow, weather information, and road events. Traditional prediction methods are typically based on statistical methods or physical models, but these methods often overlook the spatiotemporal characteristics of data and complex nonlinear relationships. In recent years, machine learning methods have made significant progress in traffic flow prediction. For example, neural network-based methods can effectively capture the spatiotemporal relationships of data. However, these methods typically require large amounts of data for training, and this data is often distributed across different locations, raising privacy concerns. Specific traffic data across cities or regions is often opaque, which means that, in many cases, training a sufficiently robust prediction model based on a single dataset is far from sufficient. If different cities or institutions could jointly train traffic flow prediction models without disclosing their own data, this would significantly increase the amount of training data available and effectively improve the model's predictive capabilities. This is particularly valuable for cities or regions with smaller data volumes. However, currently, cities and data institutions have strict confidentiality requirements, which limits data sharing and training. Therefore, the issue of data privacy and confidentiality needs to be addressed urgently.
[0003] Against this backdrop, federated learning has been proposed. It allows model training to be distributed across data holders without sharing the original data. In traffic flow prediction, each city or region can maintain data privacy and only share updated model parameters, thereby improving prediction performance globally. Federated learning uses a model aggregation algorithm to integrate local data from various locations to generate a global model. This model comprehensively considers local characteristics and spatiotemporal relationships, thereby improving prediction accuracy and generalization. However, federated learning also faces challenges in traffic flow prediction. In reality, the amount of data held by each local client participating in federated learning varies. This results in different influences on model parameters during local training. Local clients with large data volumes can disproportionately influence the final global model, resulting in a loss of personalization for other local clients, which is unfair to them. Federated learning needs to address the issue of model aggregation, ensuring that models uploaded by each local client are effectively integrated and weighted appropriately while protecting privacy.
[0004] Summary of the Invention
[0005] The present invention provides a traffic flow prediction method, device, medium and equipment, the purpose of which is to improve the prediction accuracy of traffic flow without sharing data of all parties and infringing privacy.
[0006] In order to achieve the above object, the present invention provides a traffic flow prediction method, comprising:
[0007] Step 1: Collect historical traffic flow data in the target area;
[0008] Step 2: Build an initial prediction model in the central server, which includes a graph convolutional neural network and a gated recurrent unit connected in sequence;
[0009] Step 3: Distributed collaborative training of the initial prediction model is performed on the local client. The trained initial prediction model is input into the central server for quality screening. The initial prediction models that meet the preset quality requirements are aggregated. The reputation of each local client that has trained an initial prediction model that meets the preset quality requirements is calculated. The weight parameters of the aggregated initial prediction model are customized based on the reputation of each local client to obtain the traffic flow prediction model.
[0010] Step 4: Input the historical traffic flow data into the traffic flow prediction model to perform traffic flow prediction and obtain the traffic flow prediction results in the target area.
[0011] More specifically, step 1 includes:
[0012] The historical traffic flow data in the target area is collected at preset time intervals as the step size.
[0013] More specifically, step 3 includes:
[0014] The central server sends the initial prediction model to multiple local clients for training, and obtains the trained initial prediction model;
[0015] The central server uses the accuracy and recall rate to screen the quality of the trained initial prediction model, obtains the initial prediction model that meets the preset quality requirements, and uploads it to the central server for aggregation;
[0016] The central server calculates the reputation of local clients that have trained initial prediction models that meet the preset quality requirements, obtains the reputation corresponding to each local client that has trained an initial prediction model that meets the preset quality requirements, and uploads the reputation of each local client to the central server for ranking;
[0017] The central server customizes the weight parameters of the aggregated initial prediction model according to the ranking results of the reputation of each local client, and obtains the traffic flow prediction model by weighted average.
[0018] Furthermore, the calculation expression of credibility is:
[0019] when hour,
[0020] when hour,
[0021] in, represents the amount of false cost reported by the i-th local client when uploading the initial prediction model for the k-th time, represents the credibility of the i-th local client after uploading the initial prediction model for the m-th time, It represents the reporting cost of the i-th local client at the k-th time, represents the true cost of the i-th local client at the k-th time, n represents the number of initial prediction models, i represents the i-th local client, i = 1, 2, ..., n, n represents the number of local clients, k represents the number of times the local client uploads the initial prediction model, k = 1, 2, ..., m, represents the m-th time the local client uploads the initial prediction model.
[0022] Furthermore, the central server customizes the weight parameters of the aggregated initial prediction model based on the reputation ranking results of each local client, and obtains the traffic flow prediction model by weighted average, including:
[0023] The central server allocates an influence factor to each local client in proportion to the ranking results of the local client's credibility, customizes the weight parameters of the aggregated initial prediction model, and obtains the traffic flow prediction model by weighted average.
[0024] Furthermore, before step 4, it also includes:
[0025] Preprocessing the historical traffic flow data to obtain preprocessed historical traffic flow data;
[0026] According to the spatial distance between nodes in the preprocessed historical traffic flow data, a traffic flow spatial node graph is constructed, which is used to represent the dependency relationship between nodes.
[0027] More specifically, step 4 includes:
[0028] At each sampling time point, the traffic flow in the preprocessed historical traffic flow data and the distance weight parameters between each node in the traffic flow spatial node graph are input into the graph convolutional neural network;
[0029] Through the graph convolutional neural network, spatial feature adaptive learning and graph convolution operation are performed on historical traffic flow data to obtain spatial feature data of historical traffic flow data;
[0030] Transform the spatial feature data to obtain feature sequence data;
[0031] The feature sequence data is input into the encoder in the gated recurrent unit, and the feature sequence data is encoded by the parameter matrix in the encoder to obtain the encoding result;
[0032] The encoded result is input into the decoder in the gated recurrent unit, and the encoded result is decoded using the same parameter matrix as the encoder to obtain the traffic flow prediction result of the target area.
[0033] The present invention also provides a traffic flow prediction device, comprising:
[0034] A collection module, used to collect historical traffic flow data in the target area;
[0035] A construction module for constructing an initial prediction model including a sequentially connected graph convolutional neural network and a gated recurrent unit in a central server;
[0036] The training module is used to perform distributed collaborative training on the initial prediction model on the local client, obtain the trained initial prediction model and input it into the central server for quality screening, aggregate the initial prediction models that meet the preset quality requirements, calculate the reputation of each local client that has trained an initial prediction model that meets the preset quality requirements, and customize the weight parameters of the aggregated initial prediction model based on the reputation of each local client to obtain a traffic flow prediction model;
[0037] The prediction module is used to input historical traffic flow data into the traffic flow prediction model to perform traffic flow prediction and obtain traffic flow prediction results in the target area.
[0038] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the traffic flow prediction method is implemented.
[0039] The present invention also provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the traffic flow prediction method when executing the computer program.
[0040] The above solution of the present invention has the following beneficial effects:
[0041] The present invention constructs an initial prediction model comprising a graph convolutional neural network and a gated recurrent unit connected in sequence on a central server; performs distributed collaborative training on the initial prediction model on local clients to obtain the trained initial prediction model and input it into the central server for quality screening; aggregates the initial prediction models that meet preset quality requirements; calculates the reputation of each local client that has trained an initial prediction model that meets the preset quality requirements; and customizes the weight parameters of the aggregated initial prediction model based on the reputation of each local client to obtain a traffic flow prediction model; inputs the collected historical traffic flow data within the target area into the traffic flow prediction model to perform traffic flow prediction and obtain a traffic flow prediction result within the target area; compared with the prior art, the present invention performs distributed collaborative training on the initial prediction model on the local clients; each local client trains the received initial prediction model using local data and then inputs it into the central server for model parameter sharing, avoiding direct sharing of original data. Therefore, it can protect user privacy and train a high-performance traffic flow prediction model that meets the interests of most local clients without sharing data from all parties and infringing privacy. Traffic flow within the target area is predicted using the high-performance traffic flow prediction model, thereby improving traffic flow prediction accuracy.
[0042] Other beneficial effects of the present invention will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] FIG1 is a schematic diagram of a flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0044] To make the technical problems, technical solutions, and advantages to be solved by the present invention more clear, the following is a detailed description with reference to the accompanying drawings and specific embodiments. It is obvious that the embodiments described are only some of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0045] In the description of the present invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limitations on the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0046] In the description of the present invention, it should be noted that, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood broadly. For example, they may refer to a locking connection, a detachable connection, or an integral connection; they may refer to a mechanical connection or an electrical connection; they may refer to a direct connection or an indirect connection through an intermediate medium; and they may refer to internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances.
[0047] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0048] In view of the existing problems, the present invention provides a traffic flow prediction method, device, medium and equipment.
[0049] As shown in FIG1 , an embodiment of the present invention provides a traffic flow prediction method, including:
[0050] Step 1: Collect historical traffic flow data in the target area;
[0051] Step 2: Build an initial prediction model in the central server, which includes a graph convolutional neural network and a gated recurrent unit connected in sequence;
[0052] Step 3: Distributed collaborative training of the initial prediction model is performed on the local client. The trained initial prediction model is input into the central server for quality screening. The initial prediction models that meet the preset quality requirements are aggregated. The reputation of each local client that has trained an initial prediction model that meets the preset quality requirements is calculated. The weight parameters of the aggregated initial prediction model are customized based on the reputation of each local client to obtain the traffic flow prediction model.
[0053] Step 4: Input the historical traffic flow data into the traffic flow prediction model to perform traffic flow prediction and obtain the traffic flow prediction results in the target area.
[0054] Specifically, step 1 includes:
[0055] The historical traffic flow data in the target area is collected at preset time intervals as the step size.
[0056] In an embodiment of the present invention, based on the checkpoint data in Changsha City, historical traffic flow data in the target area is collected at a frequency of once every 5 minutes, and traffic flow prediction is performed through a traffic flow prediction model to obtain traffic flow data for the next 5 minutes.
[0057] The training method of the embodiment of the present invention is a personalized federated learning method based on credibility, which is mainly divided into two parts: a local client and a central server;
[0058] The local client is mainly responsible for sending and receiving model parameters and model training;
[0059] The central server is an "intermediate organizer" with certain computing capabilities. Its main function is to screen the quality and credibility of the models uploaded by each local client, sort the credibility of each local client, and customize the weight parameters of the aggregated initial prediction model according to the credibility to achieve local client personalization. Finally, the model is sent to each local client for the next round of communication.
[0060] Each round of communication is a training process for the initial prediction model. After completing all rounds of communication, a final traffic flow prediction model (FCN-GRU) will be obtained. The central server will send this traffic flow prediction model to each local client for traffic flow prediction.
[0061] During the model aggregation phase of federated communication, the central server customizes personalized weights for each initial prediction model by calculating the quality of the model trained by each local client and the credibility of each local client, and then performs weighted average to obtain the traffic flow prediction model.
[0062] Specifically, step 3 includes:
[0063] The central server sends the initial prediction model to multiple local clients for training, and obtains the trained initial prediction model;
[0064] The central server uses the accuracy and recall rate to screen the quality of the trained initial prediction model, obtains the initial prediction model that meets the preset quality requirements and uploads it to the central server for aggregation;
[0065] The central server calculates the reputation of local clients that have trained initial prediction models that meet the preset quality requirements, obtains the reputation corresponding to each local client that has trained an initial prediction model that meets the preset quality requirements, and uploads the reputation of each local client to the central server for ranking;
[0066] The central server customizes the weight parameters of the aggregated initial prediction model according to the ranking results of the reputation of each local client, and obtains the traffic flow prediction model by weighted average.
[0067] Specifically, the central server sends the initial prediction model to multiple local clients for training to obtain the trained initial prediction model. The specific process includes:
[0068] First, the historical traffic flow data is preprocessed. According to the spatial distance of each collection node, a traffic flow spatial node graph is constructed. The information interaction between nodes is realized through GCN to model the complex dependency relationship between nodes. The expression is:
[0069] Among them, H (l+1) and H l are the outputs of the l+1th layer and the lth layer respectively; σ is the Sigmoid activation function of the model; is the normalized degree matrix; is the feature matrix; θ l is the parameter set of the lth layer, which is trained as a whole through back propagation, and a 2-layer GCN network is selected for forward propagation. After forward calculation, the data represented by the graph is projected into the spectral domain for spatial feature learning;
[0070] Then, at each sampling time point, the historical traffic flow data and the distance weight parameters between nodes are input into the initial prediction model;
[0071] The graph convolutional neural network (GCN) is used to perform spatial feature adaptive learning and graph convolution operations on the traffic flow spatial node graph to obtain the spatial features of the traffic flow and convert the spatial features into sequence data, which is then input into the gated recurrent unit (GRU).
[0072] GRU is used to model the time dependency of historical traffic flow data. GRU mainly consists of a reset gate and an update gate. The reset gate compares the hidden state of the previous moment with the input data of the current moment, and then scales the data through the tanh activation function to achieve selective memory of the hidden state of the previous moment. The update gate determines the amount of information inflow by calculating the previous moment and the current moment. The specific calculation process is as follows;
[0073] Among them, i t is the output of the update gate, O t is the output of the reset gate, h t is the hidden state at time t, h t-1 is the hidden state at time t-1, is the graph signal after multi-layer convolution calculation, is the hidden state calculated based on the reset gate, W i , W O ,W,U i , U O , U is a learnable parameter, which participates in the calculation in the form of a weight matrix, and ⊙ is the Hadamard product;
[0074] Assume that the graph signal input to the model from the initial time t to the final time T is (X(t-T+1),X(t-T+2),…,X(t)). The graph signal is passed through a two-layer neural network to obtain a graph signal after graph convolution calculation, and then passed through the GRU to obtain the time dependency of the traffic flow sequence.
[0075] Among them, Y t is the output of the encoder, i.e., the temporal dependency of the traffic flow sequence; f GRU (·) is the calculation process inside the GRU unit;
[0076] Finally, the extracted node information is encoded using a GRU-based encoder and fed into a GRU decoder. The decoder uses the same parameter matrix as the encoder for computation. After decoding, the predicted traffic flow is obtained and the model parameters are uploaded to a central server.
[0077] The encoder is mainly composed of two network structure units, GCN and GRU. The traffic flow data is mapped into the latent space representation R through the automatic encoder. The spatial representation sequence is used as the site encoding vector to initialize the decoding GRU. The latent space representation R is input into the decoder for data reconstruction, and the hidden state obtained at each moment is input into the fully connected layer to obtain the final prediction result.
[0078] Specifically, the embodiment of the present invention is to perform quality screening on the trained initial prediction model uploaded by each local client; when communication starts, the local client will download the model data from the central server and use the local data to train the initial prediction model. Each local client has its own local data and the data between them is not circulated to each other, avoiding the direct sharing of local data, thereby protecting the user's privacy, and uploading the trained initial prediction model to the central server.
[0079] The initial prediction model after training is defined as: M = {m1,m2,…,m n}, n represents the number of initial prediction models after training;
[0080] Set the two indicators for model quality screening as: {x1, x2}, where x1 represents the precision and x2 represents the recall;
[0081] Define the initial prediction model m after the i-th training i The values of the two indicators are: ij ;
[0082] Among them, G ij represents y ij After normalization, represents y ij The lower limit of represents y ij Upper limit of
[0083] Define the i-th initial prediction model m i The evaluation value sequence under each indicator is: {G i1 ,G i2}, where represents the i-th initial prediction model m i The evaluation value sequence under the accuracy index represents the i-th initial prediction model m i The sequence of evaluation values under the recall metric;
[0084] Calculate the i-th initial prediction model m i Minimum evaluation value of:
[0085] like The initial prediction model uploaded by the local client is considered a low-quality model and needs to be removed;
[0086] Quality screening of the k-th initial prediction model of the local client:
[0087] Specifically, in federated learning, each local client will pursue the maximization of individual interests, which may lead to false reporting of training costs. That is, the reported cost does not match the quality of the submitted model, which will cause damage to collective interests and even cause cooperation failure. Therefore, it is necessary to perform credibility calculation for the false cost phenomenon after quality screening of the initial prediction model uploaded by the local client.
[0088] Generally speaking, the training cost of a local client in federated learning is proportional to the quality of the model it submits. Therefore, in this embodiment of the present invention, the actual training cost is set to be numerically equal to the model quality. In federated learning, the more the cost reported by the local client exceeds the actual cost, the lower its credibility, and vice versa.
[0089] Assume that the reputation of the local client after uploading the initial prediction model is:
[0090] in, represents the credibility of the i-th local client after uploading the initial prediction model for the m-th time, represents the credibility of the i-th local client after uploading the initial prediction model for the k-th time, represents the amount of false cost reported by the i-th local client when uploading the initial prediction model for the k-th time, represents the average cost false reporting amount of the i-th local client when uploading the initial prediction model at the k-th time;
[0091] in, It represents the reporting cost of the i-th local client at the k-th time, represents the true cost of the i-th local client at the k-th time, and n represents the number of initial prediction models;
[0092] From the above formula, we can know that: hour,
[0093] when When , the formula is derived as follows:
[0094] in, represents the amount of false cost reported by the i-th local client when uploading the initial prediction model for the k-th time, represents the credibility of the i-th local client after uploading the initial prediction model for the m-th time, It represents the reporting cost of the i-th local client at the k-th time, represents the true cost of the i-th local client at the k-th time, n represents the number of initial prediction models, i represents the i-th local client, i = 1, 2, ..., n, n represents the number of local clients, k represents the number of times the local client uploads the initial prediction model, k = 1, 2, ..., m, represents the m-th time the local client uploads the initial prediction model.
[0095] Specifically, the central server customizes the weight parameters of the aggregated initial prediction model based on the reputation ranking results of each local client, and obtains the traffic flow prediction model by weighted average, including:
[0096] Based on the reputation ranking results of each local client, the central server assigns an influence factor proportional to each local client, customizes the weight parameters of the aggregated initial prediction model, and takes a weighted average to obtain the traffic flow prediction model. Local clients with larger influence factors have a greater impact on the traffic flow prediction model, and the final traffic prediction model will favor local clients with high credibility. After multiple rounds of communication, local clients that provide high-quality data and high credibility will occupy a larger weight parameter proportion in the traffic flow prediction model, and the prediction results of these local clients will be better than those of other local clients. Local clients that provide low-quality, low-quantity data and have low credibility will be eliminated, fully ensuring fairness among local clients.
[0097] Specifically, before step 4, also include:
[0098] Preprocessing the historical traffic flow data to obtain preprocessed historical traffic flow data;
[0099] According to the spatial distance between nodes in the preprocessed historical traffic flow data, a traffic flow spatial node graph is constructed, which is used to represent the dependency relationship between nodes.
[0100] Specifically, step 4 includes:
[0101] At each sampling time point, the traffic flow in the preprocessed historical traffic flow data and the distance weight parameters between each node in the traffic flow spatial node graph are input into the graph convolutional neural network;
[0102] The spatial feature data of historical traffic flow data is obtained by performing spatial feature adaptive learning and graph convolution operations on the historical traffic flow data through the graph convolutional neural network (GCN).
[0103] Transform the spatial feature data to obtain feature sequence data;
[0104] The feature sequence data is input into the encoder of the gated recurrent unit GRU, and the feature sequence data is encoded by the parameter matrix in the encoder to obtain the encoding result;
[0105] The encoded result is input into the decoder in the gated recurrent unit GRU, and the encoded result is decoded using the same parameter matrix as the encoder to obtain the traffic flow prediction result of the target area.
[0106] The embodiment of the present invention constructs an initial prediction model comprising a sequentially connected graph convolutional neural network and a gated recurrent unit on a central server; performs distributed collaborative training on the initial prediction model on local clients to obtain a trained initial prediction model, which is then input into the central server for quality screening. Initial prediction models that meet preset quality requirements are aggregated, and reputation is calculated for each local client that has trained an initial prediction model that meets the preset quality requirements. Weight parameters of the aggregated initial prediction model are customized based on the reputation of each local client to obtain a traffic flow prediction model; historical traffic flow data collected within a target area is input into the traffic flow prediction model to perform traffic flow prediction, thereby obtaining a traffic flow prediction result within the target area. Compared with the prior art, the present invention performs distributed collaborative training on the initial prediction model on the local clients. After each local client trains the received initial prediction model using local data, the model parameters are shared with the central server, avoiding direct sharing of raw data. This protects user privacy and enables training of a high-performance traffic flow prediction model that meets the interests of most local clients without sharing data or infringing privacy. Traffic flow within the target area is predicted using the high-performance traffic flow prediction model, thereby improving traffic flow prediction accuracy.
[0107] An embodiment of the present invention further provides a traffic flow prediction device, comprising:
[0108] A collection module, used to collect historical traffic flow data in the target area;
[0109] A construction module for constructing an initial prediction model including a sequentially connected graph convolutional neural network and a gated recurrent unit in a central server;
[0110] The training module is used to perform distributed collaborative training on the initial prediction model on the local client, obtain the trained initial prediction model and input it into the central server for quality screening, aggregate the initial prediction models that meet the preset quality requirements, calculate the reputation of each local client that has trained an initial prediction model that meets the preset quality requirements, and customize the weight parameters of the aggregated initial prediction model based on the reputation of each local client to obtain a traffic flow prediction model;
[0111] The prediction module is used to input historical traffic flow data into the traffic flow prediction model to perform traffic flow prediction and obtain traffic flow prediction results in the target area.
[0112] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the embodiment of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0113] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the embodiments of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0114] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a traffic flow prediction method is implemented.
[0115] If the integrated module is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned method embodiments, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of the above-mentioned various method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device capable of carrying computer program code to a construction device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0116] The present invention also provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the traffic flow prediction method when executing the computer program.
[0117] The terminal device may be a computing device such as a desktop computer, a notebook computer, a PDA, a server, a server cluster, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0118] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0119] In some embodiments, the memory may be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device. In other embodiments, the memory may also be an external storage device of the terminal device, such as a plug-in hard disk equipped on the terminal device, a smart memory card (SMC, Smart Media Card), a secure digital (SD, Secure Digital) card, a flash card, etc. Furthermore, the memory may include both an internal storage unit of the terminal device and an external storage device. The memory is used to store an operating system, an application program, a boot loader, data, and other programs, such as the program code of the computer program. The memory may also be used to temporarily store data that has been output or is about to be output.
[0120] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the embodiment of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0121] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the embodiments of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0122] 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 should also be regarded as within the scope of protection of the present invention.
Claims
1. A traffic flow prediction method, characterized in that: include: Step 1, collecting historical traffic flow data in the target area; Step 2, constructing an initial prediction model including a graph convolutional neural network and a gated recurrent unit connected in sequence in a central server; Step 3: Perform distributed collaborative training on the initial prediction model on the local client, obtain the trained initial prediction model and input it into the central server for quality screening, aggregate the initial prediction models that meet the preset quality requirements, calculate the reputation of each local client that has trained the initial prediction model that meets the preset quality requirements, customize the weight parameters of the aggregated initial prediction model according to the reputation of each local client, and obtain a traffic flow prediction model; Step 4: Input the historical traffic flow data into the traffic flow prediction model to perform traffic flow prediction to obtain traffic flow prediction results in the target area.
2. The traffic flow prediction method according to claim 1, characterized in that: The step 1 comprises: The historical traffic flow data in the target area is collected at a preset time interval as the step size.
3. The traffic flow prediction method according to claim 2, characterized in that: The step 3 comprises: The central server sends the initial prediction model to multiple local clients for training to obtain a trained initial prediction model; The central server uses the accuracy and recall rate to perform quality screening on the trained initial prediction model, obtains the initial prediction model that meets the preset quality requirements and uploads it to the central server for aggregation; The central server calculates the reputation of local clients that have trained initial prediction models that meet the preset quality requirements, obtains the reputation corresponding to each local client that has trained an initial prediction model that meets the preset quality requirements, and uploads the reputation of each local client to the central server for sorting; The central server customizes the weight parameters of the aggregated initial prediction model according to the ranking results of the reputation of each local client, and obtains the traffic flow prediction model by weighted average.
4. The traffic flow prediction method according to claim 3, characterized in that: The calculation expression of the reputation is: when hour, when hour, in, represents the amount of false cost reported by the i-th local client when uploading the initial prediction model for the kth time, represents the reputation of the i-th local client after uploading the initial prediction model for the m-th time, represents the reporting cost of the i-th local client at the k-th time, represents the true cost of the i-th local client at the k-th time, n represents the number of initial prediction models, i represents the i-th local client, i=1,2,…n, n represents the number of local clients, k represents the number of times the local client uploads the initial prediction model, k=1,2,…,m, represents the m-th time the local client uploads the initial prediction model.
5. The traffic flow prediction method according to claim 4, characterized in that: The central server customizes the weight parameters of the aggregated initial prediction model according to the ranking results of the reputation of each local client, and obtains the traffic flow prediction model by weighted average, including: The central server allocates an influence factor to each local client in proportion to the ranking result of the reputation of each local client, customizes the weight parameters of the aggregated initial prediction model, and obtains the traffic flow prediction model by weighted average.
6. The traffic flow prediction method according to claim 5, characterized in that: Before step 4, the method further includes: Preprocessing the historical traffic flow data to obtain preprocessed historical traffic flow data; According to the spatial distance between each node in the preprocessed historical traffic flow data, a traffic flow spatial node graph is constructed, and the traffic flow spatial node graph is used to characterize the dependency relationship between nodes.
7. The traffic flow prediction method according to claim 6, characterized in that: The step 4 comprises: At each sampling time point, inputting the distance weight parameters between the traffic flow in the preprocessed historical traffic flow data and each node in the traffic flow space node graph into the graph convolutional neural network; The historical traffic flow data is adaptively processed using the graph convolutional neural network. Learning and graph convolution operations to obtain spatial feature data from the historical traffic flow data; Converting the spatial feature data to obtain feature sequence data; Inputting the characteristic sequence data into the encoder in the gated cyclic unit, performing encoding operation on the characteristic sequence data through the parameter matrix in the encoder to obtain an encoding result; The encoding result is input into a decoder in the gated cyclic unit, and a decoding operation is performed on the encoding result using the same parameter matrix as that of the encoder to obtain a traffic flow prediction result of the target area.
8. A traffic flow prediction device, characterized in that: include: A collection module, used to collect historical traffic flow data in the target area; A building module, for building an initial prediction model including a graph convolutional neural network and a gated recurrent unit connected in sequence in a central server; A training module is used to perform distributed collaborative training on the initial prediction model on the local client, obtain the trained initial prediction model and input it into the central server for quality screening, aggregate the initial prediction models that meet the preset quality requirements, calculate the reputation of each local client that has trained the initial prediction model that meets the preset quality requirements, customize the weight parameters of the aggregated initial prediction model according to the reputation of each local client, and obtain a traffic flow prediction model; The prediction module is used to input the historical traffic flow data into the traffic flow prediction model to perform traffic flow prediction and obtain the traffic flow prediction result in the target area.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the traffic flow prediction method according to any one of claims 1 to 7 is implemented.
10. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the traffic flow prediction method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Urban traffic flow space-time prediction method based on federated learning
CN114757389A
Traffic flow prediction method based on federated learning
CN114881371A
Traffic prediction method and device under source data privacy protection and storage medium
CN115392552A
Traffic flow prediction method based on block chain and federal learning fusion
CN116777042A
Traffic flow prediction method and device, medium and equipment
CN117474171A
Cited By
Traffic flow prediction method, device, equipment, storage medium and program product
CN120496324A
Spatial-temporal flow data prediction model training method
CN120763625A
Traffic flow prediction method, system and equipment based on intra-block convolution and axis remapping
CN121260012A
Communication network flow prediction method and device and electronic equipment
CN121357030A
Traffic event prediction method, prediction device and prediction system
CN121981316A