A micro-service-based social network data differential privacy protection method
By generating second-order difference sequences using a microservice-based approach and adding Laplace noise, the problem of insufficient data availability and code efficiency in social network data privacy protection is solved, achieving efficient privacy protection and flexible code management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEBEI NORMAL UNIV
- Filing Date
- 2022-06-22
- Publication Date
- 2026-04-17
AI Technical Summary
Existing social network privacy protection technologies are inadequate in terms of data availability and code execution efficiency, and their privacy protection effects are unsatisfactory.
A microservice-based approach is adopted to convert social network data into graph sequences. Laplace noise is added by generating second-order difference sequences, and differential privacy is protected using microservice modules, including data processing, parameter acquisition, graph sequence differentialization, and differential privacy modules.
It improves data availability and privacy protection, while also enhancing code maintainability and operational efficiency.
Smart Images

Figure CN114943097B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a differential privacy protection method for social network graph data based on microservices, belonging to the field of network security technology. Background Technology
[0002] Social networks contain a vast amount of personal privacy information and data. Directly publishing real social network data could lead to the leakage of a large amount of personal privacy information. To prevent the leakage of users' personal privacy information, it is essential to implement certain privacy protection measures for this data before publishing it to third parties.
[0003] Common privacy protection technologies can be broadly categorized into three types: differential privacy, homomorphic encryption, and secure multi-party computation. Differential privacy, in particular, is a privacy protection model with rigorous mathematical proof and does not rely on any attacker's background knowledge.
[0004] Current social network privacy protection technologies may compromise data availability while protecting privacy, and they also suffer from low code efficiency and poor maintainability. Summary of the Invention
[0005] The technical problem to be solved by this invention is to provide a microservice-based differential privacy protection method for social network data. This invention updates the social network in real time, converts the original graph sequence into a second-order difference sequence, and adds Laplace noise, thereby achieving high data availability and high privacy protection effect.
[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0007] This invention discloses a microservice-based differential privacy protection method for social network data. The microservices include a data processing microservice module, a parameter acquisition microservice module, a graph sequence differential microservice module, and a differential privacy microservice module. The method comprises the following steps:
[0008] Step 1: The user inputs the network dataset and initial parameters;
[0009] Step 2: Call the data processing microservice module to generate the graph sequence;
[0010] The data processing microservice module converts the input data into a graph sequence based on the characteristics and parameters of the network dataset input by the user in step one.
[0011] Step 3: Obtain parameters from the graph sequence generated in Step 2; the parameter acquisition microservice module generates node degree threshold and global sensitivity based on the parameters input by the user and the current graph sequence.
[0012] Step 4: Employ the graph sequence differential microservice module; the graph sequence differential microservice module generates the original sequence based on the graph sequence, and given a random function acting on the graph sequence, first generates a first-order differential sequence based on the original sequence, and then generates a second-order differential sequence based on the first-order differential sequence;
[0013] Step 5: Apply a differential privacy microservice module to the processed second-order difference sequence. The differential privacy microservice module adds Laplace noise to the second-order difference sequence based on the global sensitivity and different privacy budgets, with the privacy budget value increasing in order from 1 to 10. The Laplace noise is proportional to the ratio of the global sensitivity to the current privacy budget. The relative L1 error between the original sequence and the sequence after adding noise is recorded.
[0014] Step Six: Based on the relative L1 error recorded in Step Five and the errors caused by different privacy budgets, generate a line graph with the privacy budget as the horizontal axis and the relative L1 error as the vertical axis.
[0015] In this invention, the set of nodes and the set of edges in each network dataset generate a graph G = (V, E), where V represents the set of nodes in the graph and E represents the set of edges in the graph; the time when a new node enters the current graph is recorded in the graph sequence and represented by V.time;
[0016] In step two, the graph sequence is defined as G = (G1, G2, G3, ...), which is generated by the data processing microservice module. t =(V t E t ), t=1,2,3...,V t E represents the set of nodes that form the graph at time t. t Let G represent the set of edges that make up the graph at time t. t =(V t E t Let t represent the graph consisting of all nodes and edges reached at time t.
[0017] The specific method for obtaining the node degree threshold in step three of this invention is as follows:
[0018] Step 301: If the user inputs the parameter "edge", then the threshold is -1.
[0019] Step 302: If the user inputs the parameter highDeg, then determine whether the current network data is a directed graph structure or an undirected graph structure. If it is a directed graph, then generate the node degree threshold based on the out-degree of the current network data; if it is an undirected graph, then generate the node degree threshold based on the degree of the current network data.
[0020] To obtain global sensitivity, first store the graph sequence from step two in a list, and then obtain the maximum value of the degree or out-degree of all nodes in the current list in a regular manner.
[0021] In step four of this invention, the original sequence is G = (f(G1), f(G2), f(G3), ...), where G represents a graph and f(G1) represents a random function acting on the graph sequence G1. First, a 0 element is inserted at the initial position of the original sequence to prepare for difference. Then, difference is performed between two consecutive adjacent elements to generate a first-order difference sequence. A 0 element is inserted at the initial position of the first-order difference sequence, and difference is performed between two consecutive adjacent elements to generate a second-order difference sequence.
[0022] The privacy budget of this invention ranges from 0 to 10. Different privacy budgets generate different Laplace noise, which is stored in a list of noise. The second-order difference sequence is traversed and the corresponding Laplace noise is added to the noise list.
[0023] The initial parameters described in this invention include graphName, edgeOpt, degType, and publish.
[0024] The technical effects achieved by the present invention using the above technical solution are as follows:
[0025] This invention combines microservices and differential sequences for differential privacy protection of network data, providing strong technical support for privacy protection of social network data. The method of this invention ensures data availability while providing privacy protection. The use of microservices in the code execution structure of this invention greatly improves the maintainability and running efficiency of the code.
[0026] This invention uses a difference sequence to perform double processing on social network data sequences, generating a second-order difference sequence. Laplace noise is added to the second-order difference sequence to improve differential privacy protection.
[0027] This invention employs four microservice modules, ensuring that individual microservice modules can be dynamically deployed, added, deleted, and migrated during program execution. This not only improves the operating efficiency of the invention but also enhances its flexibility and maintainability. Attached Figure Description
[0028] Figure 1 This is a flowchart of the present invention;
[0029] Figure 2 This is a schematic diagram of the graph sequence structure according to an embodiment of the present invention;
[0030] Figure 3 This is a line graph showing the expected experimental results of an embodiment of the present invention. Detailed Implementation
[0031] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0032] As attached Figure 1 As shown, the microservices of this invention include a data processing microservice module, a parameter acquisition microservice module, a graph sequence differential microservice module, and a differential privacy microservice module; the microservice-based social network data differential privacy protection method adopts the following steps:
[0033] Step 1: The user inputs the network dataset and initial parameters; the initial parameters include graphName (graph name, i.e., dataset name), edgeOpt (graph type), degType (degree type), and publish (graph publication type);
[0034] Step 2: Call the data processing microservice module to generate the graph sequence;
[0035] Based on the characteristics of the user-input network dataset and initial parameters, a graph G = (V, E) is generated by traversing the node and edge sets of each network dataset, where V represents the set of nodes and E represents the set of edges. Because online networks are constantly changing, the time when a new node enters the current graph is also recorded in the graph sequence, denoted by V.time. That is, nodes arriving at different times constitute different graphs; for example, when t = 1, G... t =(V t E t () represents the graph formed by all nodes and edges reached at time t; the generated graph is then converted into a graph sequence form G = (G1, G2, G3, ...) in the manner described above, where G t =(V t E t ), t=1,2,3...,V t E represents the set of nodes that form the graph at time t. tThis represents the set of edges that constitute the graph at time t. If it's a real network dataset, then based on the edges.txt, nodes.txt, and edis.txt files in the network dataset, generate the corresponding edge sequence set edges, node set nodes, and node edi set edis. Generate a stable node set and edge set based on the arrival time of each node in the graph, and then process the node sets according to the stable node and edge sets to generate a graph sequence. If it's a synthetic network dataset, then a graph sequence needs to be generated according to specific parameters. This implementation example involves two synthetic datasets: one is a comprehensive disease transmission graph I generated based on the Barabasi–Albert priority attachment model; the other is a comprehensive disease transmission graph II generated based on the SIR infection model. The parameters for comprehensive disease transmission graph I are... The features are as follows: Assuming a total of num_years = 20 years, with num_nodes_per_year = 70 nodes added each year, and an initial total of num_initial = 500 nodes, it is guaranteed that the probability of each new node entering the social network graph being isolated is proportional to the parameter p = 0.5, and the probability of this new node connecting to an existing node v is proportional to deg(v) × (current_time - v.time + 1) - c (in an undirected graph, or in a directed graph proportional to out - deg(v) × (current_time - v.time + 1) - c), where c is the decay parameter. In fact, when each new node enters a social network graph, it connects to at least m = 1 nodes in the graph. Based on the set parameters, the required graph sequence can be generated.
[0036] The parametric characteristics of the disease transmission composite graph II are as follows: In this composite graph, all nodes are in one of three states: susceptible (S), infectious (I), and recovered (R); infectious individuals transmit the disease to susceptible individuals through social connections, with a transmission probability of P. t The probability of recovery at the infected node is P. r Infectious individuals The probability of being infected with G interact Each adjacent node in the graph; assuming a total of num_years = 20 years; the required graph sequence can be generated based on the set parameters;
[0037] The specific form of a graph sequence is as follows: Figure 2 As shown, the dataset is processed into a graph sequence G = (G1, G2, G3, ...), and all graph sequences are stored in a list, where each element in the list is of the form G. t =(V t E t ), t=1,2,3..., where V t E represents the set of nodes that form the graph at time t. tRepresents the set of edges that constitute the graph at time t, such as Figure 2 The first element of the list<networkx.classes.digraph.DiGraph object at 0x000001FC04D3BD30> This represents the graph consisting of all nodes and edges reached before time t;
[0038] Step 3: Obtain parameter microservice module based on graph sequence generated in Step 2; the parameter microservice generates node degree threshold and global sensitivity based on user input parameters and the current graph sequence;
[0039] First, obtain the node degree threshold. If the user input parameter is `edge`, the threshold is -1. If the user input parameter is `highDeg`, determine whether the current social network dataset is a directed graph or an undirected graph. If it is a directed graph, since nodes in a directed graph have both in-degree and out-degree (in this example, the out-degree of the directed graph), generate the node degree threshold based on the out-degree of the current social network. If it is an undirected graph, since nodes in an undirected graph only have degree (in this example, the degree of the graph), generate the node degree threshold based on the degree of the current social network. Next, obtain the global sensitivity. Based on the user input parameter and the current graph data sequence, first store the graph sequence in a list, then obtain the maximum value of the degree or out-degree of all nodes in the current list, and then generate the global sensitivity. Different global sensitivities will be generated in different datasets due to the different data. For example, the global sensitivity generated by the real network dataset `patent` is 431.0, the global sensitivity generated by the real network dataset `citation-pos` is 51.0, the global sensitivity generated by the synthetic network dataset `synth_BA` is 11.0, and the global sensitivity generated by the synthetic network dataset `synth_SIR` is 11.0.
[0040] Step 4: Use the graph sequence difference microservice; the graph sequence difference microservice randomly selects a function to act on the current graph sequence, generating the original graph sequence to be processed G = (f(G1), f(G2), f(G3), ...); first, insert a 0 element at the beginning of the original graph sequence, and then perform differences between consecutive adjacent elements to generate a first-order difference sequence; then insert a 0 element at the beginning of the first-order difference sequence, and then perform differences between consecutive adjacent elements to generate the required second-order difference sequence.
[0041] While first-order difference sequences can protect privacy and achieve high data availability, network attackers can find patterns in them to obtain the original graph sequence. Second-order difference sequences, on the other hand, are based on first-order difference sequences and further differentiated by adding Laplace noise. This ensures that the impact on data availability is minimal while improving privacy protection.
[0042] Step 5: Apply a differential privacy microservice to the processed second-order difference sequence. The differential privacy microservice sets different privacy budgets based on global sensitivity, adds Laplace noise to the second-order difference sequence that is proportional to the ratio of global sensitivity to the current privacy budget, and records the relative L1 error between the original sequence and the sequence after adding noise. The privacy budget ranges from 0 to 10, and different privacy budgets generate different Laplace noises, which are stored in a noise list. The second-order difference sequence is iterated through, and the corresponding Laplace noise from the noise list is added accordingly.
[0043] Step Six: First, the true values corresponding to the original graph sequence are recorded. Then, based on the predicted values of the processed graph sequence recorded in Step Five, the relative L1 error between the predicted and true values is used to generate a line graph with the privacy budget on the x-axis and the relative L1 error on the y-axis. The line graph provides a clear view of the error in the data before and after applying the method of this invention, as shown in the attached figure. Figure 3 As shown, errs_senseDiff_two is the polyline of the method of the present invention, original is the original unprocessed graph sequence error polyline, and senseDiff is the error polyline after a difference processing on the original graph sequence. The errs_senseDiff_two polyline is below the original polyline and senseDiff polyline, which means that the method of the present invention produces smaller errors, better protection effect, and higher data availability.
[0044] This invention combines microservices and differential sequences for differential privacy protection of network data, providing strong technical support for privacy protection of social network data. The method of this invention ensures data availability while providing privacy protection, and greatly improves code maintainability and running efficiency.
[0045] This invention uses a difference sequence to perform double processing on social network data sequences, generating a second-order difference sequence. Laplace noise is added to the second-order difference sequence to improve differential privacy protection.
[0046] This invention employs four microservice modules, ensuring that individual microservices can be dynamically deployed, added, deleted, and migrated during program execution. This not only improves the algorithm's running efficiency but also enhances its flexibility and maintainability.
[0047] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions or improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for protecting social network data differential privacy based on microservices, characterized in that The microservices include a data processing microservice module, a parameter acquisition microservice module, a graph sequence differential microservice module, and a differential privacy microservice module; the method employs the following steps: Step 1: The user inputs the network dataset and initial parameters; Step 2: Call the data processing microservice module to generate the graph sequence; The data processing microservice module converts the input data into a graph sequence based on the characteristics and parameters of the network dataset input by the user in step one. The set of nodes and the set of edges in each network dataset generate a graph where V represents the set of nodes in the graph and E represents the set of edges in the graph; the time at which a new node enters the current graph is recorded in the graph sequence, denoted by V.time; The graph sequence form is defined as follows: Generated based on the data processing microservice module , This represents the set of nodes that form the graph at time t. Let represent the set of edges that constitute the graph at time t. This represents the graph consisting of all nodes and edges reached at time t; Step 3: Obtain parameters from the graph sequence generated in Step 2; the parameter acquisition microservice module generates node degree threshold and global sensitivity based on the parameters input by the user and the current graph sequence. The node degree threshold is obtained using the following method: Step 301: If the user inputs the parameter "edge", then the threshold is -1. Step 302: If the user inputs the parameter highDeg, then determine whether the current network data is a directed graph structure or an undirected graph structure. If it is a directed graph, then generate the node degree threshold based on the out-degree of the current network data. If it is an undirected graph, then generate a node degree threshold based on the degree of the current network data; To obtain global sensitivity, first store the graph sequence from step two in a list, and then obtain the maximum value of the degree or out-degree of all nodes in the current list in a normal way; Step 4: Employ the graph sequence differential microservice module; the graph sequence differential microservice module generates the original sequence based on the graph sequence, and given a random function acting on the graph sequence, first generates a first-order differential sequence based on the original sequence, and then generates a second-order differential sequence based on the first-order differential sequence; Step 5: Apply a differential privacy microservice module to the processed second-order difference sequence. The differential privacy microservice module adds Laplace noise to the second-order difference sequence based on the global sensitivity and different privacy budgets, with the privacy budget value increasing in order from 1 to 10. The Laplace noise is proportional to the ratio of the global sensitivity to the current privacy budget. The relative L1 error between the original sequence and the sequence after adding noise is recorded. Step Six: Based on the relative L1 error recorded in Step Five and the errors caused by different privacy budgets, generate a line graph with the privacy budget as the horizontal axis and the relative L1 error as the vertical axis.
2. The method for differential privacy protection of social network data based on microservices according to claim 1, characterized in that... The original sequence in step four is f(M1) represents a random function acting on the graph sequence M1; first, 0 elements are inserted at the initial position of the original sequence to prepare for difference, then difference is made between two consecutive adjacent elements to generate a first-order difference sequence; 0 elements are inserted at the initial position of the first-order difference sequence, and difference is made between two consecutive adjacent elements to generate a second-order difference sequence.
3. The method for differential privacy protection of social network data based on microservices according to claim 1, characterized in that... The privacy budget ranges from 0 to 10. Different privacy budgets generate different Laplace noise, which is stored in a list of noise. The second-order difference sequence is traversed and the corresponding Laplace noise is added to the noise list.
4. The method for differential privacy protection of social network data based on microservices according to claim 1, characterized in that... The initial parameters include graphName, edgeOpt, degType, and publish.
Citation Information
Patent Citations
Blockchain enabling supply chain system key information protection method based on differential privacy
CN112507377A
Method and apparatus for constructing relationship network based on privacy protection
WO2021114921A1