Privacy protection method and device for sparse traffic flow prediction based on cloud-edge-end collaboration

By using Transformer space-time self-attention mechanism and dynamic truncation Gaussian mechanism in the smart transportation system, the problem of privacy leakage in sparse traffic flow prediction is solved, and high-precision and safety prediction of sparse traffic flow are achieved.

CN119066712BActive Publication Date: 2025-02-07湖南工商大学
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411566051.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-02-07
Estimated Expiration
2044-11-05

AI Technical Summary

Technical Problem

The existing smart transportation system has the risk of privacy leakage in sparse traffic flow prediction, and traditional privacy protection technologies are difficult to effectively solve the privacy protection problem of sparse traffic data flow.

Method used

The Gestalt important region selection method based on the Transformer space-time self-attention mechanism is adopted, combined with the local w-event differential privacy protection method of dynamic truncation Gaussian mechanism, and the graph convolutional neural network pre-training protection method and space-time self-attachment protection method through dynamic space-time matrix completion Supervised learning of multi-objective weighted prediction method for traffic flows to achieve privacy protection and high-precision prediction of sparse traffic flows.

Benefits of technology

It effectively reduces the cost of data collection, ensures the privacy and security of traffic users, and improves the accuracy and security of traffic flow prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119066712B_ABST
    Figure CN119066712B_ABST
Patent Text Reader

Abstract

The present application provides a privacy protection method and device for cloud-edge-end collaborative sparse traffic flow prediction, including the following steps: Step 1: Adaptive sampling selection based on the Gestalt important area selection method of the Transformer spatiotemporal self-attention mechanism; Step 2: Dynamic Gaussian noise protection based on the local w‑event differential privacy protection method of the dynamic truncated Gaussian mechanism; Step 3: Privacy protection based on the graph convolutional neural network pre-training protection method of dynamic spatiotemporal matrix completion; Step 4: Safe prediction of sparse traffic flow based on the multi-objective weighted prediction method of traffic flow based on spatiotemporal self-supervised learning. The present application is based on the Gestalt important area selection method to reduce the cost of data collection, by completing and pre-training the model for sparse traffic data streams, and clipping and differential privacy protection for the model gradients; the multi-objective weighted prediction method of traffic flow based on spatiotemporal self-supervised learning achieves safe prediction of traffic flow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of information security and smart transportation, and in particular to a privacy protection method and device for sparse traffic flow prediction in collaboration between cloud, edge and end. Background Art

[0002] With the acceleration of global urbanization, traffic congestion has become increasingly serious and has become one of the major challenges facing modern urban management. Traditional traffic management methods rely on fixed monitoring equipment and preset traffic signals, which are difficult to cope with complex and changing traffic conditions and growing traffic demand. Therefore, by combining technologies such as the Internet of Things, big data, and artificial intelligence, accurate predictions of traffic flow can be made and the traffic system can be adjusted and optimized in real time, greatly improving the efficiency, safety, and sustainability of the traffic system.

[0003] In the smart transportation system, the collection and analysis of traffic data is the core link. However, the traditional way of collecting traffic data mainly relies on fixed sensors and monitoring equipment, such as geomagnetic induction coils and traffic cameras, which have limited coverage and high construction and maintenance costs. To solve this problem, the smart transportation system based on cloud-edge collaboration has developed rapidly. Through sparsely distributed mobile terminal devices (such as smartphones, smart watches, car navigation systems, etc.), real-time traffic data is collected and submitted to edge nodes and cloud servers for collaborative training, providing efficient and accurate traffic flow predictions, which significantly reduces the cost of data collection.

[0004] However, the existing intelligent transportation system also faces the problem of privacy leakage of sparse traffic flow when collecting and predicting traffic flow. First, due to the sparse correlation and dynamic nature of sparse traffic flow, attackers can use data analysis attacks, link attacks and other means to infer the privacy of traffic data. Secondly, in the collaborative training of model prediction between edge nodes and cloud servers, attackers can use the correlation of model training parameters to infer the privacy of model structure and trained sparse traffic flow data. Therefore, how to ensure the privacy of sparse traffic flow prediction has become a hot issue that needs to be solved urgently.

[0005] Although researchers have proposed some advanced privacy protection technologies, such as anonymity methods, encryption methods, and differential privacy methods, these technologies still face a series of challenges in the face of sparse traffic data flows. For example, anonymous methods cannot resist link attacks and are difficult to provide effective protection. Encryption methods face large-scale sparse traffic flows, and the system overhead is large. In addition, only users with secret keys are allowed to obtain data, while trusted users without secret keys find it difficult to obtain the secret keys, which is not conducive to big data sharing. Current differential privacy technology mainly focuses on intensive data. When faced with highly sparse traffic flows, it will add a lot of noise, resulting in low traffic flow prediction accuracy. In addition, traffic flows have high sparse correlations. Existing differential privacy methods do not consider the privacy protection issues of sparse correlations, and there is a risk of privacy leakage. Summary of the invention

[0006] The present application is made in view of the above-mentioned problems, and its purpose is to provide a privacy protection method and device for sparse traffic flow prediction in cloud-edge-end collaboration, a Gestalt important area selection method based on the Transformer spatiotemporal self-attention mechanism, which makes full use of the spatiotemporal correlation and cosine similarity between data to realize adaptive important sampling area selection and reduce data collection costs; a local w-event differential privacy protection method based on a dynamic truncated Gaussian mechanism, which allocates a privacy budget to the traffic flow data in the window according to the w-event sliding window, and uses a dynamic truncated Gaussian mechanism to add noise to the local data, ensuring that the privacy of traffic users will not be leaked; a graph convolutional neural network pre-training protection method based on dynamic spatiotemporal matrix completion, which ensures privacy security by completing and pre-training the sparse traffic data stream, and clipping and differentially protecting the model gradient; a traffic flow multi-objective weighted prediction method based on spatiotemporal self-supervised learning, which realizes high-precision traffic flow safety prediction.

[0007] Specifically, the first aspect of the present application provides a privacy protection method for sparse traffic flow prediction in cloud-edge-end collaboration, including the following steps:

[0008] Step 1: Adaptively sample and select important areas of historical traffic flow based on the Gestalt important area selection method based on Transformer spatiotemporal self-attention mechanism;

[0009] Step 2: Based on the local w-event differential privacy protection method of the dynamic truncated Gaussian mechanism, the privacy budget is reasonably allocated to the traffic flow in the w sliding window, and dynamic Gaussian noise protection is performed;

[0010] Step 3: Based on the graph convolutional neural network pre-training protection method of dynamic spatiotemporal matrix completion, the sparse traffic flow is completed with spatiotemporal matrix and model pre-trained, and the correlation of model gradients is protected;

[0011] Step 4: A multi-objective weighted prediction method for traffic flow based on spatiotemporal self-supervised learning is used to safely predict sparse traffic flow in cloud-edge scenarios.

[0012] Furthermore, the step 1 specifically includes:

[0013] Step 1.1: Based on the fully connected neural network method, the historical raw traffic data stream is processed through the fully connected layer to generate feature embedding;

[0014] Step 1.2: Extract the embeddings corresponding to the day of the week and timestamp from the feature embedding dictionary, concatenate and broadcast these embeddings to obtain the periodic embedding of the traffic time series, and combine them with the spatiotemporal adaptive embedding to obtain the hidden spatiotemporal representation;

[0015] Step 1.3: Based on the Transformer method, the hidden spatiotemporal representation captures the complex traffic relationship by applying Transformer along the time axis and space axis, obtaining the query matrix, key matrix and value matrix, and calculating the spatiotemporal self-attention score;

[0016] Step 1.4: According to the Gestalt principle, the cosine similarity matrix between nodes is calculated, and combined with the spatiotemporal self-attention score matrix to obtain the final score matrix. The formula is as follows:

[0017] ;

[0018] in: is the final score matrix between node i and node j;

[0019] is the spatiotemporal self-attention score between node i and node j;

[0020] is the cosine similarity matrix between node i and node j;

[0021] is an adjustable parameter based on the spatiotemporal self-attention score;

[0022] is an adjustable parameter based on the cosine similarity matrix;

[0023] is a natural constant;

[0024] Step 1.5: Select K nodes with a higher number of high similarity nodes in the final score matrix as the sparse crowd sensing sampling node set.

[0025] Furthermore, the step 2 specifically includes:

[0026] Step 2.1: Based on the w-event differential privacy concept, the traffic flow data collected by traffic users is divided into multiple sliding windows w. In each sliding window w, differential privacy is used to perform differential privacy protection on the traffic flow data in the window.

[0027] Step 2.2: Based on the sliding window method, from the current sampling time t in the sampling node set, the sliding window range is [t-w+1, t], and the data change in the current window is calculated. The formula is as follows:

[0028] ;

[0029] in: is the amount of data change in the current sliding window;

[0030] is the minimum value of the current sliding window range;

[0031] is the sampling time;

[0032] is the number of rows of the ST matrix;

[0033] is the number of columns of the ST matrix;

[0034] is a three-dimensional data sampling matrix;

[0035] Step 2.3: Calculate the total data change in the entire time period and the privacy budget allocation ratio at the current time step t, and calculate the budget to be allocated at sampling time t based on the privacy allocation ratio. The formula is as follows:

[0036] ;

[0037] ;

[0038] ;

[0039] The constraints are: ;

[0040] in: is the total data change within the total time step;

[0041] is the sampling time;

[0042] is the number of rows of the ST matrix;

[0043] is the number of columns of the ST matrix;

[0044] is the total time step;

[0045] is a three-dimensional data sampling matrix;

[0046] Allocate the privacy budget ratio for the current time step t;

[0047] is the amount of data change in the current sliding window;

[0048] is the privacy budget that should be allocated at the current sampling time t;

[0049] Step 2.4: Traffic users use the truncated Gaussian mechanism to generate perturbation results locally according to the privacy budget. When the truncated Gaussian mechanism satisfies Local differential privacy, traffic users will check whether the data after adding noise is within the perceived data utility interval. If it is within the interval, the traffic user generates perturbed data based on the noise and uploads it to the edge node; if it is not within the interval, the traffic user will continue to sample noise from the truncated Gaussian distribution until the data falls within the utility interval, and then upload the final perturbed data to the edge node. When all traffic users upload data, the edge node obtains the final perturbed spatiotemporal data matrix, the formula is as follows:

[0050] Truncated Gaussian probability density function:

[0051] ;

[0052] The normalization factor is:

[0053] ;

[0054] Noise upload:

[0055] ;

[0056] in: is the truncated Gaussian probability density function;

[0057] is the normalization factor;

[0058] is the variance;

[0059] is the disturbance vector;

[0060] is the utility interval;

[0061] is the error function;

[0062] is the standard deviation;

[0063] the value of data collected for transportation users;

[0064] is the query function representing f(y)=x;

[0065] is the added Gaussian noise.

[0066] Furthermore, the step three specifically includes:

[0067] Step 3.1: For the sparsely sensed and noisy spatiotemporal data matrix, first calculate the nonlinear spatial constraint matrix through the spatial convolution layer, and then calculate the temporal constraint matrix through the temporal convolution layer, thereby transforming the completion constraint problem into the following optimization problem, and finally converting the spatiotemporal data matrix Decompose into spatial factor matrix and the time factor matrix The product of:

[0068] ;

[0069] The constraints are:

[0070] ;

[0071] in: is a sparsely sensed and noisy spatiotemporal data matrix;

[0072] is the spatial constraint matrix;

[0073] is the time constraint matrix;

[0074] is the spatial weight parameter;

[0075] is the weight parameter of time;

[0076] is a three-dimensional data sampling matrix;

[0077] is the rank of the matrix;

[0078] is the minimum function;

[0079] The data sampling area matrix indicates whether a certain area is selected;

[0080] is the F norm;

[0081] is the rank of the matrix;

[0082] is the matrix obtained after decomposition of the spatiotemporal data matrix;

[0083] Step 3.2: Based on the graph matrix completion method, define two sets. For a node with coordinates (i, j), its data inference value The representation can be replaced by a set, and the alternating least squares method is used to iteratively train and update the factors or , recover the unperceived data through linear calculation, and finally output the complete inference matrix , the formula is as follows:

[0084] Two collections:

[0085] ;

[0086] ;

[0087] Alternative representation of inferred values ​​of data:

[0088] ;

[0089] in: , For different sets of nodes;

[0090] is the number of columns of the matrix;

[0091] is the transpose symbol;

[0092] is the inferred value of the data;

[0093] is the column vector of matrix U;

[0094] is the column vector of matrix V;

[0095] Step 3.3: Based on the graph convolutional neural network method, the present invention converts the complete inference matrix Constructed from the original traffic flow graph The result generated in Node Collection Include The set of spatial nodes and the set of edges Represents the connection between these nodes, the adjacency matrix It describes the connection relationship between nodes. Traffic tensor The traffic inflow and outflow data in the first T time steps are recorded. At time step t, the traffic volume information of each node V is expressed as This information is transformed into the model's input tensor , and passed into the spatiotemporal graph convolution block. The spatiotemporal graph convolution block structure is a temporal convolution layer, a spatial convolution layer, and a temporal convolution layer. Specifically, the temporal convolution layer is expressed as: , the spatial convolutional layer is expressed as: ,in, represents the region embedding matrix at time step t. By introducing geographic context information, the detailed embedding of all regions is expressed as , after multiple convolution operations, the resulting embedding matrix sequence is , whose time dimension is ;

[0096] Step 3.4: Bernoulli distribution-based graph enhancement method, by enhancing the traffic flow graph at the tensor and topological levels, masking the area exist The traffic flow at each moment is lowly correlated with the noise disturbance. First, from the Bernoulli distribution Extracting the masking probability , The higher the value, the more exist Traffic tensor at the moment The more likely it is to be masked. After tensor-level enhancement, the data is represented as Next, the regional traffic flow graph G is enhanced at the topological level. and When the traffic patterns of will be masked and the correlation is measured by the metric; specifically, the embedding sequence of the region in time step from Extract and generate the overall embedding. The formula is as follows:

[0097] Correlation measures:

[0098] ;

[0099] Overall embedding:

[0100] ;

[0101] ;

[0102] in: For Region and The correlation between

[0103] is the derived aggregate weight The regions across different time steps in Aggregate representation of embedded sequences;

[0104] is the derived aggregate weight The regions across different time steps in Aggregate representation of embedded sequences;

[0105] Embedded as a whole;

[0106] is the index of the time step range (tT, t);

[0107] for the current moment;

[0108] is the time step;

[0109] is the aggregation weight;

[0110] For Region At time step Embedding

[0111] for The transpose of

[0112] is the learnable parameter vector for transformation;

[0113] Step 3.5: Generate K cluster embeddings by modeling spatial and temporal correlations based on spatiotemporal self-supervised learning methods As a potential factor for regional clustering, the implementation formula of the clustering process is:

[0114] ;

[0115] in: For Region The embedding of and the Kth cluster embedding The correlation score between

[0116] Enhanced Traffic Flow Graph The area encoded in Embedding

[0117] is the transpose of the K-th cluster embedding;

[0118] area The cluster assignment of , for the region embedding of the original traffic flow graph G , whose cluster assignment is calculated by The optimization objective function of the self-supervised enhancement task is defined as:

[0119] ;

[0120] The overall self-supervision objective over all regions is defined as follows:

[0121] ;

[0122] in: Optimizing objective function for self-supervised enhancement tasks;

[0123] To indicate the area The embedding of and the embedding of the kth cluster The estimated correlation score between ;

[0124] is an exponential function with the natural constant e as base;

[0125] for The predicted distribution score of

[0126] for The predicted distribution score of

[0127] For control Temperature parameter for output smoothness;

[0128] Loss functions for modeling spatial correlation;

[0129] Optimizing functions for self-supervised enhancement tasks;

[0130] is the weight parameter;

[0131] is the regional embedding of the original traffic flow graph G;

[0132] To embed the region of the enhanced traffic flow graph G;

[0133] In order to inject temporal correlation into region embeddings, we first fused the region embeddings in the original and enhanced traffic flow graphs as follows:

[0134] ;

[0135] Generate city-level representation at time step t:

[0136] ;

[0137] Region-level and city-level embeddings at the same time step is regarded as a positive sample, while the embeddings from different time steps are regarded as negative samples, and the loss function measured by cross entropy is optimized as follows:

[0138] ;

[0139] in: To fuse the region embeddings in the original and enhanced traffic flow graphs;

[0140] is the element-wise product;

[0141] are learnable parameters;

[0142] For Region The original region embedding at time step t;

[0143] For Region Enhanced region embedding at time step t;

[0144] Generate city-level representation for time step t;

[0145] Generate city-level representation for time step t-1;

[0146] is an S-shaped function;

[0147] is the total number of all regions;

[0148] For Region The fusion function at time step t;

[0149] For Region At time step The fusion function at ;

[0150] For region-level and city-level embeddings at the same time step;

[0151] Loss functions for modeling temporal dependencies;

[0152] , For two different time steps;

[0153] is the discriminant function;

[0154] Step 3.6: Based on the acuity-aware minimization optimizer, privacy is preserved by clipping edge updates and adding random noise. The local loss function is defined as:

[0155] ;

[0156] in:

[0157] is the local loss function;

[0158] for From the distribution The expected value of the sample in ;

[0159] is the perturbation model;

[0160] is a predefined constant that controls the perturbation radius;

[0161] for norm;

[0162] for From the distribution A random variable sampled from ;

[0163] is the set of natural numbers;

[0164] For each edge node , in each local iteration And each communication round In the example, the Pearson coefficient is introduced for adaptive noise addition, and the internal iteration steps of the edge node n are as follows:

[0165] ;

[0166] ;

[0167] ;

[0168] ;

[0169] .

[0170] in: is the gradient of the current t-th round and m-th iteration;

[0171] is the mean of the gradients from the tth round and the 1st to the mth iteration;

[0172] is the model parameter of customer n in the tth round and the mth internal iteration;

[0173] is the learning rate;

[0174] is the current t-th round, m-th iteration gradient after the disturbance;

[0175] is the loss function of edge node n The gradient of the model parameter w;

[0176] To add disturbance The model parameters after

[0177] Collect sample points for data;

[0178] To pass The first-order Taylor expansion around the calculation;

[0179] In each round of communication, with probability Sample i edge nodes and dynamically adjust the adaptive trimming threshold according to the statistical characteristics of local updates. ,After pruning, Gaussian noise is added to the edge server updates, and the harmonic mean noise scale is used to reduce the negative impact of noise on model consistency. The formula is as follows:

[0180] The updated representation of trimmed edge nodes is:

[0181] ;

[0182] ;

[0183] ;

[0184] in: is the change of model parameters;

[0185] The threshold for the local update pruning operation;

[0186] is the average bi-norm of the local updates of all edge nodes;

[0187] is the adaptive clipping threshold;

[0188] is the change in model parameters of edge node n in t communication rounds;

[0189] is the updated value of the model parameters of edge node n in t communication rounds;

[0190] is the updated value of the model parameters after Gaussian noise is added to edge node n in t communication rounds;

[0191] is the given noise variance;

[0192] is Gaussian noise;

[0193] is the change in model parameters of all edge nodes in t communication rounds;

[0194] For a given noise variance, the cumulative privacy budget can be calculated based on the sampled Gaussian mechanism by minimizing the local perturbation loss function , to achieve adaptive gradient noising, which satisfies Rényi differential privacy.

[0195] Furthermore, the step 4 specifically includes:

[0196] Step 4.1: Based on the cloud server weighted average aggregation method, aggregate the local updates of all edge nodes, update the global model parameters, and send the updated model parameters after global aggregation to the edge nodes to update their model parameters. The formula is as follows:

[0197] ;

[0198] in: is the model weight vector in the t+1 communication round;

[0199] is the model weight vector at t communication round;

[0200] represents the set of clients selected in round t;

[0201] is the updated value of the model parameters after Gaussian noise is added to edge node n in t communication rounds;

[0202] is the total number of selected clients;

[0203] Step 4.2: Prediction based on the multi-layer perceptron method, each region Embed As input, predict the future time step The traffic flow prediction formula is as follows:

[0204] ;

[0205] in: For Region At time step The predicted traffic flow results;

[0206] For Multilayer Perceptron method for output;

[0207] Step 4.3: Optimize the prediction loss function based on the minimization loss function method. The formula is as follows:

[0208] ;

[0209] in: To predict losses;

[0210] is the true value of the inflow;

[0211] is the predicted value of inflow;

[0212] is the true value of the outflow;

[0213] is the predicted value of outflow;

[0214] is the parameter used to balance the impact of each type of traffic flow;

[0215] Step 4.4: Based on the multi-objective adaptive weighting mechanism, through the learnable weight parameters and , adjust the weights of each sub-loss function, obtain the overall loss by combining the prediction loss, self-supervised learning spatial and temporal correlation modeling loss, and local perturbation loss, and obtain the global optimal prediction result by minimizing the overall loss. The formula is as follows:

[0216] ;

[0217] in: : Overall loss;

[0218] To predict losses;

[0219] , is a learnable weight parameter;

[0220] Loss functions for modeling spatial correlation;

[0221] Loss functions for modeling temporal dependencies;

[0222] is the local loss function of the edge node.

[0223] The second aspect of the present application provides a cloud-edge-end collaborative sparse traffic flow prediction privacy protection device, including a Gestalt important area selection module based on the Transformer spatiotemporal self-attention mechanism, a local w-event differential privacy protection module based on a dynamic truncated Gaussian mechanism, a graph convolutional neural network pre-training protection module based on dynamic spatiotemporal matrix completion, and a traffic flow multi-target weighted prediction module based on spatiotemporal self-supervised learning;

[0224] The Gestalt important area selection module based on the Transformer spatiotemporal self-attention mechanism performs adaptive important sampling area selection on historical traffic flow data and determines sparse crowd intelligence perception sampling nodes;

[0225] The local w-event differential privacy protection module based on the dynamic truncated Gaussian mechanism allocates a privacy budget to the traffic flow data in the w-event sliding window according to the w-event sliding window, and uses the dynamic truncated Gaussian mechanism to add noise to the local data;

[0226] The graph convolutional neural network pre-training protection module based on dynamic spatiotemporal matrix completion performs model pre-training by completing the sparse spatiotemporal matrix, and performs gradient clipping and differential privacy protection;

[0227] The multi-objective weighted prediction module of traffic flow based on spatiotemporal self-supervised learning performs safe prediction of traffic flow in cloud-edge sparse crowd intelligence perception scenarios;

[0228] The smart transportation cloud server platform collects historical public transportation data streams, and adaptively selects important sampling areas through the Gestalt important area selection module based on the Transformer spatiotemporal self-attention mechanism; through the local w-event differential privacy protection module based on the dynamic truncated Gaussian mechanism, traffic users allocate privacy budgets to the traffic flow data in the window according to the w-event sliding window for the collected sparse traffic data streams, use the dynamic truncated Gaussian mechanism to add noise to the local data, and submit the noisy data to the edge node; through the local w-event differential privacy protection module based on the dynamic spatiotemporal moment The graph convolutional neural network pre-training protection module with matrix completion, the edge node completes the spatiotemporal matrix of the sparse traffic data stream, performs model pre-training, and clips and adds noise to the model gradients generated by the pre-training, and uploads them to the smart transportation cloud server platform; through the multi-objective weighted prediction module of traffic flow based on spatiotemporal self-supervised learning, the traffic flow is safely predicted in the sparse group intelligence perception scenario of the cloud edge, the gradients submitted by each edge node are globally aggregated, and the updated model parameters after aggregation are sent to the edge node to update its model parameters, so as to safely predict the traffic flow at the future time step t+1.

[0229] In the second aspect, the present application also provides a computing device, which has the function of implementing the method described in the first aspect above. The beneficial effects can be found in the description of the first aspect, which will not be repeated here. The function can be implemented by hardware, or by executing the corresponding software implementation through hardware. The hardware or software includes one or more modules corresponding to the above functions. In one possible design, the structure of the device includes an acquisition module, a training module, and optionally, a construction module. These modules can implement the function of the training node in the method example of the first aspect above. Please refer to the detailed description in the method example for details, which will not be repeated here.

[0230] In the third aspect, the present application also provides a computing device, which is used to implement the functions of the method described in the first aspect above. The beneficial effects can be found in the description of the first aspect and will not be repeated here. The structure of the computing device includes a processor and a memory, and the memory is used to store instructions and / or data. The memory is coupled to the processor, and when the processor executes the program instructions stored in the memory, the function of the training node in the example of the first aspect above can be implemented. The structure of the computing device also includes a communication interface for communicating with other devices.

[0231] In a fourth aspect, the present application also provides a computer-readable storage medium, in which instructions are stored, and when the computer-readable storage medium is run on a computer, the computer executes the method in the above-mentioned first aspect and various possible designs of the first aspect.

[0232] In a fifth aspect, the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method in the above-mentioned first aspect and various possible designs of the first aspect.

[0233] In a sixth aspect, the present application also provides a computing chip, which is connected to a memory, and the chip is used to read and execute a software program stored in the memory, and to execute the methods in the above-mentioned first aspect and various possible implementation methods of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0234] In order to more clearly illustrate the embodiments of the present drawings or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present drawings. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.

[0235] Figure 1 A flowchart of the steps of the privacy-preserving method for sparse traffic flow prediction with cloud-edge collaboration;

[0236] Figure 2 The specific operation flow chart of the privacy protection method for sparse traffic flow prediction in cloud-edge-device collaboration;

[0237] Figure 3 A comparison chart of the mean absolute errors between the embodiment and the traditional privacy protection method under different privacy budgets;

[0238] Figure 4 This is a comparison chart of the mean absolute error between the implementation example and the traditional privacy protection method under different dropout rates.

[0239] The purpose, features and advantages of this figure will be further described in conjunction with the embodiments with reference to the accompanying drawings. DETAILED DESCRIPTION

[0240] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0241] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.

[0242] Unless otherwise specified, all embodiments and optional embodiments of the present application can be combined with each other to form a new technical solution.

[0243] Unless otherwise specified, all technical features and optional technical features of this application can be combined with each other to form a new technical solution.

[0244] If there is no special explanation, all steps of the present application can be performed sequentially or randomly, preferably sequentially. For example, the method includes steps (a) and (b), which means that the method may include steps (a) and (b) performed sequentially, or may include steps (b) and (a) performed sequentially. For example, the method may further include step (c), which means that step (c) may be added to the method in any order. For example, the method may include steps (a), (b) and (c), or may include steps (a), (c) and (b), or may include steps (c), (a) and (b), etc.

[0245] If there is no special explanation, the "include" and "comprising" mentioned in this application are open-ended or closed-ended. For example, the "include" and "comprising" may mean that other components not listed may also be included or only the listed components may be included or only the listed components may be included.

[0246] If not specifically stated, in this application, the term "or" is inclusive. For example, the phrase "A or B" means "A, B, or both A and B". More specifically, any of the following conditions satisfies the condition "A or B": A is true (or exists) and B is false (or does not exist); A is false (or does not exist) and B is true (or exists); or both A and B are true (or exist).

[0247] In order to better understand the solutions of the embodiments of the present application, some relevant terms and concepts that may be involved in the embodiments of the present application are first introduced below.

[0248] (1) Transformer model is a deep learning architecture based on the self-attention mechanism. The core idea is to use the self-attention mechanism to process sequence data, which enables the model to perform well when processing long-distance dependencies. Unlike traditional recurrent neural networks (RNNs) and convolutional neural networks (CNNs), Transformer relies entirely on the self-attention mechanism and does not use sequence alignment to calculate input and output representations. This design not only improves the parallelization capability of the model, but also improves the training speed and efficiency. The Transformer model consists of two main parts: the encoder and the decoder.

[0249] (2) Transformer spatiotemporal self-attention mechanism is a self-attention mechanism that combines spatial and temporal dimensions. It is used to process data with spatiotemporal characteristics. By combining spatial and temporal information, it can more effectively capture long-distance dependencies and dynamic change characteristics, thereby improving performance and accuracy in various application scenarios. This mechanism has been applied in many fields, including video understanding, traffic flow prediction, action recognition, etc.

[0250] (3) Graph Convolutional Networks (GCN) is a deep learning model specifically designed to process graph-structured data. It is a method for deep learning on graph-structured data. Graph-structured data consists of nodes and edges, where nodes represent entities and edges represent the relationship between entities. GCN uses the features of each node and its neighboring nodes in the graph through multiple iterations to update the state of the node until an equilibrium state is reached. This mechanism enables GCN to effectively capture local structural information in the graph and apply it to tasks such as node classification and graph classification.

[0251] (4) Local Differential Privacy (LDP) protects personal privacy by adding random noise to each user’s input, making it impossible for the server to know the user’s real data. This mechanism does not require a trusted data center, so it can effectively prevent attackers from obtaining private information through guesswork.

[0252] (5) Fully Connected Neural Network (FCNN) is a basic and widely used artificial neural network structure. In this network, every neuron in each layer is connected to every neuron in the next layer. This fully connected feature enables the network to capture complex features in the input data.

[0253] In this embodiment, Figure 1~Figure 2 As shown in the figure, the privacy protection method for sparse traffic flow prediction based on cloud-edge collaboration includes the following steps:

[0254] Step 1: Adaptively sample and select important areas of historical traffic flow based on the Gestalt important area selection method based on Transformer spatiotemporal self-attention mechanism;

[0255] Historical traffic flow data includes numerical spatiotemporal traffic flow. In specific implementation, the traditional evaluation method for important areas only uses simple Euclidean distance to represent the proximity principle in the Gestalt principle, and uses the data difference between elements to represent the similarity principle, without fully considering the spatiotemporal correlation between data, resulting in improper selection of important sampling areas, and thus low model prediction accuracy. Therefore, the present invention proposes a Gestalt important area selection method based on the Transformer spatiotemporal self-attention mechanism, which uses the Transformer self-attention mechanism to fully extract the spatiotemporal correlation between data, evaluates the importance of the area through the Gestalt principle, and finally performs adaptive sampling selection on the important areas of historical traffic flow.

[0256] Step 2: Based on the local w-event differential privacy protection method of the dynamic truncated Gaussian mechanism, the privacy budget is reasonably allocated to the traffic flow in the w sliding window, and dynamic Gaussian noise protection is performed;

[0257] Step 3: Based on the graph convolutional neural network pre-training protection method of dynamic spatiotemporal matrix completion, the sparse traffic flow is completed with spatiotemporal matrix and model pre-trained, and the correlation of model gradients is protected;

[0258] Step 4: A multi-objective weighted prediction method for traffic flow based on spatiotemporal self-supervised learning is used to safely predict sparse traffic flow in cloud-edge scenarios.

[0259] Furthermore, step one specifically includes:

[0260] Step 1.1: Based on the fully connected neural network method, the historical raw traffic data stream is processed through the fully connected layer to generate feature embedding;

[0261] Specifically include: Based on the fully connected neural network method, the historical traffic data sequence within the specified time period T , generating feature embeddings through fully connected layers ,Right now , where N represents the number of spatial nodes, is the dimension of feature embedding, Represents a fully connected layer.

[0262] Step 1.2: Extract the embeddings corresponding to the day of the week and timestamp from the feature embedding dictionary, concatenate and broadcast these embeddings to obtain the periodic embedding of the traffic time series, and combine them with the spatiotemporal adaptive embedding to obtain the hidden spatiotemporal representation;

[0263] Extract the relevant day-of-week and timestamp embeddings from the embedding dictionary, concatenate and broadcast to generate the periodic embeddings of the traffic time series . Combined with spatiotemporal adaptive embedding ,in ,Right now: .

[0264] Step 1.3: Based on the Transformer method, the hidden spatiotemporal representation captures the complex traffic relationship by applying Transformer along the time axis and space axis, obtaining the query matrix, key matrix and value matrix, and calculating the spatiotemporal self-attention score;

[0265] Given a hidden spatiotemporal representation X, the temporal Transformer layer generates a query matrix , the bond matrix , value matrix ,in, , , is a learnable parameter. The self-attention score matrix is ​​calculated as follows:

[0266] .

[0267] The output of the temporal Transformer is , Then, the spatial Transformer layer repeats the above operation and calculates the spatiotemporal self-attention score matrix as follows:

[0268] ;

[0269] Step 1.4: According to the Gestalt principle, calculate the cosine similarity score between node i and node j. The formula is as follows:

[0270] ;

[0271] After calculating the scores between all nodes, the cosine similarity matrix C is generated and combined with the spatiotemporal self-attention score matrix to obtain the final score matrix. The formula is as follows:

[0272] ;

[0273] Calculate the average value of each row based on the final score matrix , the specific formula is as follows:

[0274] ;

[0275] Where: I and J are the rows and columns of the final score matrix respectively. Then take the xth row of the matrix and compare the elements of each column of this row with the average value of the xth row. If the element in the yth column is greater than the row average, it is considered that node x and node y have high similarity. The number of nodes with high similarity between node x and all other nodes is obtained by accumulation. .

[0276] Step 1.5: Select K nodes with a higher number of high similarity nodes in the final score matrix as the sparse crowd sensing sampling node set.

[0277] Furthermore, step 2 specifically includes:

[0278] Step 2.1: Based on the w-event differential privacy concept, the traffic flow data collected by traffic users is divided into multiple sliding windows w. In each sliding window w, differential privacy is used to perform differential privacy protection on the traffic flow data in the window.

[0279] In specific implementation, since traffic data is a streaming data, using traditional differential privacy methods to protect traffic data streams will cause large noise errors, and continuously allocating privacy budgets to each data point will cause the privacy budget to be exhausted, thereby causing privacy leakage. Therefore, based on the w-event differential privacy idea, the present invention divides the traffic flow into multiple sliding windows w. In each sliding window w, the truncated Gaussian mechanism is used to perform differential privacy protection on the traffic flow data in the window, thereby ensuring the privacy security of traffic users.

[0280] Step 2.2: Based on the sliding window method, for a given total privacy budget , the total time step is T, the sliding window size is w, and the current sampling time t from the sampling node set, then the sliding window range is [t-w+1, t], and the data change in the current window is calculated. The formula is as follows:

[0281] ;

[0282] ST is a three-dimensional data sampling matrix, which contains time step information, node position information, and data sampled from the sampling node set;

[0283] Step 2.3: Calculate the total data change in the entire time period and the privacy budget allocation ratio at the current time step t, and calculate the budget to be allocated at sampling time t based on the privacy allocation ratio. The formula is as follows:

[0284] ;

[0285] ;

[0286] ;

[0287] The constraints are: ;

[0288] Step 2.4: Traffic users use the truncated Gaussian mechanism to generate perturbation results locally according to the privacy budget. When the truncated Gaussian mechanism satisfies Local differential privacy, traffic users will check whether the data after adding noise is within the perceived data utility interval. If it is within the interval, the traffic user generates perturbed data based on the noise and uploads it to the edge node; if it is not within the interval, the traffic user will continue to sample noise from the truncated Gaussian distribution until the data falls within the utility interval, and then upload the final perturbed data to the edge node. When all traffic users upload data, the edge node obtains the final perturbed spatiotemporal data matrix, the formula is as follows:

[0289] Truncated Gaussian probability density function:

[0290] ;

[0291] The normalization factor is:

[0292] ;

[0293] Noise upload:

[0294] ;

[0295] boundary Determined by the maximum value within the sliding window range [t-w+1, t] at the current time step t;

[0296] Furthermore, step three specifically includes:

[0297] In the specific implementation, first of all, due to the traditional matrix completion method:

[0298] 1) Using the Toeplitz Matrix As the time constraint matrix assumes the linear relationship between time series data and the similarity between fixed adjacent moments, it cannot capture complex time dependencies such as nonlinear relationships, multi-periodicity or long-term dependencies.

[0299] 2) Using Euclidean distance As a spatial constraint matrix, an exponential decay relationship between spatial data is assumed, which results in the inability to capture complex spatial correlations, such as nonlinear spatial patterns or multi-scale spatial features. Therefore, the present invention uses a graph convolutional neural network method to calculate the nonlinear spatial constraint matrix and the temporal constraint matrix.

[0300] Secondly, traditional traffic flow prediction models often assume that traffic flow changes are linear, and often only consider the dependency of the time dimension, while ignoring the spatial dependency, which makes it impossible to effectively capture the complex spatiotemporal dependencies in traffic flow, resulting in a decrease in model performance. Therefore, the present invention is based on spatiotemporal convolution blocks and self-supervised learning models to better capture the spatiotemporal dependencies in traffic flow, and significantly improve the prediction ability of the model through model pre-training.

[0301] Finally, existing differential privacy methods only protect privacy by clipping local updates and adding random noise, which leads to sharper loss surfaces and worse robustness of weight perturbations, thus significantly degrading model performance. Therefore, the present invention protects privacy by clipping edge node updates and adaptive gradient noise based on acuity-aware minimization optimizer.

[0302] Step 3.1: For the sparsely sensed and noisy spatiotemporal data matrix, first calculate the nonlinear spatial constraint matrix through the spatial convolution layer, and then calculate the temporal constraint matrix through the temporal convolution layer, thereby transforming the completion constraint problem into the following optimization problem, and finally converting the spatiotemporal data matrix Decompose into spatial factor matrix and the time factor matrix The product of:

[0303] ;

[0304] The constraints are:

[0305] ;

[0306] Step 3.2: Based on the graph matrix completion method, define two sets. For a node with coordinates (i, j), its data inference value The representation can be replaced by a set, and the alternating least squares method is used to iteratively train and update the factors or , recover the unperceived data through linear calculation, and finally output the complete inference matrix , the formula is as follows:

[0307] Two collections:

[0308] ;

[0309] ;

[0310] Alternative representation of inferred values ​​of data: ;

[0311] Step 3.3: Based on the graph convolutional neural network method, the present invention converts the complete inference matrix Constructed from the original traffic flow graph The result generated in Node Collection Include The set of spatial nodes and the set of edges Represents the connection between these nodes, the adjacency matrix It describes the connection relationship between nodes. Traffic tensor The traffic inflow and outflow data in the first T time steps are recorded. At time step t, the traffic volume information of each node V is expressed as This information is transformed into the model's input tensor , and passed into the spatiotemporal graph convolution block.

[0312] The structure of the spatiotemporal graph convolution block is a temporal convolution layer, a spatial convolution layer, and a temporal convolution layer. Specifically, the temporal convolution layer is expressed as: , the spatial convolutional layer is expressed as: ,in, represents the region embedding matrix at time step t. By introducing geographic context information, the detailed embedding of all regions is expressed as , after multiple convolution operations, the resulting embedding matrix sequence is , whose time dimension is ;

[0313] Step 3.4: Bernoulli distribution-based graph enhancement method, by enhancing the traffic flow graph at the tensor and topological levels, masking the area exist The traffic flow at each moment is lowly correlated with the noise disturbance. First, from the Bernoulli distribution Extracting the masking probability , The higher the value, the more exist Traffic tensor at the moment The more likely it is to be masked. After tensor-level enhancement, the data is represented as Next, the regional traffic flow graph G is enhanced at the topological level. and When the traffic patterns of will be masked and the correlation is measured by the metric; specifically, the embedding sequence of the region in time step from Extract and generate the overall embedding. The formula is as follows:

[0314] Correlation measures:

[0315] ;

[0316] Overall embedding:

[0317] ;

[0318] ;

[0319] Step 3.5: Generate K cluster embeddings by modeling spatial and temporal correlations based on spatiotemporal self-supervised learning methods As a potential factor for regional clustering, the implementation formula of the clustering process is:

[0320] ;

[0321] area The cluster assignment of , for the region embedding of the original traffic flow graph G , whose cluster assignment is calculated by The optimization objective function of the self-supervised enhancement task is defined as:

[0322] ;

[0323] The overall self-supervision objective over all regions is defined as follows:

[0324] ;

[0325] In order to inject temporal correlation into region embeddings, we first fused the region embeddings in the original and enhanced traffic flow graphs as follows:

[0326] ;

[0327] Generate city-level representation at time step t:

[0328] ;

[0329] Region-level and city-level embeddings at the same time step is regarded as a positive sample, while the embeddings from different time steps are regarded as negative samples, and the loss function measured by cross entropy is optimized as follows:

[0330] ;

[0331] Step 3.6: Based on the acuity-aware minimization optimizer, privacy is preserved by clipping edge updates and adding random noise. The local loss function is defined as:

[0332] ;

[0333] For each edge node , in each local iteration And each communication round In the example, the Pearson coefficient is introduced for adaptive noise addition, and the internal iteration steps of the edge node n are as follows:

[0334] ;

[0335] ;

[0336] ;

[0337] ;

[0338] ;

[0339] In each round of communication, with probability Sample i edge nodes and dynamically adjust the adaptive trimming threshold according to the statistical characteristics of local updates. ,After pruning, Gaussian noise is added to the edge server updates, and the harmonic mean noise scale is used to reduce the negative impact of noise on model consistency. The formula is as follows:

[0340] The updated representation of trimmed edge nodes is:

[0341] ;

[0342] ;

[0343] ;

[0344] For a given noise variance, the cumulative privacy budget can be calculated based on the sampled Gaussian mechanism by minimizing the local perturbation loss function , to achieve adaptive gradient noising, which satisfies Rényi differential privacy.

[0345] Furthermore, step four specifically includes:

[0346] In specific implementation, since traditional centralized methods usually rely on the assumption that data is uniformly distributed, the model performs poorly when facing heterogeneously distributed edge data. The present invention is based on the cloud server weighted average aggregation method. By globally fusing the pre-trained model parameters of each edge node in the cloud server, the data characteristics from different nodes can be effectively integrated to generate a more representative global model. Based on the multi-objective adaptive weighting mechanism, the privacy protection task and the traffic flow prediction task are adaptively balanced.

[0347] Step 4.1: Based on the cloud server weighted average aggregation method, aggregate the local updates of all edge nodes, update the global model parameters, and send the updated model parameters after global aggregation to the edge nodes to update their model parameters. The formula is as follows:

[0348] ;

[0349] Step 4.2: Prediction based on the multi-layer perceptron method, each region Embed As input, predict the future time step The traffic flow prediction formula is as follows:

[0350] ;

[0351] Step 4.3: Optimize the prediction loss function based on the minimization loss function method. The formula is as follows:

[0352] ;

[0353] Step 4.4: Based on the multi-objective adaptive weighting mechanism, through the learnable weight parameters and , adjust the weights of each sub-loss function, obtain the overall loss by combining the prediction loss, self-supervised learning spatial and temporal correlation modeling loss, and local perturbation loss, and obtain the global optimal prediction result by minimizing the overall loss. The formula is as follows:

[0354] ;

[0355] Proof: Step 2 satisfies Local Differential Privacy:

[0356] The Gaussian mechanism achieves differential privacy by adding Gaussian noise to the data results, and its noise satisfies the normal distribution. For a given function , the noise generated by the Gaussian mechanism obeys .

[0357] The truncated Gaussian mechanism has an output range of The Gaussian noise is truncated to ensure that the output is within the specified range. Its probability density function is:

[0358] ;

[0359] is the normalization factor.

[0360] For a mechanism T that satisfies Local differential privacy, if for any two inputs and , and all possible outputs y are:

[0361] ;

[0362] Substituting the inequality into the definition of the truncated Gaussian mechanism, we obtain:

[0363] ;

[0364] By the mean inequality:

[0365] ;

[0366] Scaling and simplifying the right side of the inequality, and substituting it into the right side of the original inequality, we get:

[0367] ;

[0368] Continue simplifying the integral on the right side of the inequality:

[0369] ;

[0370] That is, we need to prove the following inequality:

[0371] ;

[0372] Taking the logarithm of both sides, we get:

[0373] ;

[0374] This is equivalent to:

[0375] ;

[0376] Further simplification gives:

[0377] ;

[0378] Right now:

[0379] ;

[0380] It can be obtained that when: When , the truncated Gaussian mechanism can satisfy Local differential privacy. According to the serial combination principle of differential privacy, the sparse data stream in the sliding window w is obtained Local differential privacy, that is: .

[0381] Proof: Step 3 satisfies Rényi differential privacy:

[0382] According to Rényi’s definition of differential privacy, we have:

[0383] ;

[0384] In the differential privacy mechanism, sensitivity is defined as follows:

[0385] ;

[0386] in: Denotes the mechanism applied to data sets, D and D′ are adjacent data sets (differing by only one data record).

[0387] For local updates The sensitivity of , assuming that the initial model parameters are , in t rounds of communication, the upper bound of the expected squared sensitivity of local updates is:

[0388] ;

[0389] Where K is the number of local iterations and L is Constant when the local adaptive learning rate satisfies And the perturbation amplitude ρ is proportional to the learning rate (e.g. ), there are:

[0390] ;

[0391] Where T is the total number of communication rounds. Using stochastic gradient descent (SGD), we have:

[0392] ;

[0393] in, Usually represents the variance of the local gradient. Therefore, when When:

[0394] ;

[0395] Perform gradient clipping:

[0396] ;

[0397] ;

[0398] After T rounds of communication, the privacy budget is accumulated The calculation is as follows:

[0399] ;

[0400] ;

[0401] where α is the order of the Rényi divergence, δ is the probability of privacy failure, and is the Gaussian probability density function, and q is the sampling rate selected by the edge node. In each round of communication, the sensitivity can be expressed as follows after clipping and noise addition:

[0402] ;

[0403] Therefore, for each communication round t, Gaussian noise is added to satisfy differential privacy, and we have:

[0404] ;

[0405] This ensures that the privacy loss in each round of communication is within the cumulative privacy budget Within, Rényi differential privacy is satisfied.

[0406] like Figure 3~Figure 4 As shown in Figure 2, in this embodiment, based on the real traffic flow dataset NYCBike1, different parameters are used: privacy budget, dropout rate, to evaluate the mean absolute error (MAE) between the traffic flow prediction value and the true value of the embodiment of the present invention. The experimental evaluation results of different privacy budgets are shown in Figure 2. Figure 3 As shown in Figure 1, the average absolute error between the traffic flow prediction value and the true value for different privacy budgets is shown. The experimental evaluation results for different dropout rates are shown in Figure 1. Figure 4 As shown, the mean absolute error between the predicted traffic flow value and the true value is shown for different dropout rates.

[0407] The experimental evaluation results for different parameters show that the average absolute error between the predicted traffic flow and the true value of this embodiment is as low as 5.22, which is better than the traditional traffic flow prediction privacy protection method. Therefore, this embodiment not only meets the local differential privacy and ensures the security of traffic flow, but also achieves high-precision prediction of sparse traffic flow.

[0408] Some of the data in the above formula are calculated by removing the dimensions and taking their numerical values. The formula is a formula that is closest to the actual situation obtained by software simulation of a large amount of collected data; the preset parameters and preset thresholds in the formula are set by technical personnel in this field according to actual conditions or obtained through simulation of a large amount of data.

[0409] The second aspect of the present application provides a cloud-edge-end collaborative sparse traffic flow prediction privacy protection device, including a Gestalt important area selection module based on the Transformer spatiotemporal self-attention mechanism, a local w-event differential privacy protection module based on a dynamic truncated Gaussian mechanism, a graph convolutional neural network pre-training protection module based on dynamic spatiotemporal matrix completion, and a traffic flow multi-target weighted prediction module based on spatiotemporal self-supervised learning;

[0410] The Gestalt important area selection module based on the Transformer spatiotemporal self-attention mechanism performs adaptive important sampling area selection on historical traffic flow data and determines sparse crowd intelligence perception sampling nodes;

[0411] The local w-event differential privacy protection module based on the dynamic truncated Gaussian mechanism allocates privacy budget to the traffic flow data in the w-event sliding window and uses the dynamic truncated Gaussian mechanism to add noise to the local data.

[0412] The graph convolutional neural network pre-training protection module based on dynamic spatiotemporal matrix completion performs model pre-training by completing the sparse spatiotemporal matrix, and performs gradient clipping and differential privacy protection.

[0413] A multi-objective weighted prediction module for traffic flow based on spatiotemporal self-supervised learning, which performs safe prediction of traffic flow in cloud-edge sparse crowd intelligence perception scenarios;

[0414] The smart transportation cloud server platform collects historical public transportation data streams, and adaptively selects important sampling areas through the Gestalt important area selection module based on the Transformer spatiotemporal self-attention mechanism; through the local w-event differential privacy protection module based on the dynamic truncated Gaussian mechanism, traffic users allocate privacy budgets to the traffic flow data in the window according to the w-event sliding window for the collected sparse traffic data streams, use the dynamic truncated Gaussian mechanism to add noise to the local data, and submit the noisy data to the edge node; through the local w-event differential privacy protection module based on the dynamic spatiotemporal moment The graph convolutional neural network pre-training protection module with matrix completion, the edge node completes the spatiotemporal matrix of the sparse traffic data stream, performs model pre-training, and clips and adds noise to the model gradients generated by the pre-training, and uploads them to the smart transportation cloud server platform; through the multi-objective weighted prediction module of traffic flow based on spatiotemporal self-supervised learning, the traffic flow is safely predicted in the sparse group intelligence perception scenario of the cloud edge, the gradients submitted by each edge node are globally aggregated, and the updated model parameters after aggregation are sent to the edge node to update its model parameters, so as to safely predict the traffic flow at the future time step t+1.

[0415] It should be noted that the present application is not limited to the above-mentioned embodiments. The above-mentioned embodiments are only examples, and the embodiments having the same structure as the technical idea and exerting the same effect within the scope of the technical solution of the present application are all included in the technical scope of the present application. In addition, without departing from the scope of the main purpose of the present application, various modifications that can be thought of by those skilled in the art to the embodiments and other methods of combining some of the constituent elements in the embodiments are also included in the scope of the present application.

Claims

1. A privacy protection method for sparse traffic flow prediction based on cloud-edge collaboration, characterized in that: The following steps are involved: Step 1: Adaptively sample and select important areas of historical traffic flow based on the Gestalt important area selection method based on Transformer spatiotemporal self-attention mechanism; Step 2: Based on the local w-event differential privacy protection method of the dynamic truncated Gaussian mechanism, the privacy budget is reasonably allocated to the traffic flow in the w sliding window, and dynamic Gaussian noise protection is performed; Step 3: Based on the graph convolutional neural network pre-training protection method of dynamic spatiotemporal matrix completion, the spatiotemporal matrix completion and model pre-training are performed on sparse traffic flow, and the privacy protection of the correlation of model gradients is performed, including: Step 3.1: For the sparsely sensed and noisy spatiotemporal data matrix, first calculate the nonlinear spatial constraint matrix through the spatial convolution layer, then calculate the temporal constraint matrix through the temporal convolution layer, and finally decompose the spatiotemporal data matrix into the product of the spatial factor matrix and the temporal factor matrix; Step 3.2: Based on the graph matrix completion method, define two sets, use the alternating least squares method to iteratively train and update the factors, restore the unperceived data through linear calculation, and finally output the complete inference matrix; Step 3.3: Based on the graph convolutional neural network method, the complete inference matrix is ​​constructed as the result generated from the original traffic flow graph. After multiple convolution operations, the embedding matrix sequence is obtained; Step 3.4: A graph enhancement method based on Bernoulli distribution is used to enhance the traffic flow graph at the tensor and topological levels to mask the traffic flow in the area with low correlation with noise disturbance at a certain time; Step 3.5: Based on the spatiotemporal self-supervised learning method, K cluster embeddings are generated as latent factors for regional clustering by modeling spatial and temporal correlations. The regional-level and city-level embeddings at the same time step are regarded as positive samples, while the embeddings from different time steps are regarded as negative samples. The loss function is optimized by the cross entropy metric. Step 3.6: Based on the acuity-aware minimization optimizer, privacy is protected by clipping edge updates and adding random noise. For each edge node, the Pearson coefficient is introduced for adaptive noise addition in each local iteration and each communication round. Step 4: Based on the multi-objective weighted prediction method of traffic flow based on spatiotemporal self-supervised learning, sparse traffic flow safety prediction is performed in the cloud-edge scenario, including: Step 4.1: Based on the cloud server weighted average aggregation method, aggregate the local updates of all edge nodes, update the global model parameters, and send the updated model parameters after global aggregation to the edge nodes to update their model parameters; Step 4.2: Perform prediction based on the multi-layer perceptron method, taking the embedding of each region as input and predicting the traffic flow in the future time step; Step 4.3: Optimize the prediction loss function based on the minimization loss function method; Step 4.4: Based on the multi-objective adaptive weighting mechanism, the overall loss is obtained by combining the prediction loss, self-supervised learning spatial and temporal correlation modeling loss, and local perturbation loss, and the global optimal prediction result is obtained by minimizing the overall loss.

2. The privacy protection method for cloud-edge-end collaborative sparse traffic flow prediction according to claim 1 is characterized in that: The step 1 specifically includes: Step 1.1: Based on the fully connected neural network method, the historical raw traffic data stream is processed through the fully connected layer to generate feature embedding; Step 1.2: Extract the embeddings corresponding to the day of the week and timestamp from the feature embedding dictionary, concatenate and broadcast these embeddings to obtain the periodic embedding of the traffic time series, and combine them with the spatiotemporal adaptive embedding to obtain the hidden spatiotemporal representation; Step 1.3: Based on the Transformer method, the hidden spatiotemporal representation captures the complex traffic relationship by applying Transformer along the time axis and space axis, obtaining the query matrix, key matrix and value matrix, and calculating the spatiotemporal self-attention score; Step 1.4: According to the Gestalt principle, the cosine similarity matrix between nodes is calculated, and combined with the spatiotemporal self-attention score matrix to obtain the final score matrix. The formula is as follows: ; in: is the final score matrix between node i and node j; is the spatiotemporal self-attention score between node i and node j; is the cosine similarity matrix between node i and node j; is an adjustable parameter based on the spatiotemporal self-attention score; is an adjustable parameter based on the cosine similarity matrix; is a natural constant; Step 1.5: Select K nodes with a higher number of high similarity nodes in the final score matrix as the sparse crowd sensing sampling node set.

3. The privacy protection method for cloud-edge-end collaborative sparse traffic flow prediction according to claim 1 is characterized in that: The step 2 specifically includes: Step 2.1: Based on the w-event differential privacy concept, the traffic flow data collected by traffic users is divided into multiple sliding windows w. In each sliding window w, differential privacy is used to perform differential privacy protection on the traffic flow data in the window. Step 2.2: Based on the sliding window method, from the current sampling time t in the sampling node set, the sliding window range is [t-w+1, t], and the data change in the current window is calculated. The formula is as follows: ; in: is the data change in the current sliding window; is the minimum value of the current sliding window range; is the sampling time; is the number of rows of the ST matrix; is the number of columns of the ST matrix; is a three-dimensional data sampling matrix; Step 2.3: Calculate the total data change in the entire time period and the privacy budget allocation ratio at the current time step t, and calculate the budget to be allocated at sampling time t based on the privacy allocation ratio. The formula is as follows: ; ; ; The constraints are: ; in: is the total data change within the total time step; is the sampling time; is the number of rows of the ST matrix; is the number of columns of the ST matrix; is the total time step; is a three-dimensional data sampling matrix; Allocate the privacy budget ratio for the current time step t; is the data change in the current sliding window; is the privacy budget that should be allocated at the current sampling time t; Step 2.4: Traffic users use the truncated Gaussian mechanism to generate perturbation results locally according to the privacy budget. When the truncated Gaussian mechanism satisfies Local differential privacy: Traffic users check whether the data after adding noise is within the perceived data utility interval. If it is within the interval, the traffic user generates perturbed data based on the noise and uploads it to the edge node. If it is not within the interval, the traffic user continues to sample noise from the truncated Gaussian distribution until the data falls within the utility interval, and then uploads the final perturbed data to the edge node. When all traffic users upload data, the edge node obtains the final perturbed spatiotemporal data matrix, as follows: Truncated Gaussian probability density function: ; The normalization factor is: ; Noise upload: ; in: is the truncated Gaussian probability density function; is the normalization factor; is the variance; is the disturbance vector; is the utility interval; is the error function; is the standard deviation; the value of data collected for transportation users; is the query function representing f(y)=x; is the added Gaussian noise.

4. The privacy protection method for cloud-edge-end collaborative sparse traffic flow prediction according to claim 1 is characterized in that: The step three specifically includes: Step 3.1: For the sparsely sensed and noisy spatiotemporal data matrix, first calculate the nonlinear spatial constraint matrix through the spatial convolution layer, and then calculate the temporal constraint matrix through the temporal convolution layer, thereby transforming the completion constraint problem into the following optimization problem, and finally converting the spatiotemporal data matrix Decompose into spatial factor matrix and the time factor matrix The product of: ; The constraints are: ; in: is a sparsely sensed and noisy spatiotemporal data matrix; is the spatial constraint matrix; is the time constraint matrix; is the spatial weight parameter; is the weight parameter of time; is a three-dimensional data sampling matrix; is the rank of the matrix; is the minimum function; is the data sampling area matrix; is the F norm; is the rank of the matrix; is the matrix obtained after decomposition of the spatiotemporal data matrix; Step 3.2: Based on the graph matrix completion method, define two sets. For a node with coordinates (x, y), its data inference value The representation can be replaced by a set, and the alternating least squares method is used to iteratively train and update the factors or , recover the unperceived data through linear calculation, and finally output the complete inference matrix , the formula is as follows: Two collections: ; ; Alternative representation of inferred values ​​of data: ; in: , For different sets of nodes; is the number of columns of the matrix; is the transpose symbol; is the inferred value of the data; is the column vector of matrix U; is the column vector of matrix V; Step 3.3: Complete inference matrix based on graph convolutional neural network method Constructed from the original traffic flow graph The result generated in; node collection Include The set of spatial nodes and the set of edges Represents the connection between these nodes, the adjacency matrix It describes the connection relationship between nodes, the traffic tensor The traffic inflow and outflow data in the first T time steps are recorded. At time step t, the traffic volume information of each node V is expressed as , this information is transformed into the input tensor of the model , and passed into the spatiotemporal graph convolution block; the spatiotemporal graph convolution block structure is a temporal convolution layer, a spatial convolution layer, and a temporal convolution layer. Specifically, the temporal convolution layer is expressed as: , the spatial convolutional layer is expressed as: ,in, Represents the region embedding matrix at time step t. By introducing geographic context information, the detailed embedding of all regions is expressed as , after multiple convolution operations, the resulting embedding matrix sequence is , whose time dimension is ; Step 3.4: Bernoulli distribution-based graph enhancement method, by enhancing the traffic flow graph at the tensor and topological levels, masking the area exist Traffic flow with low correlation with noise disturbance at the moment, first, from the Bernoulli distribution Extracting the masking probability , The higher the value, the more exist Traffic tensor at the moment The more likely it is to be masked, after tensor-level enhancement, the data is represented as Then, the regional traffic flow graph G is enhanced at the topological level. and When the traffic patterns of will be masked and the correlation is measured by the metric; specifically, the embedding sequence of the region in time step from Extract and generate the overall embedding. The formula is as follows: Correlation measures: ; Overall embedding: ; ; in: For Region and The correlation between is the derived aggregate weight The regions across different time steps in Aggregate representation of embedded sequences; is the derived aggregate weight The regions across different time steps in Aggregate representation of embedded sequences; Embedded as a whole; is the index of the time step range (tT, t); for the current moment; is the time step; is the aggregation weight; For Region Embedding at time step τ; for The transpose of is the learnable parameter vector for transformation; Step 3.5: Generate K cluster embeddings by modeling spatial and temporal correlations based on spatiotemporal self-supervised learning methods As a potential factor for regional clustering, the implementation formula of the clustering process is: ; in: For Region The embedding of and the Kth cluster embedding The correlation score between Enhanced Traffic Flow Graph The area encoded in Embedding is the transpose of the K-th cluster embedding; area The cluster assignment of , for the region embedding of the original traffic flow graph G , whose cluster assignment is calculated by The optimization objective function of the self-supervised enhancement task is defined as: ; The overall self-supervision objective over all regions is defined as follows: ; in: Optimizing objective function for self-supervised enhancement tasks; To indicate the area The embedding of and the embedding of the kth cluster The estimated correlation score between ; is an exponential function with the natural constant e as base; for The predicted distribution score of for The predicted distribution score of For control Temperature parameter for output smoothness; Loss functions for modeling spatial correlation; Optimizing functions for self-supervised enhancement tasks; is the weight parameter; is the regional embedding of the original traffic flow graph G; To embed the region of the enhanced traffic flow graph G; In order to inject temporal correlation into region embeddings, we first fused the region embeddings in the original and enhanced traffic flow graphs as follows: ; Generate city-level representation at time step t: ; Region-level and city-level embeddings at the same time step is regarded as a positive sample, while the embeddings from different time steps are regarded as negative samples, and the loss function measured by cross entropy is optimized as follows: ; in: To fuse the region embeddings in the original and enhanced traffic flow graphs; is the element-wise product; are learnable parameters; For Region The original region embedding at time step t; For Region Enhanced region embedding at time step t; Generate city-level representation for time step t; Generate city-level representation for time step t-1; is an S-shaped function; is the total number of all regions; For Region The fusion function at time step t; For Region At time step The fusion function at ; For region-level and city-level embeddings at the same time step; Loss functions for modeling temporal dependencies; , For two different time steps; is the discriminant function; Step 3.6: Based on the acuity-aware minimization optimizer, privacy is preserved by clipping edge updates and adding random noise. The local loss function is defined as: ; in: is the local loss function; for From the distribution The expected value of the sample in ; is the perturbation model; is a predefined constant that controls the perturbation radius; for norm; for From the distribution A random variable sampled from ; is the set of natural numbers; For each edge node , in each local iteration And each communication round In the example, the Pearson coefficient is introduced for adaptive noise addition, and the internal iteration steps of the edge node n are as follows: ; ; ; ; ; in: is the gradient of the current t-th round and m-th iteration; is the mean of the gradients from the tth round and the 1st to the mth iteration; is the model parameter of customer n in the tth round and the mth internal iteration; is the learning rate; is the current t-th round, m-th iteration gradient after the disturbance; is the loss function of edge node n The gradient of the model parameter w; To add disturbance The model parameters after Collect sample points for data; pass The surrounding first-order Taylor expansion calculation; In each round of communication, with probability Sample i edge nodes and dynamically adjust the adaptive trimming threshold according to the statistical characteristics of local updates. ,After pruning, Gaussian noise is added to the edge server updates, and the harmonic mean noise scale is used to reduce the negative impact of noise on model consistency. The formula is as follows: The updated representation of trimmed edge nodes is: ; ; ; in: is the change of model parameters; The threshold for the local update pruning operation; is the average bi-norm of the local updates of all edge nodes; is the adaptive clipping threshold; is the change in model parameters of edge node n in t communication rounds; is the updated value of the model parameters of edge node n in t communication rounds; is the updated value of the model parameters after Gaussian noise is added to edge node n in t communication rounds; is the given noise variance; is Gaussian noise; is the change in model parameters of all edge nodes in t communication rounds; For a given noise variance, the cumulative privacy budget can be calculated based on the sampled Gaussian mechanism by minimizing the local perturbation loss function , to achieve adaptive gradient noising and satisfy Rényi differential privacy.

5. The privacy protection method for cloud-edge-end collaborative sparse traffic flow prediction according to claim 1 is characterized in that: The step 4 specifically includes: Step 4.1: Based on the cloud server weighted average aggregation method, aggregate the local updates of all edge nodes, update the global model parameters, and send the updated model parameters after global aggregation to the edge nodes to update their model parameters. The formula is as follows: ; in: is the model weight vector in the t+1 communication round; is the model weight vector at t communication round; represents the set of clients selected in round t; is the updated value of the model parameters after Gaussian noise is added to edge node n in t communication rounds; is the total number of selected clients; Step 4.2: Prediction based on the multi-layer perceptron method, each region Embed As input, predict the future time step The traffic flow prediction formula is as follows: ; in: For Region At time step The predicted traffic flow results; For Multilayer Perceptron method for output; Step 4.3: Optimize the prediction loss function based on the minimization loss function method. The formula is as follows: ; in: To predict losses; is the true value of the inflow; is the predicted value of inflow; is the true value of the outflow; is the predicted value of outflow; is the parameter used to balance the impact of each type of traffic flow; Step 4.4: Based on the multi-objective adaptive weighting mechanism, through the learnable weight parameters and , adjust the weights of each sub-loss function, obtain the overall loss by combining the prediction loss, self-supervised learning spatial and temporal correlation modeling loss, and local perturbation loss, and obtain the global optimal prediction result by minimizing the overall loss. The formula is as follows: ; in: : Overall loss; To predict losses; , is a learnable weight parameter; Loss functions for modeling spatial correlation; Loss functions for modeling temporal dependencies; is the local loss function of the edge node.

6. Cloud-edge-device collaborative sparse traffic flow prediction privacy protection device, characterized by: It includes a Gestalt important area selection module based on the Transformer spatiotemporal self-attention mechanism, a local w-event differential privacy protection module based on the dynamic truncated Gaussian mechanism, a graph convolutional neural network pre-training protection module based on dynamic spatiotemporal matrix completion, and a traffic flow multi-target weighted prediction module based on spatiotemporal self-supervised learning; The Gestalt important area selection module based on the Transformer spatiotemporal self-attention mechanism performs adaptive important sampling area selection on historical traffic flow data and determines sparse crowd intelligence perception sampling nodes; The local w-event differential privacy protection module based on the dynamic truncated Gaussian mechanism allocates a privacy budget to the traffic flow data in the w-event sliding window according to the w-event sliding window, and uses the dynamic truncated Gaussian mechanism to add noise to the local data; The graph convolutional neural network pre-training protection module based on dynamic spatiotemporal matrix completion performs model pre-training by completing the sparse spatiotemporal matrix, and performs gradient clipping and differential privacy protection, including: Step 3.1: For the sparsely sensed and noisy spatiotemporal data matrix, first calculate the nonlinear spatial constraint matrix through the spatial convolution layer, then calculate the temporal constraint matrix through the temporal convolution layer, and finally decompose the spatiotemporal data matrix into the product of the spatial factor matrix and the temporal factor matrix; Step 3.2: Based on the graph matrix completion method, define two sets, use the alternating least squares method to iteratively train and update the factors, restore the unperceived data through linear calculation, and finally output the complete inference matrix; Step 3.3: Based on the graph convolutional neural network method, the complete inference matrix is ​​constructed as the result generated from the original traffic flow graph. After multiple convolution operations, the embedding matrix sequence is obtained; Step 3.4: A graph enhancement method based on Bernoulli distribution is used to enhance the traffic flow graph at the tensor and topological levels to mask the traffic flow in the area with low correlation with noise disturbance at a certain time; Step 3.5: Based on the spatiotemporal self-supervised learning method, K cluster embeddings are generated as latent factors for regional clustering by modeling spatial and temporal correlations. The regional-level and city-level embeddings at the same time step are regarded as positive samples, while the embeddings from different time steps are regarded as negative samples. The loss function is optimized by the cross entropy metric. Step 3.6: Based on the acuity-aware minimization optimizer, privacy is protected by clipping edge updates and adding random noise. For each edge node, the Pearson coefficient is introduced for adaptive noise addition in each local iteration and each communication round. The traffic flow multi-objective weighted prediction module based on spatiotemporal self-supervised learning performs safe prediction of traffic flow in the cloud-edge sparse crowd intelligence perception scenario, including: Step 4.1: Based on the cloud server weighted average aggregation method, aggregate the local updates of all edge nodes, update the global model parameters, and send the updated model parameters after global aggregation to the edge nodes to update their model parameters; Step 4.2: Perform prediction based on the multi-layer perceptron method, taking the embedding of each region as input and predicting the traffic flow in the future time step; Step 4.3: Optimize the prediction loss function based on the minimization loss function method; Step 4.4: Based on the multi-objective adaptive weighting mechanism, the overall loss is obtained by combining the prediction loss, the self-supervised learning spatial and temporal correlation modeling loss, and the local perturbation loss, and the global optimal prediction result is obtained by minimizing the overall loss; The smart transportation cloud server platform collects historical public transportation data streams, and adaptively selects important sampling areas through the Gestalt important area selection module based on the Transformer spatiotemporal self-attention mechanism; through the local w-event differential privacy protection module based on the dynamic truncated Gaussian mechanism, traffic users allocate privacy budgets to the traffic flow data in the window according to the w-event sliding window for the collected sparse traffic data streams, use the dynamic truncated Gaussian mechanism to add noise to the local data, and submit the noisy data to the edge node; through the local w-event differential privacy protection module based on the dynamic spatiotemporal moment The graph convolutional neural network pre-training protection module with matrix completion, the edge node completes the spatiotemporal matrix of the sparse traffic data stream, performs model pre-training, and clips and adds noise to the model gradients generated by the pre-training, and uploads them to the smart transportation cloud server platform; through the multi-objective weighted prediction module of traffic flow based on spatiotemporal self-supervised learning, the traffic flow is safely predicted in the sparse group intelligence perception scenario of the cloud edge, the gradients submitted by each edge node are globally aggregated, and the updated model parameters after aggregation are sent to the edge node to update its model parameters, so as to safely predict the traffic flow at the future time step t+1.

Citation Information

Patent Citations

  • Traffic flow prediction method based on federated learning

    CN114881371A

  • Social activity recommendation method and device for multi-modal data privacy protection

    CN117540106A