Data query method, electronic device, and storage medium

By executing intersection events and constructing encrypted matrices in financial transaction graphs, the problem of merging transaction graphs held by different financial institutions is solved, enabling complete data querying and risk assessment under data privacy protection.

CN116127146BActive Publication Date: 2026-06-23CHINA FINANCIAL CERTIFICATION AUTHORITY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA FINANCIAL CERTIFICATION AUTHORITY
Filing Date
2023-03-28
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

In tasks such as financial fraud detection and anti-money laundering, the transaction information of the same user is stored by different financial institutions, making it impossible to directly merge financial transaction graphs for analysis, resulting in insufficient information security for data queries.

Method used

The intersection of data is determined by executing intersection interaction events, and the target operation matrix is ​​constructed using an encryption matrix and a multi-source shortest path algorithm. Data fusion and analysis are performed while ensuring data privacy, and the number of target data nodes is determined to assess the risk.

Benefits of technology

While protecting data privacy, it enables complete queries of data held by multiple parties, thereby improving the information security of data queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116127146B_ABST
    Figure CN116127146B_ABST
Patent Text Reader

Abstract

The application relates to a data query method, an electronic device and a storage medium. The method comprises the following steps: initiating a first intersection interaction event to a data provider, the first intersection interaction event being used for determining a data intersection between a first data graph and a second data graph of the data provider; initiating a first interaction event to the data provider, the first interaction event being used for determining a target operation matrix, the target operation matrix being used for storing the shortest distance between any two data nodes in the data intersection; determining a first target distance according to the target operation matrix; initiating a second interaction event to the data provider, the second interaction event being used for determining a target data node quantity; and determining whether a target query node is at risk according to the target data node quantity. According to the scheme, complete data query can be performed on the data held by multiple parties in the case of data privacy, and the information security of data query is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to data query methods, electronic devices, and storage media. Background Technology

[0002] A graph is a data structure composed of a set of vertices and edges, which can conveniently model multiple things and the complex relationships between them. In the financial field, graph models and graph algorithms play an important role and can be widely used in tasks such as financial fraud detection, anti-money laundering, and suspicious transaction / account identification. For example, financial institutions can construct financial transaction graphs based on their transaction data and assess the default risk of a user by querying the number of blacklisted users in a user group with transaction relationships with that user. However, in practical applications, transaction information generated by the same user may be stored by different financial institutions. If accurate and complete transaction data of a user is required, it is necessary to merge and analyze the financial transaction graphs held by different financial institutions. However, due to considerations of protecting financial data privacy, it is not possible to directly merge financial transaction graphs.

[0003] In view of this, there is an urgent need to propose a method that can integrate and analyze data held by multiple parties to enable complete data queries while ensuring data privacy, thereby improving the information security of data queries. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this application provides a data query method, electronic device, and storage medium. This data query method can integrate and analyze data held by multiple parties while ensuring data privacy, thereby enabling complete data queries and improving the information security of data queries.

[0005] The first aspect of this application provides a data query method, including:

[0006] An execution of an intersection interaction event is initiated with the data provider, whereby the intersection interaction event is used to determine the data intersection between the local first data graph and the data provider's second data graph; a first interaction event is initiated with the data provider, whereby the first interaction event is used to determine the target operation matrix, which is used to store the shortest distance between any two data nodes in the data intersection; a first target distance is determined based on the target operation matrix, whereby the first target distance is the shortest distance between any data node in the first relative complement set and any data node in the data intersection; the first relative complement set is the relative complement set of the second data graph in the first data graph; a second interaction event is initiated with the data provider, whereby the second interaction event is used to determine the number of target data nodes based on the target operation matrix, the first target distance, preset neighborhood parameters, target query nodes, data node labels, and the second target distance determined by the data provider; and the number of target data nodes is used to determine whether there is any risk associated with the target query nodes.

[0007] In one implementation, in initiating the execution of the first interaction event to the data provider, the data query method includes: determining a first encryption matrix based on the data intersection and a first data graph and sending the first encryption matrix to the data provider; receiving a distance difference encryption matrix fed back by the data provider based on the first encryption matrix; creating a first assignment matrix based on the distance difference encryption matrix and sending the first assignment matrix to the data provider; receiving a second assignment matrix fed back by the data provider based on the first assignment matrix; constructing a target operation matrix based on the second assignment matrix; and sending the target operation matrix to the data provider.

[0008] In one implementation, the matrix elements in the first encryption matrix represent the encrypted values ​​of the shortest distances between data nodes in the data intersection of the first data graph; the matrix elements in the distance difference encryption matrix represent the encrypted values ​​of the distance difference parameters between matrix elements in the second encryption matrix determined by the data provider and the corresponding matrix elements in the first encryption matrix; and creating the first assignment matrix based on the distance difference encryption matrix includes: decrypting the distance difference encryption matrix to obtain a distance difference decryption matrix, wherein each matrix element in the distance difference decryption matrix is ​​a decrypted element value; and determining the first assignment matrix based on each decrypted element value in the distance difference decryption matrix. Each matrix element is used to create a first assignment matrix, where each element of the first assignment matrix is ​​used to indicate whether the value of each decrypted element in the distance difference decryption matrix is ​​a natural number; the second assignment matrix is ​​a matrix obtained by updating the first assignment matrix based on the first encryption matrix, the second encryption matrix, and each element of the first assignment matrix; the construction of the target operation matrix based on the second assignment matrix includes: decrypting the second assignment matrix to obtain the target decryption matrix; determining the shortest distance between each pair of data nodes in the data intersection based on the target decryption matrix, and constructing the target operation matrix based on the shortest distance between each pair of data nodes in the data intersection.

[0009] In one implementation, determining the first encryption matrix based on the data intersection and the first data graph includes: determining the shortest distance between any two data nodes in the data intersection in the first data graph; generating a first initial matrix according to the number of data nodes in the data intersection, wherein the matrix elements in the first initial matrix represent the shortest distance between any two data nodes in the data intersection in the first data graph; and encrypting each matrix element in the first initial matrix to obtain the first encryption matrix.

[0010] In one implementation, determining each element of the first assignment matrix based on each element in the distance difference decryption matrix includes: decrypting each element in the distance difference decryption matrix to obtain the decrypted element value corresponding to each element; if the current decrypted element value is greater than or equal to zero, updating the matrix element in the first assignment matrix corresponding to the element position of the current decrypted element value to 1; if the current decrypted element value is less than zero, updating the matrix element in the first assignment matrix corresponding to the element position of the current decrypted element value to 0; until each decrypted element value has been determined, forming the first assignment matrix.

[0011] In one implementation, the second interaction event initiated to the data provider includes: determining the number of first risk nodes in the first data graph based on the target query node, preset neighborhood parameters, data node labels, target operation matrix, and first target distance; determining a first judgment distance based on the target operation matrix and the first target distance, wherein the first judgment distance is the shortest distance between the target query node and each data node in the data intersection in the first data graph; generating a judgment vector based on the preset neighborhood parameters and each of the first judgment distances; sending the judgment vector to the data provider; receiving feedback from the data provider regarding the number of second risk nodes; and determining the number of target data nodes based on the number of first risk nodes and the number of second risk nodes.

[0012] In one implementation, generating a judgment vector based on preset neighborhood parameters and each first judgment distance includes: subtracting each first judgment distance from the preset neighborhood parameters to obtain each vector element; and generating a judgment vector based on each vector element.

[0013] A second aspect of this application provides a data query method, including:

[0014] The system responds to and executes an intersection interaction event, which is used to determine the data intersection between the first data graph of the data query party and the local second data graph; it responds to and executes a first interaction event to obtain a target operation matrix; it determines a second target distance based on the target operation matrix, which is the shortest distance between any data node in the second relative complement set and any data node in the data intersection set; the second relative complement set is the relative complement set of the first data graph in the second data graph; and it responds to and executes a second interaction event to receive a decision vector from the data query party and, based on the decision vector, to return a second assignment matrix to the data query party.

[0015] In one implementation, in responding to and executing a first interaction event, the first interaction event includes: determining a second encryption matrix based on a data intersection and a second data graph, wherein the matrix elements in the second encryption matrix represent the encrypted values ​​of the shortest distances between data nodes in the data intersection in the second data graph; receiving a first encryption matrix sent by a data query party; generating a random positive integer and encrypting the random positive integer to obtain an encrypted positive integer; updating each matrix element in the second encryption matrix based on the first encryption matrix, the second encryption matrix, and the encrypted positive integer to obtain a distance difference encryption matrix; sending the distance difference encryption matrix to the data query party; receiving a first assignment matrix fed back by the data query party; updating each matrix element in the first assignment matrix to the corresponding matrix element in the first encryption matrix or the second encryption matrix according to the value of each matrix element in the first assignment matrix, forming a second assignment matrix, and sending the second assignment matrix to the data query party.

[0016] In one implementation, updating each matrix element in the second encryption matrix based on the first encryption matrix, the second encryption matrix, and the encrypted positive integer includes: subtracting the matrix element in the first encryption matrix at the current element position from the matrix element at the current element position in the second encryption matrix, multiplying the difference by the encrypted positive integer to obtain the distance difference element; updating the matrix element at the current element position in the second encryption matrix to the distance difference element, until all matrix elements at all element positions in the second encryption matrix have been updated.

[0017] In one implementation, updating each matrix element in the first assignment matrix to a corresponding matrix element in the first encryption matrix or the second encryption matrix based on the value of each matrix element in the first assignment matrix includes: if the value of the current matrix element in the first assignment matrix is ​​1, then updating the current matrix element to the matrix element corresponding to the element position in the first encryption matrix; if the value of the current matrix element in the first assignment matrix is ​​0, then updating the current matrix element to the matrix element corresponding to the element position in the second encryption matrix; until all matrix elements in the first assignment matrix have been updated.

[0018] In one implementation, in responding to and executing a second interactive event, the second interactive event includes: determining a second judgment distance based on the target operation matrix and the second target distance, wherein the second judgment distance is the shortest distance between the data node to be judged in the second relative complement set and each data node in the data intersection set in the second data graph; if the data node label of the current data node to be judged in the second relative complement set is high-risk, and the second judgment distance between the current data node to be judged and the current data node in the data intersection set is less than or equal to the vector element in the judgment vector corresponding to the current data node in the data intersection set, then the current data node to be judged is determined to be a risk node; until all data nodes to be judged in the second relative complement set are judged, the number of second risk nodes is obtained; and the number of second risk nodes is sent to the data query party.

[0019] A third aspect of this application provides an electronic device, comprising:

[0020] Processor; and

[0021] A memory having executable code stored thereon, which, when executed by the processor, causes the processor to perform the method as described in the first or second aspect.

[0022] A fourth aspect of this application provides a non-transitory machine-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method described in the first or second aspect.

[0023] The technical solution provided in this application may include the following beneficial effects:

[0024] By initiating an intersection interaction event to the data provider to determine the intersection between the local first data graph and the data provider's second data graph, and then initiating a first interaction event to determine the target operation matrix (which stores the shortest distance between any two data nodes in the data intersection), a first target distance can be determined based on the target operation matrix. This first target distance is the shortest distance between any data node in the first relative complement and any data node in the data intersection, and the first relative complement is the relative complement of the second data graph in the first data graph. Further, a second interaction event is initiated to the data provider to determine the number of target data nodes based on the target operation matrix, the first target distance, preset neighborhood parameters, target query nodes, data node labels, and the second target distance determined by the data provider. This allows for the fusion and analysis of data held by multiple parties to perform complete data queries without needing to access the data provider's second data graph, ensuring data privacy. This determines the number of target data nodes and whether there is any risk associated with the target query nodes, thereby improving the information security of data queries.

[0025] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0026] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily understood by reading the following detailed description with reference to the accompanying drawings. Several embodiments of this application are illustrated in the drawings by way of example and not limitation, and the same or corresponding reference numerals denote the same or corresponding parts.

[0027] Figure 1 This is one of the flowcharts illustrating the data query method in the embodiments of this application;

[0028] Figure 2 This is a second schematic flowchart illustrating the data query method in the embodiments of this application;

[0029] Figure 3 This is the third flowchart illustrating the data query method in the embodiments of this application;

[0030] Figure 4 This is the fourth flowchart illustrating the data query method in the embodiments of this application;

[0031] Figure 5 This is the fifth flowchart illustrating the data query method in the embodiments of this application;

[0032] Figure 6This is the data graph resulting from the merging of the first and second data graphs in the data query method illustrated in this application embodiment;

[0033] Figure 7 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application. Detailed Implementation

[0034] Embodiments will now be described with reference to the accompanying drawings. It should be understood that, for the sake of simplicity and clarity, reference numerals may be repeated in the drawings to indicate corresponding or similar elements where deemed appropriate. Furthermore, numerous specific details are set forth herein to provide a thorough understanding of the embodiments described herein. However, those skilled in the art will understand that the embodiments described herein can be practiced without these specific details. In other instances, well-known methods, processes, and components have not been described in detail so as not to obscure the embodiments described herein. Moreover, this description should not be construed as limiting the scope of the embodiments described herein.

[0035] A financial transaction graph is constructed based on the transaction data held by the user. By querying the number of blacklisted users within a user group with transaction relationships with a particular user, the default risk of that user can be assessed. However, in practical applications, transaction information generated by the same user may be stored by different financial institutions. To obtain accurate and complete transaction data for a user, it is necessary to merge and analyze the financial transaction graphs held by different financial institutions. However, due to considerations of financial data privacy protection, it is not possible to directly merge financial transaction graphs. Compared to the significant research progress made in the Private Set Intersection (PSI) problem, solutions to the Private Set Union (PSU) problem are currently relatively few. Especially when both parties hold large amounts of private transaction graph data, but the number of users at intersection is relatively small, how to merge and analyze the two transaction graph data while protecting data privacy is a problem that urgently needs to be solved.

[0036] In view of this, there is an urgent need to propose a method that can integrate and analyze data held by multiple parties to enable complete data queries while ensuring data privacy, thereby improving the information security of data queries.

[0037] To address the aforementioned issues, this application provides a data query method that can integrate and analyze data held by multiple parties while ensuring data privacy, thereby enabling complete data queries and improving the information security of data queries.

[0038] The technical solutions of the embodiments of this application are described in detail below with reference to the accompanying drawings.

[0039] Figure 1This is one of the flowcharts illustrating the data query method in the embodiments of this application. Please refer to... Figure 1 The data query method shown in the embodiments of this application may include:

[0040] In step 101, an intersection interaction event is initiated with the data provider. This intersection interaction event is used to determine the data intersection between the local first data graph and the data provider's second data graph. The local first data graph is the first data graph stored locally by the data querying party.

[0041] In this embodiment, both the first and second data graphs are undirected graphs. An undirected graph can be represented by G = (V, E), where V represents the set of all data nodes in the data graph, E represents the set of edges between all data nodes in the data graph, and each edge (v...) in E... x ,v y This indicates a direct relationship between data nodes x and y. And for any two data nodes v in V... x and v y If there exists at least one path in an undirected graph G, then v x and v y If connected, then v x and v y The shortest path between them is the path that connects all v. x and v y The path between two data nodes is the path with the fewest edges, v x and v y The shortest distance between them is v x and v y The number of edges contained in the shortest path between them. Conversely, for any two data nodes v in V. x and v y If there is no path in the undirected graph G, then v x and v y If connected, then v x and v y The shortest distance between them is defined as infinity. In particular, the shortest distance between the same data nodes is defined as 0.

[0042] For a certain data node v in V x v can be defined x In the graph G, the k-neighborhood is a subset of V, containing all nodes in the undirected graph G that are adjacent to v. x The shortest distance between data nodes does not exceed k. k represents the preset neighborhood parameter.

[0043] It is understandable that the first and second data graphs can be financial transaction graphs, where each data node corresponds to a unique financial transaction user, and each edge (v) in E...x ,v y ) can represent user v x and user v y There is a direct transaction relationship between them. In practical applications, the first and second data graphs can also be other types of undirected graphs, depending on the specific application. This application does not impose any restrictions in this regard.

[0044] In this embodiment of the application, A can be defined as the data queryer holding the first data graph, and B as the data provider holding the second data graph. The first data graph can be represented by G. A =(V A E A V is represented by ) A E represents the set of all data nodes in the first data graph. A Let G represent the set of edges between all data nodes in the first data graph. Similarly, the second data graph can be represented by G. B =(V B E B V is represented by ) B E represents the set of all data nodes in the second data graph. B This represents the set of edges between all data nodes in the second data graph. Additionally, the data querying party holds data node labels associated with each data node in the first data graph, and the data provider also holds data node labels associated with each data node in the second data graph. These data node labels can be used to identify whether a data node exhibits a high-risk or abnormal condition. For example, assuming the first and second data graphs are financial transaction graphs, these data node labels can identify whether the user corresponding to the data node exhibits a high-risk condition; if identified as exhibiting a high-risk condition, then that user is considered a high-risk user.

[0045] The aforementioned intersection interaction event requires joint execution by both the data queryer and the data provider. Specifically, the data queryer can use V... A As input, the data provider can use V B As input, the data queryer and data provider can jointly execute the Private Set Intersection (PSI) protocol. Upon completion, the intersection of data nodes between the first and second data graphs is obtained, which is the data intersection shown in this application. This allows V to be set... A∩B V represents the intersection of the above data. A∩B =V A ∩V BPrivacy set intersection refers to obtaining the intersection of the data held by two participating parties without revealing any additional information. Here, additional information refers to any information other than the intersection of their data. Privacy set intersection can be achieved through methods based on Diffie-Hellman key exchange and methods based on unintentional transmission. The unintentional transmission method is commonly used; it is a cryptographic protocol that allows the sender to transmit one piece of information from a set of potential messages to the receiver without the sender knowing the information received.

[0046] In practical applications, assuming a scenario involving querying financial transaction data, the data queryer can use V... A The user's ID number is used as input for each data node, and the data provider can use V B The user's ID number corresponding to each data node in the data intersection is used as input. After the privacy set intersection protocol is executed, the user's ID number corresponding to each data node in the data intersection can be obtained. It is understood that the above assumptions are only illustrative examples. In actual applications, the input content of the data query party and the data provider needs to be determined according to the actual application situation. This application does not impose any restrictions in this regard.

[0047] It is understandable that if V A∩B If V is an empty set, it means that there are no common data nodes between the first and second data graphs. Therefore, there is no need to merge the first and second data graphs further; a search within the local first data graph is sufficient to obtain the number of target data nodes. A∩B If it is not an empty set, then the first and second data graphs need to be merged further, which can be done by letting V... A∩B ={u0,..,u m-1}, where u0,..,u m-1 This represents each data node in the data intersection, where m is greater than or equal to 1.

[0048] In step 102, a first interaction event is initiated with the data provider. This first interaction event is used to determine the target operation matrix, which stores the shortest distance between any two data nodes in the data intersection.

[0049] An undirected graph G can be represented using an adjacency matrix. Let V = {v0,...,v...} || We can create a two-dimensional matrix M of type |V|×|V|, where M[x][y] = 1 represents v. x and v y Adjacent, M[x][y]=0 indicates v x and v yThey are not adjacent, and 0 ≤ x, y ≤ |V| - 1. |V| represents the number of data nodes in V.

[0050] Based on the adjacency matrix of an undirected graph G, the shortest distance between each pair of data nodes in V on the undirected graph G can be calculated using a multi-source shortest path algorithm. An exemplary multi-source shortest path algorithm is the Floyd algorithm, also known as the interpolation algorithm, which uses dynamic programming to find the shortest path between multiple sources in a given weighted graph. Specifically, a two-dimensional matrix D of |V|×|V| can be created, where D[x][y]=1 represents a data node v. x and data node v y Adjacent, D[x][y] = INF indicates that data node v x and data node v y There is no known path connecting them, therefore v x and v y The distance between the two data nodes is set to infinity, and INF represents infinity. If a path exists in the graph connecting the two data nodes, it will be updated in algorithms such as Floyd-Warshall, replacing INF with the actual distance value. When two data nodes are adjacent, it means that there is an edge connecting them in the graph; when two data nodes are not adjacent, it means that there is no edge between them.

[0051] In this embodiment, for example, the data querying party can select a first parameter, which is greater than the total number of data nodes in the first data graph; then, the first parameter is sent to the data provider, who selects a second parameter, which is greater than the total number of data nodes in the second data graph; the data provider adds the first and second parameters to obtain a total parameter value, and feeds this total parameter value back to the data querying party. This allows for the determination of a specific value to define INF. It is understood that this total parameter value is definitely greater than the total number of data nodes in the first and second data graphs; in other words, the distance between any two data nodes in the first and second data graphs is definitely less than this total parameter value. Therefore, this total parameter value can be used to describe the distance between any two data nodes in the first and second data graphs as infinite.

[0052] For example, the Floyd algorithm can be described by the following pseudocode:

[0053] for k from 0 to |V|-1

[0054] for x from 0 to |V|-1

[0055] for y from 0 to |V|-1

[0056] D[x][y]=min{D[x][y],D[x][k]+D[k][y]}

[0057] It is understood that the multi-source shortest path algorithm can be any algorithm other than the Floyd algorithm. The appropriate multi-source shortest path algorithm should be selected according to the actual application. This application does not impose any restrictions in this regard.

[0058] In step 103, the first target distance is determined based on the target operation matrix. This first target distance is the shortest distance between any data node in the first relative complement set and any data node in the data intersection set. The first relative complement set is the relative complement set of the second data graph in the first data graph; the data nodes in the first relative complement set are the data nodes in the first data graph excluding the data nodes in the data intersection set.

[0059] In step 104, a second interaction event is initiated with the data provider. This second interaction event is used to determine the number of target data nodes based on the target operation matrix, the first target distance, preset neighborhood parameters, target query nodes, data node labels, and the second target distance determined by the data provider. The number of target data nodes is defined as follows: (V...) A ∪V B E A ∪E B The total number of data nodes in the k-neighborhood of the target query node that are labeled as having a high-risk status.

[0060] In a scenario involving querying financial transaction data, the target data node count is the total number of data nodes to be queried. Specifically, it represents the total number of data nodes labeled as high-risk within a preset neighborhood corresponding to the user of the target query node. Whether a node is within this preset neighborhood is determined based on a first target distance and a second target distance determined by the data provider. The target data node count represents the total number of high-risk users directly or indirectly encountered by the user of the target query node during the transaction process, and these high-risk users are considered when evaluating whether the user of the target query node exhibits high-risk behavior.

[0061] In step 105, the presence of risk in the target query node is determined based on the number of target data nodes. In this embodiment, a quantity threshold can be preset; for example, this threshold can be set to 10. In practical applications, this threshold can be set to other positive integers depending on the specific application; this application does not impose any restrictions in this regard. If the number of target data nodes exceeds this threshold, it can be determined that the target query node is at risk; conversely, if the number of target data nodes does not exceed this threshold, it can be determined that the target query node is not at risk.

[0062] By initiating an intersection interaction event with the data provider to determine the intersection between the local first data graph and the data provider's second data graph, and then initiating a first interaction event with the data provider to determine the target operation matrix, the target operation matrix stores the shortest distance between any two data nodes in the data intersection. This allows the determination of a first target distance, where the first target distance is the shortest distance between any data node in the first relative complement and any data node in the data intersection, and the first relative complement is the relative complement of the second data graph in the first data graph. Further, a second interaction event is initiated with the data provider to determine the number of target data nodes based on the target operation matrix, the first target distance, preset neighborhood parameters, target query nodes, data node labels, and the second target distance determined by the data provider. This enables the fusion and analysis of data held by multiple parties to perform complete data queries without needing to access the data provider's second data graph, ensuring data privacy. This determines the number of target data nodes and whether there is any risk associated with the target query nodes, thereby improving the information security of data queries.

[0063] In some embodiments, when the data query party initiates the execution of the first interaction event with the data provider, the matrix can be continuously updated through the interaction between the data query party and the data provider, thereby constructing the target operation matrix while ensuring the data security of both parties. Figure 2 This is the second flowchart illustrating the data query method in the embodiments of this application. Figure 6 This is the data graph resulting from the merging of the first and second data graphs in the data query method illustrated in this application embodiment. Please refer to... Figure 2 and Figure 6 The data query method shown in the embodiments of this application may include:

[0064] In step 201, a first encryption matrix is ​​determined based on the data intersection and the first data graph, and the first encryption matrix is ​​sent to the data provider. The matrix elements in the first encryption matrix represent the encrypted values ​​of the shortest distances between data nodes in the data intersection of the first data graph.

[0065] Specifically, the Floyd algorithm or other multi-source shortest path algorithms in step 102 can be used first to determine the shortest distance between any two data nodes in the data intersection in the first data graph. For example, such as... Figure 6As shown, data nodes a, b, c, d, e, f, g, and h are data nodes in the first data graph, while data nodes a, i, f, j, k, l, and h are data nodes in the second data graph. Therefore, the intersection of the first and second data graphs is data nodes a, f, and h. The shortest path between data nodes a and f in the first data graph is data nodes a, b, c, d, e, and f, with a length of 5. Similarly, the shortest distance between data nodes f and h in the first data graph is 2; similarly, the shortest distance between data nodes a and h in the first data graph is 7.

[0066] Then, a first initial matrix is ​​generated based on the number of data nodes in the data intersection. The elements of the first initial matrix represent the shortest distance between any two data nodes in the data intersection in the first data graph. If... Figure 6 The data intersection shown has a first initial matrix that is a 3x3 matrix. The matrix elements in can be represented as It describes two data nodes u in the data intersection. i and u j The shortest distance between them in the first data graph.

[0067] Next, a homomorphic encryption scheme can be selected to generate a key pair, consisting of a public key PK and a private key SK. Each element of the first initial matrix can be encrypted using the public key PK to obtain a first encryption matrix, which can be represented as follows: The matrix elements in the first encryption matrix can be represented as follows:

[0068] In step 202, the data provider receives a distance difference encryption matrix based on the first encryption matrix. The matrix elements of the distance difference encryption matrix represent the encrypted values ​​of the distance difference parameters between matrix elements in the second encryption matrix determined by the data provider and the corresponding matrix elements in the first encryption matrix.

[0069] In step 203, a first assignment matrix is ​​created based on the distance difference encryption matrix and sent to the data provider. In the step of creating the first assignment matrix based on the distance difference encryption matrix, the distance difference encryption matrix can first be decrypted to obtain a distance difference decryption matrix. Specifically, each matrix element in the distance difference encryption matrix can be decrypted using the aforementioned private key SK, and the decrypted element value 'a' is obtained after decryption of each matrix element. i,jEach element of the distance difference decryption matrix is ​​used as a matrix element.

[0070] Then, based on the value of each decrypted element in the distance difference decryption matrix, each element of the first assignment matrix is ​​determined to create the first assignment matrix. Each element of the first assignment matrix indicates whether the value of each decrypted element in the distance difference decryption matrix is ​​a natural number. If the current decrypted element value is a natural number, it means that the shortest distance between the two data nodes corresponding to the current matrix element in the second encryption matrix is ​​greater than the shortest distance between the two data nodes corresponding to the current matrix element in the first encryption matrix.

[0071] Specifically, if the current decrypted element value is greater than or equal to zero (i.e., a natural number), the matrix element in the first assignment matrix corresponding to the element position of the current decrypted element value can be updated to 1. If the current decrypted element value is less than zero (i.e., not a natural number), the matrix element in the first assignment matrix corresponding to the element position of the current decrypted element value can be updated to 0. For example, this can be described by the following expression:

[0072]

[0073] in, Assign values ​​to the matrix elements in the first matrix.

[0074] It is understood that updating to 1 and updating to 0 are not the only limitations. In practical applications, it can also be updated to other values, as long as the updated values ​​in the two cases are not equal, so as to be able to distinguish whether each decrypted element value in the distance difference decryption matrix is ​​a natural number. This application does not impose any restrictions in this regard.

[0075] It is also understandable that, if Figure 6 The data intersection shown creates a 3x3 first assignment matrix. The distance difference decryption matrix is ​​obtained by decrypting the distance difference encryption matrix. The distance difference encryption matrix is ​​determined by the encrypted value of the distance difference parameter between the matrix elements in the second encryption matrix and the corresponding matrix elements in the first encryption matrix. Both the first and second encryption matrices are 3x3 matrices because the number of data nodes in the data intersection is always 3. Therefore, the distance difference decryption matrix is ​​also a 3x3 matrix, ensuring that the element positions of the decrypted elements in the distance difference decryption matrix match the element positions in the first assignment matrix, allowing for updates based on element positions. This process continues until every decrypted element value has been determined, forming the first assignment matrix.

[0076] In step 204, the receiving data provider feeds back a second assignment matrix based on the first assignment matrix. The second assignment matrix is ​​obtained by updating the first assignment matrix based on the first encryption matrix, the second encryption matrix, and each element of the first assignment matrix. The purpose of the update is to determine the encrypted value representing the shortest distance between two data nodes that is smaller between the first and second encryption matrices and update it into the first assignment matrix to form the second assignment matrix.

[0077] In step 205, a target operation matrix is ​​constructed based on the second assignment matrix. In this embodiment, the second assignment matrix can first be decrypted to obtain the target decryption matrix. Specifically, each matrix element in the second assignment matrix can be decrypted using the aforementioned private key SK to obtain the target decryption matrix.

[0078] Then, based on the target decryption matrix, the shortest distance between each pair of data nodes in the data intersection is determined, and a target operation matrix is ​​constructed based on the shortest distance between each pair of data nodes in the data intersection. Specifically, the Floyd algorithm in step 102 or other multi-source shortest path algorithms can be used to determine the shortest distance between each pair of data nodes in the data intersection based on the target decryption matrix. For example, Figure 6 As shown, since the shortest distance from data node a to data node h in the data intersection is 7 in the first data graph and 6 in the second data graph, the matrix element describing the shortest distance from data node a to data node h stored in the target decryption matrix is ​​6. However, the target decryption matrix also stores a matrix element describing the shortest distance from data node a to data node f, with a value of 2; similarly, the target decryption matrix stores a matrix element describing the shortest distance from data node f to data node h, with a value of 2. Therefore, using the Floyd algorithm or other multi-source shortest path algorithms, we can determine that the shortest distance from data node a to data node h should be 4, and the shortest path is data node a, data node i, data node f, data node g, and data node h. Therefore, it is necessary to further update the matrix element describing the shortest distance from data node a to data node h from 6 to 4, thus confirming that the shortest distance from data node a to data node h is 4.

[0079] After determining the shortest distance between each pair of data nodes in the data intersection, construct the target operation matrix based on the shortest distance between each pair of data nodes in the data intersection.

[0080] In step 206, the target operation matrix is ​​sent to the data provider. The data queryer will send the constructed target operation matrix to the data provider for processing.

[0081] In some embodiments, after determining the shortest distance between each pair of data nodes in the data intersection, it is also necessary to determine the shortest distance between each data node in the first data graph (excluding the data nodes in the data intersection) and each data node in the data intersection, and then initiate a second interaction event to the data provider to determine the target number of data nodes. Figure 3 This is the third flowchart illustrating the data query method in the embodiments of this application. Please refer to... Figure 3 and Figure 6 The data query method shown in the embodiments of this application may include:

[0082] In step 301, the first target distance is determined based on the target operation matrix. Specifically, the first target distance can be determined based on the matrix elements stored in the target operation matrix using the Floyd algorithm or other multi-source shortest path algorithms in step 102. The aforementioned first target distance is the shortest distance between any data node in the first relative complement set and any data node in the data intersection set.

[0083] In step 302, the number of first risk nodes in the first data graph is determined based on the target query node, preset neighborhood parameters, data node labels, target operation matrix, and first target distance. Specifically, it is necessary to retrieve V A All nodes in the target query node v t In the first data graph, for data nodes whose shortest distance does not exceed the preset neighborhood parameter k and whose label is high-risk, sum1 can be used to represent the number of data nodes that meet the above conditions, that is, sum1 represents the number of first-risk nodes.

[0084] In step 303, a first determination distance is determined based on the target operation matrix and the first target distance. The first determination distance is the shortest distance between the target query node and every data node in the data intersection of the first data graph. It can be determined by using the Floyd algorithm or other multi-source shortest path algorithms from step 102, based on the shortest distance between each pair of data nodes in the data intersection stored in the target operation matrix and the first target distance. For example,... Figure 6 As shown, assume the target query node v t Let b be a data node. Its shortest distance to a data node is 1. The shortest distance between a data node and f is 2. Then the first determination distance between data node b and data node f is 3.

[0085] In step 304, a decision vector is generated based on preset neighborhood parameters and each first decision distance. In this embodiment, each first decision distance can be subtracted from the preset neighborhood parameters to obtain each vector element, and then a decision vector is generated based on each vector element. For example, the decision vector can be represented as λ[i]=(k-d0,...,kd m-1 ), where d0,...,d m-1 Let i represent the distance of each first determination, where 0 ≤ i ≤ m-1.

[0086] In step 305, a decision vector is sent to the data provider.

[0087] In step 306, the number of second risk nodes reported by the data provider is received.

[0088] In step 307, the target number of data nodes is determined based on the number of first risk nodes and the number of second risk nodes. Alternatively, the number of first risk nodes and the number of second risk nodes can be added together to determine the target number of data nodes.

[0089] In some embodiments, the data provider must also cooperate with the data queryer to respond to and execute interactive events. Figure 4 This is the fourth flowchart illustrating the data query method in the embodiments of this application. Please refer to... Figure 4 The data query method shown in the embodiments of this application may include:

[0090] In step 401, an intersection interaction event is responded to and executed. This intersection interaction event is used to determine the data intersection between the first data graph of the data querying party and the second data graph of the local entity.

[0091] In step 402, the first interactive event is responded to and executed to obtain the target operation matrix.

[0092] In step 403, the second target distance is determined based on the target operation matrix. This second target distance is the shortest distance between any data node in the second relative complement set and any data node in the data intersection set. The second relative complement set is the relative complement of the first data graph in the second data graph. The data nodes in the second relative complement set are the data nodes in the second data graph excluding the data nodes in the data intersection set.

[0093] In step 404, a second interactive event is responded to and executed to receive the decision vector from the data query party and, based on the decision vector, to return a second assignment matrix to the data query party.

[0094] In this embodiment of the application, during the process of responding to and executing the second interactive event, the data provider can determine the second judgment distance based on the target operation matrix and the second target distance. The second judgment distance is the shortest distance between the data node to be judged in the second relative complement and each data node in the data intersection in the second data graph.

[0095] If the data node label of the current data node to be judged in the second relative complement is high-risk, and the second judgment distance between the current data node to be judged and the current data node in the data intersection is less than or equal to the vector element corresponding to the current data node in the data intersection, then the current data node to be judged is determined to be a risk node. For example, suppose the current data node to be judged is w, its data node label is high-risk, and the second judgment distance between w and data node u in the data intersection... i If the second judgment distance is less than or equal to λ[i], then the current data node to be judged can be determined as a risk node under the preset neighborhood. This process continues until all data nodes to be judged in the second relative complement set have been judged, and the number of second risk nodes is obtained and sent to the data query party.

[0096] In some embodiments, during the response and execution of the first interaction event by the data provider, the matrix can be continuously updated through the interaction between the data queryer and the data provider, thereby constructing the target operation matrix while ensuring the data security of both parties. Figure 5 This is the fifth flowchart illustrating the data query method in the embodiments of this application. Please refer to... Figure 5 and Figure 6 The first interactive event of the data query method shown in the embodiments of this application may include:

[0097] In step 501, a second encryption matrix is ​​determined based on the data intersection and the second data graph. The matrix elements in the second encryption matrix represent the encrypted values ​​of the shortest distances between data nodes in the data intersection of the second data graph.

[0098] Specifically, the Floyd algorithm or other multi-source shortest path algorithms in step 102 can be used first to determine the shortest distance between any two data nodes in the data intersection in the second data graph. For example, such as... Figure 6As shown, data nodes a, b, c, d, e, f, g, and h are data nodes in the first data graph, while data nodes a, i, f, j, k, l, and h are data nodes in the second data graph. Therefore, the intersection of the first and second data graphs is data nodes a, f, and h. The shortest path between data nodes a and f in the second data graph is data nodes a, i, and f, with a shortest distance of 2. Similarly, the shortest distance between data nodes f and h in the second data graph is 4; and similarly, the shortest distance between data nodes a and h in the first data graph is 6.

[0099] Then, a second initial matrix is ​​generated based on the number of data nodes in the data intersection. The elements of the second initial matrix represent the shortest distance between any two data nodes in the data intersection in the second data graph. If... Figure 6 The data intersection shown has a second initial matrix that is a 3x3 matrix. The matrix elements in can be represented as It describes two data nodes u in the data intersection. i and u j The shortest distance between them in the second data graph.

[0100] Next, each element of the second initial matrix can be encrypted using the public key PK sent by the data querying party to obtain the second encrypted matrix, which can be represented as follows: The matrix elements in the second encryption matrix can be represented as follows:

[0101] In step 502, the first encryption matrix sent by the data query party is received.

[0102] In step 503, a random positive integer is generated and encrypted to obtain an encrypted positive integer. The random positive integer can be represented as r. i,j The random positive integer r can be determined using the public key PK. i,j Encryption is performed to obtain the encrypted positive integer r. i ′ ,j .

[0103] In step 504, each matrix element in the second encryption matrix is ​​updated based on the first encryption matrix, the second encryption matrix, and the encrypted positive integer to obtain the distance difference encryption matrix.

[0104] The difference between the element at the current position in the second encryption matrix and the element at the current position in the first encryption matrix is ​​multiplied by the encrypted positive integer to obtain the distance difference element. This difference element is then used to update the element at the current position in the second encryption matrix until all elements in the second encryption matrix have been updated. For example, the update process can be represented by the following expression:

[0105]

[0106] in, This represents the distance difference element in the distance difference encryption matrix.

[0107] In step 505, a distance difference encryption matrix is ​​sent to the data query party.

[0108] In step 506, the first assignment matrix is ​​received from the data query party;

[0109] In step 507, each matrix element in the first assignment matrix is ​​updated to the corresponding matrix element in the first encryption matrix or the second encryption matrix according to the value of each matrix element in the first assignment matrix, forming a second assignment matrix and sending the second assignment matrix to the data query party.

[0110] If the value of the current matrix element in the first assignment matrix is ​​1, it means that the shortest distance corresponding to the element at the current position in the first encryption matrix after decryption is less than or equal to the shortest distance corresponding to the element at the current position in the second encryption matrix. In this case, the current matrix element is updated to the element at the current position in the first encryption matrix. If the value of the current matrix element in the first assignment matrix is ​​0, it means that the shortest distance corresponding to the element at the current position in the second encryption matrix after decryption is less than the shortest distance corresponding to the element at the current position in the first encryption matrix. In this case, the element with the smaller shortest distance after decryption in the first and second encryption matrices is updated in the first assignment matrix until all matrix elements in the first assignment matrix are updated. This forms the second assignment matrix, which is then sent to the data query party. For example, this can be described using the following expression:

[0111]

[0112] in, Assign values ​​to the matrix elements in the second matrix.

[0113] Corresponding to the aforementioned application function implementation method embodiments, this application also provides an electronic device for executing a data query method and corresponding embodiments.

[0114] Figure 7 A block diagram illustrating the hardware configuration of an electronic device 700 capable of implementing the data query method of embodiments of this application is shown. Figure 7 As shown, the electronic device 700 may include a processor 710 and a memory 720. Figure 7 In the electronic device 700, only the components relevant to this embodiment are shown. Therefore, it will be apparent to those skilled in the art that the electronic device 700 may also include components related to... Figure 7 The following are common components with different constituent elements. For example, a fixed-point arithmetic unit.

[0115] Electronic device 700 can correspond to a computing device with various processing functions, such as functions for generating neural networks, training or learning neural networks, quantizing floating-point neural networks into fixed-point neural networks, or retraining neural networks. For example, electronic device 700 can be implemented as various types of devices, such as personal computers (PCs), server devices, mobile devices, etc.

[0116] The processor 710 controls all functions of the electronic device 700. For example, the processor 710 controls all functions of the electronic device 700 by executing programs stored in the memory 720 on the electronic device 700. The processor 710 can be implemented by a central processing unit (CPU), graphics processing unit (GPU), application processor (AP), artificial intelligence processor chip (IPU), etc., provided in the electronic device 700. However, this application is not limited to this.

[0117] In some embodiments, processor 710 may include an input / output (I / O) unit 711 and a computing unit 712. I / O unit 711 may be used to receive various types of data. Exemplarily, computing unit 712 may be used to execute steps in a data query method. The resulting target number of data nodes may, for example, be output by I / O unit 711. The output data may be provided to memory 720 for use by other devices (not shown), or it may be provided directly to other devices.

[0118] Memory 720 is hardware used to store various data processed in electronic device 700. For example, memory 720 can store processed data and data to be processed in electronic device 700. Memory 720 can store data involved in the data query process that has been processed or is to be processed by processor 710. In addition, memory 720 can store applications, drivers, etc. to be driven by electronic device 700. For example, memory 720 can store various programs related to the data query method to be executed by processor 710. Memory 720 can be DRAM, but this application is not limited to it. Memory 720 can include at least one of volatile memory or non-volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, phase-change RAM (PRAM), magnetic RAM (MRAM), resistive RAM (RRAM), ferroelectric RAM (FRAM), etc. Volatile memory can include dynamic RAM (DRAM), static RAM (SRAM), synchronous DRAM (SDRAM), PRAM, MRAM, RRAM, ferroelectric RAM (FeRAM), etc. In an embodiment, the memory 720 may include at least one of a hard disk drive (HDD), a solid-state drive (SSD), a high-density flash memory (CF), a secure digital card (SD), a micro-secure digital card (Micro-SD), a mini-secure digital card (Mini-SD), an extreme digital card (xD), caches, or a memory stick.

[0119] In summary, the specific functions implemented by the memory 720 and processor 710 of the electronic device 700 provided in this specification can be explained in comparison with the aforementioned embodiments in this specification, and can achieve the technical effects of the aforementioned embodiments. Therefore, they will not be repeated here.

[0120] In this embodiment, the processor 710 can be implemented in any suitable manner. For example, the processor 710 can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) that can be executed by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers, etc.

[0121] It should be understood that the possible terms "first" or "second," etc., in the claims, specification, and drawings disclosed in this application are used to distinguish different objects, rather than to describe a specific order. The terms "comprising" and "including" used in the specification and claims disclosed in this application indicate the presence of the described features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof.

[0122] It should also be understood that the terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to limit the scope of this disclosure. As used in this disclosure and claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this disclosure and claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.

[0123] Although the embodiments of this application are described above, the content is merely an example adopted for the purpose of facilitating understanding of this application and is not intended to limit the scope and application scenarios of this application. Any person skilled in the art described in this application may make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in this application, but the scope of patent protection of this application shall still be determined by the scope defined in the appended claims.

[0124] It should also be understood that any module, unit, component, server, computer, terminal, or device that executes the instructions executorized herein may include or otherwise access computer-readable media, such as storage media, computer storage media, or data storage devices (removable) and / or non-removable) such as disks, optical discs, or magnetic tapes. Computer storage media may include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data.

Claims

1. A data query method, characterized in that, include: Initiate an intersection interaction event to the data provider, wherein the intersection interaction event is used to determine the data intersection between the local first data graph and the data provider's second data graph; A first interaction event is initiated to the data provider. The first interaction event is used to determine the target operation matrix. The target operation matrix is ​​used to store the shortest distance between any two data nodes in the data intersection. The first target distance is determined based on the target operation matrix. The first target distance is the shortest distance between any data node in the first relative complement set and any data node in the data intersection set. The first relative complement set is the relative complement set of the second data graph in the first data graph. A second interaction event is initiated to the data provider. The second interaction event is used to determine the number of target data nodes based on the target operation matrix, the first target distance, the preset neighborhood parameters, the target query node, the data node label, and the second target distance determined by the data provider. The number of first risk nodes in the first data graph is determined based on the target query node, the preset neighborhood parameters, the data node labels, the target operation matrix, and the first target distance. The number of second risk nodes received from the data provider; The number of target data nodes is determined based on the number of the first risk nodes and the number of the second risk nodes; The second determination distance is determined based on the target operation matrix and the second target distance. The second target distance is the shortest distance between any data node in the second relative complement and any data node in the data intersection. The second relative complement is the relative complement of the first data graph in the second data graph. The second determination distance is the shortest distance between the data node to be determined in the second relative complement and each data node in the data intersection in the second data graph. The presence of risk in the target query node is determined based on the number of target data nodes.

2. The data query method according to claim 1, characterized in that, In the process of initiating the execution of the first interaction event with the data provider, the data query method includes: A first encryption matrix is ​​determined based on the data intersection and the first data graph, and the first encryption matrix is ​​sent to the data provider. Receive the distance difference encryption matrix fed back by the data provider based on the first encryption matrix; A first assignment matrix is ​​created based on the distance difference encryption matrix, and the first assignment matrix is ​​sent to the data provider; Receive the second assignment matrix fed back by the data provider based on the first assignment matrix; The target operation matrix is ​​constructed based on the second assignment matrix; The target operation matrix is ​​sent to the data provider.

3. The data query method according to claim 2, characterized in that, The matrix elements in the first encryption matrix represent the encrypted value of the shortest distance between data nodes in the data intersection in the first data graph; wherein the matrix elements of the distance difference encryption matrix represent the encrypted value of the distance difference parameter between the matrix elements in the second encryption matrix determined by the data provider and the corresponding matrix elements in the first encryption matrix. The creation of the first assignment matrix based on the distance difference encryption matrix includes: Decrypting the distance difference encryption matrix yields a distance difference decryption matrix, where each element of the distance difference decryption matrix is ​​a decrypted element value; and Each element of the first assignment matrix is ​​determined based on each decryption element value in the distance difference decryption matrix to create the first assignment matrix, wherein each element of the first assignment matrix is ​​used to indicate whether each decryption element value in the distance difference decryption matrix is ​​a natural number; The second assignment matrix is ​​a matrix obtained by updating the first assignment matrix based on each element of the first encryption matrix, the second encryption matrix, and the first assignment matrix. The construction of the target operation matrix based on the second assignment matrix includes: The second assignment matrix is ​​decrypted to obtain the target decryption matrix; Based on the target decryption matrix, determine the shortest distance between each pair of data nodes in the data intersection, and construct the target operation matrix according to the shortest distance between each pair of data nodes in the data intersection.

4. The data query method according to claim 2, characterized in that, Determining the first encryption matrix based on the data intersection and the first data graph includes: Determine the shortest distance between any two data nodes in the data intersection in the first data graph; A first initial matrix is ​​generated based on the number of data nodes in the data intersection. The matrix elements in the first initial matrix represent the shortest distance between any two data nodes in the data intersection in the first data graph. Each element of the first initial matrix is ​​encrypted to obtain the first encrypted matrix.

5. The data query method according to claim 3, characterized in that, Determining each element of the first assignment matrix based on each element of the distance difference decryption matrix includes: If the current decrypted element value is greater than or equal to zero, then update the matrix element in the first assignment matrix corresponding to the element position of the current decrypted element value to 1; If the current decrypted element value is less than zero, then update the matrix element in the first assignment matrix corresponding to the element position of the current decrypted element value to 0; This continues until every decrypted element value has been determined, forming the first assignment matrix.

6. The data query method according to claim 1, characterized in that, In the process of initiating the execution of the second interaction event to the data provider, the second interaction event includes: A first determination distance is determined based on the target operation matrix and the first target distance. The first determination distance is the shortest distance between the target query node and each data node in the data intersection in the first data graph. A determination vector is generated based on the preset neighborhood parameters and each first determination distance; The determination vector is sent to the data provider.

7. The data query method according to claim 6, characterized in that, The step of generating a determination vector based on the preset neighborhood parameters and each first determination distance includes: Subtract each first determination distance from the preset neighborhood parameters to obtain each vector element; The determination vector is generated based on each vector element.

8. The data query method according to claim 1, characterized in that, include: Respond to and execute an intersection interaction event initiated by the data query party, the intersection interaction event being used to determine the data intersection between the data query party's first data graph and the local second data graph; Respond to and execute the first interactive event to obtain the target operation matrix; The second target distance is determined based on the target operation matrix; the second relative complement is the relative complement of the first data graph in the second data graph; Respond to and execute the second interaction event to receive the decision vector fed back by the data query party, and feed back the second assignment matrix to the data query party based on the decision vector.

9. The data query method according to claim 8, characterized in that, In the response to and execution of the first interactive event, the first interactive event includes: A second encryption matrix is ​​determined based on the data intersection and the second data graph, wherein the matrix elements in the second encryption matrix represent the encrypted value of the shortest distance between data nodes in the data intersection in the second data graph; Receive the first encryption matrix sent by the data querying party; Generate a random positive integer and encrypt the random positive integer to obtain an encrypted positive integer; Based on the first encryption matrix, the second encryption matrix, and the encryption positive integer, each matrix element in the second encryption matrix is ​​updated to obtain the distance difference encryption matrix; The distance difference encryption matrix is ​​sent to the data querying party; Receive the first assignment matrix returned by the data query party; Each matrix element in the first assignment matrix is ​​updated to the corresponding matrix element in the first encryption matrix or the second encryption matrix according to the value of each matrix element in the first assignment matrix, forming a second assignment matrix, and the second assignment matrix is ​​sent to the data query party.

10. The data query method according to claim 9, characterized in that, The step of updating each matrix element in the second encryption matrix based on the first encryption matrix, the second encryption matrix, and the encrypted positive integer includes: The difference obtained by subtracting the element at the current position in the first encryption matrix from the element at the current position in the second encryption matrix is ​​multiplied by the encrypted positive integer to obtain the distance difference element. The matrix element at the current element position in the second encryption matrix is ​​updated to the distance difference element until all element positions in the second encryption matrix have been updated.

11. The data query method according to claim 9, characterized in that, The step of updating each matrix element in the first assignment matrix to a corresponding matrix element in the first encryption matrix or the second encryption matrix based on the value of each matrix element in the first assignment matrix includes: If the value of the current matrix element in the first assignment matrix is ​​1, then the current matrix element is updated to the matrix element corresponding to the element position in the first encryption matrix; If the value of the current matrix element in the first assignment matrix is ​​0, then the current matrix element is updated to the matrix element corresponding to the element position in the second encryption matrix; This continues until all matrix elements in the first assignment matrix have been updated.

12. The data query method according to claim 8, characterized in that, In the response and execution of the second interactive event, the second interactive event includes: If the data node label of the current data node to be judged in the second relative complement is high risk, and the second judgment distance between the current data node to be judged and the current data node in the data intersection is less than or equal to the vector element in the judgment vector corresponding to the current data node in the data intersection, then the current data node to be judged is determined to be a risk node. The number of second risk nodes is obtained after all the data nodes to be judged in the second relative complement set have been judged. Send the number of the second risk nodes to the data query party.

13. An electronic device comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the data query method according to any one of claims 1 to 12.

14. A non-transitory machine-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, implements the steps of the data query method according to any one of claims 1 to 12.