Driving path privacy protection method, electronic device and storage medium
By combining differential privacy technology with the federated learning framework, dynamically adjusting the density and distance of road network nodes, and using hybrid distance calculation and Gaussian noise addition, the problems of privacy protection and data availability of logistics vehicle driving paths are solved, achieving efficient privacy protection and model optimization in a dynamic road network environment.
Patent Information
- Application Number
- CN202411596350.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-11-11
AI Technical Summary
Existing privacy protection technologies make it difficult to simultaneously ensure the privacy and data availability of logistics vehicle driving routes in a dynamic road network environment. Especially in the federated learning scenario, how to protect privacy while maintaining data validity and model accuracy is a challenge.
Differential privacy technology is combined with a federated learning framework to dynamically adjust node density and road network distance through a road network hierarchical model. Hybrid distance calculation and dynamic path updates are used, combined with Gaussian noise addition to ensure the flexibility and accuracy of privacy protection.
It effectively protects the privacy of logistics vehicles' driving paths, is suitable for complex and real-time changing logistics scenarios, improves the accuracy and usability of the model in federated learning, and prevents the actual location of logistics vehicles from being inferred through model parameters.
Smart Images

Figure CN119557917B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle driving path privacy protection, and in particular to a driving path privacy protection method, electronic equipment and storage medium. Background Art
[0002] With the rapid development of the logistics industry, vehicle route data is widely used to optimize transportation routes, improve delivery efficiency, and reduce costs. However, this data often contains a large amount of sensitive geographic location information. Especially in logistics networks, vehicle routes can directly reflect a company's business operations, customer location information, and the vehicle's real-time location. If this data is leaked without protection, it can lead to serious privacy and security issues such as location tracking, malicious competition, and data abuse.
[0003] Existing privacy protection technologies often rely on data encryption or obfuscation. While these technologies can protect location information to a certain extent, they struggle to simultaneously ensure both data availability and privacy, especially in scenarios where logistics routes are dynamically updated and data is shared. Furthermore, differential privacy has been proven to effectively address privacy leaks. However, applying this technology in a dynamic road network environment to accurately protect the privacy of logistics vehicle routes remains a technical challenge.
[0004] Traditional differential privacy methods struggle to account for varying road types, traffic conditions, and data heterogeneity when processing location data. Logistics vehicles travel complex and diverse routes, with varying road types, congestion levels, and vehicle speeds, making a single privacy protection strategy difficult to meet practical needs. Furthermore, in federated learning scenarios, ensuring data validity and model accuracy while protecting privacy remains a pressing challenge.
[0005] Therefore, the technical problem to be solved by the present invention is to propose a differential privacy protection method that can be dynamically updated according to the hierarchical structure, traffic conditions and paths of the road network, which can not only protect the privacy of the logistics vehicle's driving path but also maintain the availability of the data. Summary of the Invention
[0006] The purpose of the present invention is to provide a driving path privacy protection method, electronic device and storage medium to solve the problems raised in the above background technology.
[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0008] A driving path privacy protection method, applied to logistics vehicles, includes:
[0009] S100, collecting dynamic road network data of the logistics vehicle, obtaining real-time traffic data and road types of the logistics vehicle based on the dynamic road network data and GIS, and performing hierarchical division processing on the dynamic road network data;
[0010] S200: setting node density of road nodes in the hierarchical road network data according to the hierarchical road network data; dynamically adjusting the node density according to the real-time traffic data and road type; and determining an optional set of obfuscated locations in the dynamically adjusted road nodes according to a dynamic weight random sampling algorithm.
[0011] S300, calculating the degree of traffic congestion based on real-time traffic data and dynamically adjusting the road network distance; calculating the mixed distance in combination with the Euclidean distance, determining the selection probability of each obfuscated position in the optional set, and further confirming the final obfuscated position;
[0012] S400, analyzing the indistinguishability of each layer in the hierarchical road network data according to the hybrid distance; calculating the comprehensive indistinguishability, and dynamically adjusting the privacy budget;
[0013] S500: Obtain data of each client of the logistics vehicle, confirm the client model gradient respectively according to the loss function and comprehensive indistinguishability, calculate the local difference of each client, and dynamically adjust the label type of the client;
[0014] S600, calculating the client's gradient change rate based on the client model gradient; dynamically adjusting the clipping threshold based on the client's gradient change rate and label type, and generating and adding noise that conforms to the Gaussian distribution;
[0015] S700: Calculate personalized bias correction values for each client, update the local model, and upload the gradients and parameters for adding noise. The server aggregates the model parameters uploaded by all clients and adds Gaussian noise to the global model.
[0016] S800: Broadcast the global model with added noise to the client and continue the next round of federated learning iteration.
[0017] Preferably, S100 includes:
[0018] S101, the real-time traffic data includes the traffic flow, speed, road width, number of lanes, road congestion and construction information of logistics vehicles;
[0019] S102: pre-processing the collected data, including removing abnormal data, completing missing data, removing duplicate records, and unifying the scale and unit of the data;
[0020] S103, hierarchical division processing: Divide the road network into different levels according to the importance, usage frequency and traffic flow of roads in the dynamic road network data, and construct a hierarchical road network model; wherein the roads at each level in the hierarchical road network model have different importance and traffic characteristics.
[0021] Preferably, S200 includes:
[0022] S201, obtaining hierarchical road network data, dividing roads in the road network data into multiple intervals; one interval represents a node, and setting a corresponding basic node density according to the road type;
[0023] S202. Dynamically adjust the basic node density based on traffic flow, vehicle speed, road width, and number of lanes in real-time traffic data:
[0024] Among them, D adjusted is the node density after dynamic adjustment, D base is the basic node density, T traffic To set the traffic flow index, T congestion is the degree of traffic congestion, W is the actual width of the road (meters), max is the maximum road width, as a normalized reference value, L is the number of lanes on the road, L max To express the maximum road width, Q max is the maximum carrying capacity of the road, γ, δ, λ1, λ2 are adjustment coefficients, which respectively control the impact of traffic flow, vehicle speed, road width, and number of lanes on node density;
[0025] S203, based on the dynamically adjusted node density D adjusted Lay out road nodes, calculate the distance between logistics vehicles and each road node, map the real-time location of logistics vehicles to the nearest node and record the node coordinates;
[0026] S204: Determine the weight of each road node based on the traffic flow, vehicle speed, and road congestion conditions in the real-time traffic data:
[0027]
[0028] Among them, V current is the current vehicle speed, V free is the normal speed under free flow state, α and β are the adjustment coefficients of speed difference and traffic flow, ∈ j is a random perturbation term, sampled from the uniform distribution U(-δ,δ);
[0029] S205: If there are n road nodes, the weight value w of each road node is jNormalized, the selection probability of each road node is calculated as At this time, the random sampling interval is divided by the cumulative weight value, the interval corresponding to the generated random number is confirmed, and the node corresponding to the interval is used as the confusion position; the confusion position is added to the set of all nodes of the current road to form a new node set S = {p1, p2, p3, ..., p n ,p j}.
[0030] Preferably, S300 includes:
[0031] S301. Obtain the real-time speed V of logistics vehicles in real-time traffic data current , get the traffic congestion level T congestion : Among them, V free is the vehicle speed in free flow state;
[0032] S302, according to the traffic congestion level T congestion , actual distance d G (p i ,p' j ) Confirm the adjusted road network distance Where α is the adjustment factor;
[0033] S303. Calculate the hybrid distance by combining the Euclidean distance: Among them, d euclidean (p i ,p j ') is the Euclidean distance, for node p i and p j ' is calculated based on the geographical coordinates, and β is the dynamically adjusted weight coefficient;
[0034] S304, according to the mixed distance D hybrid (p i ,p j ') Calculate the selection probability of each node in the node set S: Among them, α is a parameter that controls the sensitivity of selection; at this time, according to the selection probability P(p j '|p i ) Select the final obfuscated position p'.
[0035] Preferably, S400 includes:
[0036] S401. Obtain hierarchical road network data and calculate the road network distance at each level Among them, w k is the weight of the road node, K is the number of paths in this level;
[0037] S402, confirm the indistinguishability measure RN-I of each level according to the road network distance of each level L :
[0038]
[0039] Among them, ∈ L Budget for privacy at this level;
[0040] S403, based on the indistinguishability measurement RN-I L Confirm the comprehensive dynamic indistinguishability of the entire road network:
[0041]
[0042] Among them, λ L is the weight of each level, ∈ dyn budget for comprehensive privacy;
[0043] S404. Dynamically adjust the privacy budget based on the comprehensive dynamic indistinguishability and traffic congestion level. The privacy budget adjustment formula is: Among them, ∈0 is the initial privacy budget, and γ is the traffic congestion impact coefficient.
[0044] Preferably, S500 includes:
[0045] S501. Obtain the client data of each logistics vehicle and calculate the client model gradient
[0046]
[0047] Among them, |D i | is the number of samples in the dataset of client i, w t is the weight factor of time period t, γ is the adjustment factor to control the impact of traffic congestion on losses, is the square of the prediction error at time t, β is the weight coefficient for balancing the privacy protection loss, RN-I dyn It is synthetic indistinguishability;
[0048] S502: Calculate the local difference B(w) of each client: Where K is the number of clients participating in training, The gradient of the global model is calculated by averaging the gradients of all clients;
[0049] S503, dividing the vehicle trajectory data into different states or modes based on the real-time traffic data of the logistics vehicles, and defining a label for each state;
[0050] S504, based on comprehensive indistinguishability RN-I dynDynamically adjust the number of client tag types c nk :
[0051] c nk =c total ×RN-I dyn ;
[0052] Among them, c total is the number of initial tag types, RN-I dyn Indicates comprehensive indistinguishability.
[0053] Preferably, S600 includes:
[0054] S601, based on the gradient of a client i at time t Confirm the client's gradient change rate ΔG i (t): Among them, ∥·∥2 represents the L2 norm of the gradient, which is used to measure the size of the gradient vector;
[0055] S602: Based on the client gradient change rate ΔG i (t) and the number of label types to dynamically adjust the clipping threshold C i (t):
[0056]
[0057] Among them, C base is the basic clipping threshold, c n and c nk are the initial and adjusted number of tag types on the client side, RN-I dyn represents the comprehensive indistinguishability, f(ΔG i (t)) is the adjustment factor;
[0058] S603, based on the adjusted clipping threshold C i (t), dynamic privacy budget ∈ dyn and comprehensive indistinguishability RN-I dyn The standard deviation of the confirmation noise σ: Where δ is the privacy parameter; then the noise N(0,σ 2 );
[0059] S604: Add the generated Gaussian noise to the client-clipped gradient to obtain a gradient that meets the differential privacy requirements. in, is the client's original gradient, N(0,σ 2 ) is the generated Gaussian noise.
[0060] Preferably, S700 includes:
[0061] S701, according to the gradient of a client i at time t Calculate the personalized bias correction value b i (t): Among them, η b is the bias correction coefficient, is the gradient of the global model;
[0062] S702, according to the personalized deviation correction value b i (t) and the gradient that meets the differential privacy requirements Update the local model parameters w of a client i i : Where η is the learning rate;
[0063] S703, the server receives the personalized model parameters w uploaded by all clients i , confirm the updated parameters of the global model Where K is the number of clients participating in federated learning;
[0064] S704, according to the global model w global Confirm the clipping threshold C of the global model global , then the standard deviation σ of the noise is calculated as follows: Generate the corresponding noise N(0,σ) that conforms to the Gaussian distribution to protect the privacy of the global model 2 );
[0065] S705, Gaussian noise N(0,σ 2 ) is added to the global model w global In the paper, we obtain the global model parameters that meet the requirements of differential privacy.
[0066] An electronic device, comprising:
[0067] at least one processor;
[0068] and, a memory communicatively coupled to the at least one processor;
[0069] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the above protection method.
[0070] A computer-readable storage medium stores a computer program, wherein the computer program implements the above-mentioned protection method when executed by a processor.
[0071] Compared with the prior art, the present invention has the following beneficial effects:
[0072] The present invention provides a solution that can effectively protect the privacy of logistics vehicle driving paths by combining differential privacy technology with a federated learning framework. This method uses a road network hierarchical model to grade roads according to importance, frequency of use, and traffic conditions, and dynamically adjusts the road network distance and node density to ensure that the strength of privacy protection can adapt to different traffic scenarios. On this basis, hybrid distance calculation and dynamic path update are used to further improve the accuracy and flexibility of privacy protection. Through the dynamic adjustment of the clipping threshold and the addition of Gaussian noise, the present invention effectively handles the problem of data heterogeneity during the model training process, ensures that the personalized characteristics of client data are fully reflected, and enhances the accuracy and usability of the model in federated learning. At the same time, this method prevents the risk of inferring the actual location of logistics vehicles through model parameters, effectively protects sensitive location information, and is suitable for complex and real-time changing logistics scenarios, especially in large-scale dynamic road network environments, where it exhibits superior privacy protection capabilities and model optimization effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0074] Figure 1 It is a flow chart of a driving path privacy protection method of the present invention;
[0075] Figure 2 is a schematic flow chart of S200 and S300 in a driving path privacy protection method of the present invention;
[0076] Figure 3 is a schematic flow chart of S500 in a driving route privacy protection method of the present invention;
[0077] Figure 4 It is a schematic flow chart of S700 in a driving path privacy protection method of the present invention. DETAILED DESCRIPTION
[0078] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0079] See also Figure 1-Figure 4 , the present invention provides a technical solution:
[0080] A driving path privacy protection method, applied to logistics vehicles, includes:
[0081] S100, collecting dynamic road network data of the logistics vehicle, obtaining real-time traffic data and road types of the logistics vehicle based on the dynamic road network data and GIS, and performing hierarchical division processing on the dynamic road network data;
[0082] Preferably, S100 includes:
[0083] S101, the real-time traffic data includes the traffic flow, speed, road width, number of lanes, road congestion and construction information of logistics vehicles;
[0084] Dynamic road network data is collected, with real-time traffic data continuously acquired. Integrating with a geographic information system (GIS) to obtain traffic flow, vehicle speed, road congestion, construction information, and geographic information data, including road types and intersections, ensures the accuracy of road characteristics and surrounding environment data. Due to the characteristics of different data sources, the collection frequency will be dynamically adjusted according to actual conditions; for example, traffic flow and vehicle speed data are updated once a minute, while accident and construction information are updated according to actual conditions.
[0085] S102: pre-processing the collected data, including removing abnormal data, completing missing data, removing duplicate records, and unifying the scale and unit of the data;
[0086] Preprocess the collected data to ensure data quality and consistency. This includes using statistical methods to detect and remove outliers, such as those caused by sensor failures and GPS drift, as well as completing missing data and removing duplicate records to ensure the uniqueness of each data point in time and space. The data scale and units are also standardized. This series of preprocessing steps ensures the accuracy and reliability of the data foundation for subsequent model training and privacy protection strategies.
[0087] S103, hierarchical division processing: dividing the road network into different levels according to the importance, usage frequency and traffic flow of roads in the dynamic road network data, and constructing a hierarchical road network model; wherein the roads at each level in the hierarchical road network model have different importance and traffic flow characteristics;
[0088] Hierarchical road network data processing is performed, dividing the road network into different levels based on road importance, frequency of use, and traffic flow. A hierarchical road network model is constructed, specifically including trunk roads, secondary trunk roads, and branch roads. Roads at each level have different importance and traffic characteristics. Trunk roads are used for high-traffic, high-importance roads, such as highways. Data on these roads is updated frequently and has stricter privacy protection requirements. Secondary trunk roads are used for internal urban traffic flow, while branch roads are used in residential areas or remote areas with lower traffic flow. This provides a basis for data discretization and processing. The system can dynamically adjust privacy protection strategies based on the characteristics of roads at different levels, ensuring that the strength of privacy protection matches the importance of the road. Hierarchical processing not only increases the flexibility of privacy protection but also ensures that more stringent protection measures are implemented on roads with high traffic flow and high privacy risks.
[0089] S200: setting node density of road nodes in the hierarchical road network data according to the hierarchical road network data; dynamically adjusting the node density according to the real-time traffic data and road type; and determining an optional set of obfuscated locations in the dynamically adjusted road nodes according to a dynamic weight random sampling algorithm.
[0090] Preferably, S200 includes:
[0091] S201, obtaining hierarchical road network data, dividing roads in the road network data into multiple intervals; one interval represents a node, and setting a corresponding basic node density according to the road type;
[0092] Urban roads typically have heavy and complex traffic, so nodes are set up every 50 meters to ensure the accuracy and flexibility of privacy protection. Highways, while experiencing heavy traffic, have relatively uniform road conditions, so nodes are set up every 200 meters to meet demand. Rural roads, with their low traffic volume and less complex interactions, have nodes set up every 500 meters. This division ensures that the optimal node density is allocated to each road type based on its characteristics, thereby improving the overall system's operational efficiency.
[0093] S202. Dynamically adjust the basic node density based on traffic flow, vehicle speed, road width, and number of lanes in real-time traffic data:
[0094] Among them, D adjusted is the node density after dynamic adjustment, D base is the basic node density, T traffic To set the traffic flow index, T congestion is the degree of traffic congestion, W is the actual width of the road (meters), max is the maximum road width, as a normalized reference value, L is the number of lanes on the road, Lmax To express the maximum road width, Q max is the maximum capacity of the road, and γ, δ, λ1, and λ2 are adjustment coefficients that control the impact of traffic flow, vehicle speed, road width, and number of lanes on node density, respectively. Roads with high traffic volume will have increased node density, while roads with slower speeds will have reduced node density. This adjustment ensures better protection of user privacy on busy roads.
[0095] S203, based on the dynamically adjusted node density D adjusted Lay out road nodes, calculate the distance between logistics vehicles and each road node, map the real-time location of logistics vehicles to the nearest node and record the node coordinates;
[0096] S204: Determine the weight of each road node based on the traffic flow, vehicle speed, and road congestion conditions in the real-time traffic data:
[0097]
[0098] Among them, V current is the current vehicle speed, V free is the normal speed under free flow state, α and β are the adjustment coefficients of speed difference and traffic flow, ∈ j is a random perturbation term, sampled from the uniform distribution U(-δ,δ);
[0099] Through this formula, nodes with larger traffic volumes will receive higher weights, which means these nodes are more likely to be selected in subsequent obfuscation operations, thereby enhancing privacy protection.
[0100] S205: If there are n road nodes, the weight value w of each road node is j Normalized, the selection probability of each road node is calculated as At this time, the random sampling interval is divided by the cumulative weight value, the interval corresponding to the generated random number is confirmed, and the node corresponding to the interval is used as the confusion position; the confusion position is added to the set of all nodes of the current road to form a new node set S = {p1, p2, p3, ..., p n ,p j}.
[0101] By randomly sampling and selecting obfuscation locations, the node selection probability is calculated, and finally a node within the weighted cumulative value range is selected as the obfuscation location. This step effectively increases the unpredictability of the obfuscation operation by introducing randomness, thereby significantly improving the privacy protection capabilities of the system. This obfuscation mechanism makes it difficult for outsiders to simply analyze the user's actual location, ensuring that the user's location information is not leaked.
[0102] S300, calculating the degree of traffic congestion based on real-time traffic data and dynamically adjusting the road network distance; calculating the mixed distance in combination with the Euclidean distance, determining the selection probability of each obfuscated position in the optional set, and further confirming the final obfuscated position;
[0103] Preferably, S300 includes:
[0104] S301. Under actual traffic conditions, the road network distance will be affected by the degree of traffic congestion. In order to enable the system to adapt to different traffic conditions more flexibly, the real-time speed V of the logistics vehicle in the real-time traffic data is obtained. current , get the traffic congestion level Among them, V free is the vehicle speed in free-flow conditions. Through this formula, the system can adjust the road network distance according to real-time traffic conditions, ensuring that the system's route selection is more flexible and reasonable under different traffic congestion conditions.
[0105] S302, according to the traffic congestion level T congestion , actual distance d G (p i ,p' j ) Confirm the adjusted road network distance Where α is the adjustment factor, which ensures that the road network distance is dynamically adjusted according to the real-time traffic conditions;
[0106] S303. Calculate the hybrid distance by combining the Euclidean distance: ; Among them, d euclidean (p i ,p j ') is the Euclidean distance, for node p i and p j ' is calculated based on the geographical coordinates, and β is the dynamically adjusted weight coefficient;
[0107] Combining dynamic road network distance and Euclidean distance, balancing the influence of actual path and geometric distance, and calculating hybrid distance to balance the difference between actual driving path and geographical location, thus enhancing the indistinguishability of location;
[0108] By adjusting β, the influence of the two distances can be balanced according to different scenarios or needs. For example, in scenarios where precise routes are required, the weight of the dynamic road network distance can be increased, while in scenarios where privacy protection is required, the Euclidean distance can be preferred.
[0109] This hybrid distance ensures that the user's actual location is difficult to infer because it combines different characteristics of the actual driving route and geometric location, thereby increasing indistinguishability;
[0110] S304, according to the mixed distance Dhybrid (p i ,p j ') Calculate the selection probability of each node in the node set S: Among them, α is a parameter that controls the selection sensitivity, ensuring that the selection of different nodes has different probabilities. Through this formula, the obfuscated location that is far away from the user's actual location still has a certain probability of being selected, thereby effectively increasing the randomness and ensuring that it is difficult for the outside world to infer the user's true location through simple distance. At this time, according to the selection probability P(p j '|p i ) Select the final obfuscation position p';
[0111] Specifically, the system first normalizes all possible obfuscation locations based on the aforementioned selection probabilities, ensuring that the sum of all selection probabilities is 1. It then generates a random number r and selects a location based on the probability interval. If the random number r falls within the probability interval of a certain obfuscation location, that location becomes the final obfuscation location. Through random sampling, the system ensures sufficient randomness in the selection of obfuscation locations, significantly improving the system's privacy protection effectiveness and making it difficult for outsiders to infer a user's true location by analyzing their path choices.
[0112] S400, analyzing the indistinguishability of each layer in the hierarchical road network data according to the hybrid distance; calculating the comprehensive indistinguishability, and dynamically adjusting the privacy budget;
[0113] Preferably, S400 includes:
[0114] S401. Obtain hierarchical road network data and calculate the road network distance at each level Among them, w k is the weight of the road node, K is the number of paths in this level;
[0115] In a complex road network structure, different levels of roads (such as main roads, secondary roads, and branch roads) have different importance to the overall privacy protection and path selection of the system. Therefore, this step calculates the weighted hybrid distance of the paths at each level to reflect the importance of each level of path, and combines the hybrid distance of the dynamic road network distance and the Euclidean distance;
[0116] Paths at different levels are given different weights according to their importance. The weights of main roads are usually higher because these roads play a more critical role in traffic flow and location privacy, while the weights of branch roads are relatively lower;
[0117] S402, confirm the indistinguishability measure RN-I of each level according to the road network distance of each level L :
[0118]
[0119] Among them, ∈ L The privacy budget for this level is dynamically adjusted to suit different privacy requirements. Privacy budgets at different levels are allocated based on the importance and traffic volume of the road.
[0120] For example, for main roads, the privacy budget is larger to ensure stricter privacy protection; while for branch roads with less traffic, the privacy budget can be relatively low;
[0121] S403, based on the indistinguishability measurement RN-I L Confirm the comprehensive dynamic indistinguishability of the entire road network:
[0122]
[0123] Among them, λ L is the weight of each level, ∈ dyn budget for comprehensive privacy;
[0124] Through this calculation, the system can integrate the privacy protection effects of various levels, ensuring effective privacy protection on roads at different levels, and ultimately improving the privacy protection level of the overall system;
[0125] After calculating the indistinguishability metrics at each level, the system also needs to calculate the comprehensive dynamic indistinguishability of the entire road network. Based on the indistinguishability metrics at each level, the comprehensive dynamic indistinguishability of the entire road network is calculated to ensure privacy protection at different levels.
[0126] S404. Dynamically adjust the privacy budget based on the comprehensive dynamic indistinguishability and traffic congestion level. The privacy budget adjustment formula is: Where ∈0 is the initial privacy budget, and γ is the traffic congestion impact coefficient. This dynamic adjustment mechanism ensures that the privacy protection budget can dynamically adapt to the current network environment under different traffic conditions and privacy requirements, flexibly adjusting the privacy protection level, thereby effectively improving the privacy protection effect.
[0127] Through this dynamic adjustment mechanism, the system can adjust the privacy protection level in a timely manner when traffic conditions change, ensuring that in cases of severe congestion or heavy traffic, the privacy budget is increased and the privacy protection intensity is improved; in cases of light traffic, the privacy budget can be reduced accordingly, thereby improving the system's operating efficiency.
[0128] S500: Obtain data of each client of the logistics vehicle, confirm the client model gradient respectively according to the loss function and comprehensive indistinguishability, calculate the local difference of each client, and dynamically adjust the label type of the client;
[0129] Preferably, S500 includes:
[0130] S501. In order to balance privacy protection and prediction accuracy in the federated learning framework, a comprehensive loss function is used for global optimization to balance privacy protection and prediction accuracy. This ensures that prediction accuracy, traffic congestion impact, and privacy protection are considered simultaneously during model training, balancing privacy protection and model performance. The comprehensive loss function is defined as:
[0131]
[0132] During model training, the loss function not only minimizes prediction error but also optimizes model performance while maintaining privacy. By balancing privacy loss and prediction loss, the system can achieve the dual goals of higher privacy protection and prediction accuracy.
[0133] Obtain the client data of each logistics vehicle and calculate the client model gradient
[0134]
[0135] Among them, |D i | is the number of samples in the dataset of client i, w t is the weight factor of time period t, γ is the adjustment factor to control the impact of traffic congestion on losses, is the square of the prediction error at time t, β is the weight coefficient for balancing the privacy protection loss, RN-I dyn It is synthetic indistinguishability;
[0136] Through this gradient calculation formula, each client can perform local optimization of the model based on its local data and privacy protection requirements, and provide useful update information for the global model in the federated learning framework;
[0137] S502: Calculate the local difference B(w) of each client: Where K is the number of clients participating in training, The gradient of the global model is calculated by averaging the gradients of all clients;
[0138] The calculation of local differences helps the system dynamically evaluate the client's contribution to the global model update while ensuring data security in combination with privacy protection requirements;
[0139] S503, dividing the vehicle trajectory data into different states or modes based on the real-time traffic data of the logistics vehicles, and defining a label for each state;
[0140] To better analyze and model vehicle trajectory data, the data is divided into different states or modes, and labels are defined for each state. These labels help the system distinguish different traffic conditions, enabling more detailed modeling and optimization for different scenarios. Specific states and labels include:
[0141] 1) Normal driving: The vehicle is driving under normal traffic conditions, without obvious traffic interference or emergencies;
[0142] 2) Traffic congestion: When a vehicle is traveling in a traffic congestion area, its speed drops significantly, and it may be accompanied by frequent stops and starts.
[0143] 3) Detour: An alternative route chosen by a vehicle to avoid congested or closed roads, which may take less commonly used routes;
[0144] 4) Parking: The vehicle is completely stationary, regardless of whether it is due to traffic lights, traffic control or other reasons;
[0145] 5) Abnormal driving: Abnormal driving behaviors such as sudden acceleration and braking may be caused by emergencies or dangerous situations;
[0146] The definition of these labels helps the system adjust privacy protection strategies under different driving conditions and optimize the model more accurately;
[0147] S504, based on comprehensive indistinguishability RN-I dyn Dynamically adjust the number of client tag types c nk :
[0148] c nk =c total ×RN-I dyn ;
[0149] Among them, c total is the number of initial tag types, RN-I dyn represents comprehensive indistinguishability;
[0150] This adjustment mechanism ensures that each client's data can be dynamically optimized according to its privacy needs, while improving the ability to handle heterogeneous data under the federated learning framework.
[0151] S600, calculating the client's gradient change rate based on the client model gradient; dynamically adjusting the clipping threshold based on the client's gradient change rate and label type, and generating and adding noise that conforms to the Gaussian distribution;
[0152] Preferably, S600 includes:
[0153] S601, based on the gradient of a client i at time t Confirm the client's gradient change rate ΔG i (t): Among them, ∥·∥2 represents the L2 norm of the gradient, which is used to measure the size of the gradient vector;
[0154] This formula reflects the change of the client gradient over time. If the gradient change rate is large, it means that the model update is more drastic and requires stricter privacy protection measures; if the change rate is small, it means that the model update is relatively stable.
[0155] S602: Based on the client gradient change rate ΔG i (t) and the number of label types to dynamically adjust the clipping threshold C i (t):
[0156]
[0157] Among them, C base is the basic clipping threshold, c n and c nk are the initial and adjusted number of tag types on the client side, RN-I dyn represents the comprehensive indistinguishability, f(ΔG i (t)) is the adjustment factor;
[0158] Where, f(ΔG i (t)) is defined as:
[0159]
[0160] Among them, β and γ are the adjustment amplitudes for controlling the gradient change rate to be large and small, respectively, and θ is the threshold value of the gradient change rate;
[0161] According to the client gradient change rate ΔG i (t) and the number of label types to dynamically adjust the clipping threshold C i (t), the clipping threshold is used to control the maximum amplitude of the uploaded gradient to prevent some abnormal gradients from having too large an impact on the global model, while also ensuring that the requirements of differential privacy are met;
[0162] This adjustment mechanism allows the client's clipping threshold to adapt to gradient changes, avoiding overly strict clipping on models with relatively slow updates while ensuring stricter control on models with large changes, thereby balancing the effectiveness of model updates and privacy protection.
[0163] S603, based on the adjusted clipping threshold C i (t), dynamic privacy budget ∈ dyn and comprehensive indistinguishability RN-I dyn The standard deviation of the confirmation noise σ: Where δ is the privacy parameter; then the noise N(0,σ 2 );
[0164] The Gaussian noise generation process adheres to the strict requirements of differential privacy. By dynamically adjusting the noise amplitude based on the current gradient clipping threshold and privacy budget, the noise intensity is ensured to adapt to the actual situation of the client, thereby maximizing the preservation of useful information in the gradient while ensuring privacy.
[0165] S604: Add the generated Gaussian noise to the client-clipped gradient to obtain a gradient that meets the differential privacy requirements. in, is the client's original gradient, N(0,σ 2 ) is the generated Gaussian noise;
[0166] By adding noise to the gradients, the system ensures that the gradient data uploaded by the client complies with differential privacy requirements, thereby protecting the client's privacy. This process effectively prevents the inference of the client's private data through analysis of the uploaded gradients. At the same time, the intensity of the noise is optimized through a dynamic adjustment mechanism, ensuring privacy without significantly impacting model performance.
[0167] S700: Calculate personalized bias correction values for each client, update the local model, and upload the gradients and parameters for adding noise. The server aggregates the model parameters uploaded by all clients and adds Gaussian noise to the global model.
[0168] Preferably, S700 includes:
[0169] S701, according to the gradient of a client i at time t Calculate the personalized bias correction value b i (t): Among them, η b is the bias correction coefficient, is the gradient of the global model;
[0170] Calculate a personalized bias correction value b for each client i (t) is used to adjust the deviation between the client model and the global model, ensuring that the client can make personalized adjustments based on the difference between its own data distribution and the global model, ensuring that the client model can be effectively adjusted according to its own data distribution, and enhancing the adaptability of the client model;
[0171] The core idea of this formula is to compare the local gradient of the client with the global gradient, calculate the difference between the two, and use the deviation correction coefficient η bThis allows the client model to be optimized based on the changes in the global model and its own data characteristics, enhancing the model's adaptability. In particular, when there is heterogeneity in data distribution, the bias correction mechanism can help the client better adapt to the pace of global model updates.
[0172] S702, according to the personalized deviation correction value b i (t) and the gradient that meets the differential privacy requirements Update the local model parameters w of a client i i : Where η is the learning rate;
[0173] This formula adjusts the client model parameters through two parts: the first part is the gradient after differential privacy processing Used to ensure the security of private data when the client model is updated; the second part is the personalized bias correction value b i (t), used to balance the differences between the client model and the global model and enhance the personalized performance of the client model;
[0174] By combining these two components, the system not only ensures privacy protection but also enables personalized adjustments based on the client's specific data characteristics, ensuring that the model better adapts to the client's actual situation. This personalized update mechanism is particularly suitable for scenarios with large data heterogeneity and can significantly improve model performance under the federated learning framework.
[0175] S703, the server receives the personalized model parameters w uploaded by all clients i , confirm the updated parameters of the global model Where K is the number of clients participating in federated learning;
[0176] In each round of federated learning, the server averages and aggregates the model parameters of all clients to generate updated parameters for the global model. This process ensures that the global model reflects the contribution of each client while maintaining the efficiency of model updates.
[0177] S704, according to the global model w global Confirm the clipping threshold C of the global model global , then the standard deviation σ of the noise is calculated as follows: Generate the corresponding noise N(0,σ) that conforms to the Gaussian distribution to protect the privacy of the global model 2 );
[0178] The system can dynamically adjust the noise intensity based on the privacy budget and indistinguishability metric. The noise generation process ensures that the global model does not leak the client's private information during broadcast, while also maintaining the rationality of the model performance.
[0179] S705, Gaussian noise N(0,σ 2 ) is added to the global model w global In the paper, we obtain the global model parameters that meet the requirements of differential privacy.
[0180] By adding noise to the global model, the system effectively prevents external attackers from inferring private information about individual clients by analyzing global model parameters. The intensity of the added noise is adjusted based on the dynamic privacy budget and the system's indistinguishability metric, ensuring privacy while minimizing the impact on model performance.
[0181] S800: Broadcast the global model with added noise to the client and continue the next round of federated learning iteration.
[0182] An electronic device, comprising:
[0183] at least one processor;
[0184] and, a memory communicatively coupled to the at least one processor;
[0185] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the above protection method.
[0186] A computer-readable storage medium stores a computer program, wherein the computer program implements the above-mentioned protection method when executed by a processor.
[0187] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art will be able to modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A driving route privacy protection method, applied to logistics vehicles, characterized by: The method comprises: S100, collecting dynamic road network data of the logistics vehicle, obtaining real-time traffic data and road types of the logistics vehicle based on the dynamic road network data and GIS, and performing hierarchical division processing on the dynamic road network data; S200: setting node density of road nodes in the hierarchical road network data according to the hierarchical road network data; dynamically adjusting the node density according to the real-time traffic data and road type; and determining an optional set of obfuscated locations in the dynamically adjusted road nodes according to a dynamic weight random sampling algorithm. S300, calculating the degree of traffic congestion based on real-time traffic data and dynamically adjusting the road network distance; calculating the mixed distance in combination with the Euclidean distance, determining the selection probability of each obfuscated position in the optional set, and further confirming the final obfuscated position; S400, analyzing the indistinguishability of each layer in the hierarchical road network data according to the hybrid distance; calculating the comprehensive indistinguishability, and dynamically adjusting the privacy budget; S500: Obtain data of each client of the logistics vehicle, confirm the client model gradient respectively according to the loss function and comprehensive indistinguishability, calculate the local difference of each client, and dynamically adjust the label type of the client; S600, calculating the client's gradient change rate based on the client model gradient; dynamically adjusting the clipping threshold based on the client's gradient change rate and label type, and generating and adding noise that conforms to the Gaussian distribution; S700: Calculate personalized bias correction values for each client, update the local model, and upload the gradients and parameters for adding noise. The server aggregates the model parameters uploaded by all clients and adds Gaussian noise to the global model. S800: Broadcast the global model with added noise to the client and continue the next round of federated learning iteration.
2. The driving route privacy protection method according to claim 1, characterized in that: The S100 includes: S101, the real-time traffic data includes the traffic flow, speed, road width, number of lanes, road congestion and construction information of logistics vehicles; S102: pre-processing the collected data, including removing abnormal data, completing missing data, removing duplicate records, and unifying the scale and unit of the data; S103, hierarchical division processing: Divide the road network into different levels according to the importance, usage frequency and traffic flow of roads in the dynamic road network data, and construct a hierarchical road network model; wherein the roads at each level in the hierarchical road network model have different importance and traffic characteristics.
3. The driving route privacy protection method according to claim 2, characterized in that: The S200 includes: S201, obtaining hierarchical road network data, dividing roads in the road network data into multiple intervals; one interval represents a node, and setting a corresponding basic node density according to the road type; S202. Dynamically adjust the basic node density based on traffic flow, vehicle speed, road width, and number of lanes in real-time traffic data: Among them, D adjusted is the node density after dynamic adjustment, D base is the basic node density, T traffic To set the traffic flow index, T congestion is the degree of traffic congestion, W is the actual width of the road (meters), max is the maximum road width, as a normalized reference value, L is the number of lanes on the road, L max To express the maximum road width, Q max is the maximum carrying capacity of the road, γ, δ, λ1, λ2 are adjustment coefficients, which respectively control the impact of traffic flow, vehicle speed, road width, and number of lanes on node density; S203, based on the dynamically adjusted node density D adjusted Lay out road nodes, calculate the distance between logistics vehicles and each road node, map the real-time location of logistics vehicles to the nearest node and record the node coordinates; S204: Determine the weight of each road node based on the traffic flow, vehicle speed, and road congestion conditions in the real-time traffic data: Among them, V current is the current vehicle speed, V free is the normal speed under free flow state, α and β are the adjustment coefficients of speed difference and traffic flow, ∈ j is a random perturbation term, sampled from the uniform distribution U(-δ,δ); S205: If there are n road nodes, the weight value w of each road node is j Normalized, the selection probability of each road node is calculated as At this time, the random sampling interval is divided by the cumulative weight value, the interval corresponding to the generated random number is confirmed, and the node corresponding to the interval is used as the confusion position; the confusion position is added to the set of all nodes of the current road to form a new node set S = {p1, p2, p3, ..., p n ,p j }.
4. The driving route privacy protection method according to claim 3, characterized in that: The S300 includes: S301. Obtain the real-time speed V of logistics vehicles in real-time traffic data current , get the traffic congestion level T congestion : Among them, V free is the vehicle speed in free flow state; S302, according to the traffic congestion level T congestion , actual distance d G (p i ,p' j ) Confirm the adjusted road network distance Where α is the adjustment factor; S303. Calculate the hybrid distance by combining the Euclidean distance: Among them, d euclidean (p i ,p j ') is the Euclidean distance, for node p i and p j ' is calculated based on the geographical coordinates, and β is the dynamically adjusted weight coefficient; S304, according to the mixed distance D hybrid (p i ,p j ') Calculate the selection probability of each node in the node set S: Among them, α is a parameter that controls the sensitivity of selection; at this time, according to the selection probability P(p j '|p i ) Select the final obfuscated position p'.
5. The driving route privacy protection method according to claim 4, characterized in that: The S400 includes: S401. Obtain hierarchical road network data and calculate the road network distance at each level Among them, w k is the weight of the road node, K is the number of paths in this level; S402, confirm the indistinguishability measure RN-I of each level according to the road network distance of each level L : Among them, ∈ L Budget for privacy at this level; S403, based on the indistinguishability measurement RN-I L Confirm the comprehensive dynamic indistinguishability of the entire road network: Among them, λ L is the weight of each level, v dyn budget for comprehensive privacy; S404. Dynamically adjust the privacy budget based on the comprehensive dynamic indistinguishability and traffic congestion level. The privacy budget adjustment formula is: Among them, ∈0 is the initial privacy budget, and γ is the traffic congestion impact coefficient.
6. The driving route privacy protection method according to claim 5, characterized in that: The S500 includes: S501. Obtain the client data of each logistics vehicle and calculate the client model gradient Among them, |D i | is the number of samples in the dataset of client i, w t is the weight factor of time period t, γ is the adjustment factor to control the impact of traffic congestion on losses, is the square of the prediction error at time t, β is the weight coefficient for balancing the privacy protection loss, RN-I dyn It is synthetic indistinguishability; S502: Calculate the local difference B(w) of each client: Where K is the number of clients participating in training, The gradient of the global model is calculated by averaging the gradients of all clients; S503, dividing the vehicle trajectory data into different states or modes based on the real-time traffic data of the logistics vehicles, and defining a label for each state; S504, based on comprehensive indistinguishability RN-I dyn Dynamically adjust the number of client tag types c nk : c nk =c total ×RN-I dyn ; Among them, c total is the number of initial tag types, RN-I dyn Indicates comprehensive indistinguishability.
7. The driving route privacy protection method according to claim 6, characterized in that: The S600 includes: S601, based on the gradient of a client i at time t Confirm the client's gradient change rate ΔG i (t): Among them, ∥·∥2 represents the L2 norm of the gradient, which is used to measure the size of the gradient vector; S602: Based on the client gradient change rate ΔG i (t) and the number of label types to dynamically adjust the clipping threshold C i (t): Among them, C base is the basic clipping threshold, c n and c nk are the initial and adjusted number of tag types on the client side, RN-I dyn represents the comprehensive indistinguishability, f(ΔG i (t)) is the adjustment factor; S603, based on the adjusted clipping threshold C i (t), dynamic privacy budget ∈ dyn and comprehensive indistinguishability RN-I dyn The standard deviation of the confirmation noise σ: Where δ is the privacy parameter; then the noise N(0,σ 2 ); S604: Add the generated Gaussian noise to the client-clipped gradient to obtain a gradient that meets the differential privacy requirements. in, is the client's original gradient, N(0,σ 2 ) is the generated Gaussian noise.
8. The driving route privacy protection method according to claim 7, characterized in that: The S700 includes: S701, according to the gradient of a client i at time t Calculate the personalized bias correction value b i (t): Among them, η b is the bias correction coefficient, is the gradient of the global model; S702, according to the personalized deviation correction value b i (t) and the gradient that meets the differential privacy requirements Update the local model parameters w of a client i i : Where η is the learning rate; S703, the server receives the personalized model parameters w uploaded by all clients i , confirm the updated parameters w of the global model global (t+1): Where K is the number of clients participating in federated learning; S704, according to the global model w global Confirm the clipping threshold C of the global model global , then the standard deviation σ of the noise is calculated as follows: Generate the corresponding noise N(0,σ) that conforms to the Gaussian distribution to protect the privacy of the global model 2 ); S705, Gaussian noise N(0,σ 2 ) is added to the global model w global In the paper, we obtain the global model parameters that meet the requirements of differential privacy.
9. An electronic device, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the protection method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the protection method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Privacy protection asynchronous federation sharing method and system based on block chain
CN114297722A
Intelligent logistics trolley data sharing and privacy protection method based on alliance chain
CN118433191A