Data search method and device and electronic equipment
By using keyword dictionary and hop index dictionary in the social relationship network graph for encrypted query, the problems of low data search efficiency and low security in the social relationship network graph are solved, and efficient and secure data search results are achieved.
Patent Information
- Application Number
- CN202411440252.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-01-10
AI Technical Summary
In the prior art, data searching directly based on social relationship network graphs is inefficient and low security, and cannot effectively solve the search efficiency and security problems.
By receiving the search request sent by the terminal, obtain the node to be searched and the search range, use the keyword dictionary and the hop index dictionary to query, return the search results in encryption form, and use the encryption algorithm to encrypt the keywords and nodes to build an index relationship , query based on encrypted nodes and correlation degree to ensure the security and efficiency of search results.
It realizes efficient and secure query of data search results in the social relationship network diagram, improves the efficiency and security of data search, and solves the problems of low efficiency and low security.
Smart Images

Figure CN119293293A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, in particular to the field of cryptography, and specifically to a data search method, device and electronic equipment. Background Art
[0002] In current social network data search technologies, users usually need to search directly in the social network graph to find information related to specific keywords or nodes. However, since the social network graph contains a large number of nodes and links, searching directly in it may lead to low search efficiency. In addition, since some information may involve user privacy or sensitive data, searching directly in the social network graph also has security risks.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] Embodiments of the present invention provide a data search method, device, and electronic device to at least solve the technical problems of low data search efficiency and low search security in the method of directly performing data search based on a social relationship network graph in the related art.
[0005] According to one aspect of an embodiment of the present invention, a data search method is provided, comprising: receiving a search request sent by a terminal, wherein the search request is used to request a search based on a social relationship network graph, the social relationship network graph comprising a plurality of nodes and lines between the nodes, the nodes representing social objects participating in social behaviors, and the lengths of the lines representing the association between the connected social objects; obtaining keywords to be searched and a search range corresponding to the nodes to be searched from the search request; based on the keywords to be searched and the search range, querying a keyword dictionary and a hop index dictionary corresponding to the social relationship network graph to obtain search results, wherein the keyword dictionary is used to store the correspondence between nodes and keywords, and the hop index dictionary is used to store the association between nodes; and returning the search results to the terminal.
[0006] Optionally, based on the keyword to be searched and the search scope, querying the keyword dictionary and the hop index dictionary corresponding to the social relationship network graph to obtain search results includes: based on the keyword to be searched, querying the keyword dictionary to obtain associated nodes with the keyword to be searched; based on the search scope and the associated nodes, querying the hop index dictionary to obtain the search results, wherein the search results are in encrypted form.
[0007] Optionally, when there are multiple associated nodes, the search result is obtained by querying the hop index dictionary based on the search range and the associated nodes, including: obtaining the degree of association between the multiple associated nodes and the node to be searched based on the hop index dictionary; determining, from the multiple associated nodes, the associated nodes whose degree of association with the node to be searched ranks in the top predetermined number of places based on the search range and the degree of association between the multiple associated nodes and the node to be searched; and obtaining the search result based on the associated nodes ranked in the top predetermined number of places.
[0008] Optionally, before querying the keyword dictionary and the hop index dictionary corresponding to the social relationship network graph based on the keywords to be searched and the search scope to obtain search results, the method also includes: obtaining multiple social objects and association information between the multiple social objects; using the multiple social objects as nodes and the association information between the multiple social objects as edges to construct the social relationship network graph, wherein the multiple social objects correspond to the multiple nodes in a one-to-one manner.
[0009] Optionally, before querying the keyword dictionary and hop index dictionary corresponding to the social relationship network graph based on the keywords to be searched and the search range to obtain search results, the method also includes: using a first encryption algorithm to encrypt multiple keywords separately to obtain multiple first encrypted keywords; using a second encryption algorithm to encrypt multiple nodes in the social relationship network graph separately to obtain multiple encrypted nodes; establishing an index relationship between the multiple first encrypted keywords and the multiple first encrypted nodes to obtain the keyword dictionary.
[0010] Optionally, the using of the first encryption algorithm to encrypt multiple keywords separately to obtain multiple first encrypted keywords includes: using the first encryption algorithm to encrypt multiple keywords separately to obtain multiple second encrypted keywords; using the first encryption algorithm to encrypt the multiple second encrypted keywords to obtain the multiple first encrypted keywords.
[0011] Optionally, before querying the keyword dictionary and hop index dictionary corresponding to the social relationship network diagram based on the keywords to be searched and the search range to obtain search results, the method also includes: obtaining the geographical distances between the multiple nodes and the social relationship scores between the multiple nodes, wherein the social relationship scores are used to characterize the closeness of the social relationships between the connected social objects; performing weighted calculation based on the geographical distances between the multiple nodes and the corresponding social relationship scores to obtain the correlation between the multiple nodes; using a second encryption algorithm to encrypt the multiple nodes in the social relationship network diagram respectively to obtain multiple encrypted nodes; using a third encryption algorithm to encrypt the correlation between the multiple nodes respectively to obtain the encrypted correlation between the multiple nodes; and constructing the hop index dictionary based on the multiple encrypted nodes and the encrypted correlation between the multiple nodes.
[0012] Optionally, the node to be searched, the keyword to be searched and the search range are carried in the search request in the form of a search token, and the search token is obtained by the terminal encrypting the node to be searched, the keyword to be searched and the search range.
[0013] According to another aspect of an embodiment of the present invention, a data search device is also provided, including: a request receiving module, used to receive a search request sent by a terminal, wherein the search request is used to request a search based on a social relationship network graph, wherein the social relationship network graph includes multiple nodes and lines between nodes, wherein the nodes represent social objects participating in social behaviors, and the lengths of the lines represent the association between the connected social objects; a data acquisition module, used to obtain the search keywords and search ranges corresponding to the search nodes from the search request; a query module, used to query the keyword dictionary and hop index dictionary corresponding to the social relationship network graph based on the search keywords and the search range to obtain search results, wherein the keyword dictionary is used to store the correspondence between nodes and keywords, and the hop index dictionary is used to store the association between nodes; a result returning module, used to return the search results to the terminal.
[0014] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the data search methods described.
[0015] In an embodiment of the present invention, a search request sent by a receiving terminal is used to request a search based on a social relationship network graph, wherein the social relationship network graph includes multiple nodes and lines between the nodes, wherein the nodes represent social objects participating in social behaviors, and the length of the lines represents the degree of association between the connected social objects; a to-be-searched keyword and a search range corresponding to the to-be-searched node are obtained from the search request; based on the to-be-searched keyword and the search range, a keyword dictionary and a hop index dictionary corresponding to the social relationship network graph are queried to obtain search results, wherein the keyword dictionary is used to store the correspondence between nodes and keywords, and the hop index dictionary is used to store the degree of association between nodes; and the search results are returned to the terminal, thereby achieving the purpose of securely obtaining search results from the social relationship network graph by querying the keyword dictionary and the hop index dictionary based on the to-be-searched node, the to-be-searched keyword and the search range carried in the user search request, thereby achieving the technical effect of improving the efficiency and security of data search based on the social relationship network graph, and further solving the technical problems of low data search efficiency and low search security in the method of directly performing data search based on the social relationship network graph in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0017] Figure 1 is a flow chart of a data search method according to an embodiment of the present invention;
[0018] Figure 2 is a schematic diagram of the structure of an optional social relationship network diagram according to an embodiment of the present invention;
[0019] Figure 3 is a flow chart of an optional data search method according to an embodiment of the present invention;
[0020] Figure 4 is a schematic diagram of a data search device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] First, to facilitate understanding of the embodiments of the present invention, some terms or nouns involved in the present invention are explained below:
[0024] Pseudorandom Function (PRF): A cryptographic function whose output looks like it is randomly generated, but is actually calculated based on the input and a fixed key. The output of a PRF is calculated based on the input and key using a fixed algorithm, so the same input and key will produce the same output. At the same time, the output of a PRF should be random, that is, for different inputs, the output of the PRF should be different.
[0025] Rivest-Shamir-Adleman (RSA): An asymmetric encryption algorithm based on the difficulty of factoring large numbers. RSA uses two large prime numbers as input and generates a public key and a private key through a series of mathematical operations.
[0026] Advanced Encryption Standard (AES), a symmetric encryption algorithm, is widely used to protect the security of sensitive data. This algorithm is a block cipher that uses the same key to encrypt and decrypt data.
[0027] According to an embodiment of the present invention, a method embodiment of data search is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] Figure 1 is a flow chart of a data search method according to an embodiment of the present invention. Figure 1As shown, the method comprises the following steps:
[0029] Step S102, receiving a search request sent by a terminal;
[0030] Optionally, the execution entity of steps S102 to S108 can be a server (such as a cloud server). When the terminal wants to perform information query based on the social relationship network graph, it can send a search request to the server. The search request is used to request a search based on the social relationship network graph. The social relationship network graph includes multiple nodes and lines between nodes. The nodes represent social objects participating in social behaviors. The length of the lines represents the correlation between the connected social objects. The correlation is used to indicate the degree of correlation between the connected social objects. The correlation can be represented by the geographical distance information between the nodes, and / or the closeness of the social relationship between the nodes.
[0031] In an optional embodiment, before querying a keyword dictionary and a hop index dictionary corresponding to a social relationship network graph based on the keywords to be searched and the search scope to obtain search results, the method also includes: obtaining multiple social objects and association information between the multiple social objects; using the multiple social objects as nodes and the association information between the multiple social objects as edges to construct a social relationship network graph, wherein the multiple social objects and the multiple nodes correspond one to one.
[0032] Optionally, in addition to including multiple nodes and connections between nodes, where nodes represent social objects participating in social behaviors, the social relationship network diagram may also include keywords corresponding to the multiple nodes, and the keywords may include but are not limited to information such as interests, hobbies, and occupations. Figure 2 is a schematic diagram of the structure of an optional social relationship network diagram according to an embodiment of the present invention, such as Figure 2 As shown, the social network relationship diagram includes seven nodes, a, b, c, d, e, f, and g, corresponding to seven different social objects. W1 and W2 represent two different keywords (such as basketball and table tennis). The connection between the nodes indicates that the connected nodes are related, and the length of the connection indicates the degree of association between the connected nodes. The longer the length of the connection, the greater the degree of association between the nodes; otherwise, the smaller the degree of association between the nodes. For example, Figure 2 There is an association between node a and nodes b, c, and d. The corresponding keyword of node a is W1, the corresponding keyword of node b is W1, the corresponding keyword of node c is W2, and the corresponding keywords of node d are W1 and W2. The correlation between node a and nodes b, c, and d is 1.5, 2, and 1 respectively. It can be seen that the correlation between node a and node c is the highest, and the correlation between node a and node d is the lowest.
[0033] Step S104, obtaining the to-be-searched keyword and the search range corresponding to the to-be-searched node from the search request;
[0034] Optionally, the search request may carry information such as the node to be searched, the keyword to be searched, and the search scope. The node to be searched may be a node identifier of the terminal account in the social relationship network graph, the keyword to be searched may be used to indicate the query item, and the search scope may include information such as the search quantity. For example, when a terminal account initiates a query based on the social relationship network graph for social objects that also like to play basketball, the keyword to be searched may be set to basketball, and the query scope may be the two social objects with the closest correlation to the node to be searched.
[0035] In an optional embodiment, the node to be searched, the keyword to be searched and the search range are carried in the search request in the form of a search token, and the search token is obtained by encrypting the node to be searched, the keyword to be searched and the search range by the terminal.
[0036] Optionally, before sending the search request to the server, the terminal sets the corresponding query condition (k, v, w), which includes the node to be searched v, the keyword to be searched w and the search range k, encrypts the query condition in the form of a search token, and carries the search token in the search request and sends it to the server side, thereby improving the confidentiality and security of data query. Among them, the corresponding search token Token can be generated by using, but not limited to, the token formation TokenGen algorithm.
[0037] Step S106, based on the keywords to be searched and the search scope, query the keyword dictionary and the hop index dictionary corresponding to the social relationship network graph to obtain search results, wherein the keyword dictionary is used to store the corresponding relationship between nodes and keywords, and the hop index dictionary is used to store the association between nodes;
[0038] Optionally, the keyword dictionary is used to store the correspondence between nodes and keywords, that is, through the keyword dictionary, the keywords corresponding to each social object in the social relationship network diagram can be queried. The hop index dictionary is used to store the association between nodes, that is, the association between each social object in the social relationship network diagram. By querying the keyword dictionary and the hop index dictionary, search results matching the search request can be obtained.
[0039] In an optional embodiment, based on the keywords to be searched and the search scope, the keyword dictionary and the hop index dictionary corresponding to the social relationship network graph are queried to obtain search results, including: based on the keywords to be searched, the keyword dictionary is queried to obtain the associated nodes with the keywords to be searched; based on the search scope and the associated nodes, the hop index dictionary is queried to obtain search results, wherein the search results are in encrypted form.
[0040] Optionally, the keyword dictionary is used to store the correspondence between nodes and keywords. By querying the keyword dictionary, associated nodes associated with the keyword to be searched can be obtained. Further, by querying the hop index dictionary, corresponding search results can be obtained. The search results are at least used to indicate at least one associated node with a greater degree of association with the node to be searched, as well as relevant information of the at least one associated node.
[0041] Optionally, the keyword dictionary stores the correspondence between nodes and keywords in encrypted form, the hop index dictionary stores the association between nodes in encrypted form, and the corresponding associated nodes and search results are also in encrypted form, thereby ensuring the security of data search based on the social relationship network graph.
[0042] Optionally, when a query condition (k, v, w) is given, the keyword index dictionary can be queried first to quickly find a list of all vertices containing the keyword w, i.e., W[w]. The keyword dictionary can be efficiently completed by pre-storing the (w, W[w]) key-value pairs of all data. In this way, the vertex containing the query keyword w can be quickly located, avoiding global scanning and improving search efficiency. The hop index dictionary stores multiple nodes and corresponding association relationship sets, wherein the association relationship set includes the association degree between the corresponding node and other nodes respectively; in this way, when the node to be queried is known, the corresponding association relationship set can be quickly located, and the associated node matching the keyword to be searched can be determined from the association relationship set.
[0043] In an optional embodiment, when there are multiple associated nodes, based on the search range and the associated nodes, a hop index dictionary is queried to obtain search results, including: based on the hop index dictionary, obtaining the degree of association between the multiple associated nodes and the node to be searched; based on the search range and the degree of association between the multiple associated nodes and the node to be searched, determining from the multiple associated nodes the associated nodes whose degree of association with the node to be searched ranks in the top predetermined number of places; and obtaining search results based on the associated nodes ranked in the top predetermined number of places.
[0044] Optionally, by querying the hop index dictionary, the associations between multiple associated nodes and the node to be searched can be obtained. The search range may include the number of nodes to be searched and the node search conditions. For example, the search range can be set to: nodes whose associations with the node to be searched are ranked in the first predetermined number of digits, and then the corresponding search results can be obtained. Figure 2As shown, when the node to be searched is a, the search keyword is W1, the search range is the node with the greatest correlation with the node to be searched a, the associated nodes associated with node a include nodes b, c, and d, the keyword corresponding to node b is W1, the keyword corresponding to node c is W2, and the keywords corresponding to node d are W1 and W2, wherein the keyword W1 exists in both node b and node d, then node b and node d are set as associated nodes associated with the keyword W1 corresponding to node a; further, the correlation between node b and node d is judged, and the correlation between node b and node a is 1.5, which is greater than the correlation between node d and node a of 1, so the search result is determined to be node d. In the above manner, search results that have a large correlation with the node to be searched and meet the keyword requirements can be quickly queried.
[0045] In an optional embodiment, before querying the keyword dictionary and hop index dictionary corresponding to the social relationship network graph based on the keywords to be searched and the search scope to obtain the search results, the method also includes: using a first encryption algorithm to encrypt multiple keywords separately to obtain multiple first encrypted keywords; using a second encryption algorithm to encrypt multiple nodes in the social relationship network graph separately to obtain multiple encrypted nodes; establishing an index relationship between multiple first encrypted keywords and multiple first encrypted nodes to obtain a keyword dictionary.
[0046] Optionally, the first encryption algorithm may be, but is not limited to, the Advanced Encryption Standard (AES) algorithm, and the second encryption algorithm may be, but is not limited to, the Rivest-Shamir-Adleman (RSA) algorithm, that is, the AES algorithm is used to encrypt keywords to obtain multiple first encrypted keywords; and the RSA algorithm is used to encrypt nodes to obtain multiple encrypted nodes. An index relationship is established between the multiple first encrypted keywords and the corresponding encrypted nodes to obtain a keyword dictionary. It should be noted that by establishing an index relationship between the multiple first encrypted keywords and the corresponding encrypted nodes, when a keyword dictionary search is performed based on the keyword to be searched later, the associated nodes matching the keyword to be searched can be quickly obtained, thereby improving the search efficiency.
[0047] In an optional embodiment, a first encryption algorithm is used to encrypt multiple keywords separately to obtain multiple first encrypted keywords, including: using the first encryption algorithm to encrypt multiple keywords separately to obtain multiple second encrypted keywords; using the first encryption algorithm to encrypt multiple second encrypted keywords to obtain multiple first encrypted keywords.
[0048] It should be noted that if the keywords are only encrypted once, and the keyword dictionary search and index generation are performed directly based on the keywords obtained by the one-time encryption, the entire data set needs to be decrypted when querying, which will reduce the query efficiency. Therefore, in order to improve the query efficiency, each keyword can be encrypted once to obtain the corresponding second encrypted keyword, and then each second encrypted keyword can be further encrypted twice using the same encryption algorithm, thereby ensuring the query security and improving the query efficiency.
[0049] In an optional embodiment, before querying the keyword dictionary and hop index dictionary corresponding to the social relationship network graph based on the keywords to be searched and the search scope to obtain the search results, the method also includes: obtaining the geographical distances between multiple nodes and the social relationship scores between the multiple nodes, wherein the social relationship scores are used to characterize the closeness of the social relationships between connected social objects; performing weighted calculations based on the geographical distances between the multiple nodes and the corresponding social relationship scores to obtain the correlation between the multiple nodes; using a second encryption algorithm to encrypt the multiple nodes in the social relationship network graph respectively to obtain multiple encrypted nodes; using a third encryption algorithm to encrypt the correlation between the multiple nodes respectively to obtain the encrypted correlation between the multiple nodes; and constructing a hop index dictionary based on the multiple encrypted nodes and the encrypted correlation between the multiple nodes.
[0050] Optionally, the geographical distance between multiple nodes is the geographical distance between any two nodes in the multiple nodes, and the social relationship score between multiple nodes is the social relationship score between any two nodes in the multiple nodes. The geographical distance can reflect the proximity of the locations between the nodes, and the social relationship score can reflect the closeness of the social relationship between the nodes. The correlation obtained by weighted calculation based on the geographical distance and the social relationship score can not only reflect the location relationship between the social objects, but also take into account the closeness of the relationship between the social objects. This can achieve the screening of social objects that are closer to the nodes to be searched and have closer relationships to participate in the activity when searching, thereby significantly improving the user experience.
[0051] Optionally, the third encryption algorithm may be a pseudorandom function (PRF), that is, the PRF algorithm is used to encrypt the association between each node. By establishing a corresponding relationship between each encrypted node and the corresponding encrypted association, a hop index dictionary is obtained. By establishing the hop index dictionary in the form of data encryption, data access security can be improved and information leakage can be avoided; by establishing the corresponding relationship, in the subsequent hop index dictionary query process, search results can be quickly identified based on the search range, thereby improving search efficiency.
[0052] Step S108, returning the search results to the terminal.
[0053] Optionally, the search results are in encrypted form, that is, the search results are sent to the terminal in encrypted form, thereby improving the transmission security of the search results. After receiving the search results, the terminal can decrypt the search results to obtain the query information actually needed by the terminal.
[0054] Through the above steps S102 to S108, the purpose of securely obtaining search results from the social relationship network graph by querying a keyword dictionary and a hop index dictionary based on the nodes to be searched, the keywords to be searched and the search range carried in the user search request can be achieved, thereby achieving the technical effect of improving the efficiency and security of data search based on the social relationship network graph, and further solving the technical problems of low data search efficiency and low search security in the method of directly searching data based on the social relationship network graph in the related art.
[0055] Based on the above embodiments and optional embodiments, the present invention proposes an optional implementation mode: Figure 3 is a flow chart of an optional data search method according to an embodiment of the present invention. Figure 3 As shown, the method includes:
[0056] S1, the user uploads the social network graph structure data, first encrypts the graph structure data to generate a keyword dictionary and a hop index dictionary; and stores the keyword dictionary and the hop index dictionary to the server;
[0057] Among them, the keyword dictionary and the hop index dictionary can be generated in the following form:
[0058] S11, using the AES algorithm to decrypt the multiple keywords twice to obtain multiple first encrypted keywords;
[0059] S12, using an RSA algorithm to encrypt the multiple nodes respectively to obtain multiple encrypted nodes, wherein each of the multiple nodes represents a social object;
[0060] S13, establishing an index relationship between a plurality of first encrypted keywords and corresponding encrypted nodes to obtain a keyword dictionary;
[0061] S14, using a PRF algorithm to encrypt the associations between the multiple nodes to obtain the encrypted associations between the multiple nodes, wherein the associations are obtained by weighted calculation based on the geographical distances and social relationship scores between the connected nodes;
[0062] S15, establishing a corresponding relationship between the encryption association degrees corresponding to the multiple decryption nodes, and obtaining a hop index dictionary;
[0063] S2, the user inputs a search request through the terminal, and the search request includes query conditions such as the node to be searched, the keyword to be searched, and the search range;
[0064] S3, the terminal encrypts the query conditions to generate a search token, and sends the search token to the server;
[0065] S4, the server first queries the keyword dictionary through the search token to return multiple associated nodes matching the keyword to be queried, and then selects k nodes with the greatest degree of association with the node to be searched from the multiple associated nodes through the hop index dictionary, and sends the relevant information of the k nodes as search results to the terminal, where the search result is ciphertext data;
[0066] S5, the user gets the ciphertext data and decrypts it to get the plaintext data.
[0067] In the embodiments of the present invention, at least one of the following effects can be achieved: 1) A new dictionary data structure is designed to store a secret social relationship network graph structure, and a social relationship network graph that can simultaneously characterize multiple social objects, the correlation between multiple social objects, and the corresponding keywords of each social object is designed. The keyword dictionary uses keywords as indexes to store encrypted data, and the hop index dictionary is used to store the correlation between nodes. It has the characteristics of high efficiency, security, and reliability, and will not leak any plaintext data. At the same time, it can quickly find the corresponding data. 2) The correlation is obtained by weighted calculation based on the geographical distance between nodes and the social relationship score between nodes; the geographical distance body appears far and near, and the social relationship score reflects the closeness of the relationship. When screening, the social objects with the closest distance and the closest relationship can participate in the activity, thereby improving the user's data query experience. 3) When constructing the secret keyword dictionary and the hop index dictionary, multiple algorithms such as PRF, RSA, and AES are used to ensure the security of dictionary construction.
[0068] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards in the relevant regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0069] In this embodiment, a data search device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the terms "module" and "device" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0070] According to an embodiment of the present invention, there is also provided an apparatus embodiment for implementing the above data search method. Figure 4 is a schematic diagram of the structure of a data search device according to an embodiment of the present invention. Figure 4 As shown, the data search device includes: a request receiving module 200, a data acquisition module 202, a query module 204, and a result returning module 206, wherein:
[0071] A request receiving module 200 is used to receive a search request sent by a terminal, wherein the search request is used to request a search based on a social relationship network graph, wherein the social relationship network graph includes a plurality of nodes and lines between the nodes, wherein the nodes represent social objects participating in the social behavior, and the length of the lines represents the degree of association between the connected social objects;
[0072] The data acquisition module 202 is connected to the request receiving module 200 and is used to obtain the to-be-searched keywords and the search range corresponding to the to-be-searched nodes from the search request;
[0073] The query module 204 is connected to the data acquisition module 202 and is used to query the keyword dictionary and the hop index dictionary corresponding to the social relationship network graph based on the keywords to be searched and the search scope to obtain search results, wherein the keyword dictionary is used to store the corresponding relationship between nodes and keywords, and the hop index dictionary is used to store the association between nodes;
[0074] The result returning module 206 is connected to the query module 204 and is used to return the search results to the terminal.
[0075] In an embodiment of the present invention, a request receiving module 200 is provided to receive a search request sent by a terminal, wherein the search request is used to request a search based on a social relationship network diagram, wherein the social relationship network diagram includes multiple nodes and lines between nodes, wherein the nodes represent social objects participating in social behaviors, and the length of the lines represents the degree of association between the connected social objects; a data acquisition module 202 is connected to the request receiving module 200 and is used to obtain the search keywords and search range corresponding to the searched nodes from the search request; a query module 204 is connected to the data acquisition module 202 and is used to query the keyword dictionary and hop index dictionary corresponding to the social relationship network diagram based on the search keywords and search range to obtain search results, Among them, the keyword dictionary is used to store the correspondence between nodes and keywords, and the hop index dictionary is used to store the association between nodes; the result return module 206, connected to the query module 204, is used to return the search results to the terminal, so as to achieve the purpose of securely obtaining the search results from the social relationship network graph by querying the keyword dictionary and the hop index dictionary based on the nodes to be searched, the keywords to be searched and the search range carried in the user search request, thereby achieving the technical effect of improving the efficiency and security of data search based on the social relationship network graph, and further solving the technical problems of low data search efficiency and low search security in the method of directly searching data based on the social relationship network graph in the related art.
[0076] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0077] It should be noted that the request receiving module 200, the data acquisition module 202, the query module 204, and the result returning module 206 correspond to steps S102 to S108 in the embodiment, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the modules as part of the device can be run in a computer terminal.
[0078] It should be noted that the optional or preferred implementation of this embodiment can refer to the relevant description in the embodiment, which will not be repeated here.
[0079] The above-mentioned data search device may also include a processor and a memory. The above-mentioned request receiving module 200, data acquisition module 202, query module 204, result return module 206, etc. are all stored in the memory as program modules, and the processor executes the above-mentioned program modules stored in the memory to realize corresponding functions.
[0080] The processor includes a kernel, which retrieves the corresponding program module from the memory. The kernel may be one or more. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. The memory includes at least one memory chip.
[0081] According to an embodiment of the present application, an embodiment of a non-volatile storage medium is also provided. Optionally, in this embodiment, the non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute any of the above data search methods.
[0082] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group, and the non-volatile storage medium includes a stored program.
[0083] Optionally, when the program is running, the device where the non-volatile storage medium is located is controlled to perform the following functions: receiving a search request sent by a terminal, wherein the search request is used to request a search based on a social relationship network graph, the social relationship network graph includes multiple nodes and lines between nodes, the nodes represent social objects participating in social behaviors, and the length of the lines represents the association between the connected social objects; obtaining the search keywords and search ranges corresponding to the searched nodes from the search request; based on the search keywords and search ranges, querying the keyword dictionary and hop index dictionary corresponding to the social relationship network graph to obtain search results, wherein the keyword dictionary is used to store the correspondence between nodes and keywords, and the hop index dictionary is used to store the association between nodes; and returning the search results to the terminal.
[0084] According to an embodiment of the present application, an embodiment of a processor is also provided. Optionally, in this embodiment, the processor is used to run a program, wherein the program executes any one of the data search methods when it is run.
[0085] According to an embodiment of the present application, an embodiment of a computer program product is also provided. When executed on a data processing device, it is suitable for executing a program that initializes any one of the above-mentioned data search method steps.
[0086] Optionally, the above-mentioned computer program product, when executed on a data processing device, is suitable for executing a program initialized with the following method steps: receiving a search request sent by a terminal, wherein the search request is used to request a search based on a social relationship network graph, the social relationship network graph includes multiple nodes and lines between nodes, the nodes represent social objects participating in social behaviors, and the length of the lines represents the association between the connected social objects; obtaining the search keywords and search ranges corresponding to the searched nodes from the search request; based on the search keywords and search ranges, querying the keyword dictionary and hop index dictionary corresponding to the social relationship network graph to obtain search results, wherein the keyword dictionary is used to store the correspondence between nodes and keywords, and the hop index dictionary is used to store the association between nodes; and returning the search results to the terminal.
[0087] An embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: receiving a search request sent by a terminal, wherein the search request is used to request a search based on a social relationship network graph, wherein the social relationship network graph includes multiple nodes and lines between the nodes, wherein the nodes represent social objects participating in social behaviors, and the lengths of the lines represent the association between the connected social objects; obtaining keywords to be searched and a search range corresponding to the nodes to be searched from the search request; based on the keywords to be searched and the search range, querying a keyword dictionary and a hop index dictionary corresponding to the social relationship network graph to obtain search results, wherein the keyword dictionary is used to store the correspondence between nodes and keywords, and the hop index dictionary is used to store the association between nodes; and returning the search results to the terminal.
[0088] The above sequence of the embodiments of the present invention is for description only and does not represent the superiority or inferiority of the embodiments.
[0089] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0090] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the above modules can be a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, modules or indirect coupling or communication connection of modules, which can be electrical or other forms.
[0091] The modules described above as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0092] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of software functional modules.
[0093] If the above-mentioned integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a non-volatile storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present invention. The aforementioned non-volatile storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0094] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A data search method, characterized in that: include: A search request sent by a receiving terminal is used to request a search based on a social relationship network graph, wherein the social relationship network graph includes a plurality of nodes and lines between the nodes, the nodes represent social objects participating in the social behavior, and the length of the lines represents the degree of association between the connected social objects; Obtaining the to-be-searched keywords and the search range corresponding to the to-be-searched nodes from the search request; Based on the keywords to be searched and the search scope, querying a keyword dictionary and a hop index dictionary corresponding to the social relationship network graph to obtain search results, wherein the keyword dictionary is used to store the corresponding relationship between nodes and keywords, and the hop index dictionary is used to store the association between nodes; The search result is returned to the terminal.
2. The method according to claim 1, characterized in that The step of querying a keyword dictionary and a hop index dictionary corresponding to the social relationship network graph based on the keyword to be searched and the search scope to obtain search results includes: Based on the keyword to be searched, query the keyword dictionary to obtain nodes associated with the keyword to be searched; Based on the search range and the associated node, the hop index dictionary is queried to obtain the search result, wherein the search result is in an encrypted form.
3. The method according to claim 2, characterized in that When there are multiple associated nodes, querying the hop index dictionary based on the search range and the associated nodes to obtain the search result includes: Based on the hop index dictionary, obtaining the association degrees between a plurality of associated nodes and the node to be searched respectively; Based on the search range and the association degrees between the multiple associated nodes and the node to be searched, determining, from the multiple associated nodes, an associated node whose association degree with the node to be searched ranks first by a predetermined number of digits; The search result is obtained based on the associated nodes ranked in the first predetermined number of places.
4. The method according to claim 1, characterized in that: Before querying the keyword dictionary and the hop index dictionary corresponding to the social relationship network diagram based on the keyword to be searched and the search scope to obtain search results, the method further includes: Acquire multiple social objects and association information between the multiple social objects; The social relationship network graph is constructed by taking the multiple social objects as nodes and the association information between the multiple social objects as edges, wherein the multiple social objects correspond to the multiple nodes one by one.
5. The method according to claim 1, characterized in that Before querying the keyword dictionary and the hop index dictionary corresponding to the social relationship network diagram based on the keyword to be searched and the search scope to obtain search results, the method further includes: Using a first encryption algorithm to encrypt the multiple keywords respectively to obtain multiple first encrypted keywords; Using a second encryption algorithm to encrypt multiple nodes in the social relationship network graph respectively to obtain multiple encrypted nodes; An index relationship between the plurality of first encrypted keywords and the plurality of first encrypted nodes is established to obtain the keyword dictionary.
6. The method according to claim 5, characterized in that The first encryption algorithm is used to encrypt the multiple keywords respectively to obtain multiple first encrypted keywords, including: Using the first encryption algorithm to encrypt the multiple keywords respectively to obtain multiple second encrypted keywords; The first encryption algorithm is used to encrypt the plurality of second encrypted keywords to obtain the plurality of first encrypted keywords.
7. The method according to any one of claims 1 to 6, characterized in that: Before querying the keyword dictionary and the hop index dictionary corresponding to the social relationship network diagram based on the keyword to be searched and the search scope to obtain search results, the method further includes: Acquire the geographical distances between the multiple nodes and the social relationship scores between the multiple nodes, wherein the social relationship scores are used to characterize the closeness of the social relationship between the connected social objects; Performing weighted calculation based on the geographical distances between the multiple nodes and the corresponding social relationship scores to obtain the association degree between the multiple nodes; Using a second encryption algorithm to encrypt multiple nodes in the social relationship network graph respectively to obtain multiple encrypted nodes; Using a third encryption algorithm to encrypt the association degrees between the multiple nodes respectively, to obtain the encrypted association degrees between the multiple nodes; The hop index dictionary is constructed based on the multiple encryption nodes and the encryption association degrees between the multiple nodes.
8. The method according to any one of claims 1 to 6, characterized in that The node to be searched, the keyword to be searched and the search range are carried in the search request in the form of a search token, and the search token is obtained by the terminal encrypting the node to be searched, the keyword to be searched and the search range.
9. A data search device, characterized in that: include: A request receiving module, configured to receive a search request sent by a terminal, wherein the search request is used to request a search based on a social relationship network graph, wherein the social relationship network graph includes a plurality of nodes and lines between the nodes, wherein the nodes represent social objects participating in social behaviors, and the length of the lines represents the degree of association between the connected social objects; A data acquisition module, used to acquire the to-be-searched keywords and the search range corresponding to the to-be-searched nodes from the search request; A query module, configured to query a keyword dictionary and a hop index dictionary corresponding to the social relationship network graph based on the keyword to be searched and the search scope, to obtain search results, wherein the keyword dictionary is used to store the correspondence between nodes and keywords, and the hop index dictionary is used to store the association between nodes; The result returning module is used to return the search result to the terminal.
10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the data search method described in any one of claims 1 to 8.