+

CN118070327B - Distance query method and device in social graph satisfying differential privacy protection - Google Patents

Distance query method and device in social graph satisfying differential privacy protection Download PDF

Info

Publication number
CN118070327B
CN118070327B CN202410189281.3A CN202410189281A CN118070327B CN 118070327 B CN118070327 B CN 118070327B CN 202410189281 A CN202410189281 A CN 202410189281A CN 118070327 B CN118070327 B CN 118070327B
Authority
CN
China
Prior art keywords
distance
social graph
shortest path
privacy
path
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410189281.3A
Other languages
Chinese (zh)
Other versions
CN118070327A (en
Inventor
胡春强
盛伟洪
蔡斌
陈佳俊
叶青
夏晓峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing University
Original Assignee
Chongqing University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing University filed Critical Chongqing University
Priority to CN202410189281.3A priority Critical patent/CN118070327B/en
Publication of CN118070327A publication Critical patent/CN118070327A/en
Application granted granted Critical
Publication of CN118070327B publication Critical patent/CN118070327B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Bioethics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Medical Informatics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a social graph processing technology, and discloses a distance query method in a social graph meeting differential privacy protection, which comprises the following steps: the client generates an application request for inquiring the distance between nodes in the social graph; the server receives the application request and calculates privacy sensitivity of a corresponding social graph node set in the application request; and calculating the distance between nodes in the social graph according to the privacy sensitivity, adding noise to the distance, and then transmitting the distance to the client. The invention further provides a distance query device, equipment and medium in the social graph which meet the differential privacy protection. The method and the device can improve the accuracy of distance inquiry in the social graph meeting the differential privacy protection.

Description

满足差分隐私保护的社交图中距离查询方法及装置Distance query method and device in social graph satisfying differential privacy protection

技术领域Technical Field

本发明涉及社交图处理技术领域,尤其涉及满足差分隐私保护的社交图中距离查询方法及装置。The present invention relates to the technical field of social graph processing, and in particular to a distance query method and device in a social graph that meets differential privacy protection.

背景技术Background technique

社交图是一种在当今社会中广泛使用的社交关系表示方式。它由节点和边组成,可以有效地表示各种实体及其之间的关系。社交图中的隐私信息可以是节点的属性、边的权重或者图的结构信息。但是,随着人们隐私意识的提高,对社交图中的信息不加保护的披露会导致隐私泄露,产生道德和法律上的问题。Social graph is a widely used way to represent social relationships in today's society. It consists of nodes and edges, and can effectively represent various entities and their relationships. The private information in the social graph can be the attributes of the nodes, the weights of the edges, or the structural information of the graph. However, as people's privacy awareness increases, the unprotected disclosure of information in the social graph will lead to privacy leaks and cause ethical and legal problems.

为了保护社交图数据的隐私,早期研究者使用传统的数据匿名计算如k-匿名、l-多样和t-接近等技术。但是这些技术无法抵御来自攻击者越来越强的算力和基于背景知识发起的攻击。因此,有研究者尝试使用差分隐私技术来保护图中数据的隐私。In order to protect the privacy of social graph data, early researchers used traditional data anonymity computing techniques such as k-anonymity, l-diversity, and t-proximity. However, these techniques cannot resist the increasing computing power of attackers and attacks based on background knowledge. Therefore, some researchers have tried to use differential privacy technology to protect the privacy of graph data.

差分隐私是当今一种流行的隐私保护方法,因其严格的数学定义和稳健的隐私度量赢得了研究人员的青睐。其主要思想是通过随机性减少输入变化对输出的影响。具体来说,如果算法满足差分隐私,输入之间的差异就不会导致输出泄露隐私。差分隐私具有许多理想特性,即:(1)最大背景知识假设:假设攻击者知道除目标记录之外的所有记录;(2)隐私机制合成:简单的差分隐私机制可以组合成复杂的差分隐私机制;(3)隐私损失量化:对机制的隐私保护能力进行具体量化。因此,差分隐私被视为隐私保护算法的标准,并被微软(Microsoft)、谷歌(Google)和苹果(Apple)应用,在不侵犯隐私的情况下收集遥测数据。Differential privacy is a popular privacy protection method today, which has won the favor of researchers for its rigorous mathematical definition and robust privacy measurement. Its main idea is to reduce the impact of input changes on output through randomness. Specifically, if the algorithm satisfies differential privacy, the difference between the inputs will not cause the output to leak privacy. Differential privacy has many ideal properties, namely: (1) Maximum background knowledge assumption: it is assumed that the attacker knows all records except the target record; (2) Privacy mechanism synthesis: simple differential privacy mechanisms can be combined into complex differential privacy mechanisms; (3) Privacy loss quantification: the privacy protection ability of the mechanism is specifically quantified. Therefore, differential privacy is regarded as the standard for privacy protection algorithms and is applied by Microsoft, Google, and Apple to collect telemetry data without violating privacy.

最短路径是社交图中常用的指标,具有广泛的用途,如社交图中的好友匹配和介中心性(betweenness centrality)计算等。目前已有发明或者研究解决了当图中边的权重敏感(即属于隐私信息,不能公开)时,如何发布最短路径的问题。为清晰起见,我们用最短路径表示最短路径经过的边序列,用距离表示最短路径经过的边的数量。The shortest path is a commonly used metric in social graphs and has a wide range of uses, such as friend matching and betweenness centrality calculation in social graphs. At present, there have been inventions or studies that solve the problem of how to publish the shortest path when the weights of the edges in the graph are sensitive (i.e., they are private information and cannot be made public). For the sake of clarity, we use the shortest path to represent the sequence of edges that the shortest path passes through, and the distance to represent the number of edges that the shortest path passes through.

已有的研究因为使用权重敏感图假设,使得其全局敏感度为1。全局敏感度是差分隐私中用来衡量查询在相邻数据集下输出结果的最大差异。全局敏感度越大,则需要向结果引入更大的随机噪声以保护数据集的隐私。但是如果在无权图上进行距离查询,其假设隐私信息为边本身,那么其全局敏感度可以达到n的大小,n是图中节点的数量。该过大的敏感度使得我们必须使用较大的噪声才能保护数据集中边的隐私。为了降低全局敏感度对结果效用的破坏,可以使用光滑敏感度进行替代,但光滑敏感度的计算成本较高。Existing studies have used a weighted sensitive graph assumption, which makes its global sensitivity 1. Global sensitivity is used in differential privacy to measure the maximum difference in the output results of queries under adjacent data sets. The larger the global sensitivity, the more random noise needs to be introduced into the results to protect the privacy of the data set. However, if a distance query is performed on an unweighted graph, which assumes that the private information is the edge itself, then its global sensitivity can reach the size of n, where n is the number of nodes in the graph. This excessive sensitivity requires us to use a larger noise to protect the privacy of the edges in the data set. In order to reduce the damage of global sensitivity to the utility of the results, smooth sensitivity can be used as an alternative, but the computational cost of smooth sensitivity is high.

考虑社交图,其中节点表示用户,节点之间的边表示他们之间是好友关系。在该图中,最短路径则是可以指从某个用户A到用户B的一条由相互连接的边组成的序列。节点A和B之间的距离代表了这条最短路径的长度。如果A和B之间存在一条具有较小距离的最短路径(如距离小于某个阈值),那么可以尝试向A和B推荐彼此,扩展他们之间的好友关系。例如,存在一个可信数据库(或称其为服务端)存储了完整的用户社交图。某客户端需要向该服务端查询用户A和B之间的距离,如果服务端对其结果不进行保护,那么可能就会暴露图中其他用户之间的好友关系,这会影响用户之间的隐私安全,对图中使用敏感度增加噪声以保护图的隐私,但使用全局敏感度会很容易暴露社交图中各用户之间的隐私关系,且采用全局敏感度会增大敏感度数值,导致引入更大的随机噪声保护社交图的安全,导致隐私保护的效用降低。Consider a social graph, where nodes represent users and edges between nodes represent friendships between them. In this graph, the shortest path can refer to a sequence of interconnected edges from a user A to user B. The distance between nodes A and B represents the length of this shortest path. If there is a shortest path with a small distance between A and B (such as a distance less than a certain threshold), then we can try to recommend A and B to each other and expand their friendship. For example, there is a trusted database (or server) that stores a complete user social graph. A client needs to query the server for the distance between users A and B. If the server does not protect its results, the friendships between other users in the graph may be exposed, which will affect the privacy security between users. Using sensitivity to add noise to the graph to protect the privacy of the graph, but using global sensitivity will easily expose the privacy relationships between users in the social graph, and using global sensitivity will increase the sensitivity value, resulting in the introduction of greater random noise to protect the security of the social graph, resulting in a decrease in the effectiveness of privacy protection.

发明内容Summary of the invention

本发明提供一种满足差分隐私保护的社交图中距离查询方法及装置,可以提高满足差分隐私保护的社交图中距离查询的准确性。The present invention provides a distance query method and device in a social graph that meets differential privacy protection, which can improve the accuracy of distance query in a social graph that meets differential privacy protection.

为实现上述目的,本发明提供的一种满足差分隐私保护的社交图中距离查询方法,包括:To achieve the above object, the present invention provides a distance query method in a social graph that satisfies differential privacy protection, comprising:

客户端生成查询社交图中节点之间距离的申请请求;The client generates an application request to query the distance between nodes in the social graph;

服务端接收所述申请请求,并计算所述申请请求中对应的社交图节点集合的隐私敏感度;The server receives the application request and calculates the privacy sensitivity of the social graph node set corresponding to the application request;

根据所述隐私敏感度计算所述社交图中节点之间距离,并将所述距离添加噪声后下发至所述客户端。The distance between nodes in the social graph is calculated according to the privacy sensitivity, and noise is added to the distance before being sent to the client.

可选地,在所述计算所述申请请求对应的查询集合的隐私敏感度之前,还包括:Optionally, before calculating the privacy sensitivity of the query set corresponding to the application request, the method further includes:

步骤1、遍历所述社交图中任意的节点对;Step 1, traversing any node pair in the social graph;

步骤2、在所述节点对存在连接边时,提取所述连接边,得到第一最短路径,并将所述连接边在所述社交图中进行删除,得到删除后的社交图;Step 2: when there is a connection edge between the node pairs, extract the connection edge to obtain a first shortest path, and delete the connection edge from the social graph to obtain a social graph after deletion;

步骤3、在所述节点对不存在连接边时,则在所述社交图中采用广度优先搜索算法获取所述节点对之间的路径。Step 3: When there is no connecting edge between the node pairs, a breadth-first search algorithm is used in the social graph to obtain a path between the node pairs.

可选地,所述将所述连接边在所述社交图中进行删除,得到删除后的社交图,还包括:Optionally, deleting the connection edge in the social graph to obtain a deleted social graph further includes:

在删除后的社交图中利用所述广度优先搜索算法进行路径搜索,得到所述节点对之间的第二最短路径;Performing a path search using the breadth-first search algorithm in the deleted social graph to obtain the second shortest path between the node pairs;

在得到所述节点对之间的第二最短路径后,删除所述第二最短路径;After obtaining the second shortest path between the node pairs, deleting the second shortest path;

再次采用所述广度优先搜索算法对删除第二最短路径后的社交图进行路径搜索,得到所述节点对之间的第三最短路径;The breadth-first search algorithm is used again to perform path search on the social graph after deleting the second shortest path, so as to obtain the third shortest path between the node pairs;

将所述第二最短路径和所述第三最短路径存储至所述路径集合中。The second shortest path and the third shortest path are stored in the path set.

可选地,在所述将所述第二最短路径和所述第三最短路径存储至所述路径集合中之后,还包括:Optionally, after storing the second shortest path and the third shortest path in the path set, the method further includes:

识别所述第二最短路径的距离,并将所述第二最短路径的距离减去连接边的距离后加入至第一距离集合;Identify the distance of the second shortest path, and add the distance of the second shortest path minus the distance of the connecting edge to the first distance set;

识别所述第三最短路径的距离,并利用所述第三最短路径的距离减去所述第二最短路径的距离得到距离差,并将所述距离差加入至第二距离集合。The distance of the third shortest path is identified, and the distance difference is obtained by subtracting the distance of the second shortest path from the distance of the third shortest path, and the distance difference is added to the second distance set.

可选地,所述在所述节点对不存在连接边时,则在所述社交图中采用广度优先搜索算法,得到所述节点对之间的最短路径,包括:Optionally, when there is no connecting edge between the node pairs, a breadth-first search algorithm is used in the social graph to obtain the shortest path between the node pairs, including:

在所述节点对不存在连接边时,则采用所述广度优先搜索算法进行节点对之间的路径搜索,搜索完成后得到第二最短路径;When there is no connecting edge between the node pairs, the breadth-first search algorithm is used to search for paths between the node pairs, and after the search is completed, the second shortest path is obtained;

识别所述第二最短路径的距离后加入至第一距离集合;Identifying the distance of the second shortest path and adding it to the first distance set;

从所述社交图中删除所述第二最短路径后,采用所述广度优先搜索算法搜索节点对之间的第三最短路径,识别所述第三最短路径的距离后减去所述第二最短路径的距离,得到路径距离差值,将所述路径距离差值加入至第二距离集合。After deleting the second shortest path from the social graph, the breadth-first search algorithm is used to search for a third shortest path between node pairs, and the distance of the third shortest path is identified and then subtracted from the distance of the second shortest path to obtain a path distance difference, and the path distance difference is added to the second distance set.

可选地,所述计算所述申请请求中对应的社交图节点集合的隐私敏感度,包括:Optionally, calculating the privacy sensitivity of the set of social graph nodes corresponding to the application request includes:

获取所述服务端中预设的隐私参数;Obtaining privacy parameters preset in the server;

根据所述预设的隐私参数、第一距离集合以及第二距离集合计算所述隐私敏感度。The privacy sensitivity is calculated according to the preset privacy parameter, the first distance set and the second distance set.

可选地,所述根据所述预设的隐私参数、第一距离集合以及第二距离集合计算所述隐私敏感度,包括:Optionally, the calculating the privacy sensitivity according to the preset privacy parameter, the first distance set, and the second distance set includes:

采用下述公式计算所述隐私敏感度:The privacy sensitivity is calculated using the following formula:

ss=max(max(S),max(R)×e)ss=max(max(S),max(R)×e )

其中,max(S)为第一距离集合中最大值,max(R)为第二距离集合中最大值,β为第三隐私参数,其中,∈为第一隐私参数,δ为第二隐私参数。Where max(S) is the maximum value in the first distance set, max(R) is the maximum value in the second distance set, and β is the third privacy parameter. ∈ is the first privacy parameter, and δ is the second privacy parameter.

为了解决上述问题,本发明还提供一种满足差分隐私保护的社交图中距离查询装置,所述装置包括:In order to solve the above problems, the present invention also provides a distance query device in a social graph that satisfies differential privacy protection, and the device includes:

距离查询请求模块,用于客户端生成查询社交图中节点之间距离的申请请求;The distance query request module is used by the client to generate an application request for querying the distance between nodes in the social graph;

敏感度计算模块,用于服务端接收所述申请请求,并计算所述申请请求中对应的社交图节点集合的隐私敏感度;A sensitivity calculation module, configured to receive the application request at the server end and calculate the privacy sensitivity of the set of social graph nodes corresponding to the application request;

距离结果下发模块,用于根据所述隐私敏感度计算所述社交图中节点之间距离,并将所述距离添加噪声后下发至所述客户端。The distance result sending module is used to calculate the distance between nodes in the social graph according to the privacy sensitivity, and send the distance to the client after adding noise.

为了解决上述问题,本发明还提供一种电子设备,所述电子设备包括:In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

至少一个处理器;以及,at least one processor; and,

与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,

所述存储器存储有可被所述至少一个处理器执行的计算机程序,所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述所述的满足差分隐私保护的社交图中距离查询方法。The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the distance query method in the social graph that satisfies differential privacy protection as described above.

为了解决上述问题,本发明还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个计算机程序,所述至少一个计算机程序被电子设备中的处理器执行以实现上述所述的满足差分隐私保护的社交图中距离查询方法。In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned distance query method in a social graph that meets differential privacy protection.

本发明实施例通过对客户端中社交图的距离进行查询,可以通过在社交图中查询到的节点之间的距离进行隐私敏感度的计算,增加了隐私安全性,进一步地,社交图作为无权图,可以实现无权图中的距离查询,另外,在客户端的距离查询申请请求中,通过计算距离集合的隐私敏感度完成社交图整体敏感度的计算,采用隐私敏感度代替全局敏感度并降低全局敏感度对距离计算结果的误差破坏,此外,本发明实施例通过采用直接在无权图中进行隐私敏感度的计算,相较于现有的基于差分隐私的距离发布技术无法作用于无权图的缺点,本发明可以降低在无权图中进行隐私敏感度计算的成本。The embodiment of the present invention queries the distance of the social graph in the client, and can calculate the privacy sensitivity through the distance between the nodes queried in the social graph, thereby increasing privacy security. Furthermore, as an unweighted graph, the social graph can realize distance query in the unweighted graph. In addition, in the distance query application request of the client, the overall sensitivity of the social graph is calculated by calculating the privacy sensitivity of the distance set, and the privacy sensitivity is used instead of the global sensitivity to reduce the error damage of the global sensitivity to the distance calculation result. In addition, the embodiment of the present invention directly calculates the privacy sensitivity in the unweighted graph. Compared with the disadvantage that the existing distance publishing technology based on differential privacy cannot act on the unweighted graph, the present invention can reduce the cost of privacy sensitivity calculation in the unweighted graph.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本发明一实施例提供的满足差分隐私保护的社交图中距离查询方法的流程示意图;FIG1 is a schematic diagram of a flow chart of a distance query method in a social graph that satisfies differential privacy protection provided by an embodiment of the present invention;

图2为本发明一实施例提供的一种满足差分隐私保护的社交图中距离查询装置的功能模块图;FIG2 is a functional module diagram of a distance query device in a social graph that satisfies differential privacy protection, provided by an embodiment of the present invention;

图3为本发明一实施例提供的实现所述一种满足差分隐私保护的社交图中距离查询方法的电子设备的结构示意图。FIG3 is a schematic diagram of the structure of an electronic device for implementing a distance query method in a social graph satisfying differential privacy protection, provided by an embodiment of the present invention.

本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings.

具体实施方式Detailed ways

应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

本申请实施例提供一种满足差分隐私保护的社交图中距离查询方法。所述一种满足差分隐私保护的社交图中距离查询方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述一种满足差分隐私保护的社交图中距离查询方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。所述服务器可以是独立的服务器,也可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。The embodiment of the present application provides a distance query method in a social graph that satisfies differential privacy protection. The execution subject of the distance query method in a social graph that satisfies differential privacy protection includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided in the embodiment of the present application. In other words, the distance query method in a social graph that satisfies differential privacy protection can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

参照图1所示,为本发明一实施例提供的满足差分隐私保护的社交图中距离查询方法的流程示意图。在本实施例中,所述满足差分隐私保护的社交图中距离查询方法包括:1 is a flow chart of a distance query method in a social graph that satisfies differential privacy protection provided by an embodiment of the present invention. In this embodiment, the distance query method in a social graph that satisfies differential privacy protection includes:

S1、客户端生成查询社交图中节点之间距离的申请请求。S1. The client generates an application request to query the distance between nodes in the social graph.

本发明实施例中,所述客户端是指参与数据分析的个体和实体,可以表示为社交图中的社交用户和社交节点。In the embodiment of the present invention, the client refers to an individual or entity participating in data analysis, and can be represented as a social user or a social node in a social graph.

本发明实施例客户端生成查询社交图中节点之间距离的申请请求,可以实现客户端到服务端的数据通信。In the embodiment of the present invention, the client generates an application request for querying the distance between nodes in the social graph, which can realize data communication from the client to the server.

S2、服务端接收所述申请请求,并计算所述申请请求中对应的社交图节点集合的隐私敏感度。S2. The server receives the application request and calculates the privacy sensitivity of the social graph node set corresponding to the application request.

本发明实施例中,所述服务端是指收集和处理客户端数据的中心节点。服务端的目的是利用客户端数据进行一些数据分析或机器学习的任务,例如社交网络中的好友推荐。为了保护客户端的隐私,服务端不能直接访问客户端的原始数据,而只能接收到经过一定的隐私保护机制处理后的数据。服务端需要在保证数据可用性的前提下,尽量减少对客户端数据的隐私泄露风险。In the embodiment of the present invention, the server refers to a central node that collects and processes client data. The purpose of the server is to use the client data to perform some data analysis or machine learning tasks, such as friend recommendations in social networks. In order to protect the privacy of the client, the server cannot directly access the client's original data, but can only receive data processed by a certain privacy protection mechanism. The server needs to minimize the risk of privacy leakage of client data while ensuring data availability.

作为本发明一实施例,在所述计算所述申请请求对应的查询集合的隐私敏感度之前,还包括:As an embodiment of the present invention, before calculating the privacy sensitivity of the query set corresponding to the application request, the method further includes:

步骤1、遍历所述社交图中任意的节点对;Step 1, traversing any node pair in the social graph;

步骤2、在所述节点对存在连接边时,提取所述连接边,得到第一最短路径,并将所述连接边在所述社交图中进行删除,得到删除后的社交图;Step 2: when there is a connection edge between the node pairs, extract the connection edge to obtain a first shortest path, and delete the connection edge from the social graph to obtain a social graph after deletion;

步骤3、在所述节点对不存在连接边时,则在所述社交图中采用广度优先搜索算法获取所述节点对之间的路径。Step 3: When there is no connecting edge between the node pairs, a breadth-first search algorithm is used in the social graph to obtain a path between the node pairs.

本发明实施例中,所述节点对是指社交图中的任意两个节点。In the embodiment of the present invention, the node pair refers to any two nodes in the social graph.

本发明实施例中,所述连接边是指节点对有且仅有通过一条边直接相连的边。In the embodiment of the present invention, the connecting edge refers to an edge in which a pair of nodes is directly connected by only one edge.

作为本发明一实施例,所述将所述连接边在所述社交图中进行删除,得到删除后的社交图,还包括:As an embodiment of the present invention, deleting the connection edge in the social graph to obtain a deleted social graph further includes:

在删除后的社交图中利用所述广度优先搜索算法进行路径搜索,得到所述节点对之间的第二最短路径;Performing a path search using the breadth-first search algorithm in the deleted social graph to obtain the second shortest path between the node pairs;

在得到所述节点对之间的第二最短路径后,删除所述第二最短路径;After obtaining the second shortest path between the node pairs, deleting the second shortest path;

再次采用所述广度优先搜索算法对删除第二最短路径后的社交图进行路径搜索,得到所述节点对之间的第三最短路径;The breadth-first search algorithm is used again to perform path search on the social graph after deleting the second shortest path, so as to obtain the third shortest path between the node pairs;

将所述第二最短路径和所述第三最短路径存储至所述路径集合中。The second shortest path and the third shortest path are stored in the path set.

进一步地,在所述将所述第二最短路径和所述第三最短路径存储至所述路径集合中之后,还包括:Further, after storing the second shortest path and the third shortest path in the path set, the method further includes:

识别所述第二最短路径的距离,并将所述第二最短路径的距离减去连接边的距离后加入至第一距离集合;Identify the distance of the second shortest path, and add the distance of the second shortest path minus the distance of the connecting edge to the first distance set;

识别所述第三最短路径的距离,并利用所述第三最短路径的距离减去所述第二最短路径的距离得到距离差,并将所述距离差加入至第二距离集合。The distance of the third shortest path is identified, and the distance difference is obtained by subtracting the distance of the second shortest path from the distance of the third shortest path, and the distance difference is added to the second distance set.

本发明实施例中,所述距离是指两个节点间的路径中所包括的连接边数量的多少。In the embodiment of the present invention, the distance refers to the number of connecting edges included in the path between two nodes.

作为本发明一实施例,所述在所述节点对不存在连接边时,则在所述社交图中采用广度优先搜索算法,得到所述节点对之间的最短路径,包括:As an embodiment of the present invention, when there is no connecting edge between the node pairs, a breadth-first search algorithm is used in the social graph to obtain the shortest path between the node pairs, including:

在所述节点对不存在连接边时,则采用所述广度优先搜索算法进行节点对之间的路径搜索,搜索完成后得到第二最短路径;When there is no connecting edge between the node pairs, the breadth-first search algorithm is used to search for paths between the node pairs, and after the search is completed, the second shortest path is obtained;

识别所述第二最短路径的距离后加入至第一距离集合;Identifying the distance of the second shortest path and adding it to the first distance set;

从所述社交图中删除所述第二最短路径后,采用所述广度优先搜索算法搜索节点对之间的第三最短路径,识别所述第三最短路径的距离后减去所述第二最短路径的距离,得到路径距离差值,将所述路径距离差值加入至第二距离集合。After deleting the second shortest path from the social graph, the breadth-first search algorithm is used to search for a third shortest path between node pairs, and the distance of the third shortest path is identified and then subtracted from the distance of the second shortest path to obtain a path distance difference, and the path distance difference is added to the second distance set.

本发明实施例中,所述第一距离集合是指节点对之间第二最短路径的距离和第一最短路径的距离的差值的集合,用集合S表示。In the embodiment of the present invention, the first distance set refers to a set of differences between the distance of the second shortest path and the distance of the first shortest path between node pairs, and is represented by a set S.

本发明实施例中,所述第二距离集合是指节点对之间后续所有路径的距离和第二最短路径的距离的差值的集合,用集合R表示。In the embodiment of the present invention, the second distance set refers to a set of differences between the distances of all subsequent paths between node pairs and the distance of the second shortest path, and is represented by a set R.

本发明实施例中,所述连接边距离因为是节点对之间直接相连的边,因此,所述连接边的距离为1。In the embodiment of the present invention, the connection edge distance is an edge directly connecting a pair of nodes, and therefore, the connection edge distance is 1.

示例性地,所述采用所述广度优先搜索算法进行节点对之间的路径搜索,包括:Exemplarily, the adopting the breadth-first search algorithm to perform path search between node pairs includes:

定义u∈V,v∈V,其中V是图G的顶点集合,其中,图G为社交图。遍历任意的节点对(u,v):Define u∈V,v∈V, where V is the vertex set of graph G, where graph G is a social graph. Traverse any node pair (u,v):

如果它们在图G上存在连接边,表示为e(u,v):那么从节点u开始,在图G\{e(u,v)}上执行广度优先搜索算法,得到一条u和v之间的最短路径p(u,v)。(图G\{e(u,v)}表示从图G中删去边e(u,v),下述定义类似)。If they have a connecting edge on graph G, represented by e(u,v): then starting from node u, perform a breadth-first search algorithm on graph G\{e(u,v)} to obtain a shortest path p(u,v) between u and v. (graph G\{e(u,v)} means deleting edge e(u,v) from graph G, and the following definition is similar).

具体而言,广度优先搜索流程如下:Specifically, the breadth-first search process is as follows:

1.预先设置一个长度为n(n是图中节点的数量)的空白数组A和一个队列Q(队列是一种在计算机领域广泛使用的先进先出的数据结构)。1. Pre-set a blank array A of length n (n is the number of nodes in the graph) and a queue Q (a queue is a first-in-first-out data structure widely used in the computer field).

2.将节点对(u,u)放入队列中。该节点对中第一个节点表示当前访问的节点的上一个已访问过的节点,第二个节点表示当前访问的节点。对于初始节点u,需要特殊设置为两个节点是一样。这一设置是为了搜索到节点v时,可以获取到最短路径p(u,v)。2. Put the node pair (u,u) into the queue. The first node in the node pair represents the node that was previously visited before the currently visited node, and the second node represents the currently visited node. For the initial node u, a special setting is required so that the two nodes are the same. This setting is to obtain the shortest path p(u,v) when searching for node v.

3.从队列中取出第一个节点对,命名为(a,b):如果b是目标节点v,则设置A[b]=a,停止搜索;否则,在图中标记节点b为已访问,设置A[b]=a,并把该节点和它未访问的邻居节点组成节点对加入到队列中。3. Take the first node pair from the queue and name it (a, b): If b is the target node v, set A[b] = a and stop searching; otherwise, mark node b as visited in the graph, set A[b] = a, and add the node and its unvisited neighbor nodes to form a node pair and add them to the queue.

4.重复步骤3,直到找到目标节点v。找到目标节点后,根据A包含的先后访问顺序,可以获得一条u,v之间的最短路径p(u,v)={e(u,s1),e(s1,s2),…,e(sk,v)}。其中s1,…,sk是虚指u,v的最短路径经过的节点。4. Repeat step 3 until the target node v is found. After the target node is found, according to the access order contained in A, a shortest path between u and v can be obtained: p(u,v) = {e(u,s 1 ), e(s 1 ,s 2 ),…, e(s k ,v)}. Among them, s 1 ,…,s k are the nodes passed by the shortest path between virtual nodes u and v.

类似地,从节点u开始,在图G\{p(u,v),e(u,v)}上执行广度优先搜索算法,得到一条u和v之间的最短路径p′(u,v)。(图G\{p(u,v),e(u,v)}表示图G中删去边e(u,v)和路径p(u,v)所包含的边)。向集合S中加入元素|p(u,v)|-1(||表示路径的长度)。向集合R中加入元素|p′(u,v)|-|p(u,v)|。Similarly, starting from node u, perform a breadth-first search algorithm on the graph G\{p(u,v),e(u,v)} to obtain a shortest path p′(u,v) between u and v. (The graph G\{p(u,v),e(u,v)} represents the graph G with the edge e(u,v) and the edge included in the path p(u,v) deleted.) Add the element |p(u,v)|-1 to the set S (|| represents the length of the path). Add the element |p′(u,v)|-|p(u,v)| to the set R.

示例性地,在所述社交图G上未有连接边时,则从节点u开始,在图G上执行广度优先搜索算法,得到一条u和v之间的最短路径p(u,v)。Exemplarily, when there is no connecting edge on the social graph G, starting from node u, a breadth-first search algorithm is executed on the graph G to obtain a shortest path p(u, v) between u and v.

类似地,从节点u开始,在图G\{p(u,v)}上执行广度优先搜索算法,得到一条u和v之间的最短路径p′(u,v)。Similarly, starting from node u, a breadth-first search algorithm is performed on the graph G\{p(u,v)} to obtain a shortest path p′(u,v) between u and v.

向集合S中加入元素|p′(u,v)|-|p(u,v)|。Add the element |p′(u,v)|-|p(u,v)| to the set S.

作为本发明一实施例,所述计算所述申请请求中对应的社交图节点集合的隐私敏感度,包括:As an embodiment of the present invention, the calculating the privacy sensitivity of the set of social graph nodes corresponding to the application request includes:

获取所述服务端中预设的隐私参数;Obtaining privacy parameters preset in the server;

根据所述预设的隐私参数、第一距离集合以及第二距离集合计算所述隐私敏感度。The privacy sensitivity is calculated according to the preset privacy parameter, the first distance set and the second distance set.

进一步地,所述根据所述预设的隐私参数、第一距离集合以及第二距离集合计算所述隐私敏感度,包括:Further, the calculating the privacy sensitivity according to the preset privacy parameter, the first distance set and the second distance set includes:

采用下述公式计算所述隐私敏感度:The privacy sensitivity is calculated using the following formula:

ss=max(max(S),max(R)×e)ss=max(max(S),max(R)×e )

其中,max(S)为第一距离集合中最大值,max(R)为第二距离集合中最大值,β为第三隐私参数,其中,∈为第一隐私参数,δ为第二隐私参数。Where max(S) is the maximum value in the first distance set, max(R) is the maximum value in the second distance set, and β is the third privacy parameter. ∈ is the first privacy parameter, and δ is the second privacy parameter.

本发明实施例通过构建集合S和集合R可以高效率地计算出敏感度。The embodiment of the present invention can efficiently calculate the sensitivity by constructing the set S and the set R.

S3、根据所述隐私敏感度计算所述社交图中节点之间距离,并将所述距离下发至所述客户端。S3. Calculate the distance between nodes in the social graph according to the privacy sensitivity, and send the distance to the client.

作为本发明一实施例,所述根据所述隐私敏感度计算所述社交图中节点之间距离,包括:As an embodiment of the present invention, calculating the distance between nodes in the social graph according to the privacy sensitivity includes:

从所述社交图中查询目标节点对;Querying a target node pair from the social graph;

获取所述目标节点对之间的距离;Obtaining the distance between the target node pairs;

对所述目标节点对之间的距离添加噪声后进行无偏处理,得到目标距离。The distance between the target node pairs is subjected to unbiased processing after adding noise to obtain the target distance.

本发明实施例中,所述目标节点对是指客户端申请请求中对应的节点。In the embodiment of the present invention, the target node pair refers to the corresponding nodes in the client application request.

本发明实施例中,所述进行无偏处理是为了计算结果的规范性,所以要进行后置处理,使得有偏的计算结果变成无偏的计算结果,减少误差。In the embodiment of the present invention, the unbiased processing is performed for the purpose of standardizing the calculation results, so post-processing is performed to convert the biased calculation results into unbiased calculation results, thereby reducing errors.

进一步地,所述对所述目标节点对之间的距离添加噪声后进行无偏处理,得到目标距离,包括:Further, the adding noise to the distance between the target node pairs and performing unbiased processing to obtain the target distance includes:

采用下述公式对所述目标节点对之间的距离添加噪声后进行无偏处理:The following formula is used to add noise to the distance between the target node pairs for unbiased processing:

其中,D为目标距离,d为目标节点对之间的距离,ss为隐私敏感度,α为第四隐私参数,z为指数噪声,其中, Where D is the target distance, d is the distance between the target node pairs, ss is the privacy sensitivity, α is the fourth privacy parameter, and z is the exponential noise.

本发明实施例中,z通常为尺度λ=1的指数噪声Exp-(λ)。In the embodiment of the present invention, z is usually an exponential noise Exp - (λ) with a scale λ=1.

进一步地,所述指数噪声Exp-(λ)的概率密度函数为:Furthermore, the probability density function of the exponential noise Exp - (λ) is:

本发明实施例通过对客户端中社交图的距离进行查询,可以通过在社交图中查询到的节点之间的距离进行隐私敏感度的计算,增加了隐私安全性,进一步地,社交图作为无权图,可以实现无权图中的距离查询,另外,在客户端的距离查询申请请求中,通过计算距离集合的隐私敏感度完成社交图整体敏感度的计算,采用隐私敏感度代替全局敏感度并降低全局敏感度对距离计算结果的误差破坏,此外,本发明实施例通过采用直接在无权图中进行隐私敏感度的计算,相较于现有的基于差分隐私的距离发布技术无法作用于无权图的缺点,本发明可以降低在无权图中进行隐私敏感度计算的成本。The embodiment of the present invention queries the distance of the social graph in the client, and can calculate the privacy sensitivity through the distance between the nodes queried in the social graph, thereby increasing privacy security. Furthermore, as an unweighted graph, the social graph can realize distance query in the unweighted graph. In addition, in the distance query application request of the client, the overall sensitivity of the social graph is calculated by calculating the privacy sensitivity of the distance set, and the privacy sensitivity is used instead of the global sensitivity to reduce the error damage of the global sensitivity to the distance calculation result. In addition, the embodiment of the present invention directly calculates the privacy sensitivity in the unweighted graph. Compared with the disadvantage that the existing distance publishing technology based on differential privacy cannot act on the unweighted graph, the present invention can reduce the cost of privacy sensitivity calculation in the unweighted graph.

如图2所示,是本发明一实施例提供的一种满足差分隐私保护的社交图中距离查询装置的功能模块图。As shown in FIG. 2 , it is a functional module diagram of a distance query device in a social graph that satisfies differential privacy protection provided by an embodiment of the present invention.

本发明所述一种满足差分隐私保护的社交图中距离查询装置100可以安装于电子设备中。根据实现的功能,所述一种满足差分隐私保护的社交图中距离查询装置100可以包括距离查询请求模块101、敏感度计算模块102以及距离结果下发模块103。The device 100 for querying distance in a social graph meeting differential privacy protection of the present invention can be installed in an electronic device. According to the implemented functions, the device 100 for querying distance in a social graph meeting differential privacy protection can include a distance query request module 101, a sensitivity calculation module 102, and a distance result delivery module 103.

本发明所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The module described in the present invention may also be referred to as a unit, which refers to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, and is stored in a memory of the electronic device.

在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:

所述距离查询请求模块101,用于客户端生成查询社交图中节点之间距离的申请请求。The distance query request module 101 is used by the client to generate an application request for querying the distance between nodes in the social graph.

本发明实施例中,所述客户端是指参与数据分析的个体和实体,可以表示为社交图中的社交用户和社交节点。In the embodiment of the present invention, the client refers to an individual or entity participating in data analysis, and can be represented as a social user or a social node in a social graph.

本发明实施例客户端生成查询社交图中节点之间距离的申请请求,可以实现客户端到服务端的数据通信。In the embodiment of the present invention, the client generates an application request for querying the distance between nodes in the social graph, which can realize data communication from the client to the server.

所述敏感度计算模块102,用于服务端接收所述申请请求,并计算所述申请请求中对应的社交图节点集合的隐私敏感度。The sensitivity calculation module 102 is used for receiving the application request at the server end and calculating the privacy sensitivity of the social graph node set corresponding to the application request.

本发明实施例中,所述服务端是指收集和处理客户端数据的中心节点。服务端的目的是利用客户端数据进行一些数据分析或机器学习的任务,例如社交网络中的好友推荐。为了保护客户端的隐私,服务端不能直接访问客户端的原始数据,而只能接收到经过一定的隐私保护机制处理后的数据。服务端需要在保证数据可用性的前提下,尽量减少对客户端数据的隐私泄露风险。In the embodiment of the present invention, the server refers to a central node that collects and processes client data. The purpose of the server is to use the client data to perform some data analysis or machine learning tasks, such as friend recommendations in social networks. In order to protect the privacy of the client, the server cannot directly access the client's original data, but can only receive data processed by a certain privacy protection mechanism. The server needs to minimize the risk of privacy leakage of client data while ensuring data availability.

作为本发明一实施例,As an embodiment of the present invention,

在所述计算所述申请请求对应的查询集合的隐私敏感度之前,还包括:Before calculating the privacy sensitivity of the query set corresponding to the application request, the method further includes:

步骤1、遍历所述社交图中任意的节点对;Step 1, traversing any node pair in the social graph;

步骤2、在所述节点对存在连接边时,提取所述连接边,得到第一最短路径,并将所述连接边在所述社交图中进行删除,得到删除后的社交图;Step 2: when there is a connection edge between the node pairs, extract the connection edge to obtain a first shortest path, and delete the connection edge from the social graph to obtain a social graph after deletion;

步骤3、在所述节点对不存在连接边时,则在所述社交图中采用广度优先搜索算法获取所述节点对之间的路径。Step 3: When there is no connecting edge between the node pairs, a breadth-first search algorithm is used in the social graph to obtain a path between the node pairs.

本发明实施例中,所述节点对是指社交图中的任意两个节点。In the embodiment of the present invention, the node pair refers to any two nodes in the social graph.

本发明实施例中,所述连接边是指节点对有且仅有通过一条边直接相连的边。In the embodiment of the present invention, the connecting edge refers to an edge in which a pair of nodes is directly connected by only one edge.

作为本发明一实施例,所述将所述连接边在所述社交图中进行删除,得到删除后的社交图,还包括:As an embodiment of the present invention, deleting the connection edge in the social graph to obtain a deleted social graph further includes:

在删除后的社交图中利用所述广度优先搜索算法进行路径搜索,得到所述节点对之间的第二最短路径;Performing a path search using the breadth-first search algorithm in the deleted social graph to obtain the second shortest path between the node pairs;

在得到所述节点对之间的第二最短路径后,删除所述第二最短路径;After obtaining the second shortest path between the node pairs, deleting the second shortest path;

再次采用所述广度优先搜索算法对删除第二最短路径后的社交图进行路径搜索,得到所述节点对之间的第三最短路径;The breadth-first search algorithm is used again to perform path search on the social graph after deleting the second shortest path, so as to obtain the third shortest path between the node pairs;

将所述第二最短路径和所述第三最短路径存储至所述路径集合中。The second shortest path and the third shortest path are stored in the path set.

进一步地,further,

在所述将所述第二最短路径和所述第三最短路径存储至所述路径集合中之后,还包括:After storing the second shortest path and the third shortest path in the path set, the method further includes:

识别所述第二最短路径的距离,并将所述第二最短路径的距离减去连接边的距离后加入至第一距离集合;Identify the distance of the second shortest path, and add the distance of the second shortest path minus the distance of the connecting edge to the first distance set;

识别所述第三最短路径的距离,并利用所述第三最短路径的距离减去所述第二最短路径的距离得到距离差,并将所述距离差加入至第二距离集合。The distance of the third shortest path is identified, and the distance difference is obtained by subtracting the distance of the second shortest path from the distance of the third shortest path, and the distance difference is added to the second distance set.

本发明实施例中,所述距离是指两个节点间的路径中所包括的连接边数量的多少。In the embodiment of the present invention, the distance refers to the number of connecting edges included in the path between two nodes.

作为本发明一实施例,所述在所述节点对不存在连接边时,则在所述社交图中采用广度优先搜索算法,得到所述节点对之间的最短路径,包括:As an embodiment of the present invention, when there is no connecting edge between the node pairs, a breadth-first search algorithm is used in the social graph to obtain the shortest path between the node pairs, including:

在所述节点对不存在连接边时,则采用所述广度优先搜索算法进行节点对之间的路径搜索,搜索完成后得到第二最短路径;When there is no connecting edge between the node pairs, the breadth-first search algorithm is used to search for paths between the node pairs, and after the search is completed, the second shortest path is obtained;

识别所述第二最短路径的距离后加入至第一距离集合;Identifying the distance of the second shortest path and adding it to the first distance set;

从所述社交图中删除所述第二最短路径后,采用所述广度优先搜索算法搜索节点对之间的第三最短路径,识别所述第三最短路径的距离后减去所述第二最短路径的距离,得到路径距离差值,将所述路径距离差值加入至第二距离集合。After deleting the second shortest path from the social graph, the breadth-first search algorithm is used to search for a third shortest path between node pairs, and the distance of the third shortest path is identified and then subtracted from the distance of the second shortest path to obtain a path distance difference, and the path distance difference is added to the second distance set.

本发明实施例中,所述第一距离集合是指节点对之间第二最短路径的距离和第一最短路径的距离的差值的集合,用集合S表示。In the embodiment of the present invention, the first distance set refers to a set of differences between the distance of the second shortest path and the distance of the first shortest path between node pairs, and is represented by a set S.

本发明实施例中,所述第二距离集合是指节点对之间后续所有路径的距离和第二最短路径的距离的差值的集合,用集合R表示。In the embodiment of the present invention, the second distance set refers to a set of differences between the distances of all subsequent paths between node pairs and the distance of the second shortest path, and is represented by a set R.

本发明实施例中,所述连接边距离因为是节点对之间直接相连的边,因此,所述连接边的距离为1。In the embodiment of the present invention, the connection edge distance is an edge directly connecting a pair of nodes, and therefore, the connection edge distance is 1.

示例性地,所述采用所述广度优先搜索算法进行节点对之间的路径搜索,包括:Exemplarily, the adopting the breadth-first search algorithm to perform path search between node pairs includes:

定义u∈V,v∈V,其中V是图G的顶点集合,其中,图G为社交图。遍历任意的节点对(u,v):Define u∈V,v∈V, where V is the vertex set of graph G, where graph G is a social graph. Traverse any node pair (u,v):

如果它们在图G上存在连接边,表示为e(u,v):那么从节点u开始,在图G\{e(u,v)}上执行广度优先搜索算法,得到一条u和v之间的最短路径p(u,v)。(图G\{e(u,v)}表示从图G中删去边e(u,v),下述定义类似)。If they have a connecting edge on graph G, represented by e(u,v): then starting from node u, perform a breadth-first search algorithm on graph G\{e(u,v)} to obtain a shortest path p(u,v) between u and v. (graph G\{e(u,v)} means deleting edge e(u,v) from graph G, and the following definition is similar).

具体而言,广度优先搜索流程如下:Specifically, the breadth-first search process is as follows:

1.预先设置一个长度为n(n是图中节点的数量)的空白数组A和一个队列Q(队列是一种在计算机领域广泛使用的先进先出的数据结构)。1. Pre-set a blank array A of length n (n is the number of nodes in the graph) and a queue Q (a queue is a first-in-first-out data structure widely used in the computer field).

2.将节点对(u,u)放入队列中。该节点对中第一个节点表示当前访问的节点的上一个已访问过的节点,第二个节点表示当前访问的节点。对于初始节点u,需要特殊设置为两个节点是一样。这一设置是为了搜索到节点v时,可以获取到最短路径p(u,v)。2. Put the node pair (u,u) into the queue. The first node in the node pair represents the node that was previously visited before the currently visited node, and the second node represents the currently visited node. For the initial node u, a special setting is required so that the two nodes are the same. This setting is to obtain the shortest path p(u,v) when searching for node v.

3.从队列中取出第一个节点对,命名为(a,b):如果b是目标节点v,则设置A[b]=a,停止搜索;否则,在图中标记节点b为已访问,设置A[b]=a,并把该节点和它未访问的邻居节点组成节点对加入到队列中。3. Take the first node pair from the queue and name it (a, b): If b is the target node v, set A[b] = a and stop searching; otherwise, mark node b as visited in the graph, set A[b] = a, and add the node and its unvisited neighbor nodes to form a node pair and add them to the queue.

4.重复步骤3,直到找到目标节点v。找到目标节点后,根据A包含的先后访问顺序,可以获得一条u,v之间的最短路径p(u,v)={e(u,s1),e(s1,s2),…,e(sk,v)}。其中s1,…,sk是虚指u,v的最短路径经过的节点。4. Repeat step 3 until the target node v is found. After the target node is found, according to the access order contained in A, a shortest path between u and v can be obtained: p(u,v) = {e(u,s 1 ), e(s 1 ,s 2 ),…, e(s k ,v)}. Among them, s 1 ,…,s k are the nodes passed by the shortest path between virtual nodes u and v.

类似地,从节点u开始,在图G\{p(u,v),e(u,v)}上执行广度优先搜索算法,得到一条u和v之间的最短路径p′(u,v)。(图G\{p(u,v),e(u,v)}表示图G中删去边e(u,v)和路径p(u,v)所包含的边)。向集合S中加入元素|p(u,v)|-1(||表示路径的长度)。向集合R中加入元素|p′(u,v)|-|p(u,v)|。Similarly, starting from node u, perform a breadth-first search algorithm on the graph G\{p(u,v),e(u,v)} to obtain a shortest path p′(u,v) between u and v. (The graph G\{p(u,v),e(u,v)} represents the graph G with the edge e(u,v) and the edge included in the path p(u,v) deleted.) Add the element |p(u,v)|-1 to the set S (|| represents the length of the path). Add the element |p′(u,v)|-|p(u,v)| to the set R.

示例性地,在所述社交图G上未有连接边时,则从节点u开始,在图G上执行广度优先搜索算法,得到一条u和v之间的最短路径p(u,v)。Exemplarily, when there is no connecting edge on the social graph G, starting from node u, a breadth-first search algorithm is executed on the graph G to obtain a shortest path p(u, v) between u and v.

类似地,从节点u开始,在图G\{p(u,v)}上执行广度优先搜索算法,得到一条u和v之间的最短路径p′(u,v)。Similarly, starting from node u, a breadth-first search algorithm is performed on the graph G\{p(u,v)} to obtain a shortest path p′(u,v) between u and v.

向集合S中加入元素|p′(u,v)|-|p(u,v)|。Add the element |p′(u,v)|-|p(u,v)| to the set S.

作为本发明一实施例,所述计算所述申请请求中对应的社交图节点集合的隐私敏感度,包括:As an embodiment of the present invention, the calculating the privacy sensitivity of the set of social graph nodes corresponding to the application request includes:

获取所述服务端中预设的隐私参数;Obtaining privacy parameters preset in the server;

根据所述预设的隐私参数、第一距离集合以及第二距离集合计算所述隐私敏感度。The privacy sensitivity is calculated according to the preset privacy parameter, the first distance set and the second distance set.

进一步地,所述根据所述预设的隐私参数、第一距离集合以及第二距离集合计算所述隐私敏感度,包括:Further, the calculating the privacy sensitivity according to the preset privacy parameter, the first distance set and the second distance set includes:

采用下述公式计算所述隐私敏感度:The privacy sensitivity is calculated using the following formula:

SS=max(max(S),max(R)×e)SS=max(max(S),max(R)×e )

其中,max(S)为第一距离集合中最大值,max(R)为第二距离集合中最大值,β为第三隐私参数,其中,∈为第一隐私参数,δ为第二隐私参数。Where max(S) is the maximum value in the first distance set, max(R) is the maximum value in the second distance set, and β is the third privacy parameter. ∈ is the first privacy parameter, and δ is the second privacy parameter.

本发明实施例通过构建集合S和集合R可以高效率地计算出敏感度。The embodiment of the present invention can efficiently calculate the sensitivity by constructing the set S and the set R.

所述距离结果下发模块103,用于根据所述隐私敏感度计算所述社交图中节点之间距离,并将所述距离添加噪声后下发至所述客户端。The distance result sending module 103 is used to calculate the distance between nodes in the social graph according to the privacy sensitivity, and send the distance to the client after adding noise.

作为本发明一实施例,所述根据所述隐私敏感度计算所述社交图中节点之间距离,包括:As an embodiment of the present invention, calculating the distance between nodes in the social graph according to the privacy sensitivity includes:

从所述社交图中查询目标节点对;Querying a target node pair from the social graph;

获取所述目标节点对之间的距离;Obtaining the distance between the target node pairs;

对所述目标节点对之间的距离添加噪声后进行无偏处理,得到目标距离。The distance between the target node pairs is subjected to unbiased processing after adding noise to obtain the target distance.

本发明实施例中,所述目标节点对是指客户端申请请求中对应的节点。In the embodiment of the present invention, the target node pair refers to the corresponding nodes in the client application request.

本发明实施例中,所述进行无偏处理是为了计算结果的规范性,所以要进行后置处理,使得有偏的计算结果变成无偏的计算结果,减少误差。In the embodiment of the present invention, the unbiased processing is performed for the purpose of standardizing the calculation results, so post-processing is performed to convert the biased calculation results into unbiased calculation results, thereby reducing errors.

进一步地,所述对所述目标节点对之间的距离添加噪声后进行无偏处理,得到目标距离,包括:Further, the adding noise to the distance between the target node pairs and performing unbiased processing to obtain the target distance includes:

采用下述公式对所述目标节点对之间的距离添加噪声后进行无偏处理:The following formula is used to add noise to the distance between the target node pairs for unbiased processing:

其中,D为目标距离,d为目标节点对之间的距离,ss为隐私敏感度,α为第四隐私参数,z为指数噪声,其中, Where D is the target distance, d is the distance between the target node pairs, ss is the privacy sensitivity, α is the fourth privacy parameter, and z is the exponential noise.

本发明实施例中,z通常为尺度λ=1的指数噪声Exp-(λ)。In the embodiment of the present invention, z is usually an exponential noise Exp - (λ) with a scale λ=1.

进一步地,所述指数噪声Exp-(λ)的概率密度函数为:Furthermore, the probability density function of the exponential noise Exp - (λ) is:

如图3所示,是本发明一实施例提供的实现一种满足差分隐私保护的社交图中距离查询方法的电子设备的结构示意图。As shown in FIG3 , it is a schematic diagram of the structure of an electronic device for implementing a distance query method in a social graph satisfying differential privacy protection provided by an embodiment of the present invention.

所述电子设备可以包括处理器10、存储器11、通信总线12以及通信接口13,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如一种满足差分隐私保护的社交图中距离查询方法程序。The electronic device may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a distance query method program in a social graph that satisfies differential privacy protection.

其中,所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing Unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(ControlUnit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行一种满足差分隐私保护的社交图中距离查询方法程序等),以及调用存储在所述存储器11内的数据,以执行电子设备的各种功能和处理数据。In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing a distance query method program in a social graph that satisfies differential privacy protection, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.

所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备的内部存储单元,例如该电子设备的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备的外部存储设备,例如电子设备上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备的应用软件及各类数据,例如一种满足差分隐私保护的社交图中距离查询方法程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as a code of a distance query method program in a social graph that satisfies differential privacy protection, but can also be used to temporarily store data that has been output or is to be output.

所述通信总线12可以是外设部件互连标准(Peripheral ComponentInterconnect,简称PCI)总线或扩展工业标准结构(Extended Industry StandardArchitecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

所述通信接口13用于上述电子设备与其他设备之间的通信,包括网络接口和用户接口。可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备与其他电子设备之间建立通信连接。所述用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备中处理的信息以及用于显示可视化的用户界面。The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

图3仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图3示出的结构并不构成对所述电子设备的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG3 merely shows an electronic device with components. Those skilled in the art will appreciate that the structure shown in FIG3 does not limit the electronic device and may include fewer or more components than shown in the figure, or a combination of certain components, or a different arrangement of components.

例如,尽管未示出,所述电子设备还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

所述电子设备中的所述存储器11存储的一种满足差分隐私保护的社交图中距离查询方法程序是多个指令的组合,在所述处理器10中运行时,可以实现:The memory 11 in the electronic device stores a distance query method program in a social graph that satisfies differential privacy protection, which is a combination of multiple instructions. When running in the processor 10, the following can be achieved:

客户端生成查询社交图中节点之间距离的申请请求;The client generates an application request to query the distance between nodes in the social graph;

服务端接收所述申请请求,并计算所述申请请求中对应的社交图节点集合的隐私敏感度;The server receives the application request and calculates the privacy sensitivity of the social graph node set corresponding to the application request;

根据所述隐私敏感度计算所述社交图中节点之间距离,并将所述距离添加噪声后下发至所述客户端。The distance between nodes in the social graph is calculated according to the privacy sensitivity, and noise is added to the distance before being sent to the client.

具体地,所述处理器10对上述指令的具体实现方法可参考附图对应实施例中相关步骤的描述,在此不赘述。Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.

进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。所述计算机可读存储介质可以是易失性的,也可以是非易失性的。例如,所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。Furthermore, if the module/unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

本发明还提供一种计算机可读存储介质,所述可读存储介质存储有计算机程序,所述计算机程序在被电子设备的处理器所执行时,可以实现:The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:

客户端生成查询社交图中节点之间距离的申请请求;The client generates an application request to query the distance between nodes in the social graph;

服务端接收所述申请请求,并计算所述申请请求中对应的社交图节点集合的隐私敏感度;The server receives the application request and calculates the privacy sensitivity of the social graph node set corresponding to the application request;

根据所述隐私敏感度计算所述社交图中节点之间距离,并将所述距离添加噪声后下发至所述客户端。The distance between nodes in the social graph is calculated according to the privacy sensitivity, and noise is added to the distance before being sent to the client.

在本发明所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本发明各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

对于本领域技术人员而言,显然本发明不限于上述示范性实施例的细节,而且在不背离本发明的精神或基本特征的情况下,能够以其他的具体形式实现本发明。It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本发明内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

本发明所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in the present invention is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the blockchain underlying platform, platform product service layer, and application service layer.

本申请实施例可以基于人工智能技术对相关的数据进行获取和处理。其中,人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第一、第二等词语用来表示名称,而并不表示任何特定的顺序。In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.

最后应说明的是,以上实施例仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或等同替换,而不脱离本发明技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims (5)

1.一种满足差分隐私保护的社交图中距离查询方法,其特征在于,所述方法包括:1. A distance query method in a social graph that satisfies differential privacy protection, characterized in that the method comprises: 客户端生成查询社交图中节点之间距离的申请请求;The client generates an application request to query the distance between nodes in the social graph; 服务端接收所述申请请求,并计算所述申请请求中对应的社交图节点集合的隐私敏感度;其中,在所述计算所述申请请求对应的查询集合的隐私敏感度之前,还包括:The server receives the application request and calculates the privacy sensitivity of the social graph node set corresponding to the application request; wherein, before calculating the privacy sensitivity of the query set corresponding to the application request, it also includes: 步骤1、遍历所述社交图中任意的节点对;Step 1, traversing any node pair in the social graph; 步骤2、在所述节点对存在连接边时,提取所述连接边,得到第一最短路径,并将所述连接边在所述社交图中进行删除,得到删除后的社交图;其中,所述将所述连接边在所述社交图中进行删除,得到删除后的社交图,还包括:在删除后的社交图中利用广度优先搜索算法进行路径搜索,得到所述节点对之间的第二最短路径;在得到所述节点对之间的第二最短路径后,删除所述第二最短路径;再次采用所述广度优先搜索算法对删除第二最短路径后的社交图进行路径搜索,得到所述节点对之间的第三最短路径;将所述第二最短路径和所述第三最短路径存储至所述路径集合中;其中,在所述将所述第二最短路径和所述第三最短路径存储至所述路径集合中之后,还包括:识别所述第二最短路径的距离,并将所述第二最短路径的距离减去连接边的距离后加入至第一距离集合;识别所述第三最短路径的距离,并利用所述第三最短路径的距离减去所述第二最短路径的距离得到距离差,并将所述距离差加入至第二距离集合;Step 2: when there is a connecting edge between the node pairs, extract the connecting edge to obtain a first shortest path, and delete the connecting edge in the social graph to obtain a social graph after deletion; wherein, deleting the connecting edge in the social graph to obtain the social graph after deletion also includes: using a breadth-first search algorithm to perform a path search in the social graph after deletion to obtain a second shortest path between the node pairs; after obtaining the second shortest path between the node pairs, deleting the second shortest path; using the breadth-first search algorithm again to perform a path search on the social graph after deleting the second shortest path to obtain a third shortest path between the node pairs; storing the second shortest path and the third shortest path in the path set; wherein, after storing the second shortest path and the third shortest path in the path set, it also includes: identifying the distance of the second shortest path, and adding the distance of the second shortest path minus the distance of the connecting edge to the first distance set; identifying the distance of the third shortest path, and using the distance of the third shortest path minus the distance of the second shortest path to obtain a distance difference, and adding the distance difference to the second distance set; 步骤3、在所述节点对不存在连接边时,则在所述社交图中采用广度优先搜索算法获取所述节点对之间的路径;Step 3: When there is no connecting edge between the node pairs, a breadth-first search algorithm is used in the social graph to obtain a path between the node pairs; 其中,所述计算所述申请请求中对应的社交图节点集合的隐私敏感度,包括:The step of calculating the privacy sensitivity of the set of social graph nodes corresponding to the application request includes: 获取所述服务端中预设的隐私参数;Obtaining privacy parameters preset in the server; 根据所述预设的隐私参数、第一距离集合以及第二距离集合计算所述隐私敏感度;其中,所述根据所述预设的隐私参数、第一距离集合以及第二距离集合计算所述隐私敏感度,包括:The privacy sensitivity is calculated according to the preset privacy parameter, the first distance set, and the second distance set; wherein the privacy sensitivity is calculated according to the preset privacy parameter, the first distance set, and the second distance set, including: 采用下述公式计算所述隐私敏感度:The privacy sensitivity is calculated using the following formula: ss=max(max(S),max(R)×e)ss=max(max(S),max(R)×e ) 其中,max(S)为第一距离集合中最大值,max(R)为第二距离集合中最大值,β为第三隐私参数,其中,∈为第一隐私参数,δ为第二隐私参数;Where max(S) is the maximum value in the first distance set, max(R) is the maximum value in the second distance set, and β is the third privacy parameter. ∈ is the first privacy parameter, δ is the second privacy parameter; 根据所述隐私敏感度计算所述社交图中节点之间距离,并将所述距离添加噪声后下发至所述客户端。The distance between nodes in the social graph is calculated according to the privacy sensitivity, and noise is added to the distance before being sent to the client. 2.如权利要求1所述的满足差分隐私保护的社交图中距离查询方法,其特征在于,所述在所述节点对不存在连接边时,则在所述社交图中采用广度优先搜索算法,得到所述节点对之间的最短路径,包括:2. The distance query method in a social graph that satisfies differential privacy protection according to claim 1, characterized in that when there is no connecting edge between the node pairs, a breadth-first search algorithm is used in the social graph to obtain the shortest path between the node pairs, comprising: 在所述节点对不存在连接边时,则采用所述广度优先搜索算法进行节点对之间的路径搜索,搜索完成后得到第二最短路径;When there is no connecting edge between the node pairs, the breadth-first search algorithm is used to search for paths between the node pairs, and after the search is completed, the second shortest path is obtained; 识别所述第二最短路径的距离后加入至第一距离集合;Identifying the distance of the second shortest path and adding it to the first distance set; 从所述社交图中删除所述第二最短路径后,采用所述广度优先搜索算法搜索节点对之间的第三最短路径,识别所述第三最短路径的距离后减去所述第二最短路径的距离,得到路径距离差值,将所述路径距离差值加入至第二距离集合。After deleting the second shortest path from the social graph, the breadth-first search algorithm is used to search for a third shortest path between node pairs, and the distance of the third shortest path is identified and then subtracted from the distance of the second shortest path to obtain a path distance difference, and the path distance difference is added to the second distance set. 3.一种满足差分隐私保护的社交图中距离查询装置,其特征在于,所述装置可以实现如权利要求1至2中任意一项所述的满足差分隐私保护的社交图中距离查询方法,所述装置包括:3. A device for distance query in a social graph that satisfies differential privacy protection, characterized in that the device can implement the distance query method in a social graph that satisfies differential privacy protection as described in any one of claims 1 to 2, and the device comprises: 距离查询请求模块,用于客户端生成查询社交图中节点之间距离的申请请求;The distance query request module is used by the client to generate an application request for querying the distance between nodes in the social graph; 敏感度计算模块,用于服务端接收所述申请请求,并计算所述申请请求中对应的社交图节点集合的隐私敏感度;其中,在所述计算所述申请请求对应的查询集合的隐私敏感度之前,还包括:步骤1、遍历所述社交图中任意的节点对;步骤2、在所述节点对存在连接边时,提取所述连接边,得到第一最短路径,并将所述连接边在所述社交图中进行删除,得到删除后的社交图;其中,所述将所述连接边在所述社交图中进行删除,得到删除后的社交图,还包括:在删除后的社交图中利用所述广度优先搜索算法进行路径搜索,得到所述节点对之间的第二最短路径;在得到所述节点对之间的第二最短路径后,删除所述第二最短路径;再次采用所述广度优先搜索算法对删除第二最短路径后的社交图进行路径搜索,得到所述节点对之间的第三最短路径;将所述第二最短路径和所述第三最短路径存储至所述路径集合中;其中,在所述将所述第二最短路径和所述第三最短路径存储至所述路径集合中之后,还包括:识别所述第二最短路径的距离,并将所述第二最短路径的距离减去连接边的距离后加入至第一距离集合;识别所述第三最短路径的距离,并利用所述第三最短路径的距离减去所述第二最短路径的距离得到距离差,并将所述距离差加入至第二距离集合;步骤3、在所述节点对不存在连接边时,则在所述社交图中采用广度优先搜索算法获取所述节点对之间的路径;其中,所述计算所述申请请求中对应的社交图节点集合的隐私敏感度,包括:获取所述服务端中预设的隐私参数;根据所述预设的隐私参数、第一距离集合以及第二距离集合计算所述隐私敏感度;其中,所述根据所述预设的隐私参数、第一距离集合以及第二距离集合计算所述隐私敏感度,包括:A sensitivity calculation module, configured to receive the application request at the server end and calculate the privacy sensitivity of the set of social graph nodes corresponding to the application request; wherein, before calculating the privacy sensitivity of the query set corresponding to the application request, it also includes: step 1, traversing any node pair in the social graph; step 2, when there is a connecting edge in the node pair, extracting the connecting edge to obtain a first shortest path, and deleting the connecting edge in the social graph to obtain a social graph after deletion; wherein, deleting the connecting edge in the social graph to obtain a social graph after deletion also includes: performing a path search using the breadth-first search algorithm in the social graph after deletion to obtain a second shortest path between the node pairs; after obtaining the second shortest path between the node pairs, deleting the second shortest path; performing a path search using the breadth-first search algorithm again on the social graph after deleting the second shortest path to obtain a third shortest path between the node pairs; and comparing the second shortest path and the third shortest path. The method further comprises: storing the second shortest path and the third shortest path in the path set; wherein, after storing the second shortest path and the third shortest path in the path set, it further comprises: identifying the distance of the second shortest path, and adding the distance of the second shortest path minus the distance of the connecting edge to the first distance set; identifying the distance of the third shortest path, and obtaining the distance difference by subtracting the distance of the second shortest path from the distance of the third shortest path, and adding the distance difference to the second distance set; step 3, when there is no connecting edge between the node pair, a breadth-first search algorithm is used in the social graph to obtain the path between the node pair; wherein, calculating the privacy sensitivity of the social graph node set corresponding to the application request comprises: obtaining a privacy parameter preset in the server; calculating the privacy sensitivity according to the preset privacy parameter, the first distance set and the second distance set; wherein, calculating the privacy sensitivity according to the preset privacy parameter, the first distance set and the second distance set comprises: 采用下述公式计算所述隐私敏感度:The privacy sensitivity is calculated using the following formula: ss=max(max(S),max(R)×e)ss=max(max(S),max(R)×e ) 其中,max(S)为第一距离集合中最大值,max(R)为第二距离集合中最大值,β为第三隐私参数,其中,∈为第一隐私参数,δ为第二隐私参数;Where max(S) is the maximum value in the first distance set, max(R) is the maximum value in the second distance set, and β is the third privacy parameter. ∈ is the first privacy parameter, δ is the second privacy parameter; 距离结果下发模块,用于根据所述隐私敏感度计算所述社交图中节点之间距离,并将所述距离添加噪声后下发至所述客户端。The distance result sending module is used to calculate the distance between nodes in the social graph according to the privacy sensitivity, and send the distance to the client after adding noise. 4.一种电子设备,其特征在于,所述电子设备包括:4. An electronic device, characterized in that the electronic device comprises: 至少一个处理器;以及,at least one processor; and, 与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein, 所述存储器存储有可被所述至少一个处理器执行的计算机程序,所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至2中任意一项所述的满足差分隐私保护的社交图中距离查询方法。The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the distance query method in a social graph that satisfies differential privacy protection as described in any one of claims 1 to 2. 5.一种计算机可读存储介质,存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至2中任意一项所述的满足差分隐私保护的社交图中距离查询方法。5. A computer-readable storage medium storing a computer program, characterized in that when the computer program is executed by a processor, the method for distance query in a social graph satisfying differential privacy protection as described in any one of claims 1 to 2 is implemented.
CN202410189281.3A 2024-02-20 2024-02-20 Distance query method and device in social graph satisfying differential privacy protection Active CN118070327B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410189281.3A CN118070327B (en) 2024-02-20 2024-02-20 Distance query method and device in social graph satisfying differential privacy protection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410189281.3A CN118070327B (en) 2024-02-20 2024-02-20 Distance query method and device in social graph satisfying differential privacy protection

Publications (2)

Publication Number Publication Date
CN118070327A CN118070327A (en) 2024-05-24
CN118070327B true CN118070327B (en) 2024-07-30

Family

ID=91094782

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410189281.3A Active CN118070327B (en) 2024-02-20 2024-02-20 Distance query method and device in social graph satisfying differential privacy protection

Country Status (1)

Country Link
CN (1) CN118070327B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119577258B (en) * 2024-07-26 2025-08-22 重庆大学 Distance query method, device, equipment and medium based on local differential privacy
CN119066234B (en) * 2024-08-23 2025-04-15 重庆大学 Social graph synthesis method, device, equipment and medium based on local differential privacy

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116541883A (en) * 2023-05-10 2023-08-04 重庆大学 Trust-based differential privacy protection method, device, equipment and storage medium
CN116628360A (en) * 2023-07-25 2023-08-22 北京科技大学 Social network histogram issuing method and device based on differential privacy

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9330183B2 (en) * 2013-05-08 2016-05-03 Facebook, Inc. Approximate privacy indexing for search queries on online social networks
CN117494196B (en) * 2023-10-31 2024-05-14 重庆大学 A friend matching method and system based on differential privacy protection

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116541883A (en) * 2023-05-10 2023-08-04 重庆大学 Trust-based differential privacy protection method, device, equipment and storage medium
CN116628360A (en) * 2023-07-25 2023-08-22 北京科技大学 Social network histogram issuing method and device based on differential privacy

Also Published As

Publication number Publication date
CN118070327A (en) 2024-05-24

Similar Documents

Publication Publication Date Title
CN118070327B (en) Distance query method and device in social graph satisfying differential privacy protection
US11791987B2 (en) Content validation using blockchain
Riederer et al. Linking users across domains with location data: Theory and validation
CN110851879A (en) Method, device and equipment for infringement and evidence preservation based on evidence preservation block chain
CN114982193A (en) Digital contracts using blockchain transactions
Ji et al. General graph data de-anonymization: From mobility traces to social networks
CN116541883B (en) Trust-based differential privacy protection method, device, equipment and storage medium
CN108959370A (en) The community discovery method and device of entity similarity in a kind of knowledge based map
CN117744139B (en) Collaborative personalized edge differential privacy protection method and device for social networks
CN114826736B (en) Information sharing method, device, equipment and storage medium
CN117494196B (en) A friend matching method and system based on differential privacy protection
CN113537806A (en) Abnormal user identification method, device, electronic device and readable storage medium
CN113506045A (en) Risk user identification method, device, equipment and medium based on mobile equipment
CN115002211B (en) Method, device, equipment and medium for realizing after-sale micro-service based on cloud protogenesis
CN107070932B (en) Anonymous method for preventing label neighbor attack in social network dynamic release
CN113987206A (en) Abnormal user identification method, device, equipment and storage medium
CN114398678A (en) Registration verification method and device for preventing electronic file from being tampered, electronic equipment and medium
CN115499231B (en) Flow detection method, device, electronic device and storage medium
CN114036068B (en) Update detection method, device, equipment and storage medium based on privacy security
CN115119197B (en) Wireless network risk analysis method, device, equipment and medium based on big data
CN114510695A (en) Malicious account detection method, device, device and medium
CN116055144A (en) Data security analysis method, device, equipment and storage based on internet of things
Liao et al. BCDP: A blockchain-based credible data publishing system
CN109962907B (en) User identification method and terminal equipment based on big data
CN114518993A (en) System performance monitoring method, device, equipment and medium based on business characteristics

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载