Information retrieval method and apparatus, electronic device, and storage medium

By switching the logical fields and attribute condition relationships of node data in the initial retrieval graph data, the target retrieval graph data is generated, which solves the problem of low efficiency in attribute retrieval in the existing technology and realizes efficient and low-cost information retrieval.

CN115309926BActive Publication Date: 2025-12-30BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211059477.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-29
Publication Date
2025-12-30
Estimated Expiration
2042-08-29

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as high time and storage costs, difficulty in setting memory usage, and inability to perform complement operations during attribute retrieval, resulting in low retrieval efficiency.

Method used

By switching the relationship between logical fields and attribute condition information of node data in the initial retrieval graph data, target retrieval graph data is generated. The index structure of the storage end is used for efficient retrieval, avoiding logical NOT operations and reducing time and execution costs.

Benefits of technology

It achieves efficient attribute retrieval, reduces time and execution costs, makes full use of the storage index structure, and improves retrieval efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115309926B_ABST
    Figure CN115309926B_ABST
Patent Text Reader

Abstract

The present disclosure provides an information retrieval method, relates to the technical field of artificial intelligence, and particularly relates to the technical fields of computer vision, deep learning and natural language processing. The specific implementation scheme is: according to a retrieval sentence, initial retrieval graph data is determined, wherein the initial retrieval graph data comprises at least one node data, the node data comprises a value of a first logical field, a value of a second logical field and at least one attribute condition information; the value of the second logical field of target node data in the initial retrieval graph data and the attribute relationship of the attribute condition information are switched to obtain switched target node data, wherein the target node data is node data whose value of the first logical field is a first type first logical value; target retrieval graph data is determined according to the switched target node data and the initial retrieval graph data; and information retrieval is performed according to the target retrieval graph data. The present disclosure also provides an information retrieval device, an electronic device and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, and more particularly to the fields of computer vision, deep learning, and natural language processing. More specifically, this disclosure provides an information retrieval method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the development of artificial intelligence technology, it is possible to filter data from global data based on certain attribute conditions using attribute retrieval methods. To achieve attribute retrieval, some databases can configure corresponding index storage structures for attribute retrieval to accelerate the process. Summary of the Invention

[0003] This disclosure provides an information retrieval method, apparatus, device, and storage medium.

[0004] According to one aspect of this disclosure, an information retrieval method is provided, comprising: determining initial retrieval graph data based on a retrieval statement. For example, the initial retrieval graph data includes at least one node data, the node data including the value of a first logical field, the value of a second logical field, and at least one attribute condition information, the attribute condition information including an attribute field, an attribute relationship, and an attribute parameter value. Switching the value of the first logical field, the value of the second logical field, and the attribute relationship of the attribute condition information of the target node data in the initial retrieval graph data to obtain switched target node data. For example, the target node data is node data whose first logical field value is a first type of first logical value. Determining target retrieval graph data based on the switched target node data and the initial retrieval graph data. Performing information retrieval based on the target retrieval graph data.

[0005] According to another aspect of this disclosure, an information retrieval apparatus is provided, comprising: a first determining module, configured to determine initial retrieval graph data based on a retrieval statement. For example, the initial retrieval graph data includes at least one node data, the node data including the value of a first logical field, the value of a second logical field, and at least one attribute condition information, the attribute condition information including an attribute field, an attribute relationship, and an attribute parameter value. A switching module, configured to switch the value of the first logical field, the value of the second logical field, and the attribute relationship of the attribute condition information of target node data in the initial retrieval graph data, to obtain switched target node data. For example, the target node data is node data whose first logical field value is a first type of first logical value. A second determining module, configured to determine target retrieval graph data based on the switched target node data and the initial retrieval graph data. A retrieval module, configured to perform information retrieval based on the target retrieval graph data.

[0006] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method provided according to this disclosure.

[0007] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform the methods provided according to this disclosure.

[0008] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method provided according to this disclosure.

[0009] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0010] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0011] Figure 1 This is an exemplary system architecture diagram of an embodiment of the present disclosure in which information retrieval methods and apparatus can be applied;

[0012] Figure 2 This is a flowchart of an information retrieval method according to an embodiment of the present disclosure;

[0013] Figure 3A This is a schematic diagram of the first initial node according to an embodiment of the present disclosure;

[0014] Figure 3B This is a schematic diagram of the first initial node after processing according to an embodiment of the present disclosure;

[0015] Figure 3C This is a schematic diagram of the first node according to an embodiment of the present disclosure;

[0016] Figure 3D This is a schematic diagram of the second initial node according to an embodiment of the present disclosure;

[0017] Figure 3E This is a schematic diagram of the second initial node after processing according to an embodiment of the present disclosure;

[0018] Figure 3F This is a schematic diagram of the second node according to an embodiment of the present disclosure;

[0019] Figure 3G This is a schematic diagram of the third initial node according to an embodiment of the present disclosure;

[0020] Figure 3H This is a schematic diagram of the third initial node after processing according to an embodiment of the present disclosure;

[0021] Figure 3I This is a schematic diagram of an initial search diagram according to an embodiment of the present disclosure;

[0022] Figure 4A This is a schematic diagram of the second node after switching according to an embodiment of the present disclosure;

[0023] Figure 4B This is a schematic diagram of the first updated search map according to an embodiment of the present disclosure.

[0024] Figure 4C This is a schematic diagram of a target retrieval map according to an embodiment of the present disclosure;

[0025] Figure 5A This is a schematic diagram of a first node to be compressed according to an embodiment of the present disclosure;

[0026] Figure 5B This is a schematic diagram of a first compressed node according to an embodiment of the present disclosure;

[0027] Figure 6A This is a schematic diagram of a target retrieval map according to another embodiment of the present disclosure;

[0028] Figure 6B This is a schematic diagram of a target compression retrieval map according to another embodiment of the present disclosure;

[0029] Figure 7 This is a schematic diagram of a third node to be compressed according to another embodiment of the present disclosure;

[0030] Figure 8 This is an illustration showing the implementation effect of an information retrieval method according to an embodiment of the present disclosure;

[0031] Figure 9 This is a block diagram of an information retrieval device according to an embodiment of the present disclosure; and

[0032] Figure 10 This is a block diagram of an electronic device to which an information retrieval method can be applied, according to an embodiment of the present disclosure. Detailed Implementation

[0033] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0034] During attribute retrieval, various attribute conditions can be combined to achieve combined attribute retrieval. In actual execution, when retrieving based on a subset of attribute conditions within a combination of conditions, the index structure configured by the database for those conditions can be utilized. If each attribute condition can leverage the database's configured index structure, this structure can be fully utilized, significantly improving the efficiency of attribute retrieval.

[0035] In some embodiments, for one or more attribute conditions in a combination of attribute conditions, the index structure configured for the attribute conditions in the database can be used for retrieval to obtain initial search results. Then, attribute filtering is performed based on other attribute conditions in the combination to obtain the final search results. This embodiment can reduce the development cost of attribute retrieval and can be applied to smaller databases.

[0036] In some embodiments, attribute filtering can also be used to filter out data that does not meet certain attribute conditions from the global data, thereby obtaining data that does meet the conditions. Attribute filtering requires retrieving a large amount of data related to the attribute conditions from storage, which incurs significant time costs. Furthermore, a large amount of memory space needs to be allocated for this data. To reduce storage costs, this data can be packaged and compressed during storage. Decompression is then required when reading this data, further increasing execution costs.

[0037] In some embodiments, attribute conditions can be stored in memory to implement attribute retrieval. Increasing memory usage reduces time costs. However, in this case, accurately setting memory usage is difficult. If the memory usage limit is set too high, system resources will be heavily consumed; if the memory usage limit is set too low, cached information will need to be evicted, increasing both development and execution costs.

[0038] In some embodiments, the storage end for storing large amounts of data and the processing end for performing specific retrieval operations can be deployed on different devices. The processing end requests data from the storage end based on the parsing results of the retrieval statement. Multiple attribute condition information can be determined from the parsing results of the retrieval statement. During the parsing process, initial retrieval results can be obtained from the storage end based on one or more attribute condition information, and then the processing end uses other attribute condition information to determine the target retrieval result from the initial retrieval result. During the process of determining the target retrieval result from the initial retrieval result, if multiple attribute condition information contains attribute condition information corresponding to a first type of first logical value (e.g., logical "NOT"), a complement set operation can be performed. However, after obtaining the initial retrieval result from the storage end based on one or more attribute conditions, the initial retrieval result does not contain global data. In this case, a complement set operation may not be possible.

[0039] Figure 1 This is a schematic diagram of an exemplary system architecture for applying information retrieval methods and apparatus according to an embodiment of this disclosure. It should be noted that... Figure 1 The examples shown are merely examples of system architectures that can be applied to the embodiments of this disclosure, in order to help those skilled in the art understand the technical content of this disclosure, but do not mean that the embodiments of this disclosure cannot be used in other devices, systems, environments or scenarios.

[0040] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a storage terminal 101 and a processing terminal 102. A network 103 serves as a medium for providing a communication link between the storage terminal 101 and the processing terminal 102. The network 103 may include various connection types, such as wired and / or wireless communication links, etc.

[0041] Users can store large amounts of data on storage terminal 101. Users can also input search queries on processing terminal 102, which will then parse the queries. Storage terminal 101 and processing terminal 102 can be deployed on different devices.

[0042] Processing end 102 can request data from storage end based on the parsing results of the search statement. Multiple attribute condition information can be determined from the parsing results of the search statement. During the parsing process, initial search results can be obtained from storage end 101 based on one or more attribute condition information, and then processing end 102 can determine the target search result from the initial search results using other attribute condition information. Processing end 102 can transform attribute condition information related to the first type of first logical value.

[0043] Figure 2 This is a flowchart of an information retrieval method according to an embodiment of the present disclosure.

[0044] like Figure 2As shown, the method 200 may include operations S210 to S240.

[0045] In operation S210, the initial retrieval graph data is determined based on the retrieval statement.

[0046] In this embodiment of the disclosure, the initial retrieval graph data includes at least one node data.

[0047] In this embodiment of the disclosure, the node data includes a first logical value of a first logical field, a second logical value of a second logical field, and at least one attribute condition information.

[0048] For example, the value of the first logical field could be a first-class first logical value. First-class first logical values ​​are used to indicate that a clause in a search statement contains a logical operator related to the logical "NOT". In one example, a first-class first logical value could be "True".

[0049] For example, the value of the first logical field could be a second type first logical value. A second type first logical value is used to indicate that another clause of the retrieval statement does not contain a logical operator related to the logical "NOT". In one example, a second type first logical value could be "False".

[0050] For example, the value of the second logical field can have at least two categories.

[0051] For example, a first-class second logical value can correspond to the logical operator "AND". In one example, a first-class second logical value is associated with two attribute conditions. Based on the two attribute conditions, two search results can be determined. Based on this first-class second logical value, the intersection of these two search results can be obtained.

[0052] For example, a second type of second logical value can correspond to a logical operator related to the logical "OR" (or OR) operator. In one example, a second type of second logical value is associated with two attribute conditions. Based on the two attribute conditions, two search results can be determined. Based on this second type of second logical value, the union of these two search results can be taken.

[0053] In this embodiment of the disclosure, the attribute condition information includes attribute fields, attribute relationships, and attribute parameter values.

[0054] For example, attribute relationships can include at least two categories. In one example, the attribute relationship for one category can be "equal to" (==), and the attribute relationship for the other category can be "not equal to" (!=). In another example, for an attribute condition, the attribute field can be "name", the attribute relationship can be "equal to", and the attribute parameter value can be "Zhang San". Based on this attribute condition, a subset of data in the stored dataset that contains "name is Zhang San" can be retrieved as the search result corresponding to this attribute condition.

[0055] In operation S220, the values ​​of the first logical field, the second logical field, and the attribute relationships of the attribute condition information of the target node data in the initial retrieval graph data are switched to obtain the switched target node data.

[0056] In this embodiment of the disclosure, in the initial retrieval graph data, the target node data is node data whose first logical field value is a first type of first logical value.

[0057] For example, you can iterate through the node data in the initial retrieval graph. If the value of the first logical field in a node is a first-class first logical value, then that node can be used as the target node data.

[0058] For example, if the value of the second logical field of the target node data is a first type second logical value, the value of the second logical field of the target node data can be switched to a second type second logical value.

[0059] For example, the value of the first logical field can be switched from the first type of first logical value to the second type of first logical value.

[0060] For example, if the attribute relationship of the attribute condition information in the target node data is equal to "==", the attribute relationship of the attribute condition information can be switched to not equal to "!=". In one example, for an attribute condition information, the attribute field can be "name", the attribute relationship can be equal to "==", and the attribute parameter value can be "Zhang San". The attribute relationship of the switched attribute condition information can be not equal to "!=". Based on the switched attribute condition information, the data subset of "name is not Zhang San" in the stored dataset can be obtained as the search result corresponding to the switched attribute condition information.

[0061] In operation S230, the target retrieval graph data is determined based on the target node data after the switch and the initial retrieval graph data.

[0062] For example, the target node data in the initial retrieval graph data can be replaced with the switched target node data in order to determine the target retrieval graph data.

[0063] In operation S240, information retrieval is performed based on the target retrieval map data.

[0064] For example, data can be retrieved from storage based on target retrieval graph data in order to perform information retrieval.

[0065] In this embodiment of the disclosure, the value of the first logical field in each node data of the target retrieval graph data can be a second type of first logical value. Therefore, when retrieving data from the storage end using the target retrieval graph data, the index storage structure configured for attribute retrieval in the storage end's database can be fully utilized, avoiding logically irrelevant operations, thus enabling efficient attribute retrieval and reducing the time and execution costs of attribute retrieval.

[0066] The following will describe in detail some implementation methods for determining the initial retrieval graph data with reference to relevant embodiments.

[0067] In some embodiments, determining the initial search graph data based on the search statement includes: parsing the search statement to obtain N node data, where N is an integer greater than or equal to 1; and determining the initial search graph data based on the N node data. The following will combine... Figures 3A to 3I Please provide a detailed explanation.

[0068] Figure 3A This is a schematic diagram of the first initial node according to an embodiment of the present disclosure.

[0069] The search query Sentexe_1 obtained by the processing end can be, for example, "and(has('Name', 'EQ', 'Zhang San'), not(or(has('Nationality', 'EQ', 'XYZ'), not(has('Gender', 'EQ', 'Male').has('Occupation', 'EQ', 'Actor'))))". For example, EQ can indicate that the attribute relationship is equal to "==".

[0070] When parsing the search query Sentecne_1, the first initial node data can be created. The first initial node data corresponds to the first initial node 3101, as shown below. Figure 3A As shown. The first initial node data includes a first logical field, a second logical field, an attribute condition field, and a child node field. For the first initial node data, the value of the first logical field is the default second type first logical value "False", the value of the second logical field is empty, the value of the attribute condition field is also empty, and the value of the child node field is also empty.

[0071] Figure 3B This is a schematic diagram of the first initial node after processing according to an embodiment of the present disclosure.

[0072] In this embodiment of the disclosure, parsing the retrieval statement to obtain N node data includes: in response to parsing the second logical value from the retrieval statement and the value of the second logical field in the nth initial node data being empty, adding the second logical value to the nth initial node data to obtain the nth node data, where n is an integer less than N and n is an integer greater than or equal to 1.

[0073] For example, the first type of second logical value, "and," can be parsed from the search statement Sentexe_1. Furthermore, since the second logical field value in the first initial node data corresponding to the first initial node 310_1 is null, this first type of second logical value can be added to the first initial node data to obtain the processed first initial node data. The processed first initial node data corresponds to the processed first initial node 310_2, as shown below. Figure 3B As shown.

[0074] Figure 3C This is a schematic diagram of the first node according to an embodiment of the present disclosure.

[0075] In this embodiment of the disclosure, parsing the retrieval statement to obtain N node data includes: in response to parsing attribute condition information from the retrieval statement, adding the attribute condition information to the h-th initial node data to obtain the h-th node data.

[0076] For example, h is an integer less than N, and h is an integer greater than or equal to 1. In this embodiment, h = 1.

[0077] For example, continuing to parse the search query Sentecne_1, we can extract the identifier "has" corresponding to the attribute condition information, and also extract the attribute condition information: "Name == Zhang San". Furthermore, the value of the second logical field in the processed first initial node data is the first type of second logical value "and". Adding the attribute condition information "Name == Zhang San" to the processed first initial node data yields the first node data. The first node data corresponds to the first node 310, as shown below. Figure 3C As shown.

[0078] Figure 3D This is a schematic diagram of the second initial node according to an embodiment of the present disclosure.

[0079] In this embodiment of the disclosure, parsing the retrieval statement to obtain N node data includes: in response to the first type of first logical value being parsed from the retrieval statement and the value of the second logical field of the j-th initial node data not being null, generating the (j+1)-th initial node data.

[0080] For example, j is an integer less than N, and j is an integer greater than or equal to 1. In this embodiment, j = n = 1.

[0081] For example, continuing to parse the search statement Sentecne_1, we can extract the first type of first logical value "not" from it. Furthermore, as mentioned above, the value of the second logical field in the first node data is the first type of second logical value, which is not null. This allows us to generate the second initial node data. The second initial node data corresponds to the second initial node 3201, as shown below. Figure 3D As shown.

[0082] In this embodiment of the disclosure, parsing the retrieval statement to obtain N node data further includes: determining the association between the j-th node data and the (j+1)-th initial node data.

[0083] For example, the j-th node data is obtained based on the j-th initial node data, and the j-th node data is the parent node data of the (j+1)-th initial node data.

[0084] For example, the first node data is derived from the first initial node data. A relationship can be established between the first node data and the second initial node data. The first node data can serve as the parent node data of the second initial node data. The second initial node data can serve as the child node data of the first node data. After establishing the relationship, the values ​​of the child node fields in the first node data can be set to non-null values. The relationship between the two is... Figure 3D The edge E312 shown corresponds to this.

[0085] Figure 3E This is a schematic diagram of the second initial node after processing according to an embodiment of the present disclosure.

[0086] In this embodiment of the disclosure, parsing the retrieval statement to obtain N node data further includes: setting the value of the first logical field of the (j+1)th initial node data to the first type of first logical value to obtain the (j+1)th node data.

[0087] For example, the value of the first logical field of the second initial node data can be set to the first logical value of the first type, "True".

[0088] For example, in response to the second type of second logical value "or" being parsed from the retrieval statement Sentex_1 and the second logical field in the second initial node data being null, the second type of second logical value "or" is added to the second initial node data, resulting in the processed second initial node data. The processed second initial node data corresponds to the processed second initial node 3202. The processed second initial node 3202 is as follows: Figure 3E As shown.

[0089] Figure 3F This is a schematic diagram of the second node according to an embodiment of the present disclosure.

[0090] For example, continuing to parse the search query Sentecne_1, we can extract the identifier "has" related to the attribute condition information, as well as another attribute condition: "nationality == XYZ". Furthermore, the value of the second logical field in the processed second initial node data is the second type of second logical value "or". Adding the attribute condition "nationality == XYZ" to the processed second initial node data yields the second node data. The second node data corresponds to the second node 320, as shown below. Figure 3F As shown.

[0091] Furthermore, in this embodiment of the disclosure, the j-th node data can be the parent node data of the (j+1)-th node data. For example, the 1st node data can be the parent node data of the 2nd node data.

[0092] Figure 3G This is a schematic diagram of the third initial node according to an embodiment of the present disclosure.

[0093] For example, continuing to parse the search statement Sentecne_1, another first-class first logical value "not" can be extracted from it. Furthermore, as mentioned above, the value of the second logical field in the second node data is a second-class second logical value, which is not null. A third initial node data can then be generated. The third initial node data corresponds to the third initial node 3301, as shown below. Figure 3G As shown.

[0094] For example, the second node data is derived from the second initial node data. A relationship can be established between the second node data and the third initial node data. The second node data can serve as the parent node data of the third initial node data. The third initial node data can serve as the child node data of the second node data. After establishing the relationship, the values ​​of the child node fields in the second node data can be set to non-null values. The relationship between the two is... Figure 3G The edge E323 shown corresponds to this.

[0095] Figure 3H This is a schematic diagram of the third initial node after processing according to an embodiment of the present disclosure.

[0096] In this embodiment of the disclosure, parsing the retrieval statement to obtain N node data further includes: in response to parsing attribute condition information from the retrieval statement and determining that the second logical field of the g-th initial node data is null, setting the value of the second logical field of the h-th initial node data to a first type of second logical value.

[0097] For example, g is an integer less than N, g is an integer greater than or equal to 1. In this embodiment, g = 3.

[0098] For example, by continuing to parse the search query Sentecne_1, we can extract the value "has" that corresponds to the attribute condition information from the search query Sentecne_1, as well as two other attribute condition information: "gender == male" and "occupation == actor".

[0099] For example, if the second logical field of the third initial node data is null, the value of the second logical field in the third initial node data can be set to the first type of second logical value "and", resulting in the processed third initial node data. The processed third initial node data corresponds to the processed third initial node 330_2. The processed third initial node 330_2 is as follows: Figure 3H As shown.

[0100] Figure 3I This is a schematic diagram of an initial search diagram according to an embodiment of the present disclosure.

[0101] For example, adding the two attribute conditions "Gender == Male" and "Occupation == Actor" to the processed third initial node data will yield the third node data. The third node data corresponds to the third node 330, as shown below. Figure 3I As shown. Thus, the parsing of the search query is complete, yielding three node data points. Based on these three node data points, the initial search graph data is obtained. The initial search graph corresponding to the initial search graph data is shown below. Figure 3I As shown.

[0102] It is understood that the foregoing has described in detail some implementation methods for obtaining data from N nodes in conjunction with relevant embodiments, but this disclosure is not limited thereto. Further detailed description will follow with reference to relevant embodiments.

[0103] In some embodiments, parsing a retrieval statement to obtain N node data includes: generating (m+1)th initial node data in response to the second logical value being parsed from the retrieval statement and the value of the second logical field of the m-th initial node data not being null; adding the second logical value to the (m+1)-th initial node data to obtain the (m+1)-th node data; and determining the association relationship between the m-th node data and the (m+1)-th node data.

[0104] For example, m is an integer less than N, and m is an integer greater than or equal to 1;

[0105] For example, the data of the m-th node is obtained from the data of the n-th initial node, and the data of the m-th node is the parent node data of the (m+1)-th node.

[0106] In one example, parsing the search statement Sentecne_1' also yields the first node data mentioned above. Continuing to parse the search statement Sentecne_1', if the first type of second logical value "and" is extracted, a second initial node data can be created. The association between the first node data and the second initial node data is then established. The first node data can serve as the parent node data of the second initial node data in this embodiment. After obtaining the second node data from the second initial node data, the first node data can also serve as the parent node data of the second node data in this embodiment. In this example, m = 1.

[0107] In some embodiments, parsing a retrieval statement to obtain N node data includes: in response to parsing a first type of first logical value from the retrieval statement and the value of the second logical field in the i-th initial node data being null, setting the value of the first logical field of the i-th initial node data to the first type of first logical value to obtain the i-th node data.

[0108] For example, i is an integer less than N, and i is an integer greater than or equal to 1.

[0109] For example, when parsing the search query Sentecne_2, the first initial node data can be created. At this time, for the first initial node data, the value of the first logical field is the default second type first logical value "False", the value of the second logical field is empty, the value of the attribute condition field is also empty, and the value of the child node field is also empty.

[0110] If we continue parsing the search statement Sentecne_2, we can extract the first type of first logical value "True". As mentioned above, the value of the second logical field in the first initial node data is null. We can set the value of the first logical field of the first initial node data to the first type of first logical value "True".

[0111] It is understood that the above has described in detail some implementation methods for determining the initial retrieval graph data. The following will further describe in detail some implementation methods for switching the values ​​of the first logical field, the second logical field, and the attribute relationships of attribute condition information in the initial retrieval graph data, in conjunction with relevant embodiments.

[0112] Figure 4A This is a schematic diagram of the second node after switching according to an embodiment of the present disclosure.

[0113] It is understood that the detailed descriptions of the first node 310, the third node 330, edge E312, and edge E323 described above can also be applied to the first node 410, the third node 430, edge E412, and edge E423 in this embodiment.

[0114] The value of the first logical field of the second node is the first logical value of the first type, "True". The second node can be used as the target node. The data of the second node corresponding to the second node can be the data of the target node. It is understood that the detailed description of the second node 320 described above can also be applied to the second node in this embodiment, and will not be repeated here.

[0115] In this embodiment of the disclosure, in response to determining that target node data exists in the initial search graph, the values ​​of the first logical field, the second logical field, and the attribute relationships of the attribute condition information of the target node data can be switched to obtain the first switched target node data.

[0116] For example, the value of the first logical field of the target node's data can be switched to a second type of first logical value. As another example, the value of the first logical field of the second node's data, "True", can be switched to a second type of first logical value, "False".

[0117] For example, the value of the second logical field of the target node data can be changed from a second logical value of one category to a second logical value of another category. As another example, if the value of the second logical field of the second node data is the second logical value of the second category "or", the value of the second logical field of the second node data can be changed to the first logical value "and".

[0118] For example, the attribute relationship of the target node data's attribute condition information can be switched from an attribute relationship of one category to an attribute relationship of another category. Another example: in the second node data, the attribute condition information is "nationality == XYZ", and its attribute relationship is equal to "==". This attribute relationship can be switched to not equal to "!=". The switched attribute condition information can be "nationality != XYZ". Thus, the switched second node data can be obtained. The switched second node data and... Figure 4AThe second node 420' after the switch is shown.

[0119] Figure 4B This is a schematic diagram of the first updated search map according to an embodiment of the present disclosure.

[0120] In this embodiment of the disclosure, when the target node data is a parent node data in the initial retrieval graph data, the initial retrieval graph data includes initial retrieval subgraph data related to the target node data, and the initial retrieval subgraph data includes at least one node data. For example, the second node data can be a target node data. The second node data is the parent node data of the third node data. The relationship between the two is as follows: Figure 4A Edge E423 is shown. The initial retrieval subgraph data associated with the second node data may include the third node data. The third node data and Figure 4A The third node, 430, is shown.

[0121] In this embodiment of the disclosure, switching the values ​​of the first logical field, the second logical field, and the attribute relationships of the attribute condition information of the target node data in the initial retrieval graph data may include traversing the initial retrieval subgraph related to the target node data. For example, a pre-order traversal can be used to traverse the initial retrieval subgraph data of the second node data.

[0122] In this embodiment of the disclosure, in response to determining that there is second target child node data in the initial search subgraph, the value of the first logical field in the second target child node data is switched to a second type of first logical value. Traversal of the initial search subgraph is then stopped.

[0123] For example, the value of the first logical field in the second target child node data is a first-class first logical value. As another example, as mentioned above, the initial retrieval subgraph data includes the third node data. The value of the first logical field in the third node data is the first-class first logical value "True". The third node data can be used as the second target child node data. The value of the first logical field in the third node data can be switched to the second-class first logical value "False", resulting in the switched third node data. Then, traversing the initial retrieval subgraph data stops. The switched third node data and... Figure 4B The third node 430' after the switch corresponds to this. Based on the data of the second and third nodes after the switch, the retrieval graph data after the first update can be obtained.

[0124] In this embodiment of the disclosure, in response to determining that there is no target node data in the search graph data after the first update, the search graph data after the first update is determined as the target search graph data. For example, the search graph data after the first update can be compared with... Figure 4BThe search graph shown corresponds to the first update.

[0125] Figure 4C This is a schematic diagram of a target retrieval map according to an embodiment of the present disclosure.

[0126] In this embodiment of the disclosure, in response to determining that no target node data exists in the search graph data after the first update, the search graph data after the first update can be determined as the target search graph data. For example, if no target node data exists, the value of the first logical field in each node data is the second type first logical value "False". The first logical field and the value of the first logical field of the node data in the search graph data after the first update can be deleted to obtain processed search graph data. The processed search graph data is used as the target search graph data. The target search graph corresponding to the target search graph data is as follows: Figure 4C As shown, in this target retrieval graph, each node includes the value of the second logical field and the value of the attribute condition field (at least one attribute condition information).

[0127] Understandable. Figures 4A to 4C The present disclosure describes in detail the methods for obtaining the target node data after the handover. However, the present disclosure is not limited to this, and other methods may also be used to obtain the target node data after the handover.

[0128] In this embodiment of the disclosure, switching the value of the first logical field, the value of the second logical field, and the attribute relationship of the attribute condition information of the target node data in the initial retrieval graph data may include: in response to determining that there is a first target child node data in the initial retrieval subgraph, switching the value of the second logical field and the attribute relationship of the attribute condition information in the first target child node data.

[0129] For example, the value of the first logical field in the data of the first target child node is the first logical value of the second type.

[0130] For example, with Figure 4A Unlike the third node 430 shown, in this embodiment, the value of the first logical field of the third node's data is the second type of first logical value "False". Furthermore, compared to... Figure 4A Similar to the third node 430 shown, in this embodiment, the value of the attribute condition field in the data of the third node also includes two attribute condition information: "gender == male" and "occupation == actor". The value of the second logical field in the data of the third node is the first type of second logical value "and".

[0131] For example, in this embodiment, the value of the first logical field of the third node data is the second type of first logical value "False", and the third node data can be used as the first target child node data. The value of the second logical field in the third node data can be switched to the second type of second logical value "or". Furthermore, the attribute relationship between the two attribute condition information in the third node data is equal to "==", which can be switched to not equal to "!=". The two switched attribute condition information can be "Gender != Male" and "Occupation != Actor". Thus, the switched third node data can be obtained.

[0132] Furthermore, in this embodiment of the disclosure, switching the values ​​of the first logical field, the second logical field, and the attribute relationships of the attribute condition information of the target node data in the initial retrieval graph data to obtain the switched target node data may further include: in response to determining that there is target node data in the retrieval graph data after the (k-1)th update, switching the values ​​of the first logical field, the second logical field, and the attribute relationships of the attribute condition information of the target node data to obtain the kth switched target node data.

[0133] For example, k is an integer less than or equal to K, K is an integer greater than 1, and k is an integer greater than 1.

[0134] For example, besides Figure 4B In addition to the three nodes shown, the retrieval graph after the first update in this embodiment may also include a fourth node. The fourth node is connected to the third node by an edge. The data of the fourth node is the child node data of the data of the third node. The value of the first logical field of the fourth node data is the first type first logical value "True".

[0135] As mentioned above, the initial retrieval subgraph data includes the third node data. The value of the first logical field in the third node data is the first type of first logical value, "True". This third node data can be used as the second target child node data. The value of the first logical field in the third node data can be changed to the second type of first logical value, "False", to obtain the changed third node data. Next, traversal of the initial retrieval subgraph data is stopped. Based on the changed second and third node data, the retrieval graph data after the first update can be obtained.

[0136] In this embodiment, the retrieval graph data after the first update also includes a fourth node data. The value of the first logical field of the fourth node data is the first type of first logical value "True", which can be used as target node data. By switching the values ​​of the first logical field, the second logical field, and the attribute relationships of the attribute condition information of the fourth node data, the switched fourth node data is obtained. The switched fourth node data can be used as the second switched target data.

[0137] For example, determining the target retrieval graph data based on the switched target node data and the initial retrieval graph data includes: obtaining the retrieval graph data after the kth switch based on the kth switched target node data. In this embodiment, the retrieval graph data after the second update can be obtained based on the switched 4th node data and the retrieval graph data after the first update.

[0138] For example, determining the target retrieval graph data based on the switched target node data and the initial retrieval graph data includes: in response to determining that the target node data does not exist in the retrieval graph data after the Kth update, determining the retrieval graph data after the Kth update as the target retrieval graph data. For example, determining the retrieval graph data after the Kth update as the target retrieval graph data includes: deleting the first logical field of the node data and the value of the first logical field from the retrieval graph data after the Kth update to obtain the processed retrieval graph data; and determining the processed retrieval graph data as the target retrieval graph data.

[0139] In this embodiment, after the second update, the values ​​of the first logical fields in each node's data are all the second type of first logical value "False". It can be determined that the second-updated retrieval graph data does not contain the target node data. Therefore, the second-updated retrieval graph data can be identified as the target retrieval graph data. In one example, the first logical fields and their values ​​can be deleted from the node data in the second-updated retrieval graph data to obtain processed retrieval graph data. This processed retrieval graph data is then used as the target retrieval graph data.

[0140] In some embodiments, attribute relationships may include a first type of attribute relationship, a second type of attribute relationship, a third type of attribute relationship, a fourth type of attribute relationship, a fifth type of attribute relationship, and a sixth type of attribute relationship. For example, a first type of attribute relationship can be equal to “==". A second type of attribute relationship can be not equal to “!=". The first and second types of attribute relationships correspond to each other. Another example is a third type of attribute relationship, which can be less than “<”. A fourth type of attribute relationship can be greater than or equal to “≥”. The third and fourth types of attribute relationships correspond to each other. Yet another example is a fifth type of attribute relationship, which can be greater than ">”. A sixth type of attribute relationship can be less than or equal to “≤”. The fifth and sixth types of attribute relationships correspond to each other.

[0141] In some embodiments, switching the attribute relationship of the attribute condition information of the target node data may include switching to an attribute relationship of the category corresponding to the current category's attribute relationship. For example, the attribute relationship of one attribute condition information of the target node data is a third-category attribute relationship. When switching the attribute relationship of the attribute condition information of the target node data, the attribute relationship of that attribute condition information can be switched to a fourth-category attribute relationship.

[0142] As can be understood, the above text has provided a detailed explanation of the methods for determining target retrieval graph data. The following text will provide a detailed explanation of some implementation methods for information retrieval using target retrieval graph data, in conjunction with relevant embodiments.

[0143] In some embodiments, information retrieval based on target retrieval graph data includes: compressing the target retrieval graph data to obtain target compressed retrieval graph data; and performing information retrieval based on the target compressed retrieval graph data.

[0144] For example, target retrieval graph data can be compressed in various ways. Another example is retrieving data from the storage terminal based on the first node data in the compressed target retrieval graph data for information retrieval.

[0145] For example, attribute retrieval is performed by traversing each node in the target retrieval graph. The fewer nodes in the retrieval graph, the lower the execution overhead. Through embodiments of this disclosure, compressing the target retrieval graph data can optimize the retrieval graph and reduce execution costs.

[0146] The following will describe in detail some implementation methods for compressing target retrieval graph data with reference to relevant embodiments.

[0147] In some embodiments, the target retrieval graph data includes first node data to be compressed, the value of the second logical field of the first node data to be compressed is a first type of second logical value, and there are multiple first target attribute condition information in the first node data to be compressed, and the attribute fields and attribute relationships of the multiple first target attribute condition information are consistent with each other.

[0148] In some embodiments, compressing target retrieval graph data to obtain target compressed retrieval graph data includes: in response to determining that the target retrieval graph data contains first node data to be compressed, merging multiple first target attribute condition information to obtain first compressed attribute condition information; obtaining first compressed node data based on the first compressed attribute condition information; and obtaining target compressed retrieval graph data based on the first compressed node data.

[0149] In this embodiment of the disclosure, the attribute fields and attribute relationships of the first compressed attribute condition information are consistent with the attribute fields and attribute relationships of the multiple first target attribute condition information, and the attribute parameter values ​​of the first compressed attribute condition information are extreme values ​​of the attribute parameter values ​​of the multiple first target attribute condition information.

[0150] The following will combine Figure 5A and Figure 5B Please provide a detailed explanation.

[0151] Figure 5A This is a schematic diagram of a first node to be compressed according to an embodiment of the present disclosure. Figure 5B This is a schematic diagram of a first compressed node according to an embodiment of the present disclosure.

[0152] like Figure 5A As shown, the first node to be compressed 540 includes a second logical field and an attribute condition field. The first node to be compressed 540 corresponds to the first node data to be compressed. The value of the second logical field of the first node data to be compressed is the first type of second logical value "and". The two attribute condition information present in the first node data to be compressed are "A>10" and "A>11". The attribute field of these two attribute condition information is "A", and the attribute relationship is ">", which can be used as the first target attribute condition information respectively.

[0153] For example, in response to determining that the target retrieval graph data contains a first node data to be compressed, the two first target attribute condition information can be merged to obtain the first compressed attribute condition information. The attribute field of the first compressed attribute condition information is "A", the attribute relationship is ">", and the attribute parameter value is the maximum value of the attribute parameter values ​​of multiple first target attribute condition information, "11". The first compressed attribute condition information can be "A>11".

[0154] Based on the first compression attribute condition information and the first node data to be compressed, the first compressed node data can be obtained. The first compressed node 540' corresponding to the first compressed node data is shown below. Figure 5B As shown, by replacing the data of the first node to be compressed with the data of the first compressed node, the target compressed retrieval graph data can be obtained.

[0155] It is understood that, in another embodiment, with Figure 5A The data of the first node to be compressed differs from the data of the first node to be compressed in this embodiment. In this embodiment, the two first target attribute condition information in the first node to be compressed data can also be "A < 10" and "A < 11" respectively. Therefore, in this embodiment, the attribute field of the first compression attribute condition information is "A", the attribute relationship is "<", and the attribute parameter value is the minimum value of the attribute parameter values ​​of multiple first target attribute condition information, "10". The first compression attribute condition information can be "A < 10".

[0156] In some embodiments, the target retrieval graph data includes multiple second node data to be compressed, each of the multiple second node data to be compressed contains second target attribute condition information, and each of the multiple second node data to be compressed is a child node data of a node data in the target retrieval graph data.

[0157] In some embodiments, compressing the target retrieval graph data to obtain compressed target retrieval graph data includes: in response to determining that the target retrieval graph data contains multiple second nodes to be compressed, adding second target attribute condition information to the parent node data of the multiple second nodes to be compressed, obtaining processed parent node data. Deleting the second target attribute condition information from the multiple second nodes to be compressed, obtaining second compressed node data. Obtaining the compressed target retrieval graph data based on the second compressed node data and the processed parent node data. The following will combine... Figure 6A and Figure 6B Please provide a detailed explanation.

[0158] Figure 6A This is a schematic diagram of a target retrieval map according to another embodiment of the present disclosure. Figure 6B This is a schematic diagram of a target compression retrieval map according to another embodiment of the present disclosure.

[0159] like Figure 6A As shown, the target retrieval graph includes a second node to be compressed 651, a second node to be compressed 652, and their parent node 650. The two second nodes to be compressed, corresponding to the second nodes to be compressed 651 and 652 respectively, both share the same attribute condition information: "A is greater than 11". This attribute condition information can be used as the second target attribute condition information.

[0160] The second target attribute condition information can be added to the parent node data corresponding to parent node 650 to obtain the processed parent node data. The processed parent node data corresponds to... Figure 6B The parent node after processing is 650'.

[0161] Alternatively, the second target attribute condition information can be deleted from the data of the two second nodes to be compressed, corresponding to the second nodes to be compressed 651 and 652, respectively, to obtain two second compressed node data. The two second compressed node data correspond to... Figure 6B The second compressed node 651' and the second compressed node 652' in the middle.

[0162] In some embodiments, the target retrieval graph data includes third node data to be compressed, the value of the second logical field of the third node data to be compressed is a second type of second logical value, the third node data to be compressed includes at least two third target attribute condition information, and the at least two retrieval results corresponding to the at least two third target attribute condition information are complementary sets of each other.

[0163] In some embodiments, compressing the target retrieval graph data to obtain compressed target retrieval graph data includes: in response to determining that the target retrieval graph data contains third node data to be compressed, deleting at least two third target attribute condition information to obtain third compressed node data. Based on the third compressed node data, the compressed target retrieval graph data is obtained.

[0164] In this embodiment of the disclosure, the attribute fields and attribute parameter values ​​of at least two third target attribute condition information are consistent with each other, and the categories of the attribute relationships of at least two third target attribute condition information are inconsistent. The following will combine... Figure 7 Please provide a detailed explanation.

[0165] Figure 7 This is a schematic diagram of a third node to be compressed according to another embodiment of the present disclosure.

[0166] The value of the second logical field in the data of the third node to be compressed, corresponding to the third node 760, is the second type of second logical value "or". The data of the third node to be compressed also includes two attribute condition information: "A>10" and "A≤10". The attribute field for both "A>10" and "A≤10" is "A". The attribute parameter value for both "A>10" and "A≤10" is "10". Their attribute relationships are inconsistent. The search result R1 for the attribute condition "A>10" and the search result R_2 for the attribute condition "A≤10" are complementary. These two attribute condition information can be used as the third target attribute condition information.

[0167] For example, based on the value "or" of the second logical field, the union of search results R1 and R2 can be calculated, thus obtaining the result of all A. These two third target attribute conditions can be deleted to obtain the third compressed node data.

[0168] In some embodiments, the target retrieval graph data includes fourth node data to be compressed, the value of the second logical field of the fourth node data to be compressed is a first type of second logical value, the fourth node data to be compressed includes at least two fourth target attribute condition information, and the intersection of at least two retrieval results corresponding to the at least two fourth target attribute condition information is an empty set.

[0169] In some embodiments, compressing the target retrieval graph data to obtain target compressed retrieval graph data includes: in response to the existence of a fourth node data to be compressed in the target retrieval graph data, deleting the fourth node data to be compressed and the target retrieval subgraph data associated with the fourth node to be compressed, thereby obtaining the target compressed retrieval graph data.

[0170] For example, the difference between the fourth node data to be compressed and the third node data to be compressed described above is that the value of the second logical field in the fourth node data is the first type of second logical value "and". The fourth node data to be compressed can also include two attribute condition information. These two attribute condition information can be "A>10" and "A≤10" respectively. The attribute field of both attribute condition information "A>10" and attribute condition information "A≤10" is "A". The attribute parameter value of both attribute condition information "A>10" and attribute condition information "A≤10" is "10". The attribute relationship between the two is inconsistent. The intersection between the search result R1' of attribute condition information "A>10" and the search result R_2' of attribute condition information "A≤10" is an empty set. These two attribute condition information can be used as the fourth target attribute condition information respectively.

[0171] For example, based on the value "and" of the second logical field, the intersection of search results R_1' and R_2' can be found, resulting in an empty set. The data of the fourth node to be compressed can be deleted, as can the child nodes of the fourth node to be compressed.

[0172] Figure 8 This is an illustration showing the implementation effect of an information retrieval method according to an embodiment of the present disclosure.

[0173] like Figure 8 As shown, for the same search query, the time cost required by the method provided in this disclosure is significantly less than that required by the attribute filtering method when the entity size is different.

[0174] For example, with 10,000 entities, the method provided in this disclosure retrieves 2,500 results in 18 ms. However, using attribute filtering, the time required to retrieve 2,500 results is 140 ms.

[0175] For example, with 100,000 entities, the method provided in this disclosure retrieves 25,000 results in 108 ms. However, using attribute filtering, the time required to retrieve 25,000 results is 1100 ms.

[0176] For example, with 1 million entities, the method provided in this disclosure requires 1250ms to retrieve 250,000 results. However, using attribute filtering, the time required to retrieve 250,000 results is 12200ms.

[0177] Figure 9 This is a block diagram of an information retrieval device according to an embodiment of the present disclosure.

[0178] like Figure 9 As shown, the device 900 may include a first determining module 910, a switching module 920, a second determining module 930, and a retrieval module 940.

[0179] The first determining module 910 is used to determine the initial search graph data based on the search statement. For example, the initial search graph data includes at least one node data, which includes the value of a first logical field, the value of a second logical field, and at least one attribute condition information, which includes attribute fields, attribute relationships, and attribute parameter values.

[0180] The switching module 920 is used to switch the values ​​of the first logical field, the second logical field, and the attribute relationships of the attribute condition information of the target node data in the initial retrieval graph data, to obtain the switched target node data. For example, the target node data is node data whose first logical field value is the first type of first logical value.

[0181] The second determining module 930 is used to determine the target retrieval graph data based on the target node data after switching and the initial retrieval graph data.

[0182] The retrieval module 940 is used to retrieve information based on the target retrieval graph data.

[0183] In some embodiments, the value of the second logical field includes second logical values ​​of at least two categories, and the attribute relationship includes attribute relationships of at least two categories.

[0184] The switching gate includes: a first switching submodule, used to switch the value of the first logical field of the target node data to a second type of first logical value. A second switching submodule, used to switch the value of the second logical field of the target node data from a second logical value of one category to a second logical value of another category. A third switching submodule, used to switch the attribute relationship of the attribute condition information of the target node data from an attribute relationship of one category to an attribute relationship of another category.

[0185] In some embodiments, when the target node data is a parent node in the initial retrieval graph data, the initial retrieval graph data includes initial retrieval subgraph data related to the target node data, and the initial retrieval subgraph data includes at least one node data. The switching module includes: a traversal submodule for traversing the initial retrieval subgraph related to the target node data; and a fourth switching submodule for switching the value of the second logical field and the attribute relationship of the attribute condition information in the first target child node data in response to determining that a first target child node data exists in the initial retrieval subgraph data. For example, the value of the first logical field in the first target child node data is a second type of first logical value.

[0186] In some embodiments, the switching module further includes: a fifth switching submodule, configured to, in response to determining that second target child node data exists in the initial retrieval subgraph data, switch the value of the first logical field in the second target child node data to a second type of first logical value, wherein the value of the first logical field in the second target child node data is a first type of first logical value. A stop traversal submodule is also included, configured to stop traversing the initial retrieval subgraph.

[0187] In some embodiments, the switching module includes: a sixth switching submodule, configured to, in response to determining that target node data exists in the initial retrieval graph data, switch the value of the first logical field, the value of the second logical field, and the attribute relationship of the attribute condition information of the target node data to obtain the first switched target node data.

[0188] In some embodiments, the second determining module includes: a first obtaining submodule, configured to obtain the first updated retrieval graph data based on the first switched target node data.

[0189] In some embodiments, the switching module further includes a seventh switching submodule, configured to, in response to determining that target node data exists in the search graph data after the (k-1)th update, switch the values ​​of the first logical field, the second logical field, and the attribute relationships of the attribute condition information of the target node data to obtain the kth switched target node data. For example, k is an integer less than or equal to K, K is an integer greater than 1, and k is an integer greater than 1.

[0190] In some embodiments, the second determining module includes a second obtaining submodule, configured to obtain the retrieved graph data after the kth update based on the target node data after the kth switch.

[0191] In some embodiments, the second determining module includes: a first determining submodule, configured to determine the Kth updated retrieval graph data as target retrieval graph data in response to determining that there is no target node data in the retrieval graph data after the Kth update.

[0192] In some embodiments, the first determining submodule includes: a first deletion unit, configured to delete the first logical field and the value of the first logical field of the node data in the Kth updated retrieval graph data, to obtain processed retrieval graph data; and a first determining unit, configured to determine the processed retrieval graph data as the target retrieval graph data.

[0193] In some embodiments, the first determining module includes: a parsing submodule, used to parse the retrieval statement to obtain N node data. For example, N is an integer greater than or equal to 1. A second determining submodule is used to determine initial retrieval graph data based on the N node data.

[0194] In some embodiments, the parsing submodule includes: a first adding unit, configured to add the second logical value to the nth initial node data in response to parsing the second logical value from the retrieval statement and the value of the second logical field in the nth initial node data being null, thereby obtaining the nth node data. For example, n is an integer less than N, n is an integer greater than or equal to 1.

[0195] In some embodiments, the parsing submodule includes: a first generation unit, configured to generate (m+1)th initial node data in response to the second logical value being parsed from the retrieval statement and the value of the second logical field of the m-th initial node data not being null. For example, m is an integer less than N, m is an integer greater than or equal to 1. A second addition unit, configured to add the second logical value to the (m+1)-th initial node data to obtain the (m+1)-th node data. A second determination unit, configured to determine the association relationship between the m-th node data and the (m+1)-th initial node data. For example, the m-th node data is obtained based on the m-th initial node data, and the m-th node data is the parent node data of the (m+1)-th node data.

[0196] In some embodiments, the parsing submodule includes: a first setting unit, configured to, in response to parsing a first type of first logical value from a retrieval statement and the value of the second logical field in the i-th initial node data being null, set the value of the first logical field of the i-th initial node data to the first type of first logical value, thereby obtaining the i-th node data. For example, i is an integer less than N, and i is an integer greater than or equal to 1.

[0197] In some embodiments, the parsing submodule includes: a second generation unit, configured to generate (j+1)th initial node data in response to the parsing of a first type of first logical value from a retrieval statement and the value of the second logical field of the j-th initial node data not being null. For example, j is an integer less than N, or j is an integer greater than or equal to 1. A second setting unit, configured to set the value of the first logical field of the (j+1)-th initial node data to the first type of first logical value, thereby obtaining the (j+1)-th node data. A third determining unit, configured to determine the association relationship between the j-th node data and the (j+1)-th initial node data. For example, the j-th node data is obtained based on the j-th initial node data, and the j-th node data is the parent node data of the (j+1)-th node data.

[0198] In some embodiments, the parsing submodule includes a third adding unit, configured to add the attribute condition information to the h-th initial node data in response to parsing attribute condition information from the retrieval statement, thereby obtaining the h-th node data. For example, h is an integer less than N, or h is an integer greater than or equal to 1.

[0199] In some embodiments, the parsing submodule includes a third setting unit, configured to set the value of the second logical field in the g-th initial node data to a first type of second logical value in response to determining that the value of the second logical field of the g-th initial node data is null. For example, g is an integer less than N, g is an integer greater than or equal to 1.

[0200] In some embodiments, the retrieval module includes: a compression submodule, used to compress the target retrieval graph data to obtain target compressed retrieval graph data; and a retrieval submodule, used to perform information retrieval based on the target compressed retrieval graph data.

[0201] In some embodiments, the target retrieval graph data includes first node data to be compressed, the value of the second logical field of the first node data to be compressed is a first type of second logical value, and the first node data to be compressed contains multiple first target attribute condition information, the attribute fields and attribute relationships of the multiple first target attribute condition information are consistent with each other. The compression submodule includes: a merging unit, configured to merge multiple first target attribute condition information to obtain first compressed attribute condition information in response to determining that the target retrieval graph data contains first node data to be compressed. For example, the attribute fields and attribute relationships of the first compressed attribute condition information are consistent with the attribute fields and attribute relationships of the multiple first target attribute condition information, and the attribute parameter values ​​of the first compressed attribute condition information are extreme values ​​of the attribute parameter values ​​of the multiple first target attribute condition information. A first obtaining unit, configured to obtain first compressed node data based on the first compressed attribute condition information. A second obtaining unit, configured to obtain target compressed retrieval graph data based on the first compressed node data.

[0202] In some embodiments, the target retrieval graph data includes multiple second node data to be compressed, each of which contains second target attribute condition information, and each of the multiple second node data to be compressed is a child node data of a node data in the target retrieval graph data. The compression submodule includes: a fourth adding unit, configured to, in response to determining that the target retrieval graph data contains multiple second node data to be compressed, add the second target attribute condition information to the parent node data of the multiple second node data to be compressed, obtaining processed parent node data; a second deleting unit, configured to delete the second target attribute condition information from the multiple second node data to be compressed, obtaining second compressed node data; and a third obtaining unit, configured to obtain the target compressed retrieval graph data based on the second compressed node data and the processed parent node data.

[0203] In some embodiments, the target retrieval graph data includes third node data to be compressed. The value of the second logical field of the third node data to be compressed is a second type of second logical value. The third node data to be compressed includes at least two third target attribute condition information, and the at least two retrieval results corresponding to the at least two third target attribute condition information are complementary sets. The compression submodule includes: a third deletion unit, used to delete at least two third target attribute condition information in response to determining that the target retrieval graph data contains third node data to be compressed, to obtain third compressed node data; and a fourth obtaining unit, used to obtain target compressed retrieval graph data based on the third compressed node data.

[0204] In some embodiments, the attribute fields and attribute parameter values ​​of at least two third target attribute condition information are consistent with each other, and the categories of the attribute relationships of at least two third target attribute condition information are inconsistent.

[0205] In some embodiments, the target retrieval graph data includes fourth node data to be compressed. The value of the second logical field of the fourth node data to be compressed is a first type of second logical value. The fourth node data to be compressed includes at least two fourth target attribute condition information, and the intersection of at least two retrieval results corresponding to the at least two fourth target attribute condition information is an empty set. The compression submodule includes: a fourth deletion unit, used to delete the fourth node data to be compressed and the target retrieval subgraph data related to the fourth node data to be compressed in response to the existence of the fourth node data to be compressed in the target retrieval graph data, to obtain the target compressed retrieval graph data.

[0206] In some embodiments, a first type of first logical value is used to characterize the target node data as being related to a logical NOT operation.

[0207] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0208] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0209] Figure 10A schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0210] like Figure 10 As shown, device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1002 or a computer program loaded from storage unit 1008 into random access memory (RAM) 1003. The RAM 1003 may also store various programs and data required for the operation of device 1000. The computing unit 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. Input / output (I / O) interface 1005 is also connected to bus 1004.

[0211] Multiple components in device 1000 are connected to I / O interface 1005, including: input unit 1006, such as keyboard, mouse, etc.; output unit 1007, such as various types of monitors, speakers, etc.; storage unit 1008, such as disk, optical disk, etc.; and communication unit 1009, such as network card, modem, wireless transceiver, etc. Communication unit 1009 allows device 1000 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0212] The computing unit 1001 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the various methods and processes described above, such as information retrieval methods. For example, in some embodiments, the information retrieval method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1000 via ROM 1002 and / or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by the computing unit 1001, one or more steps of the information retrieval method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the information retrieval method by any other suitable means (e.g., by means of firmware).

[0213] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0214] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0215] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0216] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) monitor or an LCD (liquid crystal display)) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0217] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0218] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.

[0219] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0220] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for information retrieval, comprising: determining initial retrieval graph data according to a retrieval statement, wherein the initial retrieval graph data comprises at least one node data, the node data comprises a value of a first logical field, a value of a second logical field, and at least one attribute condition information, the attribute condition information comprises an attribute field, an attribute relationship, and an attribute parameter value, the value of the second logical field comprises at least two categories of second logical values, and the attribute relationship comprises at least two categories of attribute relationships; switching the value of the first logical field, the value of the second logical field, and the attribute relationship of the attribute condition information of target node data in the initial retrieval graph data to obtain switched target node data, comprising: switching the value of the first logical field of the target node data to a second category of first logical values; switching the value of the second logical field of the target node data from one category of second logical values to another category of second logical values; and switching the attribute relationship of the attribute condition information of the target node data from one category of attribute relationships to another category of attribute relationships, the target node data being node data whose value of the first logical field is a first category of first logical values, the first category of first logical values being used to indicate that one clause of the retrieval statement has a logical operator related to logical NOT, and the second category of first logical values being used to indicate that another clause of the retrieval statement does not have a logical operator related to logical NOT; determining target retrieval graph data according to the switched target node data and the initial retrieval graph data; and performing information retrieval according to the target retrieval graph data. In a case where the target node data is one parent node data in the initial retrieval graph data, the initial retrieval graph data comprises initial retrieval subgraph data related to the target node data, the initial retrieval subgraph data comprises at least one node data, the switching the value of the first logical field, the value of the second logical field, and the attribute relationship of the attribute condition information of target node data in the initial retrieval graph data further comprises: traversing the initial retrieval subgraph related to the target node data; and in response to determining that there is first target subnode data in the initial retrieval subgraph data, switching the value of the second logical field and the attribute relationship of the attribute condition information in the first target subnode data, wherein the value of the first logical field in the first target subnode data is the second category of first logical values. the switching the value of the first logical field, the value of the second logical field, and the attribute relationship of the attribute condition information of target node data in the initial retrieval graph data further comprises: in response to determining that there is second target subnode data in the initial retrieval subgraph data, wherein the value of the first logical field in the second target subnode data is the first category of first logical values, switching the value of the first logical field in the second target subnode data to the second category of first logical values; and stopping traversing the initial retrieval subgraph. ​ 2. The method of claim 1, wherein, ​ ​ ​ ​ 3. The method of claim 2, wherein, ​ ​ ​ ​ 4. The method of claim 1, wherein, The switching the value of the first logical field, the value of the second logical field and the attribute relationship of the attribute condition information of the target node data in the initial search graph data to obtain switched target node data further includes: In response to determining that the target node data exists in the initial search graph data, switching the value of the first logical field, the value of the second logical field and the attribute relationship of the attribute condition information of the target node data to obtain the first switched target node data.

5. The method of claim 4, wherein, The determining target search graph data according to the switched target node data and the initial search graph data includes: According to the first switched target node data, the first updated search graph data is obtained.

6. The method of claim 1, wherein, The switching the value of the first logical field, the value of the second logical field and the attribute relationship of the attribute condition information of the target node data in the initial search graph data to obtain switched target node data further includes: In response to determining that the target node data exists in the k-1th updated search graph data, switching the value of the first logical field, the value of the second logical field and the attribute relationship of the attribute condition information of the target node data to obtain the kth switched target node data, wherein k is an integer less than or equal to K, K is an integer greater than 1, and k is an integer greater than 1.

7. The method of claim 6, wherein, The determining target search graph data according to the switched target node data and the initial search graph data includes: According to the kth switched target node data, the kth updated search graph data is obtained.

8. The method of claim 6, wherein, The determining target search graph data according to the switched target node data and the initial search graph data includes: In response to determining that the target node data does not exist in the Kth updated search graph data, the Kth updated search graph data is determined as the target search graph data.

9. The method of claim 8, wherein, The determining the Kth updated search graph data as the target search graph data includes: Deleting the first logical field and the value of the first logical field of the node data in the Kth updated search graph data to obtain processed search graph data; and Determining the processed search graph data as the target search graph data.

10. The method of claim 1, wherein, The determining initial search graph data according to a search statement includes: Parsing the search statement to obtain N node data, wherein N is an integer greater than or equal to 1; and Determining the initial search graph data according to the N node data.

11. The method of claim 10, wherein, The parsing the search statement to obtain N node data includes: In response to parsing a second logical value from the search statement and the value of the second logical field in the nth initial node data being a null value, adding the second logical value to the nth initial node data to obtain the nth node data, n is an integer less than N, and n is an integer greater than or equal to 1.

12. The method of claim 10, wherein, The parsing the search statement to obtain N node data includes: generating an m+1th initial node data in response to that a second logical value is parsed from the search sentence and a value of a second logical field of the mth initial node data is not a null value, where m is an integer less than N, and m is an integer greater than or equal to 1; adding the second logical value to the m+1th initial node data to obtain an m+1th node data; and determining an association relationship between an mth node data and the m+1th initial node data, where the mth node data is obtained according to the mth initial node data, and the mth node data is parent node data of the m+1th node data.

13. The method of claim 10, wherein, The parsing the search sentence to obtain the N node data includes: setting a value of a first logical field of the ith initial node data to the first type first logical value to obtain an ith node data in response to that the first type first logical value is parsed from the search sentence and a value of a second logical field of the ith initial node data is a null value, where i is an integer less than N, and i is an integer greater than or equal to 1.

14. The method of claim 10, wherein, The parsing the search sentence to obtain the N node data includes: generating a j+1th initial node data in response to that the first type first logical value is parsed from the search sentence and a value of a second logical field of a jth initial node data is not a null value, where j is an integer less than N, and j is an integer greater than or equal to 1; setting a value of a first logical field of the j+1th initial node data to the first type first logical value to obtain a j+1th node data; and determining an association relationship between a jth node data and the j+1th initial node data, where the jth node data is obtained according to the jth initial node data, and the jth node data is parent node data of the j+1th node data.

15. The method of claim 10, wherein, The parsing the search sentence to obtain the N node data includes: adding the attribute condition information to a hth initial node data to obtain a hth node data in response to that the attribute condition information is parsed from the search sentence, where h is an integer less than N, and h is an integer greater than or equal to 1.

16. The method of claim 15, wherein, The parsing the search sentence to obtain the N node data further includes: setting a value of a second logical field of the gth initial node data to a first type second logical value in response to that the value of the second logical field of the gth initial node data is a null value, where g is an integer less than N, and g is an integer greater than or equal to 1.

17. The method of claim 1, wherein, The performing information retrieval according to the target search graph data includes: compressing the target search graph data to obtain target compressed search graph data; and performing information retrieval according to the target compressed search graph data.

18. The method of claim 17, wherein, The target search graph data includes a first to-be-compressed node data, a value of a second logical field of the first to-be-compressed node data is a first type second logical value, a plurality of first target attribute condition information exists in the first to-be-compressed node data, and attribute fields and attribute relationships of the plurality of first target attribute condition information are consistent with each other; The compressing the target retrieval graph data to obtain target compressed retrieval graph data comprises: In response to determining that the target retrieval graph data has the first to-be-compressed node data, merging the plurality of first target attribute condition information to obtain first compressed attribute condition information, wherein the attribute field and the attribute relationship of the first compressed attribute condition information are consistent with the attribute field and the attribute relationship of the plurality of first target attribute condition information respectively, and the attribute parameter value of the first compressed attribute condition information is the extreme value of the attribute parameter values of the plurality of first target attribute condition information; obtaining first compressed node data according to the first compressed attribute condition information; and obtaining the target compressed retrieval graph data according to the first compressed node data.

19. The method of claim 17, wherein, The target retrieval graph data comprises a plurality of second to-be-compressed node data, the plurality of second to-be-compressed node data all have second target attribute condition information, and the plurality of second to-be-compressed node data are all child node data of a node data in the target retrieval graph data, The compressing the target retrieval graph data to obtain target compressed retrieval graph data comprises: In response to determining that the target retrieval graph data has a plurality of second to-be-compressed node data, adding the second target attribute condition information to parent node data of the plurality of second to-be-compressed node data to obtain processed parent node data; deleting the second target attribute condition information from the plurality of second to-be-compressed node data to obtain second compressed node data; and obtaining the target compressed retrieval graph data according to the second compressed node data and the processed parent node data.

20. The method of claim 17, wherein, The target retrieval graph data comprises third to-be-compressed node data, the value of the second logical field of the third to-be-compressed node data is a second type second logical value, the third to-be-compressed node data comprises at least two third target attribute condition information, and the at least two third target attribute condition information correspond to at least two search results that are mutually exclusive, The compressing the target retrieval graph data to obtain target compressed retrieval graph data comprises: In response to determining that the target retrieval graph data has third to-be-compressed node data, deleting the at least two third target attribute condition information to obtain third compressed node data; and obtaining the target compressed retrieval graph data according to the third compressed node data.

21. The method of claim 20, wherein, The attribute fields and the attribute parameter values of the at least two third target attribute condition information are consistent with each other, and the categories of the attribute relationships of the at least two third target attribute condition information are inconsistent.

22. The method of claim 17, wherein, The target retrieval graph data comprises fourth to-be-compressed node data, the value of the second logical field of the fourth to-be-compressed node data is a first type second logical value, the fourth to-be-compressed node data comprises at least two fourth target attribute condition information, and the intersection of at least two search results corresponding to the at least two fourth target attribute condition information is an empty set, The compressing the target retrieval graph data to obtain target compressed retrieval graph data comprises: In response to the presence of the fourth to-be-compressed node data in the target retrieval graph data, the fourth to-be-compressed node data and target retrieval subgraph data related to the fourth to-be-compressed node are deleted to obtain the target compressed retrieval graph data.

23. The method of claim 1, wherein, The first type of first logic value is used to represent that the target node data is related to a logical NOT operation. 24.An information retrieval apparatus, comprising: a first determination module configured to determine initial retrieval graph data according to a retrieval statement, wherein the initial retrieval graph data comprises at least one node data, the node data comprising a value of a first logic field, a value of a second logic field, and at least one attribute condition information, the attribute condition information comprising an attribute field, an attribute relationship, and an attribute parameter value; a switching module configured to switch the value of the first logic field, the value of the second logic field, and the attribute relationship of the attribute condition information of target node data in the initial retrieval graph data to obtain switched target node data, wherein the target node data is node data whose value of the first logic field is a first type of first logic value; a second determination module configured to determine target retrieval graph data according to the switched target node data and the initial retrieval graph data; and a retrieval module configured to perform information retrieval according to the target retrieval graph data, the switching module comprises: a first switching submodule configured to switch the value of the first logic field of the target node data to a second type of first logic value, the first type of first logic value being used to indicate that one clause of the retrieval statement has a logical operator related to a logical NOT, and the second type of first logic value being used to indicate that another clause of the retrieval statement does not have a logical operator related to a logical NOT; a second switching submodule configured to switch the value of the second logic field of the target node data from one category of second logic value to another category of second logic value; a third switching submodule configured to switch the attribute relationship of the attribute condition information of the target node data from one category of attribute relationship to another category of attribute relationship. 25.An electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 23.

26. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method of any one of claims 1 to 23. 27.A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1 to 23.

Citation Information

Patent Citations

  • Information retrieval method and device, electronic equipment and storage medium

    CN114579573A

  • Natural language processing utilizing logical tree structures and propagation of knowledge through logical parse tree structures

    WO2016055895A1