Internet of vehicles behavior detection method based on block chain-driven reward and punishment mechanism and federated learning
By introducing blockchain technology and reputation value evaluation mechanism into the Internet of Vehicles system, combined with the prepayment game mechanism, the problems of data privacy, node trust and resource utilization efficiency in the Internet of Vehicles system are solved, and higher system security is achieved. Transparency and stability.
Patent Information
- Application Number
- CN202411632081.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-11-15
AI Technical Summary
There are problems in existing Internet of Vehicles systems with insufficient data privacy, node trust and system transparency, especially in federated learning of autonomous vehicles (CAVs), where unreasonable resource allocation leads to degradation of system performance.
Using blockchain technology to build a decentralized federated learning architecture (BlockFL), combined with the reputation value evaluation mechanism and blockchain prepayment game mechanism, ensure that high-quality nodes participate in training and improve the resource utilization efficiency of the system and the loyalty of participants .
Through blockchain technology, data privacy and transparency have been improved, the reputation value assessment mechanism has improved node trust and participation, the pre -paid game mechanism optimizes the efficiency of resource utilization, and the overall safety, transparency, and stability of the system will be improved.
Smart Images

Figure CN119363469A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of blockchain and Internet of Vehicles, and specifically is a method for detecting Internet of Vehicles behavior using a blockchain-driven reward and punishment mechanism and federated learning in an Internet of Vehicles system based on blockchain. Background Art
[0002] With the development of information and communication technology (ICT), the Internet of Vehicles (IoV) aims to improve the efficiency of intelligent transportation systems through the all-round connection between vehicles and the environment. However, with the popularization of autonomous vehicles (CAVs), IoV systems have become more complex and the risk of cyber attacks has increased significantly. According to relevant data, hundreds of automotive cyber attacks have occurred in the past decade, highlighting the importance of network security. Various countries have issued a number of regulations requiring the strengthening of intrusion detection. Traditional machine learning and deep learning methods are difficult to cope with large-scale data processing problems in the Internet of Vehicles due to resource constraints. Federated learning (FL), as a distributed machine learning method, overcomes the storage and computing difficulties of centralized methods by training models locally and aggregating updates. However, FL relies on a central server for model aggregation, which has single point failures and privacy security issues. To address these challenges, the present invention introduces blockchain technology to construct a decentralized federated learning architecture (BlockFL) to achieve secure storage and transparent recording of models, and enhance system security and transparency. In addition, the traditional blockchain reward and punishment mechanism has limitations in resource allocation, and some nodes do not participate due to insufficient resources or high costs. To this end, the present invention designs a blockchain prepayment game mechanism, which combines reputation value evaluation to ensure that high-quality nodes participate in training, thereby improving the resource utilization efficiency of the system and the loyalty of participants. Summary of the invention
[0003] Purpose of the invention: In response to the increasingly complex security challenges and resource constraints in the Internet of Vehicles (IoV), the present invention proposes a method for detecting IoV behavior using a blockchain-driven reward and punishment mechanism and federated learning. First, a reputation value evaluation mechanism is introduced to measure the credibility and contribution of autonomous vehicles (CAVs), incentivize high-quality node participation, exclude bad nodes, and ensure the security and credibility of model training. Secondly, a dynamic anomaly detection method based on federated learning is proposed. Through a distributed node selection algorithm, dynamic aggregation of local models is achieved, and the optimal global model is recorded on the blockchain to improve the transparency and security of the system. In addition, a blockchain prepayment game mechanism is designed, requiring CAVs nodes to pay fees before training, and participants are screened by combining reputation values to optimize resource utilization efficiency. The prepayment mechanism not only prevents waste of resources, but also improves the loyalty and enthusiasm of participants through economic incentives, ensuring the stable operation of the system.
[0004] Technical solution: A method for detecting Internet of Vehicles behaviors based on blockchain-driven reward and punishment mechanism and federated learning in an Internet of Vehicles system: including the following steps:
[0005] 1) Build a multi-level federated learning model driven by blockchain;
[0006] 2) Blockchain-based federated learning vehicle selection algorithm;
[0007] 3) Blockchain-based Internet of Vehicles federated learning optimization algorithm;
[0008] 4) Vehicle reward and punishment mechanism based on reputation value.
[0009] Furthermore, in the step 1), a multi-level federated learning vehicle networking abnormal system model driven by blockchain is constructed. The above network model is mainly divided into the following four layers:
[0010] Autonomous driving vehicles (CAVs): The main task of CAVs is to use local data to participate in the training of local intrusion detection models in federated learning, and send the parameters of the training results to the roadside unit (RSU). The local data set only contains normal traffic to ensure privacy protection. Each CAV acts as a working node of federated learning and performs learning and training tasks through the on-board unit (OBU). CAVs can apply to the RSU for the use of multiple models. After the application is successful, they can download the latest block of the blockchain to obtain the latest global model and must participate in the global learning process.
[0011] Roadside Units (RSUs): RSUs play a core role in the model distribution and CAVs model results aggregation process. During the training of the intrusion detection model, the RSUs mainly undertake three key tasks. First, the RSUs use the federated learning vehicle selection algorithm to dynamically select the CAVs nodes that are most suitable for participating in the federated learning (FL) model training to ensure the effectiveness and diversity of the training. Secondly, the RSUs aggregate the model application results of CAVs, review and distribute the required models through smart contracts. After the CAVs complete the model training, the RSUs use the federated learning model calculation method to aggregate and verify the model to ensure the accuracy of the results and create new blocks in the consensus process. Finally, before the federated learning task is started, the RSUs dynamically calculate and collect prepaid fees based on the CAV’s reputation value and historical model training records, and after the task is completed, rewards are issued based on the performance using the CAVs node’s reward and punishment mechanism to encourage the active participation of participants.
[0012] Blockchain: This framework uses blockchain technology to ensure the security and transparency of federated learning model updates. Each roadside unit can create a trusted and tamper-proof ledger for secure storage and distribution of updates to anomaly detection models. The decentralized nature of blockchain effectively prevents a single node from controlling the entire IoV network, minimizing the risk of data tampering and single point failure.
[0013] Interplanetary File System (IPFS): IPFS is used in conjunction with blockchain in this framework to store anomaly logs. When an abnormal event is detected by the IoV network system, IPFS is used to store the anomaly log and generate the corresponding hash value, which is then recorded in the blockchain to ensure the immutability and traceability of the log. The anomaly detection system administrator regularly accesses and analyzes the anomaly logs stored in IPFS, uses the analysis results to optimize the IoV anomaly detection system, and continuously improves the federated learning training model to improve the overall security and responsiveness of the system.
[0014] Furthermore, in step 2), a blockchain-based federated learning vehicle selection algorithm is designed to calculate the prepayment amount of the node and select N max Nodes participate in federated learning.
[0015] Step 2-1: Calculate vehicle driving records
[0016]
[0017] Among them, γ1 and γ2 are the weight coefficients of driving records, VC i is the number of violation records, ML i For mileage.
[0018] Step 2-2: Calculate the complexity of the current task
[0019]
[0020] Among them, θ1 and θ2 are the weight coefficients of the complexity of the current task, D i is the number of current tasks of node i EO i,j,max Data volume (MB), is the single-round training time of model j of vehicle node i, T max Limiting the total training time for federated learning, EO i,j,max is the maximum number of convergence rounds of vehicle node i trained in model j obtained from historical records, and n is the number of models of vehicle i. and EO i,j,max A smaller value ensures that the number of training rounds does not exceed the maximum number of convergence rounds of the node to prevent overfitting.
[0021] Step 2-3: The prepaid amount P is calculated based on this i
[0022]
[0023] Among them, λ is the adjustment coefficient, which is used to adjust the overall level of prepayment amount, Reward i For the last reward, is the historical reputation value, DR i For driving records, BW i For network broadband.
[0024] Step 2-4: Based on the calculated prepayment amount P i , sort from high to low, select the first N max This method increases the prepayment amount by improving reputation value and reducing energy consumption, ensuring the participation of high-quality nodes, thereby improving model accuracy and efficiency, while enhancing node participation enthusiasm and data quality, and ensuring the fairness and efficiency of the federated learning process.
[0025] Furthermore, in step 3), a blockchain-based vehicle network federated learning optimization algorithm is invented. The federated learning network is regarded as a monopoly market, which includes several operator headquarters (full roadside unit nodes), M operator branches (light roadside unit nodes) and N vehicle nodes. Vehicle node i is the data owner and has a local data sample size of S. i and multiple models. Each vehicle node can choose X i A model is used to participate in the federated learning task. The sample consists of an input-output pair. The input sample contains data feature vectors of various messages, and the output sample is a message traffic classification, which is used to determine the security of message communication. The model is used to classify the message traffic of local data samples for the behavior detection training of vehicle nodes in the Internet of Vehicles. The vehicle node contains multiple models, which are federated through a multi-level learning algorithm to improve the accuracy of federated learning and make behavior detection more accurate.
[0026] Step 3-1: The aggregation of the federated learning model and the rewards and penalties given to the vehicle node by the roadside unit light node depend on the local reputation value of the vehicle node. When the vehicle node registers to join the federated learning network, it needs to submit information such as the number of device CPU cores, memory capacity, power capacity, and driver violation records to form a reputation attribute set (ReputationAttribute Matrix-RAM).
[0027] RAM={ra1,ra2,…,ra l ,…,ra m} (4)
[0028] Step 3-2: Calculate the initial reputation value IR of the vehicle node i i ,in Represents the reputation attribute ra g The relevant metric function of the credible measurement.
[0029]
[0030] Step 3-3: During the driving process, vehicle node i defines the local reputation value through path transmission loss and the accuracy of the provided message, and feeds back the reputation generated in the area to the roadside unit. The local reputation value of the vehicle node in the calculation area is defined as:
[0031]
[0032] Where ω1 and ω2 represent the weights of path loss and message transmission accuracy, and γ and η are additional parameters used to adjust the impact of path loss and message transmission accuracy. i Message accuracy:
[0033]
[0034] Where T and F represent the number of correct and incorrect messages sent by vehicle node i to the roadside unit light node in the federated learning network, respectively.
[0035] Step 3-4: Since the local reputation value of a vehicle is time-sensitive, the roadside unit light node for message transmission will change as the vehicle moves. Therefore, the local reputation of vehicle node i at time t is defined as If no information exchange is performed within time t, the initial reputation is used for assignment. When vehicle node i changes the roadside unit light node for communication, the weighted update method of the historical reputation value is used for update.
[0036]
[0037] in represents the local trust value of the τth history within the window time, and σ is a decay function used to control the weight of the historical trust value.
[0038] Step 3-7: The learning outcome θ generated by each model j of vehicle node i ij , uploaded to the roadside unit light node through transactions. ij The local precision ε is included ij and model parameters The roadside unit light node will be θ B ={θ1,θ2,…,θ i ,…θ M}Package into blocks and upload to blockchain (BC). And initially aggregate the learning results to form a preliminary global model for model j
[0039]
[0040] Among them LR ix is the local reputation value between vehicle node i and roadside unit light node x, and t represents the number of rounds.
[0041] Step 3-8: The roadside unit light node updates the global model parameters Broadcast to all vehicles so that they can use it in the next round of training. After the vehicle receives the global model, further training and updating are performed based on the local data model j. The training is repeated multiple times until the roadside unit light node converges for the local data model j or reaches a predetermined number of training rounds.
[0042]
[0043] Step 3-9: In order to obtain the best detection model for classification, the full RSU node uses the global model results of the q RSU light nodes in the federated learning network. The results are selected and optimized, where j = 1, 2, ..., q. The global model structure is divided into B seed models according to the model type. The B model of q roadside unit light nodes is fused with the global parameter model of the roadside unit light node using the weighted average fusion method to obtain the comprehensive global model of the B model.
[0044]
[0045] Where b = 1, 2, …, B. The full roadside unit node uses local data to fine-tune each model to further improve its accuracy. All selected optimized sub-models are deployed on the original vehicle node, and the best model is used for the actual message detection task. Other sub-models are used for the next global model training, and new local data is continuously collected to optimize and update the model regularly.
[0046] Furthermore, in step 4), a vehicle reward and punishment mechanism based on reputation value is constructed.
[0047] Step 4-1: Define the iterative calculation time of the local training model j of vehicle node i.
[0048]
[0049] where f ij is the CPU cycle frequency of vehicle node i during the local model j training process. ijis the number of CPU cycles required by vehicle node i to train local model j using a single data sample.
[0050] Step 4-2: Calculate the CPU energy consumed by one iteration in the local training model j.
[0051]
[0052] in is the effective capacitance parameter of the computing chipset of vehicle node i. In each round of training, the learning rate η is dynamically adjusted according to the convergence of the model to accelerate model convergence and improve accuracy. In the process of global model training, all vehicle nodes in the federated learning network undergo multi-level global iterations to achieve multi-model global learning. The vehicle node sends its local model update results to the roadside unit light node through wireless communication. The result contains ε ij is the local accuracy achieved by updating the local model j, corresponding to the local data quality of vehicle node i. ij The higher the value, the fewer the local iterations.
[0053] Step 4-3: Calculate the data transmission rate of vehicle node i.
[0054]
[0055] Where BW i represents the bandwidth, ρ i is the transmission power of the vehicle node, h i is the point-to-point channel gain from vehicle node i to roadside unit light node x, and N0 is the background noise. Assuming that the data size updated by each model j of all vehicle nodes is the same, it is a constant σ j The transmission time for each vehicle node to update the local model j is
[0056] Step 4-4: The total time of global iteration includes the calculation time of local iteration and the uplink communication time of local model update. Therefore, the total time for a vehicle node to participate in a global multi-level model iteration is
[0057]
[0058] Step 4-5: Calculate the transmission energy consumption of local model j of vehicle node i in the global iteration.
[0059]
[0060] Step 4-6: During one global iteration, the total energy consumption of vehicle node i is:
[0061]
[0062] Step 4-7: Finally, the reward and penalty received by vehicle node i in the federated learning network comes from the roadside unit light node x that issues the task. The calculation formula for its reward value Reward is:
[0063]
[0064] Among them, α, β, γ and δ are weight coefficients, which can be adjusted through experiments or experience to ensure the rationality and effectiveness of the reward and punishment mechanism; E i is the total energy consumption of vehicle i in a global iteration process; T i is the global trust of the vehicle; FLPO is the result of the federated learning model; ε ij is the local accuracy of the model of vehicle i in predicting message event j, and n is the number of models of vehicle i.
[0065] Beneficial effects: The present invention is a method for detecting Internet of Vehicles behavior using a blockchain-driven reward and punishment mechanism and federated learning, which aims to solve the problems of insufficient data privacy, node trust and system transparency in existing methods. The present invention introduces a reputation value evaluation mechanism to dynamically measure the credibility and contribution of autonomous driving vehicles (CAVs) participating in federated learning, effectively manage and incentivize node behavior, avoid the negative impact of selfish nodes on the system, and thus improve the overall efficiency and security of the system. At the same time, a dynamic anomaly detection method based on federated learning is proposed, which uses a multi-level dynamic aggregation of vehicle local models to store the optimal global model on the blockchain to achieve data transparency and immutability.
[0066] In addition, the present invention proposes a prepayment game mechanism based on blockchain, which enhances the loyalty of participating nodes and system stability in the Internet of Vehicles environment by optimizing resource utilization efficiency, and avoids the degradation of system performance caused by unreasonable resource allocation in traditional methods. Through this mechanism, unnecessary communication overhead and resource waste are effectively reduced, and the application effect of federated learning in Internet of Vehicles anomaly detection is improved. The present invention provides a safe, efficient and scalable solution for Internet of Vehicles behavior detection in intelligent transportation systems, and lays a theoretical and technical foundation for future Internet of Vehicles security management and anomaly detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 A multi-level federated learning vehicle network anomaly system model driven by blockchain.
[0068] Figure 2 Comparison of the accuracy of federated learning under five models.
[0069] Figure 3Savings value in federated learning varies with learning rounds. DETAILED DESCRIPTION
[0070] The technical method of the present invention will be further described in detail below in conjunction with the accompanying drawings.
[0071] like Figure 1 As shown in the figure, a multi-level federated learning model driven by blockchain is constructed. The above network model is mainly divided into the following four layers:
[0072] Autonomous driving vehicles (CAVs): The main task of CAVs is to use local data to participate in the training of local intrusion detection models in federated learning, and send the parameters of the training results to the roadside unit (RSU). The local data set only contains normal traffic to ensure privacy protection. Each CAV acts as a working node of federated learning and performs learning and training tasks through the on-board unit (OBU). CAVs can apply to the RSU for the use of multiple models. After the application is successful, they can download the latest block of the blockchain to obtain the latest global model and must participate in the global learning process.
[0073] Roadside Units (RSUs): RSUs play a core role in the model distribution and CAVs model results aggregation process. During the training of the intrusion detection model, the RSUs mainly undertake three key tasks. First, the RSUs use the federated learning vehicle selection algorithm to dynamically select the CAVs nodes that are most suitable for participating in the federated learning (FL) model training to ensure the effectiveness and diversity of the training. Secondly, the RSUs aggregate the model application results of CAVs, review and distribute the required models through smart contracts. After the CAVs complete the model training, the RSUs use the federated learning model calculation method to aggregate and verify the model to ensure the accuracy of the results and create new blocks in the consensus process. Finally, before the federated learning task is started, the RSUs dynamically calculate and collect prepaid fees based on the CAV’s reputation value and historical model training records, and after the task is completed, rewards are issued based on the performance using the CAVs node’s reward and punishment mechanism to encourage the active participation of participants.
[0074] Blockchain: This framework uses blockchain technology to ensure the security and transparency of federated learning model updates. Each roadside unit can create a trusted and tamper-proof ledger for secure storage and distribution of updates to anomaly detection models. The decentralized nature of blockchain effectively prevents a single node from controlling the entire IoV network, minimizing the risk of data tampering and single point failure.
[0075] Interplanetary File System (IPFS): IPFS is used in conjunction with blockchain in this framework to store anomaly logs. When an abnormal event is detected by the IoV network system, IPFS is used to store the anomaly log and generate the corresponding hash value, which is then recorded in the blockchain to ensure the immutability and traceability of the log. The anomaly detection system administrator regularly accesses and analyzes the anomaly logs stored in IPFS, uses the analysis results to optimize the IoV anomaly detection system, and continuously improves the federated learning training model to improve the overall security and responsiveness of the system.
[0076] In step 2, a blockchain-based federated learning vehicle selection algorithm is designed to calculate the prepayment amount of the node and select N max Nodes participate in federated learning.
[0077] Step 2-1: Calculate vehicle driving records
[0078]
[0079] Among them, γ1 and γ2 are the weight coefficients of driving records, VC i is the number of violation records, ML i For mileage.
[0080] Step 2-2: Calculate the complexity of the current task
[0081]
[0082] Among them, θ1 and θ2 are the weight coefficients of the complexity of the current task, D i is the number of current tasks of node i EO i,j,max Data volume (MB), is the single-round training time of model j of vehicle node i, T max Limiting the total training time for federated learning, EO i,j,max is the maximum number of convergence rounds of vehicle node i trained in model j obtained from historical records, and n is the number of models of vehicle i. and EO i,j,max A smaller value ensures that the number of training rounds does not exceed the maximum number of convergence rounds of the node to prevent overfitting.
[0083] Step 2-3: The prepaid amount P is calculated based on this i
[0084]
[0085] Among them, λ is the adjustment coefficient, which is used to adjust the overall level of prepayment amount, Reward i For the last reward, is the historical reputation value, DRi For driving records, BW i For network broadband.
[0086] Step 2-4: Based on the calculated prepayment amount P i , sort from high to low, select the first N max This method increases the prepayment amount by improving reputation value and reducing energy consumption, ensuring the participation of high-quality nodes, thereby improving model accuracy and efficiency, while enhancing node participation enthusiasm and data quality, and ensuring the fairness and efficiency of the federated learning process.
[0087] In step 3, a blockchain-based federated learning optimization algorithm for the Internet of Vehicles is invented. The federated learning network is considered as a monopoly market, which contains several operator headquarters (full roadside unit nodes), M operator branches (light roadside unit nodes), and N vehicle nodes. Vehicle node i is the data owner and has a local data sample size of S. i and multiple models. Each vehicle node can choose X i A model is used to participate in the federated learning task. The sample consists of an input-output pair. The input sample contains data feature vectors of various messages, and the output sample is a message traffic classification, which is used to determine the security of message communication. The model is used to classify the message traffic of local data samples for the behavior detection training of vehicle nodes in the Internet of Vehicles. The vehicle node contains multiple models, which are federated through a multi-level learning algorithm to improve the accuracy of federated learning and make behavior detection more accurate.
[0088] Step 3-1: The aggregation of the federated learning model and the rewards and penalties given to the vehicle node by the roadside unit light node depend on the local reputation value of the vehicle node. When the vehicle node registers to join the federated learning network, it needs to submit information such as the number of device CPU cores, memory capacity, power capacity, and driver violation records to form a reputation attribute set (ReputationAttribute Matrix-RAM).
[0089] RAM={ra1,ra2,…,ra l ,…,ra m}
[0090] Step 3-2: Calculate the initial reputation value IR of the vehicle node i i ,in Represents the reputation attribute ra g The relevant metric function of the credible measurement.
[0091]
[0092] Step 3-3: During the driving process, vehicle node i defines the local reputation value through path transmission loss and the accuracy of the provided message, and feeds back the reputation generated in the area to the roadside unit. The local reputation value of the vehicle node in the calculation area is defined as:
[0093]
[0094] Where ω1 and ω2 represent the weights of path loss and message transmission accuracy, and γ and η are additional parameters used to adjust the impact of path loss and message transmission accuracy. i Message accuracy:
[0095]
[0096] Where T and F represent the number of correct and incorrect messages sent by vehicle node i to the roadside unit light node in the federated learning network, respectively.
[0097] Step 3-4: Since the local reputation value of a vehicle is time-sensitive, the roadside unit light node for message transmission will change as the vehicle moves. Therefore, the local reputation of vehicle node i at time t is defined as If no information exchange is performed within time t, the initial reputation is used for assignment. When vehicle node i changes the roadside unit light node for communication, the weighted update method of the historical reputation value is used for update.
[0098]
[0099] in represents the local trust value of the τth history within the window time, and σ is a decay function used to control the weight of the historical trust value.
[0100]
[0101] Step 3-5: The learning outcome θ generated by each model j of vehicle node i ij , uploaded to the roadside unit light node through transactions. ij The local precision ε is included ij and model parameters The roadside unit light node will be θ B ={θ1,θ2,…,θ i ,…θ M}Package into blocks and upload to blockchain (BC). And initially aggregate the learning results to form a preliminary global model for model j
[0102]
[0103] Among them LR ix is the local reputation value between vehicle node i and roadside unit light node x, and t represents the number of rounds.
[0104] Step 3-6: The roadside unit light node updates the global model parameters Broadcast to all vehicles so that they can use it in the next round of training. After the vehicle receives the global model, further training and updating are performed based on the local data model j. The training is repeated multiple times until the roadside unit light node converges for the local data model j or reaches a predetermined number of training rounds.
[0105]
[0106] Step 3-7: In order to obtain the best detection model for classification, the full RSU node uses the global model results of the q RSU light nodes in the federated learning network. The results are selected and optimized, where j = 1, 2, ..., q. The global model structure is divided into B seed models according to the model type. The B model of q roadside unit light nodes is fused with the global parameter model of the roadside unit light node using the weighted average fusion method to obtain the comprehensive global model of the B model.
[0107]
[0108] Where b = 1, 2, …, B. The full roadside unit node uses local data to fine-tune each model to further improve its accuracy. All selected optimized sub-models are deployed on the original vehicle node, and the best model is used for the actual message detection task. Other sub-models are used for the next global model training, and new local data is continuously collected to optimize and update the model regularly.
[0109] In step 4, a vehicle reward and punishment mechanism based on reputation value is constructed.
[0110] Step 4-1: Define the iterative calculation time of the local training model j of vehicle node i.
[0111]
[0112] where f ij is the CPU cycle frequency of vehicle node i during the local model j training process. ij is the number of CPU cycles required by vehicle node i to train local model j using a single data sample.
[0113] Step 4-2: Calculate the CPU energy consumed by one iteration in the local training model j.
[0114]
[0115] in is the effective capacitance parameter of the computing chipset of vehicle node i. In each round of training, the learning rate η is dynamically adjusted according to the convergence of the model to accelerate model convergence and improve accuracy. In the process of global model training, all vehicle nodes in the federated learning network undergo multi-level global iterations to achieve multi-model global learning. The vehicle node sends its local model update results to the roadside unit light node through wireless communication. The result contains ε ij is the local accuracy achieved by updating the local model j, corresponding to the local data quality of vehicle node i. ij The higher the value, the fewer the local iterations.
[0116] Step 4-3: Calculate the data transmission rate of vehicle node i.
[0117]
[0118] Where BW i represents the bandwidth, ρ i is the transmission power of the vehicle node, h i is the point-to-point channel gain from vehicle node i to roadside unit light node x, and N0 is the background noise. Assuming that the data size updated by each model j of all vehicle nodes is the same, it is a constant σ j The transmission time for each vehicle node to update the local model j is
[0119] Step 4-4: The total time of global iteration includes the calculation time of local iteration and the uplink communication time of local model update. Therefore, the total time for a vehicle node to participate in a global multi-level model iteration is
[0120]
[0121] Step 4-5: Calculate the transmission energy consumption of local model j of vehicle node i in the global iteration.
[0122]
[0123] Step 4-6: During one global iteration, the total energy consumption of vehicle node i is:
[0124]
[0125] Step 4-7: Finally, the reward and penalty received by vehicle node i in the federated learning network comes from the roadside unit light node x that issues the task. The calculation formula for its reward value Reward is:
[0126]
[0127] Among them, α, β, γ and δ are weight coefficients, which can be adjusted through experiments or experience to ensure the rationality and effectiveness of the reward and punishment mechanism; E i is the total energy consumption of vehicle i in a global iteration process; T i is the global trust of the vehicle; FLPO is the result of the federated learning model; ε ij is the local accuracy of the model of vehicle i in predicting message event j, and n is the number of models of vehicle i.
[0128] Aiming at the problems of privacy protection, node selection and resource utilization efficiency in existing federated learning in vehicle network behavior detection, this paper proposes a blockchain-driven federated learning behavior detection optimization framework. First, this paper designs a multi-level federated learning method based on vehicle selection algorithm, which can dynamically select distributed autonomous driving vehicles (CAVs) to participate in local model training, and aggregate the optimal global model in the roadside unit (RSU) through a weighted average algorithm, and record the model on the blockchain to improve the transparency and network security of the system. Secondly, a reputation value evaluation mechanism is constructed to measure the credibility and contribution of CAVs nodes, and an incentive mechanism is used to encourage active nodes, punish or exclude poorly performing nodes, and improve system fairness and node participation. Finally, a blockchain-based prepayment reward mechanism is proposed, which requires CAVs nodes to make prepayments before participating in model training, and rewards nodes after generating a global model, so as to optimize resource utilization efficiency and enhance the stability and effectiveness of federated learning.
[0129] The above is only an implementation method of the present invention under the blockchain-based Internet of Vehicles model. The protection scope of the present invention is not limited to the above implementation method. Any equivalent modifications and other modifications made by ordinary technicians in this field based on the contents disclosed by the present invention should be included in the protection scope recorded in the claims.
Claims
1. A blockchain-driven reward and punishment mechanism and a federated learning vehicle network behavior detection method, characterized by: The following steps are involved: Step 1: The roadside unit uses the federated learning vehicle selection algorithm to dynamically select the most suitable autonomous driving vehicle nodes for participating in the federated learning model training, and the prepaid amount serves as a deposit for the autonomous driving vehicle to participate in the federated learning; Step 2: The autonomous vehicle applies to the roadside unit for the latest parameters of the local training model in federated learning. The roadside unit summarizes the model application results of the autonomous vehicle, reviews them through smart contracts, and distributes the required models. Step 3: After the model application is successful, the autonomous driving vehicle downloads the latest block of the blockchain to obtain the latest global model parameters. Then the autonomous driving vehicle uses local data to participate in the local training model training in federated learning. The federated learning model includes several roadside unit full nodes, M roadside unit light nodes and N vehicle nodes. The roadside unit full nodes constitute the blockchain. Step 4: The autonomous vehicle transmits the learning results generated by local training to the light node of the roadside unit. After receiving the learning results, the light node uploads them to the full node of the roadside unit. After the consensus process, all nodes upload the learning results to the chain and aggregate the models of each participating node through the federated learning method to generate a global model; Subsequently, the roadside unit broadcasts the parameters of the global model to all autonomous vehicles participating in federated learning. After receiving the global model parameters, the autonomous vehicles will perform further training and updates based on their own local training models. Step 5: The RSU full node performs weighted average fusion on the global model parameters of the RSU light nodes to obtain a comprehensive global model, and broadcasts the comprehensive global model to all RSU light nodes; Step 6: Compare the local model training of the autonomous driving vehicle with the global model, and give a certain amount of reward to the autonomous driving vehicles participating in federated learning based on the accuracy and reputation value of the model.
2. According to claim 1, a blockchain-driven reward and punishment mechanism and a method for detecting Internet of Vehicles behavior based on federated learning, characterized in that: Step 1 specifically includes: Step 1-1: Calculate vehicle driving records Among them, γ1 and γ2 are the weight coefficients of driving records, VC i is the number of violation records, ML i is the mileage; Step 1-2: Calculate the complexity of the current task Among them, θ1 and θ2 are the weight coefficients of the complexity of the current task, D i is the number of current tasks of node i EO i,j,max According to the quantity, is the single-round training time of model j of vehicle node i, T max Limiting the total training time for federated learning, EO i,j,max is the maximum number of convergence rounds of vehicle node i trained in model j obtained from historical records, and n is the number of models of vehicle i; Step 1-3: Calculate the prepayment amount P i Among them, λ is the adjustment coefficient, which is used to adjust the overall level of prepayment amount, Reward i For the last reward, is the historical reputation value, DR i For driving records, BW i For network width; Step 1-4: Based on the calculated prepayment amount P i , sort from high to low, select the first N max Nodes participate in federated learning.
3. According to claim 1, a blockchain-driven reward and punishment mechanism and a method for detecting Internet of Vehicles behavior based on federated learning, characterized in that: Step 4 specifically includes: Step 4-1: The learning outcome θ generated by each model j of vehicle node i ij , uploaded to the roadside unit light node through transactions; θ ij The local precision ε is included ij and model parameters The roadside unit light node will be θ B ={θ1, θ2, ..., θ i ,…θ M }Package into blocks and upload to the roadside unit full node after consensus, and initially aggregate the learning results to form a preliminary global model for model j Among them LR ix is the local reputation value between vehicle node i and roadside unit light node x, and t represents the number of rounds; Step 4-2: The roadside unit light node updates the global model parameters Broadcast to all vehicles participating in federated learning so that they can use it in the next round of training; After the vehicle receives the global model, further training and updating are performed based on the local data model j; Repeat the training multiple times until the roadside unit light node converges for the local data model j or reaches the predetermined number of training rounds 4. According to claim 3, a blockchain-driven reward and punishment mechanism and a method for detecting Internet of Vehicles behavior based on federated learning are characterized by: Step 5 specifically includes: the full roadside unit node is based on the global model results of q roadside unit light nodes in the federated learning network The results are selected and optimized, where j = 1, 2, ..., q; according to The global model structure is divided into B seed models according to the model type. The B model of q roadside unit light nodes is fused with the global parameter model of the roadside unit light node using the weighted average fusion method to obtain the comprehensive global model of the B model. Where b = 1, 2, ..., B; the roadside unit full node uses local data to fine-tune each model to improve the accuracy of the model; all optimized sub-models are selected and deployed on the original vehicle node, and the best model is used for the actual message detection task; other sub-models are used for the next global model training, and new local data is continuously collected to optimize and update the model regularly.
5. According to claim 3, a blockchain-driven reward and punishment mechanism and a method for detecting Internet of Vehicles behavior based on federated learning, characterized in that: Step 6 specifically includes: before the federated learning task is started, the roadside unit dynamically calculates and collects the prepaid deposit based on the reputation value of the autonomous driving vehicle and the historical model training records, and after the task is completed, rewards are issued based on the performance using the reward and punishment mechanism of the autonomous driving vehicle node to encourage the active participation of participants. The specific steps include: Step 6-1: When registering a vehicle node to join the federated learning network, you need to submit the device's CPU core number, memory capacity, power capacity, and driver violation record information to form a reputation attribute set. RAM={ra1,ra2,…,ra l ,…,on m } Step 6-2: Calculate the initial reputation value IR of the vehicle node i i ,in Represents the reputation attribute ra g The relevant metric function of the credible measurement Step 6: During the driving process, vehicle node i defines the local reputation value through path transmission loss and the accuracy of the provided message, and feeds back the reputation generated in the area to the roadside unit. The local reputation value of the vehicle node in the calculated area is defined as: Where ω1 and ω2 represent the weights of path loss and message transmission accuracy, γ and η are additional parameters used to adjust the impact of path loss and message transmission accuracy; Ture i Message accuracy: Where T and F represent the number of correct and incorrect messages sent by vehicle node i to the roadside unit light node in the federated learning network, respectively; Step 6-4: Define the set of local reputations of vehicle node i at time t If no information interaction is performed within time t, the initial reputation is used for assignment; when vehicle node i replaces the roadside unit light node of communication, the weighted update method of historical reputation value is used for update in represents the local trust value of the τth history within the window time, and σ is a decay function used to control the weight of the historical trust value; Step 6-5: Calculate the rewards and penalties received by vehicle node i in the federated learning network from the roadside unit light node x that issues the task. The calculation formula for its reward value Reward is: Among them, α, β, γ and δ are weight coefficients; E i is the total energy consumption of vehicle i in a global iteration process; T i is the global trust of the vehicle; FLPO is the result of the federated learning model; ε ij is the local accuracy of the message event predicted by the model of vehicle i, and n is the number of models of vehicle i.
6. A blockchain-driven reward and punishment mechanism and federated learning vehicle network behavior detection system, characterized in that: including autonomous vehicles, roadside units, blockchain, and the InterPlanetary File System; Autonomous vehicles use local data to participate in local model training in federated learning, and send the parameters of the training results to the roadside unit; each autonomous vehicle acts as a working node of federated learning and performs learning and training tasks through the on-board unit; autonomous vehicles apply to the roadside unit for the use of multiple models, and after successful application, they download the latest block of the blockchain to obtain the latest global model and must participate in the global learning process; The tasks of the roadside unit are: using the federated learning vehicle selection algorithm to dynamically select the most suitable autonomous driving vehicle nodes for participating in the federated learning model training; summarizing the model application results of the autonomous driving vehicles, reviewing and distributing the required models through smart contracts; after the autonomous driving vehicle completes the model training, the roadside unit uses the federated learning model calculation method to aggregate and verify the model to ensure the accuracy of the results, and creates a new block in the consensus process; Before the federated learning task is started, the prepayment fee is dynamically calculated and collected based on the reputation value of the autonomous driving vehicle and the historical model training record. After the task is completed, rewards are issued based on the performance using the reward and punishment mechanism of the autonomous driving vehicle node to encourage the active participation of participants. The blockchain consists of trusted and immutable blocks created by each autonomous vehicle for secure storage and distribution of updates to the anomaly detection model; The function of the InterPlanetary File System is: when the Internet of Vehicles detects an abnormal event, the InterPlanetary File System is used to store the abnormality log and generate corresponding hash values, which are then recorded in the blockchain.
Citation Information
Patent Citations
Autonomous vehicle credible lane changing method based on block chain and federal reinforcement learning
CN115660077A
Federal learning excitation method and device based on block chain, equipment and storage medium
CN116595094A
Internet of vehicles federated learning excitation method and system based on deep reinforcement learning
CN117034130A
Internet of Things intrusion detection method, system and equipment
CN118250042A
Internet of vehicles intrusion detection model construction method based on federated learning
CN118784305A
Cited By
Opportunity fair federated learning excitation method and system based on game theory
CN120123884A
Dynamic trusted aggregation method and system for vehicle networking federated learning
CN122951794A