A Method and System for Training Parking Prediction Models Based on Federated Learning and Blockchain

By combining federated learning and blockchain to train a parking prediction model, data is collected and processed, and model parameters are uploaded and aggregated using smart contracts. This improves the timeliness and training efficiency of the parking prediction model and solves the problem of reduced accuracy caused by timeliness issues in existing technologies.

CN113592102BActive Publication Date: 2025-11-14QINGDAO ELINK INFORMATION TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202110838858.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-23
Publication Date
2025-11-14
Estimated Expiration
2041-07-23

AI Technical Summary

Technical Problem

Existing parking prediction models that combine federated learning and blockchain suffer from timeliness issues, leading to reduced accuracy.

Method used

By using a parking prediction model training method based on federated learning and blockchain, historical parking data is collected and processed. Local model parameters are uploaded using smart contracts, global model parameters are aggregated, and the model is continuously updated through incremental learning until convergence. The converged global model is then saved.

Benefits of technology

While ensuring the privacy and security of parking data, this approach prevents single points of failure and improves the timeliness and training efficiency of parking prediction models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113592102B_ABST
    Figure CN113592102B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for training a parking prediction model based on federated learning and blockchain. The method includes: training a local model using processed historical parking data, and uploading the parameters of the trained local model to the blockchain via a smart contract; monitoring and aggregating the parameters of the local model through a smart contract to obtain global model parameters and uploading them to the blockchain; establishing a global model based on the global model parameters, and determining whether the global model has converged. If it has not converged, each participant obtains the global model parameters from the blockchain through a smart contract and continues iterative training until the global model converges. The parameters of the converged global model are the global model parameters for the current time period; upon entering the next time period, the global model parameters of the previous time period are used as the initial model parameters of the local model for the current time period for a new round of local model training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain technology, and in particular to a method and system for training a parking prediction model based on federated learning and blockchain. Background Technology

[0002] Federated learning is an emerging machine learning paradigm that effectively solves the data silo problem. It allows participating parties to collaboratively model data without directly accessing the training data, enabling them to train a continuously optimized global model without leaving their local systems. Patent application CN111814985A proposes establishing a federated learning network with a central client and multiple nodes. The central client issues initial model parameters and aggregates local model parameters, while each node receives and updates its local model through multiple rounds of training. However, this federated learning network relies on a central client for model parameter aggregation; if the central client fails, the model training process is interrupted, compromising the normal training process. Patent application CN112765677A proposes replacing the central client with a blockchain network. Each node participating in the federated learning is deployed as a blockchain node, and smart contracts on the blockchain are used to maintain and manage important data in the federated learning process on-chain, solving the problem of centralized single point of failure in federated learning. The patent application with publication number CN112784995A, based on blockchain and federated learning, employs a meta-learning method to train a local model using a small amount of data until the local model converges to a preset range, thereby improving the model's convergence speed and saving computational resources. The aforementioned prior art uses blockchain technology to prevent single points of failure in federated learning, ensuring normal model training and improving convergence speed through meta-learning. However, the prior art does not consider the timeliness of the model. For continuously generated parking data, training with only fixed data based on federated learning and blockchain results in a timeliness issue in the final prediction model, leading to reduced accuracy. Summary of the Invention

[0003] This invention addresses the technical problem of reduced accuracy in existing prediction models due to timeliness issues, and proposes a parking prediction model training method and system based on federated learning and blockchain.

[0004] In a first aspect, embodiments of this application provide a method for training a parking prediction model based on federated learning and blockchain, including:

[0005] Data processing steps: Collect historical parking data from the parking lot and process the historical parking data;

[0006] Local model training steps: Train a local model using the processed historical parking data, and upload the parameters of the trained local model to the blockchain via a smart contract;

[0007] Parameter aggregation step: The smart contract listens for and aggregates the parameters of the local model uploaded by each participant, thereby obtaining the global model parameters and uploading them to the blockchain;

[0008] Model update steps: A global model is established based on the global model parameters, and it is determined whether the global model has converged. If it has not converged, the global model parameters are obtained from the blockchain by calling the smart contract through each blockchain node and sent to each participant. Then, the parameters of the local model are updated according to the global model parameters, and the local model training step is returned to perform the next round of local model training until the global model converges. The converged global model is stored in the blockchain as the final parking traffic prediction model for the current time period, and the parameters of the converged global model are the global model parameters for the current time period.

[0009] Iterative training steps: After entering the next time period, the global model parameters of the previous time period are used as the initial model parameters of the local model in the current time period to conduct a new round of local model training.

[0010] The above-mentioned parking prediction model training method includes the following data processing steps:

[0011] Data preprocessing steps: Collect the historical parking data of the parking lot and preprocess the historical parking data;

[0012] Data normalization processing steps: Construct parking flow time series data based on the preprocessed historical parking data, and perform normalization processing on the parking flow time series data.

[0013] The above-mentioned parking prediction model training method includes the following data preprocessing steps:

[0014] Data collection steps: If the current time period is the initial time period, the historical parking data of the parking lot before the initial time period is collected; if the current time period is not the initial time period, the historical parking data of the previous time period is collected.

[0015] Data cleaning steps: Clean the historical parking data and remove sample data with abnormal parking times or missing data.

[0016] The above-mentioned parking prediction model training method, wherein the data normalization processing step includes:

[0017] Sequence data construction steps: The number of vehicles arriving in each time period is counted after preprocessing the historical parking data, and the parking flow time series data is constructed in chronological order;

[0018] Normalization process: Normalize the parking flow time series data for each time period to between 0 and 1 based on the maximum and minimum values ​​in the parking flow time series data.

[0019] The above-mentioned parking prediction model training method includes the following steps: writing a smart contract for local model aggregation and deploying the smart contract in the blockchain; monitoring whether the parameters of the local models are uploaded through the smart contract; and after all the parameters of the local models have been uploaded, downloading the parameters of each local model from the blockchain to perform model parameter aggregation and obtain the global model parameters.

[0020] The above-mentioned parking prediction model training method involves dividing the normalized parking flow time series data into a historical dataset and a test dataset. Each participant uses the historical dataset to train the local model and uses the test dataset to calculate the prediction error value to determine whether the global model has converged.

[0021] Secondly, embodiments of this application provide a parking prediction model training system based on federated learning and blockchain, comprising:

[0022] Data processing unit: collects historical parking data from the parking lot and processes the historical parking data;

[0023] Local model training unit: Trains a local model using the processed historical parking data, and uploads the parameters of the trained local model to the blockchain via a smart contract;

[0024] Parameter aggregation unit: It listens to and aggregates the parameters of the local model uploaded by each participant through the smart contract, thereby obtaining the global model parameters and uploading them to the blockchain;

[0025] Model Update Unit: Based on the global model parameters, a global model is established, and it is determined whether the global model has converged. If it has not converged, the global model parameters are obtained from the blockchain by calling the smart contract through each blockchain node and sent to each participant. Then, the parameters of the local model are updated according to the global model parameters, and the local model training step is returned to perform the next round of local model training until the global model converges. The converged global model is stored in the blockchain as the final parking traffic prediction model for the current time period. The parameters of the converged global model are the global model parameters for the current time period.

[0026] Iterative training unit: After entering the next time period, the global model parameters of the previous time period are used as the initial model parameters of the local model in the current time period to carry out a new round of local model training.

[0027] The aforementioned parking prediction model training system, wherein the data processing unit includes:

[0028] Data preprocessing module: Collects the historical parking data of the parking lot and preprocesses the historical parking data through the data preprocessing module;

[0029] Data normalization processing module: Constructs parking flow time series data based on the preprocessed historical parking data, and normalizes the parking flow time series data through the data normalization processing module.

[0030] The aforementioned parking prediction model training system, wherein the data preprocessing module includes:

[0031] Data acquisition module: If the current time period is the initial time period, the historical parking data of the parking lot before the initial time period is collected through the data acquisition module; if the current time period is not the initial time period, the historical parking data of the previous time period is collected through the data acquisition module.

[0032] Data cleaning module: The data cleaning module cleans the historical parking data and removes sample data with abnormal parking times or missing data.

[0033] The aforementioned parking prediction model training system, wherein the data normalization processing module includes:

[0034] Sequence data construction module: Calculates the number of vehicles arriving in each time period based on the preprocessed historical parking data, and constructs the parking flow time series data in chronological order using the sequence data construction module;

[0035] Normalization module: Based on the maximum and minimum values ​​in the parking flow time series data, the normalization module normalizes the parking flow time series data for each time period to between 0 and 1.

[0036] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

[0037] The parking prediction model training method proposed in this invention, based on federated learning and blockchain, can prevent single points of failure and enhance the security of parking data by using blockchain while ensuring the privacy and security of parking data. It also improves the timeliness of the parking prediction model through incremental learning, and at the same time improves the training efficiency of the parking prediction model. Attached Figure Description

[0038] Figure 1 A schematic diagram illustrating the steps of a parking prediction model training method based on federated learning and blockchain provided by the present invention;

[0039] Figure 2 A flowchart illustrating the training process of the parking prediction model based on blockchain and federated incremental learning provided by this invention.

[0040] Figure 3 A schematic diagram of the global model trained at different time periods in the blockchain provided by this invention;

[0041] Figure 4 The training architecture diagram of the parking prediction model based on blockchain and federated incremental learning provided by this invention;

[0042] Figure 5 The prediction results of the existing model trained on blockchain and federated learning provided by this invention on parking lot 1 data;

[0043] Figure 6 The prediction results of the existing model trained on blockchain and federated learning provided by this invention on the parking lot 2 data are shown in the figure.

[0044] Figure 7 The prediction results of the existing model trained on blockchain and federated learning provided by this invention on parking lot 3 data;

[0045] Figure 8 A graph showing the prediction results of the model trained using the method of the present invention on parking lot 1 data;

[0046] Figure 9 A prediction result diagram of the model trained using the method of the present invention on parking lot 2 data;

[0047] Figure 10 A graph showing the prediction results of the model trained using the method of the present invention on parking lot 3 data.

[0048] Figure 11 This invention provides a framework diagram of a parking prediction model training system based on federated learning and blockchain. Detailed Implementation

[0049] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0050] Obviously, the accompanying drawings described below are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar scenarios based on these drawings without any inventive effort. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, any changes to design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as insufficient disclosure of the content of this application.

[0051] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0052] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may indicate singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms “connected,” “linked,” “coupled,” and similar words used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," and "third" used in this application are merely to distinguish similar objects and do not represent a specific ordering of the objects.

[0053] The present invention will now be described in detail with reference to the embodiments shown in the accompanying drawings. However, it should be noted that these embodiments are not intended to limit the present invention. Equivalent changes or substitutions in function, method, or structure made by those skilled in the art based on these embodiments are all within the scope of protection of the present invention.

[0054] Before detailing the various embodiments of the present invention, the core inventive concept of the present invention is summarized and then described in detail through the following several embodiments.

[0055] This invention proposes a parking prediction model training method and system based on federated learning and blockchain. Under the condition of ensuring the privacy and security of parking data, blockchain is used to prevent single points of failure and enhance the security of parking data. Incremental learning is used to ensure the timeliness of the parking prediction model and improve the training efficiency of the parking prediction model.

[0056] Example 1:

[0057] Figure 1 This diagram illustrates the steps of a parking prediction model training method based on federated learning and blockchain, as provided by the present invention. Figure 1 As shown in the figure, this embodiment discloses a specific implementation method for training a parking prediction model based on federated learning and blockchain (hereinafter referred to as "the method").

[0058] Specifically, the method disclosed in this embodiment mainly includes the following steps:

[0059] Step S1: Collect historical parking data from the parking lot and process the historical parking data;

[0060] Specifically, the historical parking data of the parking lot is collected and preprocessed; if the current time period is the initial time period, the historical parking data of the parking lot before the initial time period is collected; if the current time period is not the initial time period, the historical parking data of the previous time period is collected; the historical parking data is cleaned to remove sample data with abnormal parking time or missing data.

[0061] Then, parking flow time series data is constructed based on the preprocessed historical parking data, and the parking flow time series data is normalized. First, the number of vehicles arriving in each time period is counted from the preprocessed historical parking data, and the parking flow time series data is constructed in chronological order. Then, the parking flow time series data for each time period is normalized to between 0 and 1 based on the maximum and minimum values ​​in the parking flow time series data. The normalized parking flow time series data is divided into historical datasets and test datasets.

[0062] Step S2: Train a local model using the processed historical parking data, and upload the parameters of the trained local model to the blockchain via a smart contract; specifically, each participant trains a local model using the historical dataset in the processed historical parking data.

[0063] Step S3: Listen to and aggregate the parameters of the local model uploaded by each participant through the smart contract, thereby obtaining the global model parameters and uploading them to the blockchain;

[0064] Specifically, a smart contract for local model aggregation is written and deployed in the blockchain. The smart contract monitors whether the parameters of the local models are uploaded. Once the parameters of all local models have been uploaded, the parameters of each local model are downloaded from the blockchain and the model parameters are aggregated to obtain the global model parameters.

[0065] Step S4: Establish a global model based on the global model parameters, and use the test dataset to calculate the prediction error value to determine whether the global model has converged. If it has not converged, each blockchain node calls the smart contract to obtain the global model parameters from the blockchain and send them to each participant. Then, update the parameters of the local model according to the global model parameters, return to step S2 to perform the next round of local model training, until the global model converges. The converged global model is then stored in the blockchain as the final parking traffic prediction model for the current time period. The parameters of the converged global model are the global model parameters for the current time period.

[0066] Step S5: After entering the next time period, use the global model parameters from the previous time period as the initial model parameters for the local model in the current time period, and conduct a new round of local model training.

[0067] Please refer to the following. Figure 2 , Figure 2 This invention provides a flowchart of the training process for a parking prediction model based on blockchain and federated incremental learning, combined with... Figure 2 The specific application process of this method is explained as follows:

[0068] Step S101: Collect historical parking data of the parking lot during the initial time period and preprocess the historical parking data of the parking lot;

[0069] This involves cleaning the historical parking data of the parking lot and removing sample data with abnormal parking times or missing data.

[0070] Step S102: Calculate the number of vehicles arriving in each time period from the preprocessed historical parking data, construct parking flow time series data, and perform normalization processing.

[0071] Specifically, the preprocessed historical parking data is analyzed by counting the number of arrivals in each time period, and parking flow time series data is constructed in chronological order. The maximum and minimum values ​​in the parking flow time series data are obtained, and the parking flow time series data for each time period is normalized to between 0 and 1. The normalization formula is as follows: Where x' is the normalized value, x is the actual parking flow rate, and x min x is the minimum value in the parking flow time series data. max This represents the maximum value in the parking traffic time series data.

[0072] Step S103: Federated learning is performed based on the normalized parking flow time series data. Each participant uses local data to train a local model of a long short-term memory artificial neural network, and the parameters of the trained local model are uploaded to the blockchain through a smart contract.

[0073] Step S104: Set up a smart contract to listen for and aggregate all local model parameters, obtain global model parameters, and upload them to the blockchain;

[0074] Specifically, a smart contract for local model aggregation is written and deployed on the blockchain. The smart contract is set to listen for whether local models are uploaded. If all local models are uploaded, the parameters of each local model are downloaded from the blockchain, the model parameters are aggregated, and the aggregated model parameters are stored on the blockchain.

[0075] Step S105: Obtain the global model from the blockchain to determine whether the model has converged. If it has not converged, each participant obtains the global model parameters from the blockchain through a smart contract and continues iterative training until the global model converges, which will be used as the global model parameters for the initial period.

[0076] Specifically, at each time period, the trained global model parameters are obtained from the blockchain. The prediction error value is calculated using test data to determine whether the global model has converged. If it has not converged, each participant calls the smart contract through the blockchain node to obtain the global model parameters from the blockchain and continues iterative training until the global model converges. The global model parameters are then used as the global model parameters for that time period.

[0077] Step S106: Starting from the second time period, process the new parking data generated in the previous time period, use the global model parameters of the previous time period as the initial model parameters of the current time period for iterative training, until the global model converges and is used as the global model parameters of the current time period.

[0078] Specifically, starting from the second time period, the new parking data generated in the previous time period is processed. The global model parameters from the previous time period are retrieved from the blockchain via a smart contract and used as the initial local model parameters for the current time period for iterative training. This continues until the global model converges and is used as the global model parameters for the current time period, ultimately yielding the trained global model for each time period, such as... Figure 3 As shown.

[0079] The following describes in detail, with reference to embodiments, the parking prediction model training method based on blockchain and federated incremental learning proposed in this invention.

[0080] This invention selects historical parking data from three parking lots as an example, where each parking lot acts as a participant, such as... Figure 4 As shown, there are three participants, and the blockchain used is the consortium blockchain Fabric. The specific process is as follows:

[0081] First, each participant trains its local model 100 times using local parking traffic time-series data. Then, the local model parameters are extracted and uploaded to the blockchain via a smart contract called by a blockchain node. A smart contract for aggregating local models is deployed on the blockchain, monitoring whether each participant has uploaded their local model parameters. Once all participants have uploaded their parameters, the local model parameters are aggregated using a weighted average based on the amount of local parking traffic time-series data from each participant, obtaining the global model parameters for this round of federated learning. A global model is then built, and its convergence is tested using a test dataset. If the global model has not converged, each participant retrieves the global model parameters via the smart contract called by the blockchain node and updates their local model parameters. This process is repeated for another 100 rounds of local model training using the local parking traffic time-series data until the global model converges. The converged global model is then used as the final parking traffic prediction model for that period and stored on the blockchain. Starting from the next period, based on the new parking data generated in the previous period and the global model parameters obtained from the previous period on the blockchain, 50 rounds of local model training are performed, and the above steps are repeated.

[0082] The specific method in this embodiment is as follows:

[0083] Step 1: Select historical parking data from the four sides of the three parking lots respectively. Parking lot 1 has its historical parking data for the entire day from August 24, 2020 to September 18, 2020; Parking lot 2 has its historical parking data for the entire day from October 5, 2020 to October 31, 2020; and Parking lot 3 has its historical parking data for the entire day from August 3, 2020 to August 29, 2020. The original field information of the historical parking lot data is shown in Table 1.

[0084] Table 1 Original Field Information of Historical Parking Data

[0085] Data fields Detailed information User Information User type, license plate number, payment type, account balance Vehicle entry and exit information Entry time, exit time, parking duration Parking fee information Payment Amount (RMB), Reduction / Exemption Amount (RMB), Fee Type, Payment Method Operation information Operator

[0086] Step 2: In this example, the vehicle data selection time period is 0:00-24:00. The license plate number, entry time, and exit time from the original fields of the parking lot's historical data are retained, and the number of vehicles arriving in each time period is counted. For example, the number of vehicles arriving in each time period for parking lot 1 on August 24, 2020 is counted, as shown in Table 2.

[0087] Table 2. Number of vehicles arriving per time period on August 24, 2020

[0088] time Number of vehicles arriving time Number of vehicles arriving 2020 / 8 / 24 0:00 0 2020 / 8 / 24 12:00 8 2020 / 8 / 24 1:00 0 2020 / 8 / 24 13:00 17 2020 / 8 / 24 2:00 0 2020 / 8 / 24 14:00 8 2020 / 8 / 24 3:00 0 2020 / 8 / 24 15:00 9 2020 / 8 / 24 4:00 1 2020 / 8 / 24 16:00 9 2020 / 8 / 24 5:00 1 2020 / 8 / 24 17:00 2 2020 / 8 / 24 6:00 16 2020 / 8 / 24 18:00 0 2020 / 8 / 24 7:00 90 2020 / 8 / 24 19:00 4 2020 / 8 / 24 8:00 47 2020 / 8 / 24 20:00 0 2020 / 8 / 24 9:00 10 2020 / 8 / 24 21:00 1 2020 / 8 / 24 10:00 8 2020 / 8 / 24 22:00 1 2020 / 8 / 24 11:00 12 2020 / 8 / 24 23:00 0

[0089] Step 3: Construct time-series data based on the number of vehicles arriving in each time period, resulting in 624 data points, and perform normalization processing. The data from the first three weeks is used as the historical dataset, and the data from the last week is used as the test dataset. Each day is considered a time period, resulting in five time periods. The historical dataset is used to train the model, and the test dataset is used to test the model's timeliness.

[0090] Step 4: Conduct the blockchain-based federated incremental learning model training process. If it's the initial period, each participant will conduct 100 rounds of model training locally using the historical dataset from the previous three weeks and a Long Short-Term Memory (LSTM) artificial neural network. Otherwise, each participant will retrieve the global model parameters from the previous period via a smart contract called through the blockchain node, using them as the initial model parameters for their local model, and then conduct 50 rounds of model training. After training, the model parameters are retrieved from the local model and uploaded to the blockchain network via a smart contract called through the blockchain node. The smart contract aggregating local models deployed in the blockchain network automatically listens for the upload of parameters from each local model. Once all local model parameters are uploaded, a weighted average is used to calculate the global model parameters. The specific weighted average formula is as follows: Where w represents the aggregated global model parameters, w i To verify the local model parameters of participant i.

[0091] Step 5: Based on the aggregated global model parameters, establish a global model and use the root mean square error (RMSE) to check if the model has converged. If it has not converged, each blockchain node calls a smart contract to retrieve the global model parameters from the blockchain and sends them to each participant. Then, each participant updates its local model based on the global model parameters and performs the next round of training for its local model. The RMSE is the square root of the ratio of the squared deviations of the model's predicted values ​​from the actual values ​​to the number of predictions (n), and the formula is:

[0092] Step 6: Global model convergence, obtain the parking prediction model for the current time period, and verify the performance of the parking prediction model based on the test data for the current time period. Figure 5 , Figure 6 and Figure 7 These are the prediction results for each parking lot and each time period for the existing model trained using blockchain and federated learning. Figure 8 , Figure 9 and Figure 10 Table 3 shows the prediction results of the model trained by the method of the present invention for each parking lot and each time period. Table 4 compares the errors of the two methods. As can be seen from the figure and the root mean square error, the model of the method of the present invention has high accuracy, and at the same time, it verifies that the method of the present invention can guarantee the timeliness of the model. Table 5 compares the training time of the two methods. The method of the present invention significantly reduces the training time of the model and improves the training efficiency of the model compared with the existing methods.

[0093] Table 3 Comparison of root mean square error between the two methods

[0094]

[0095] Table 4 Comparison of training time for the two methods

[0096] Existing methods Method of the present invention Model training time per round 8.72s 3.56s Total training time of the model 10m27s 4m42s

[0097] This invention provides a parking prediction model training method based on blockchain and federated incremental learning. Compared with existing methods, it reduces the root mean square error and shortens the model training time, which not only improves the timeliness of the parking prediction model, but also improves the training efficiency of the model.

[0098] Example 2:

[0099] In conjunction with the parking prediction model training method based on federated learning and blockchain disclosed in Embodiment 1, this embodiment discloses a specific implementation example of a parking prediction model training system based on federated learning and blockchain (hereinafter referred to as "the system").

[0100] Reference Figure 11 As shown, the system includes:

[0101] Data processing unit 1: Collects historical parking data from the parking lot and processes the historical parking data;

[0102] Local model training unit 2: Trains a local model using the processed historical parking data, and uploads the parameters of the trained local model to the blockchain via a smart contract;

[0103] Parameter aggregation unit 3: Listens to and aggregates the parameters of the local model uploaded by each participant through the smart contract, thereby obtaining the global model parameters and uploading them to the blockchain;

[0104] Model Update Unit 4: Based on the global model parameters, a global model is established, and it is determined whether the global model has converged. If it has not converged, the global model parameters are obtained from the blockchain by calling the smart contract through each blockchain node and sent to each participant. Then, the parameters of the local model are updated according to the global model parameters, and the local model training step is returned to perform the next round of local model training until the global model converges. The converged global model is stored in the blockchain as the final parking traffic prediction model for the current time period. The parameters of the converged global model are the global model parameters for the current time period.

[0105] Iterative Training Unit 5: After entering the next time period, the global model parameters of the previous time period are used as the initial model parameters of the local model in the current time period to conduct a new round of local model training.

[0106] Specifically, the data processing unit 1 includes:

[0107] Data preprocessing module 11: Collects the historical parking data of the parking lot and preprocesses the historical parking data through the data preprocessing module;

[0108] Data normalization processing module 12: Constructs parking flow time series data based on the preprocessed historical parking data, and normalizes the parking flow time series data through the data normalization processing module.

[0109] The data preprocessing module 11 includes:

[0110] Data acquisition module 111: If the current time period is the initial time period, the historical parking data of the parking lot before the initial time period is collected through the data acquisition module; if the current time period is not the initial time period, the historical parking data of the previous time period is collected through the data acquisition module.

[0111] Data cleaning module 112: The data cleaning module cleans the historical parking data and removes sample data with abnormal parking times or missing data.

[0112] The data normalization processing module 12 includes:

[0113] Sequence data construction module 121: Calculates the number of vehicles arriving in each time period based on the preprocessed historical parking data, and constructs the parking flow time series data in chronological order through the sequence data construction module;

[0114] Normalization module 122: Based on the maximum and minimum values ​​in the parking flow time series data, the normalization module normalizes the parking flow time series data for each time period to between 0 and 1.

[0115] The technical solutions for the parking prediction model training system based on federated learning and blockchain disclosed in this embodiment are the same as those for the parking prediction model training method based on federated learning and blockchain disclosed in Embodiment 1. Please refer to Embodiment 1 for the technical solutions for the remaining parts, which will not be repeated here.

[0116] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0117] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for training a parking prediction model based on federated learning and blockchain, characterized in that, Based on blockchain and federated incremental learning, including: Data processing steps: Collect historical parking data of the parking lot and preprocess the historical parking data; specifically including: if the current time period is the initial time period, collect the historical parking data of the parking lot before the initial time period; if the current time period is not the initial time period, collect the historical parking data of the previous time period; count the number of vehicles arriving in each time period based on the preprocessed historical parking data, and construct parking flow time series data in chronological order. Local model training steps: Train a local model using the processed historical parking data, and upload the parameters of the trained local model to the blockchain via a smart contract; Parameter aggregation step: The smart contract listens for and aggregates the parameters of the local model uploaded by each participant, thereby obtaining the global model parameters and uploading them to the blockchain; Model update steps: A global model is established based on the global model parameters, and it is determined whether the global model has converged. If it has not converged, the global model parameters are obtained from the blockchain by calling the smart contract through each blockchain node and sent to each participant. Then, the parameters of the local model are updated according to the global model parameters, and the local model training step is returned to perform the next round of local model training until the global model converges. The converged global model is stored in the blockchain as the final parking traffic prediction model for the current time period, and the parameters of the converged global model are the global model parameters for the current time period. Iterative training steps: After entering the next time period, the new parking data generated in the previous time period is processed. The global model parameters of the previous time period are obtained from the blockchain through smart contract and used as the local initial model parameters for this time period for iterative training until the global model converges and is used as the global model parameters for this time period, and finally the global model after training for each time period is obtained. The parameter aggregation step includes: Write a smart contract for local model aggregation and deploy the smart contract in the blockchain. Use the smart contract to monitor whether the parameters of the local models are uploaded. Once all the parameters of the local models have been uploaded, download the parameters of each local model from the blockchain and aggregate the model parameters to obtain the global model parameters.

2. The parking prediction model training method according to claim 1, characterized in that, The data processing steps include a data preprocessing step, which includes: Data cleaning steps: Clean the historical parking data and remove sample data with abnormal parking times or missing data.

3. The parking prediction model training method according to claim 2, characterized in that, The data processing steps include a data normalization step, which includes: Normalization process: Normalize the parking flow time series data for each time period to between 0 and 1 based on the maximum and minimum values ​​in the parking flow time series data.

4. The parking prediction model training method according to claim 3, characterized in that, The normalized parking flow time series data is divided into historical datasets and test datasets. Each participant uses the historical dataset to train the local model and uses the test dataset to calculate the prediction error value to determine whether the global model has converged.

5. A parking prediction model training system based on federated learning and blockchain, characterized in that, Based on blockchain and federated incremental learning, including: Data processing unit: collects historical parking data of the parking lot and preprocesses the historical parking data; specifically including: if the current time period is the initial time period, collect the historical parking data of the parking lot before the initial time period; if the current time period is not the initial time period, collect the historical parking data of the previous time period; count the number of vehicles arriving in each time period based on the preprocessed historical parking data, and construct parking flow time series data in chronological order. Local model training unit: Trains a local model using the processed historical parking data, and uploads the parameters of the trained local model to the blockchain via a smart contract; Parameter aggregation unit: It listens to and aggregates the parameters of the local model uploaded by each participant through the smart contract, thereby obtaining the global model parameters and uploading them to the blockchain; Model Update Unit: Based on the global model parameters, a global model is established, and it is determined whether the global model has converged. If it has not converged, the global model parameters are obtained from the blockchain by calling the smart contract through each blockchain node and sent to each participant. Then, the parameters of the local model are updated according to the global model parameters, and the local model training step is returned to perform the next round of local model training until the global model converges. The converged global model is stored in the blockchain as the final parking traffic prediction model for the current time period. The parameters of the converged global model are the global model parameters for the current time period. Iterative Training Unit: After entering the next time period, the new parking data generated in the previous time period is processed. The global model parameters of the previous time period are obtained from the blockchain through smart contracts and used as the local initial model parameters for this time period for iterative training until the global model converges and is used as the global model parameters for this time period, and finally the global model after training for each time period is obtained. The parameter aggregation unit includes: Write a smart contract for local model aggregation and deploy the smart contract in the blockchain. Use the smart contract to monitor whether the parameters of the local models are uploaded. Once all the parameters of the local models have been uploaded, download the parameters of each local model from the blockchain and aggregate the model parameters to obtain the global model parameters.

6. The parking prediction model training system according to claim 5, characterized in that, The data processing unit includes a data preprocessing module, which includes: Data cleaning module: The data cleaning module cleans the historical parking data and removes sample data with abnormal parking times or missing data.

7. The parking prediction model training system according to claim 5, characterized in that, The data processing unit includes a data normalization processing module, which includes: Normalization module: Based on the maximum and minimum values ​​in the parking flow time series data, the normalization module normalizes the parking flow time series data for each time period to between 0 and 1.

Citation Information

Patent Citations

  • Model training method under federated learning network and related equipment thereof

    CN111814985A

  • Federal learning method, device and system based on block chain

    CN112765677A

  • Federal learning method and device, equipment and storage medium

    CN112784995A

  • Internet of Things personalized federal learning method based on blockchain

    CN113052331A