Search method and device, electronic equipment and computer readable storage medium

By weighted fusion and graph neural network processing of feature data from user information, query terms, and search results, the problem of insufficient expressive power of spliced ​​feature data is solved, thereby improving the matching degree and accuracy of search results.

CN117785904BActive Publication Date: 2026-04-24XIAOHONGSHU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAOHONGSHU TECH CO LTD
Filing Date
2022-09-16
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In existing technologies, the expressive power of the spliced ​​feature data is limited, resulting in low accuracy in representing user information, which in turn leads to a low degree of matching between search results and users.

Method used

By weighted fusion of feature data from user information, query terms, and search results, updated feature data is generated, and graph neural networks are used to process heterogeneous graphs to enhance the expressive power of the feature data.

Benefits of technology

It improved the accuracy of user information and query term representation, enhanced the matching degree between search results and users, reduced data processing volume, and improved search performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117785904B_ABST
    Figure CN117785904B_ABST
Patent Text Reader

Abstract

The application discloses a search method and device, electronic equipment and a computer readable storage medium. The method comprises: obtaining first feature data of first user information, second feature data of a first query word, and third feature data of a first search result; the first user information is user information of a first user, the first query word is a historical query word of the first user, the first search result is a search result of the first query word, and the first user is interested in the first search result; the first feature data, the second feature data and the third feature data are weighted and fused to obtain updated feature data; the updated feature data comprises fourth feature data of the first user information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a search method and apparatus, electronic device and computer-readable storage medium. Background Technology

[0002] In search applications, some methods concatenate feature data of user information with feature data of query terms to obtain concatenated feature data, so that the concatenated feature data carries both user information and query term information. Then, the concatenated feature data is matched with feature data in the search results database to determine the search results.

[0003] However, due to the limited expressive power of the concatenated feature data, the accuracy of the concatenated feature data in representing users is low, resulting in a low matching degree between search results and users. Therefore, improving the expressive power of user information feature data is of great significance. Summary of the Invention

[0004] This application provides a search method and apparatus, an electronic device, and a computer-readable storage medium.

[0005] In a first aspect, a search method is provided, the method comprising: obtaining first feature data of first user information, second feature data of a first query term, and third feature data of a first search result;

[0006] The first user information is the user information of the first user, the first query term is the historical query term of the first user, the first search result is the search result of the first query term, and the first user is interested in the first search result;

[0007] The first feature data, the second feature data, and the third feature data are weighted and fused to obtain updated feature data; the updated feature data includes the fourth feature data of the first user information.

[0008] In this respect, both the first feature data and the fourth feature data can characterize the first user information, but the first feature data only carries the first user information. The fourth feature data, however, is obtained by fusing the information carried by the first feature data, the second feature data, and the third feature data. Therefore, the fourth feature data carries not only the first user information but also the semantic information of the first query term and the semantic information of the first search result. Since both the first query term and the first search result are related to the first user (i.e., the first query term is a historical query term of the first user, and the first user is interested in the first search result), the semantic information of both the first query term and the first search result helps to enrich the first user's user information.

[0009] Therefore, compared with the first feature data, the fourth feature data can more accurately represent the first user. That is, when the first user searches using any query term, the fourth feature data can be used to determine the search results that are suitable for the first user, thereby improving the matching degree between the search results and the first user.

[0010] In other words, the search device obtains the fourth feature data by weighted fusion of the first feature data, the second feature data, and the third feature data. This improves the expressive power of the fourth feature data, thereby enhancing the accuracy of the representation of the first user by the feature data of the first user information.

[0011] In any embodiment of this application, the updated feature data further includes the fifth feature data of the first query term.

[0012] In this implementation, both the second feature data and the fifth feature data can characterize the first query term, but the second feature data only carries the semantic information of the first query term. The fifth feature data, however, is obtained by fusing the information carried by the first feature data, the second feature data, and the third feature data. Therefore, the fifth feature data carries not only the semantic information of the first query term but also the semantic information of the first user information and the first search result. Since both the first user and the first search result are related to the first query term (i.e., the first query term is the first user's historical query term, and the first search result is the search result for the first query term), the semantic information of both the first user information and the first search result is beneficial for characterizing the first query term.

[0013] Therefore, compared with the second feature data, the fifth feature data can more accurately represent the first query term. That is, when a third user (who can be any user, the same as or different from the first user) uses the first query term to search, the fifth feature data can determine the search results suitable for the third user, thereby improving the matching degree between the search results and the third user.

[0014] In other words, the search device obtains the fifth feature data by weighted fusion of the first feature data, the second feature data, and the third feature data. This improves the expressive power of the fifth feature data, thereby enhancing the accuracy of the representation of the first query term by its feature data.

[0015] In any embodiment of this application, the updated feature data further includes the sixth feature data of the first search result.

[0016] In this implementation, both the third feature data and the sixth feature data can characterize the first search result, but the third feature data only carries the semantic information of the first search result. The sixth feature data, however, is obtained by fusing the information carried by the first feature data, the second feature data, and the third feature data. Therefore, the sixth feature data carries not only the semantic information of the first search result but also the semantic information of the first user information and the first query term. Since both the first user and the first query term are related to the first search result (i.e., the first user is interested in the first search result, and the first search result is the search result of the first query term), the semantic information of both the first user information and the first query term is beneficial for characterizing the first search result.

[0017] Therefore, the sixth feature data can more accurately represent the first search result than the third feature data. That is, when a third user searches using any query term, the sixth feature data can be used to determine whether the first search result is suitable for the third user, thus improving the accuracy of the judgment.

[0018] In other words, the search device obtains the sixth feature data by weighted fusion of the first feature data, the second feature data, and the third feature data. This improves the expressive power of the sixth feature data, thereby enhancing the accuracy of the representation of the first search result by the feature data of the first search result.

[0019] In conjunction with any embodiment of this application, the method further includes: upon detecting a search request for the first query term input by the first user, fusing the fourth feature data and the fifth feature data to obtain seventh feature data;

[0020] A second search result is determined from the search result database that has eighth feature data that matches the seventh feature data; the second search result is the search result for the first query term.

[0021] In this implementation, upon detecting a search request, the search device fuses the fourth and fifth feature data to obtain the seventh feature data, thereby enabling the seventh feature data to more accurately represent the first user and the first query term. By comparing the seventh feature data with the eighth feature data in the search results database to determine the second search result, not only is the amount of data processing reduced, but the matching degree between the second search result and the first query term is also improved, as is the matching degree between the second search result and the first user, thereby enhancing the search effect.

[0022] In conjunction with any embodiment of this application, the method further includes: replacing the feature data of the first search result in the search results library with the sixth feature data.

[0023] In this embodiment, the search result library includes a first search result. When the search device obtains the sixth feature data, it can use the sixth feature data to replace the feature data of the first search result, thereby improving the accuracy of the feature data representing the first search result in the search result library. In conjunction with any embodiment of this application, obtaining the first feature data of the first user information, the second feature data of the first query term, and the third feature data of the first search result includes:

[0024] Obtain a first heterogeneous graph; the first heterogeneous graph includes the first feature data, the second feature data and the third feature data, and in the first heterogeneous graph, there are edges between the first feature data and the second feature data and the third feature data, and there are also edges between the second feature data and the third feature data;

[0025] The weighted fusion of the first feature data, the second feature data, and the third feature data to obtain the updated feature data includes:

[0026] Obtain the first neural network graph;

[0027] The first heterogeneous graph is processed using the first graph neural network to obtain the updated feature data.

[0028] In this embodiment, the relationship between the first feature data, the second feature data, and the third feature data is expressed by a first heterogeneous graph. Then, by using a first graph neural network to process the first heterogeneous graph, the relationship between the first feature data, the second feature data, and the third feature data can be used to fuse the first feature data, the second feature data, and the third feature data to obtain updated feature data.

[0029] Furthermore, when the first heterogeneous graph includes the first additional node, the updated feature data can be obtained by processing the first heterogeneous graph. The information carried by the first additional node can also be used to update the feature data of the first user, the feature data of the first query term, and the feature data of the first search result, thereby improving the expressive power of the updated feature data.

[0030] In conjunction with any embodiment of this application, obtaining the first graph neural network includes:

[0031] Obtain a second graph neural network and a second heterogeneous graph; the second heterogeneous graph includes the ninth feature data of the second user information, the tenth feature data of the second query term, and the eleventh feature data of the third search result, the second user information is the user information of the second user, the second query term is the historical query term of the second user, the third search result is the search result of the second query term, and the second user is interested in the third search result;

[0032] The second graph neural network is used to process the second heterogeneous graph, and the tenth feature data of the second query term is updated to obtain the twelfth feature data, and the eleventh feature data of the third search result is updated to obtain the thirteenth feature data.

[0033] Calculate the first similarity between the twelfth feature data and the thirteenth feature data;

[0034] The training loss is obtained based on the first difference between the first similarity and the first label; the first difference is positively correlated with the training loss; and the first label represents whether the second query term is related to the third search result.

[0035] Based on the training loss, the parameters of the second graph neural network are updated to obtain the first graph neural network.

[0036] In this implementation, the first similarity is the similarity between the twelfth and thirteenth feature data. The twelfth feature data is the feature data of the second query term, and the thirteenth feature data is the feature data of the third search result. Therefore, the first similarity can characterize the relevance between the second query term and the third search result. Thus, by obtaining the training loss based on the first difference between the first similarity and the first label, and updating the parameters of the second graph neural network based on the training loss, the expressive power of the query term feature data extracted by the second graph neural network (i.e., the accuracy of the query term feature data in representing the query term) and the expressive power of the search result feature data extracted by the second graph neural network (i.e., the accuracy of the search result feature data in representing the search result) can be improved.

[0037] In conjunction with any embodiment of this application, before obtaining the training loss based on the first difference between the first similarity and the first label, the method further includes:

[0038] The second graph neural network is used to process the second heterogeneous graph, and the ninth feature data of the second user is updated to obtain the fourteenth feature data;

[0039] Calculate the second similarity between the thirteenth feature data and the fourteenth feature data;

[0040] Determine the second difference between the second similarity and the second tag; the second tag indicates whether the second user is interested in the third search result.

[0041] The step of obtaining the training loss based on the first difference between the first similarity and the first label includes:

[0042] The training loss is obtained based on the first difference and the second difference; the second difference is positively correlated with the training loss.

[0043] In this implementation, the second similarity is the similarity between the thirteenth and fourteenth feature data. The thirteenth feature data is the feature data of the third search result, and the fourteenth feature data is the feature data of the second user. Therefore, the second similarity can characterize whether the second user is interested in the third search result. Thus, by obtaining the training loss based on the second difference between the second similarity and the second label, and updating the parameters of the second graph neural network based on the training loss, the expressive power of the user feature data extracted by the second graph neural network (i.e., the accuracy with which the user feature data expresses the user) and the expressive power of the search result feature data extracted by the second graph neural network can be improved.

[0044] In conjunction with any embodiment of this application, before obtaining the training loss based on the first difference and the second difference, the method further includes:

[0045] Before obtaining the training loss based on the first difference between the first similarity and the first label, the method further includes:

[0046] The second graph neural network is used to process the second heterogeneous graph, and the ninth feature data of the second user is updated to obtain the fourteenth feature data;

[0047] Calculate the third similarity between the twelfth feature data and the fourteenth feature data;

[0048] Determine the third difference between the third similarity and the third tag; the third tag indicates whether the second query term is a historical query term of the second user;

[0049] The step of obtaining the training loss based on the first difference between the first similarity and the first label includes:

[0050] The training loss is obtained based on the first difference and the third difference; the third difference is positively correlated with the training loss.

[0051] In this implementation, the third similarity is the similarity between the twelfth feature data and the fourteenth feature data. The twelfth feature data is the feature data of the second query term, and the fourteenth feature data is the feature data of the second user. Therefore, the third similarity can characterize whether the second query term is a historical query term of the second user. Thus, by obtaining the training loss based on the third difference between the third similarity and the third label, and updating the parameters of the second graph neural network based on the training loss, the expressive power of the user feature data extracted by the second graph neural network and the expressive power of the query term feature data extracted by the second graph neural network can be improved.

[0052] In conjunction with any embodiment of this application, before obtaining the training loss based on the first difference and the second difference, the method further includes:

[0053] Calculate the third similarity between the twelfth feature data and the fourteenth feature data;

[0054] Determine the third difference between the third similarity and the third tag; the third tag indicates whether the second query term is a historical query term of the second user;

[0055] The step of obtaining the training loss based on the first difference and the second difference includes:

[0056] The training loss is obtained based on the first difference, the second difference, and the third difference; the third difference is positively correlated with the training loss.

[0057] In this implementation, the third similarity is the similarity between the twelfth feature data and the fourteenth feature data. The twelfth feature data is the feature data of the second query term, and the fourteenth feature data is the feature data of the second user. Therefore, the third similarity can characterize whether the second query term is a historical query term of the second user. Thus, by obtaining the training loss based on the third difference between the third similarity and the third label, and updating the parameters of the second graph neural network based on the training loss, the expressive power of the user feature data extracted by the second graph neural network and the expressive power of the query term feature data extracted by the second graph neural network can be improved.

[0058] Secondly, a search device is provided, characterized in that the device comprises:

[0059] The acquisition unit is used to acquire the first feature data of the first user information, the second feature data of the first query term, and the third feature data of the first search result;

[0060] The first user information is the user information of the first user, the first query term is the historical query term of the first user, the first search result is the search result of the first query term, and the first user is interested in the first search result;

[0061] The processing unit is used to perform weighted fusion of the first feature data, the second feature data, and the third feature data to obtain updated feature data; the updated feature data includes the fourth feature data of the first user information.

[0062] In any embodiment of this application, the updated feature data further includes the fifth feature data of the first query term.

[0063] In any embodiment of this application, the updated feature data further includes the sixth feature data of the first search result.

[0064] In conjunction with any embodiment of this application, the processing unit is further configured to: upon detecting a search request for the first query term input by the first user, fuse the fourth feature data and the fifth feature data to obtain seventh feature data;

[0065] A second search result is determined from the search result database that has eighth feature data that matches the seventh feature data; the second search result is the search result for the first query term.

[0066] In conjunction with any embodiment of this application, the processing unit is further configured to replace the feature data of the first search result in the search result library with the sixth feature data.

[0067] In conjunction with any embodiment of this application, the acquisition unit is used for:

[0068] Obtain a first heterogeneous graph; the first heterogeneous graph includes the first feature data, the second feature data and the third feature data, and in the first heterogeneous graph, there are edges between the first feature data and the second feature data and the third feature data, and there are also edges between the second feature data and the third feature data;

[0069] The weighted fusion of the first feature data, the second feature data, and the third feature data to obtain the updated feature data includes:

[0070] Obtain the first neural network graph;

[0071] The first heterogeneous graph is processed using the first graph neural network to obtain the updated feature data.

[0072] In conjunction with any embodiment of this application, the acquisition unit is used for:

[0073] Obtain a second graph neural network and a second heterogeneous graph; the second heterogeneous graph includes the ninth feature data of the second user information, the tenth feature data of the second query term, and the eleventh feature data of the third search result, the second user information is the user information of the second user, the second query term is the historical query term of the second user, the third search result is the search result of the second query term, and the second user is interested in the third search result;

[0074] The second graph neural network is used to process the second heterogeneous graph, and the tenth feature data of the second query term is updated to obtain the twelfth feature data, and the eleventh feature data of the third search result is updated to obtain the thirteenth feature data.

[0075] Calculate the first similarity between the twelfth feature data and the thirteenth feature data;

[0076] The training loss is obtained based on the first difference between the first similarity and the first label; the first difference is positively correlated with the training loss; and the first label represents whether the second query term is related to the third search result.

[0077] Based on the training loss, the parameters of the second graph neural network are updated to obtain the first graph neural network.

[0078] In conjunction with any embodiment of this application, the acquisition unit is further configured to:

[0079] The second graph neural network is used to process the second heterogeneous graph, and the ninth feature data of the second user is updated to obtain the fourteenth feature data;

[0080] Calculate the second similarity between the thirteenth feature data and the fourteenth feature data;

[0081] Determine the second difference between the second similarity and the second tag; the second tag indicates whether the second user is interested in the third search result.

[0082] The training loss is obtained based on the first difference and the second difference; the second difference is positively correlated with the training loss.

[0083] In conjunction with any embodiment of this application, the acquisition unit is further configured to:

[0084] Before obtaining the training loss based on the first difference between the first similarity and the first label, the method further includes:

[0085] The second graph neural network is used to process the second heterogeneous graph, and the ninth feature data of the second user is updated to obtain the fourteenth feature data;

[0086] Calculate the third similarity between the twelfth feature data and the fourteenth feature data;

[0087] Determine the third difference between the third similarity and the third tag; the third tag indicates whether the second query term is a historical query term of the second user;

[0088] The training loss is obtained based on the first difference and the third difference; the third difference is positively correlated with the training loss.

[0089] In conjunction with any embodiment of this application, the acquisition unit is further configured to:

[0090] Calculate the third similarity between the twelfth feature data and the fourteenth feature data;

[0091] Determine the third difference between the third similarity and the third tag; the third tag indicates whether the second query term is a historical query term of the second user;

[0092] The training loss is obtained based on the first difference, the second difference, and the third difference; the third difference is positively correlated with the training loss.

[0093] Thirdly, an electronic device is provided, characterized in that it comprises: a processor and a memory, the memory being used to store computer program code, the computer program code including computer instructions, wherein, when the processor executes the computer instructions, the electronic device performs a method as described in the first aspect above and any possible implementation thereof.

[0094] Fourthly, another electronic device is provided, comprising: a processor, a transmitting device, an input device, an output device, and a memory, the memory being used to store computer program code, the computer program code including computer instructions, wherein, when the processor executes the computer instructions, the electronic device performs a method as described in the first aspect above and any possible implementation thereof.

[0095] Fifthly, a computer-readable storage medium is provided, wherein a computer program is stored therein, the computer program including program instructions that, when executed by a processor, cause the processor to perform a method as described in the first aspect above and any possible implementation thereof.

[0096] In a sixth aspect, a computer program product is provided, the computer program product comprising a computer program or instructions that, when the computer program or instructions are executed on a computer, cause the computer to perform the method described in the first aspect and any possible implementation thereof.

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

[0098] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.

[0099] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.

[0100] Figure 1 A flowchart illustrating a search method provided in an embodiment of this application;

[0101] Figure 2 This is a schematic diagram of a first heterogeneous diagram provided in an embodiment of this application;

[0102] Figure 3 This application provides a schematic diagram illustrating the relationship between query term nodes and search result nodes in an embodiment.

[0103] Figure 4 A schematic diagram of the structure of a search device provided in an embodiment of this application;

[0104] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0105] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0106] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0107] It should be understood that in this application, "at least one (item)" refers to one or more, "more than one" refers to two or more, "at least two (items)" refers to two or three or more, and "and / or" is used to describe the relationship between related objects, indicating that there can be three relationships. For example, "A and / or B" can indicate three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " can indicate that the related objects before and after are in an "or" relationship, referring to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple. The character " / " can also represent the division sign in mathematical operations, for example, a / b = a divided by b; 6 / 3 = 2. "At least one of the following" or similar expressions.

[0108] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0109] In search applications, current search methods typically determine search results by matching the feature data of query terms with the feature data of search results in a search results database. However, since different users have different interests, and this search process does not take into account the content that users are interested in, the relevance of search results to users is low.

[0110] Therefore, some methods concatenate the feature data of user information with the feature data of query terms to obtain concatenated feature data, so that the concatenated feature data carries both user information and query term information. Then, the concatenated feature data is matched with the feature data in the search results database to determine the search results.

[0111] However, due to the limited expressive power of the concatenated feature data, the accuracy of the concatenated feature data in representing users is low, resulting in a still low matching degree between search results and users. Therefore, improving the expressive power of user information feature data is of great significance. Based on this, embodiments of this application provide a solution to improve the expressive power of user information feature data.

[0112] The execution subject of this application embodiment is a search device, which can be any electronic device capable of executing the technical solutions disclosed in the method embodiments of this application. Optionally, the search device can be one of the following: a mobile phone, a computer, a tablet computer, or a wearable smart device.

[0113] It should be understood that the method embodiments of this application can also be implemented by a processor executing computer program code. The embodiments of this application are described below with reference to the accompanying drawings. Please refer to... Figure 1 , Figure 1 This is a flowchart illustrating a search method provided in an embodiment of this application.

[0114] 101. Obtain the first feature data of the first user information, the second feature data of the first query term, and the third feature data of the first search result.

[0115] In this embodiment, the first user information is the user information of a first user, wherein a user profile of the first user can be determined based on the first user's user information. Optionally, the first user's user information includes at least one of the following: gender and age. The first feature data is the feature data of the first user information, that is, the first feature data carries the first user information.

[0116] In this embodiment, the first query term is the first user's historical query term, meaning the first user has used the first query term in a search. The second feature data is the feature data of the first query term, meaning the second feature data carries the semantic information of the second query term.

[0117] In this embodiment, the first search result is the search result for the first query term. That is, when a search is performed based on the first query term, the search result includes the first search result, meaning the relevance between the first search result and the first query term is greater than or equal to a relevance threshold. For example, the first search result is a document obtained by searching based on the first query term. The third feature data is the feature data of the first search result, meaning the third feature data carries the semantic information of the first search result.

[0118] In this embodiment, the first user is interested in the first search result. Optionally, the first user is interested in the first search result if they have performed at least one of the following operations: viewing, saving, liking, commenting, forwarding, or recommending.

[0119] In one implementation of acquiring first feature data, the search device receives the first feature data input by a user through an input component. The input component includes at least one of the following: a keyboard, a mouse, a touchscreen, a touchpad, or an audio input device.

[0120] In another implementation of acquiring the first feature data, the search device receives the first feature data sent by the terminal. The terminal can be any of the following: a mobile phone, a computer, a tablet computer, or a server.

[0121] In one implementation of acquiring second feature data, the search device receives second feature data input by the user through an input component.

[0122] In another implementation of acquiring the second feature data, the search device receives the second feature data sent by the terminal.

[0123] In one implementation of acquiring third feature data, the search device receives third feature data input by the user through an input component.

[0124] In another implementation of acquiring the third feature data, the search device receives the third feature data sent by the terminal.

[0125] It should be understood that in the embodiments of this application, the steps of obtaining the first feature data, obtaining the second feature data, and obtaining the third feature data can be performed simultaneously or separately, and this application does not limit this.

[0126] 102. The first feature data, the second feature data, and the third feature data are weighted and fused to obtain the updated feature data.

[0127] By executing step 102, the search device performs weighted fusion of the information carried by the first feature data, the second feature data, and the third feature data to obtain updated feature data.

[0128] In this embodiment of the application, the updated feature data includes the fourth feature data of the first user information, wherein the fourth feature data can be used to characterize the first user information.

[0129] Both the first and fourth feature data can represent the first user's information, but the first feature data only carries the first user's information. The fourth feature data, however, is obtained by fusing the information carried by the first, second, and third feature data. Therefore, the fourth feature data carries not only the first user's information but also the semantic information of the first query term and the semantic information of the first search result. Since both the first query term and the first search result are related to the first user (i.e., the first query term is the first user's historical query term, and the first user is interested in the first search result), the semantic information of both the first query term and the first search result helps enrich the first user's user information.

[0130] Therefore, compared with the first feature data, the fourth feature data can more accurately represent the first user. That is, when the first user searches using any query term, the fourth feature data can be used to determine the search results that are suitable for the first user, thereby improving the matching degree between the search results and the first user.

[0131] In other words, the search device obtains the fourth feature data by weighted fusion of the first feature data, the second feature data, and the third feature data. This improves the expressive power of the fourth feature data, thereby enhancing the accuracy of the representation of the first user by the feature data of the first user information.

[0132] As an optional implementation, the updated feature data also includes fifth feature data of the first query term, which can be used to characterize the first query term.

[0133] It should be understood that the search device performs weighted fusion of the first feature data, the second feature data, and the third feature data with different weights, resulting in different results. That is, the weights for obtaining the fourth feature data and the weights for obtaining the fifth feature data are different.

[0134] Optionally, the search device performs a first weighted fusion on the first feature data, the second feature data, and the third feature data to obtain the fourth feature data. The search device then performs a second weighted fusion on the first feature data, the second feature data, and the third feature data to obtain the fifth feature data. The weights of the first weighted fusion are different from those of the second weighted fusion.

[0135] In this implementation, both the second feature data and the fifth feature data can characterize the first query term, but the second feature data only carries the semantic information of the first query term. The fifth feature data, however, is obtained by fusing the information carried by the first feature data, the second feature data, and the third feature data. Therefore, the fifth feature data carries not only the semantic information of the first query term but also the semantic information of the first user information and the first search result. Since both the first user and the first search result are related to the first query term (i.e., the first query term is the first user's historical query term, and the first search result is the search result for the first query term), the semantic information of both the first user information and the first search result is beneficial for characterizing the first query term.

[0136] Therefore, compared with the second feature data, the fifth feature data can more accurately represent the first query term. That is, when a third user (who can be any user, the same as or different from the first user) uses the first query term to search, the fifth feature data can determine the search results suitable for the third user, thereby improving the matching degree between the search results and the third user.

[0137] In other words, the search device obtains the fifth feature data by weighted fusion of the first feature data, the second feature data, and the third feature data. This improves the expressive power of the fifth feature data, thereby enhancing the accuracy of the representation of the first query term by its feature data.

[0138] As an optional implementation, the updated feature data also includes sixth feature data of the first search result, which can be used to characterize the first search result.

[0139] It should be understood that the search device performs weighted fusion of the first feature data, the second feature data, and the third feature data with different weights, resulting in different results. That is, the weights for obtaining the fourth feature data, the fifth feature data, and the sixth feature data are all different from each other.

[0140] Optionally, the search device performs a first weighted fusion on the first, second, and third feature data to obtain the fourth feature data. The search device performs a second weighted fusion on the first, second, and third feature data to obtain the fifth feature data. The search device performs a third weighted fusion on the first, second, and third feature data to obtain the sixth feature data. The weights of the first and third weighted fusions are different.

[0141] In this implementation, both the third feature data and the sixth feature data can characterize the first search result, but the third feature data only carries the semantic information of the first search result. The sixth feature data, however, is obtained by fusing the information carried by the first feature data, the second feature data, and the third feature data. Therefore, the sixth feature data carries not only the semantic information of the first search result but also the semantic information of the first user information and the first query term. Since both the first user and the first query term are related to the first search result (i.e., the first user is interested in the first search result, and the first search result is the search result of the first query term), the semantic information of both the first user information and the first query term is beneficial for characterizing the first search result.

[0142] Therefore, the sixth feature data can more accurately represent the first search result than the third feature data. That is, when a third user searches using any query term, the sixth feature data can be used to determine whether the first search result is suitable for the third user, thus improving the accuracy of the judgment.

[0143] In other words, the search device obtains the sixth feature data by weighted fusion of the first feature data, the second feature data, and the third feature data. This improves the expressive power of the sixth feature data, thereby enhancing the accuracy of the representation of the first search result by the feature data of the first search result.

[0144] As an optional implementation, the updated feature data includes fourth feature data and fifth feature data. That is, the search device obtains the fourth feature data and fifth feature data by performing step 102. At this time, the search device also performs the following steps:

[0145] 201. Upon detecting the search request for the first query term input by the first user, the fourth feature data and the fifth feature data are fused to obtain the seventh feature data.

[0146] In this embodiment, the search request input by the first user for the first query term indicates that the first user wishes to search based on the first query term. Upon detecting this search request, the search device can determine suitable search results for the first user based on the first user's feature data and the feature data of the first query term.

[0147] As described in step 102, the fourth feature data can more accurately represent the first user, and the fifth feature data can more accurately represent the first query term. Therefore, the search device obtains the seventh feature data by fusing the fourth and fifth feature data, which enables the seventh feature data to more accurately represent the first user and the first query term.

[0148] 202. Determine a second search result from the search result database that has eighth feature data that matches the seventh feature data mentioned above.

[0149] In this embodiment, the search result library includes multiple search results and feature data for each search result, wherein the feature data for the search results is the eighth feature data. The eighth feature data carries semantic information about the search results. Optionally, the search result library can be one of the following: Faiss, Milvus, or HNSWLib.

[0150] For example, the search results library includes documents, audio, and video; that is, documents, audio, and video in the search results library can all be considered search results. Users can enter query terms to search for documents, audio, or video that match their query terms from the search results library.

[0151] The search device compares the seventh feature data with the eighth feature data in the search results database, determines an eighth feature data that matches the seventh feature data from the search results database, and uses the search result of the eighth feature data that matches the seventh feature data as the second search result. In other words, the second search result is the search result of the first query term; specifically, the second search result is the search result obtained by the first user using the first query term.

[0152] In this implementation, upon detecting a search request, the search device fuses the fourth and fifth feature data to obtain the seventh feature data, thereby enabling the seventh feature data to more accurately represent the first user and the first query term. By comparing the seventh feature data with the eighth feature data in the search results database to determine the second search result, not only is the amount of data processing reduced, but the matching degree between the second search result and the first query term is also improved, as is the matching degree between the second search result and the first user, thereby enhancing the search effect.

[0153] It should be understood that the first user information and the first query term in the embodiments of this application are descriptive objects determined for the purpose of concisely describing the implementation process of the technical solution. The search device can use the technical solutions provided in steps 101 and 102 to determine the feature data of any user information and the feature data of any query term, and then perform a search based on the technical solutions provided in steps 201 and 202.

[0154] As an optional implementation, the updated feature data includes sixth feature data, that is, the search device obtains the sixth feature data by performing step 102, and the search device further performs the following steps:

[0155] 301. Replace the feature data of the first search result in the search results database with the sixth feature data mentioned above.

[0156] In this embodiment, the search result library includes a first search result. When the search device obtains the sixth feature data, it can use the sixth feature data to replace the feature data of the first search result, thereby improving the accuracy of the feature data of the first search result in the search result library in representing the first search result.

[0157] It should be understood that the first search result in this application embodiment is a descriptive object determined for the purpose of concisely describing the implementation process of the technical solution, and should not be construed as the search device updating the feature data of the first search result in the search result library only based on the technical solution provided above. In practical applications, the search device can update the feature data of any search result in the search result library based on the technical solution provided above.

[0158] As an optional implementation, the search device performs the following steps during step 101:

[0159] 401. Obtain the first heterogeneous graph.

[0160] In this embodiment of the application, the first heterogeneous graph includes first feature data, second feature data and third feature data. The first heterogeneous graph includes the following three types of nodes: user nodes, query term nodes and search result nodes. User nodes represent users, query term nodes represent query terms and search result nodes represent search results.

[0161] The input data for each node is the feature data of the object it represents. That is, in the first heterogeneous graph, the first user, the first query term, and the first search result are represented by different nodes. The first feature data is the input data of the node corresponding to the first user, the second feature data is the input data of the node corresponding to the first query term, and the third feature data is the input data of the node corresponding to the first search result. It should be understood that the first heterogeneous graph may include nodes other than the nodes corresponding to the first feature data, the second feature data, and the third feature data (hereinafter referred to as the first additional nodes).

[0162] An edge exists between a query term node and a user node, indicating that the query term represented by the query term node is a historical query term of the user represented by the user node. An edge exists between a user node and a search result node, indicating that the user represented by the user node is interested in the search result represented by the search result node. An edge exists between a query term node and a search result node, indicating that the search result represented by the search result node is a search result for the query term represented by the query term node, meaning there is a high relevance between the search result and the query term (i.e., the relevance is greater than or equal to the relevance threshold). Therefore, in the first heterogeneous graph, there are edges between the first feature data and the second and third feature data, and there is also an edge between the second feature data and the third feature data. Optionally, Figure 2 The diagram shown illustrates the relationships between the three types of nodes in the first heterogeneous graph.

[0163] It should be understood that a query term may have a high relevance to multiple different search results, and a search result may also have a high relevance to multiple different query terms. For example, Figure 3 The diagram shows the relationship between query node and search result node. Query node A has edges with both search result nodes C and E. Query node B has edges with both search result nodes D and E. Search result node E has edges with both query node A and query node B.

[0164] In one implementation of acquiring the first heterogeneous graph, the search device receives the first heterogeneous graph input by the user through an input component.

[0165] In another implementation of acquiring the first heterogeneous graph, the search device receives the first heterogeneous graph sent by the terminal.

[0166] Upon obtaining the first heterogeneous graph, the search device performs the following steps during step 102:

[0167] 402. Obtain the first neural network graph.

[0168] In this implementation, the first graph neural network can be an arbitrary graph neural network (GNN).

[0169] 403. The first heterogeneous graph is processed using the first graph neural network described above to obtain the updated feature data.

[0170] The search device uses a first graph neural network to process the first heterogeneous graph, which can perform weighted fusion of the first feature data, the second feature data, and the third feature data to obtain updated feature data.

[0171] In this embodiment, the relationship between the first feature data, the second feature data, and the third feature data is expressed by a first heterogeneous graph. Then, by using a first graph neural network to process the first heterogeneous graph, the relationship between the first feature data, the second feature data, and the third feature data can be used to fuse the first feature data, the second feature data, and the third feature data to obtain updated feature data.

[0172] Furthermore, when the first heterogeneous graph includes the first additional node, the updated feature data can be obtained by processing the first heterogeneous graph. The information carried by the first additional node can also be used to update the feature data of the first user, the feature data of the first query term, and the feature data of the first search result, thereby improving the expressive power of the updated feature data.

[0173] As an optional implementation, the search device performs the following steps during step 402:

[0174] 501. Obtain the second neural network and the second heterogeneous graph.

[0175] In this embodiment, the second graph neural network is an arbitrary GNN. The second heterogeneous graph is the training data. The construction method of the second heterogeneous graph is the same as that of the first heterogeneous graph.

[0176] The second heterogeneous graph includes the ninth feature data of the second user information, the tenth feature data of the second query term, and the eleventh feature data of the third search result. The second user information refers to the user's information, the second query term refers to the user's historical query terms, and the third search result refers to the search result for the second query term, indicating that the second user is interested in the third search result. That is, in the second heterogeneous graph, there are edges between the ninth and tenth / eleventh feature data, and also between the tenth and eleventh feature data. It should be understood that the second heterogeneous graph may include nodes other than those corresponding to the ninth, tenth, and eleventh feature data.

[0177] 502. The second graph neural network described above is used to process the second heterogeneous graph, and the tenth feature data of the second query term is updated to obtain the twelfth feature data, and the eleventh feature data of the third search result is updated to obtain the thirteenth feature data.

[0178] The search device processes the second heterogeneous graph using a second graph neural network, which can update the tenth feature data of the second query term to the twelfth feature data, and update the eleventh feature data of the third search result to the thirteenth feature data.

[0179] 503. Calculate the first similarity between the twelfth feature data and the thirteenth feature data.

[0180] 504. Based on the first similarity and the first difference of the first label, the training loss is obtained.

[0181] In this embodiment, the first label indicates whether the second query term and the third search result are related. Specifically, if the second query term and the third search result are related, the relevance between them is greater than or equal to a relevance threshold; if they are not related, the relevance is less than the relevance threshold. For example, a first label of 1 indicates that the second query term and the third search result are related, and a first label of 0 indicates that the second query term and the third search result are not related.

[0182] In this embodiment, the first difference is positively correlated with the training loss. In one possible implementation, the first similarity is s1, the first label is y1, and the training loss is l, where s1, y1, and l satisfy the following equation:

[0183] l=-y1×ln s1-(1-y1)×ln(1-s1)…Formula (1)

[0184] That is, the search device can calculate the training loss using formula (1), and in formula (1), the training loss is positively correlated with the first difference.

[0185] In another possible implementation, the first similarity is s1, the first label is y1, the first difference is d1, and the training loss is l, where l, s1, y1, and d1 satisfy the following equation:

[0186]

[0187] Where k1 is a positive number.

[0188] In another possible implementation, the first similarity is s1, the first label is y1, the first difference is d1, and the training loss is l, where l, s1, y1, and d1 satisfy the following equation:

[0189]

[0190] Where k1 is a positive number and c1 is a constant.

[0191] In another possible implementation, the first similarity is s1, the first label is y1, the first difference is d1, and the training loss is l, where l, s1, y1, and d1 satisfy the following equation:

[0192]

[0193] Where k1 is a positive number.

[0194] 505. Based on the training loss described above, update the parameters of the second neural network to obtain the first neural network described above.

[0195] In one possible implementation, the search device updates the parameters of the second graph neural network based on the training loss until the training loss converges, thus completing the training of the second graph neural network and obtaining the first graph neural network.

[0196] In this implementation, the first similarity is the similarity between the twelfth and thirteenth feature data. The twelfth feature data is the feature data of the second query term, and the thirteenth feature data is the feature data of the third search result. Therefore, the first similarity can characterize the relevance between the second query term and the third search result. Thus, by obtaining the training loss based on the first difference between the first similarity and the first label, and updating the parameters of the second graph neural network based on the training loss, the expressive power of the query term feature data extracted by the second graph neural network (i.e., the accuracy of the query term feature data in representing the query term) and the expressive power of the search result feature data extracted by the second graph neural network (i.e., the accuracy of the search result feature data in representing the search result) can be improved.

[0197] Optionally, the first graph neural network trained in steps 501 to 505 can be used to process the first heterogeneous graph to obtain the fifth feature data and the sixth feature data, which can improve the expressive power of the fifth feature data and the sixth feature data.

[0198] As an optional implementation, the search device also performs the following steps:

[0199] 601. The second graph neural network described above is used to process the second heterogeneous graph described above, and the ninth feature data of the second user described above is updated to obtain the fourteenth feature data.

[0200] It should be understood that the search device processes the second heterogeneous graph using a second graph neural network to obtain the twelfth, thirteenth, and fourteenth feature data. That is, steps 601 and 502 are performed simultaneously.

[0201] 602. Calculate the second similarity between the thirteenth feature data and the fourteenth feature data.

[0202] 603. Determine the second difference between the second similarity and the second label.

[0203] In this embodiment, the second tag indicates whether the second user is interested in the third search result. Optionally, the second user is interested in the third search result if they have performed at least one of the following actions: view, favorite, like, comment, forward, or recommend; otherwise, the second user is not interested in the third search result.

[0204] For example, a second tag of 1 indicates that the second user is interested in the third search result, while a second tag of 0 indicates that the second user is not interested in the third search result.

[0205] Optionally, the second difference is the absolute value of the difference between the second similarity and the second label.

[0206] Upon obtaining the second difference, the search device performs the following steps during step 504:

[0207] 604. Based on the first difference and the second difference mentioned above, the training loss is obtained.

[0208] In this embodiment, both the first difference and the second difference are positively correlated with the training loss. In one possible implementation, the first similarity is s1, the second similarity is s2, the first label is y1, the second label is y2, the training loss is l, and s1, s2, y1, y2, and l satisfy the following formula:

[0209] l=-y1×ln s1-(1-y1)×ln(1-s1)-y2×ln s2-(1-y2)×ln(1-s2)…Formula (5)

[0210] That is, the search device can calculate the training loss through formula (5), and in formula (5), the training loss is positively correlated with the first difference and the second difference.

[0211] In another possible implementation, the first similarity is s1, the second similarity is s2, the first label is y1, the second label is y2, the first difference is d1, the second difference is d2, the training loss is l1, and s1, s2, y1, y2, d1, d2, and l satisfy the following equation:

[0212]

[0213] In this case, k2 and k3 are both positive numbers.

[0214] In another possible implementation, the first similarity is s1, the second similarity is s2, the first label is y1, the second label is y2, the first difference is d1, the second difference is d2, the training loss is l1, and s1, s2, y1, y2, d1, d2, and l satisfy the following equation:

[0215]

[0216] Where k2 and k3 are both positive numbers, and c2 is a constant.

[0217] In another possible implementation, the first similarity is s1, the second similarity is s2, the first label is y1, the second label is y2, the first difference is d1, the second difference is d2, the training loss is l1, and s1, s2, y1, y2, d1, d2, and l satisfy the following equation:

[0218]

[0219] In this case, k2 and k3 are both positive numbers.

[0220] In this implementation, the second similarity is the similarity between the thirteenth and fourteenth feature data. The thirteenth feature data is the feature data of the third search result, and the fourteenth feature data is the feature data of the second user. Therefore, the second similarity can characterize whether the second user is interested in the third search result. Thus, by obtaining the training loss based on the second difference between the second similarity and the second label, and updating the parameters of the second graph neural network based on the training loss, the expressive power of the user feature data extracted by the second graph neural network (i.e., the accuracy with which the user feature data expresses the user) and the expressive power of the search result feature data extracted by the second graph neural network can be improved.

[0221] Optionally, the first graph neural network trained in steps 601 to 604 can be used to process the first heterogeneous graph to obtain the fourth feature data, the fifth feature data, and the sixth feature data, which can improve the expressive power of the fourth feature data, the fifth feature data, and the sixth feature data.

[0222] As an optional implementation, the search device also performs the following steps:

[0223] 701. The second graph neural network described above is used to process the second heterogeneous graph described above, and the ninth feature data of the second user described above is updated to obtain the fourteenth feature data.

[0224] The implementation process of this step can be found in step 601, and will not be repeated here.

[0225] 702. Calculate the third similarity between the twelfth feature data and the fourteenth feature data.

[0226] 703. Determine the third difference between the third similarity and the third label mentioned above.

[0227] In this embodiment, the second tag indicates whether the second query term is a historical query term of the second user, that is, whether the second user has used the second query term to search. Optionally, a third tag of 1 indicates that the second query term is a historical query term of the second user, and a third tag of 0 indicates that the second query term is not a historical query term of the second user.

[0228] Upon obtaining the third difference, the search device performs the following steps during step 504:

[0229] 704. Based on the first difference and the third difference mentioned above, the training loss is obtained; the third difference is positively correlated with the training loss.

[0230] In this embodiment, both the first difference and the third difference are positively correlated with the training loss. In one possible implementation, the first similarity is s1, the third similarity is s3, the first label is y1, the third label is y3, the training loss is l, and s1, s3, y1, y3, and l satisfy the following formula:

[0231] l=-y1×ln s1-(1-y1)×ln(1-s1)-y3×ln s3-(1-y3)×ln(1-s3)…Formula (9)

[0232] That is, the search device can calculate the training loss through formula (9), and in formula (9), the training loss is positively correlated with the first difference and the third difference.

[0233] In another possible implementation, the first similarity is s1, the third similarity is s3, the first label is y1, the third label is y3, the first difference is d1, the third difference is d3, the training loss is l1, and s1, s3, y1, y3, d1, d3, and l satisfy the following equation:

[0234]

[0235] Among them, k4 and k5 are both positive numbers.

[0236] In another possible implementation, the first similarity is s1, the third similarity is s3, the first label is y1, the third label is y3, the first difference is d1, the third difference is d3, the training loss is l1, and s1, s3, y1, y3, d1, d3, and l satisfy the following equation:

[0237]

[0238] Where k4 and k5 are both positive numbers, and c3 is a constant.

[0239] In another possible implementation, the first similarity is s1, the third similarity is s3, the first label is y1, the third label is y3, the first difference is d1, the third difference is d3, the training loss is l1, and s1, s3, y1, y3, d1, d3, and l satisfy the following equation:

[0240]

[0241] Among them, k4 and k5 are both positive numbers.

[0242] In this implementation, the third similarity is the similarity between the twelfth feature data and the fourteenth feature data. The twelfth feature data is the feature data of the second query term, and the fourteenth feature data is the feature data of the second user. Therefore, the third similarity can characterize whether the second query term is a historical query term of the second user. Thus, by obtaining the training loss based on the third difference between the third similarity and the third label, and updating the parameters of the second graph neural network based on the training loss, the expressive power of the user feature data extracted by the second graph neural network and the expressive power of the query term feature data extracted by the second graph neural network can be improved.

[0243] Optionally, the first heterogeneous graph can be processed by the first graph neural network trained in steps 701 to 704 to obtain the fourth feature data, the fifth feature data, and the sixth feature data, which can improve the expressive power of the fourth feature data, the fifth feature data, and the sixth feature data.

[0244] As an optional implementation, the search device further performs the following steps before performing step 604:

[0245] 801. Calculate the third similarity between the twelfth feature data and the fourteenth feature data mentioned above.

[0246] 802. Determine the third difference between the third similarity and the third label.

[0247] In this embodiment, the second tag indicates whether the second query term is a historical query term of the second user, that is, whether the second user has used the second query term to search. Optionally, a third tag of 1 indicates that the second query term is a historical query term of the second user, and a third tag of 0 indicates that the second query term is not a historical query term of the second user.

[0248] Upon obtaining the third difference, the search device performs the following steps during step 604:

[0249] 803. Based on the first difference, the second difference, and the third difference mentioned above, the training loss is obtained; the third difference is positively correlated with the training loss.

[0250] In this embodiment, the first difference, second difference, and third difference are all positively correlated with the training loss. In one possible implementation, the first similarity is s1, the second similarity is s2, the third similarity is s3, the first label is y1, the second label is y2, the third label is y3, the training loss is l, and s1, s2, s3, y1, y2, y3, and l satisfy the following formula:

[0251] l=-y1×ln s1-(1-y1)×ln(1-s1)-y2×ln s2-(1-y2)×ln(1-s2)-y3×ln s3-(1-y3)×ln(1-s3)…Formula (13)

[0252] That is, the search device can calculate the training loss through formula (13), and in formula (13), the training loss is positively correlated with the first difference, the second difference, and the third difference.

[0253] In another possible implementation, the first similarity is s1, the second similarity is s2, the third similarity is s3, the first label is y1, the second label is y2, the third label is y3, the first difference is d1, the second difference is d2, the third difference is d3, the training loss is l1, and s1, s2, s3, y1, y2, y3, d1, d2, d3, and l satisfy the following equation:

[0254]

[0255] Among them, k7, k8, and k9 are all positive numbers.

[0256] In another possible implementation, the first similarity is s1, the second similarity is s2, the third similarity is s3, the first label is y1, the second label is y2, the third label is y3, the first difference is d1, the second difference is d2, the third difference is d3, the training loss is l1, and s1, s2, s3, y1, y2, y3, d1, d2, d3, and l satisfy the following equation:

[0257]

[0258] Among them, k7, k8, and k9 are all positive numbers, and c4 is a constant.

[0259] In another possible implementation, the first similarity is s1, the second similarity is s2, the third similarity is s3, the first label is y1, the second label is y2, the third label is y3, the first difference is d1, the second difference is d2, the third difference is d3, the training loss is l1, and s1, s2, s3, y1, y2, y3, d1, d2, d3, and l satisfy the following equation:

[0260]

[0261] Among them, k7, k8, and k9 are all positive numbers.

[0262] In this implementation, the third similarity is the similarity between the twelfth feature data and the fourteenth feature data. The twelfth feature data is the feature data of the second query term, and the fourteenth feature data is the feature data of the second user. Therefore, the third similarity can characterize whether the second query term is a historical query term of the second user. Thus, by obtaining the training loss based on the third difference between the third similarity and the third label, and updating the parameters of the second graph neural network based on the training loss, the expressive power of the user feature data extracted by the second graph neural network and the expressive power of the query term feature data extracted by the second graph neural network can be improved.

[0263] Optionally, the first heterogeneous graph can be processed by the first graph neural network trained in steps 801 to 803 to obtain the fourth feature data, the fifth feature data and the sixth feature data, which can improve the expressive power of the fourth feature data, the fifth feature data and the sixth feature data.

[0264] It should be understood that the second user, second query term, third search result, ninth feature data, tenth feature data, and eleventh feature data in the embodiments of this application are all descriptive objects determined for the purpose of concisely describing the training process of the second graph neural network. They should not be construed as the search device updating the parameters of the second graph neural network solely based on the second user, second query term, third search result, ninth feature data, tenth feature data, and eleventh feature data during the training process. In actual training, the second heterogeneous graph may include nodes other than those corresponding to the second user, the second query term, and the third search result (hereinafter referred to as second additional nodes). For the second additional nodes, the search device can determine the additional loss of the second additional nodes based on the method of determining the training loss using the ninth feature data, tenth feature data, and eleventh feature data. By summing the training loss and the additional loss, the total loss can be obtained. Finally, based on the total loss, the parameters of the second graph neural network are updated to obtain the first graph neural network.

[0265] Based on the technical solutions provided in the embodiments of this application, the embodiments of this application also provide several possible application scenarios.

[0266] Company A provides a search function in its software, allowing any user to perform searches. To improve search results, Company A can update the feature data of all user information, the feature data of all query terms, and the feature data of all search results based on the technical solution provided above.

[0267] After updating the feature data of all user information, all query terms, and all search results, the search results can be determined based on the updated feature data of user information, query terms, and search results when a user searches. This can improve the matching degree between search results and users, thereby improving search effectiveness.

[0268] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0269] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, while using clear signs / information to inform users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, personal information processing may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.

[0270] The methods of the embodiments of this application have been described in detail above, and the apparatus of the embodiments of this application is provided below.

[0271] Please see Figure 4 , Figure 4 This is a schematic diagram of a search device provided in an embodiment of this application. The search device 1 includes an acquisition unit 11 and a processing unit 12. Specifically:

[0272] The acquisition unit 11 is used to acquire the first feature data of the first user information, the second feature data of the first query term, and the third feature data of the first search result;

[0273] The first user information is the user information of the first user, the first query term is the historical query term of the first user, the first search result is the search result of the first query term, and the first user is interested in the first search result;

[0274] The processing unit 12 is used to perform weighted fusion on the first feature data, the second feature data and the third feature data to obtain updated feature data; the updated feature data includes the fourth feature data of the first user information.

[0275] In any embodiment of this application, the updated feature data further includes the fifth feature data of the first query term.

[0276] In any embodiment of this application, the updated feature data further includes the sixth feature data of the first search result.

[0277] In conjunction with any embodiment of this application, the processing unit 12 is further configured to: upon detecting a search request for the first query term input by the first user, fuse the fourth feature data and the fifth feature data to obtain seventh feature data;

[0278] A second search result is determined from the search result database that has eighth feature data that matches the seventh feature data; the second search result is the search result for the first query term.

[0279] In any embodiment of this application, the processing unit 12 is further configured to replace the feature data of the first search result in the search result library with the sixth feature data.

[0280] In any embodiment of this application, the acquisition unit 11 is used for:

[0281] Obtain a first heterogeneous graph; the first heterogeneous graph includes the first feature data, the second feature data and the third feature data, and in the first heterogeneous graph, there are edges between the first feature data and the second feature data and the third feature data, and there are also edges between the second feature data and the third feature data;

[0282] The weighted fusion of the first feature data, the second feature data, and the third feature data to obtain the updated feature data includes:

[0283] Obtain the first neural network graph;

[0284] The first heterogeneous graph is processed using the first graph neural network to obtain the updated feature data.

[0285] In any embodiment of this application, the acquisition unit 11 is used for:

[0286] Obtain a second graph neural network and a second heterogeneous graph; the second heterogeneous graph includes the ninth feature data of the second user information, the tenth feature data of the second query term, and the eleventh feature data of the third search result, the second user information is the user information of the second user, the second query term is the historical query term of the second user, the third search result is the search result of the second query term, and the second user is interested in the third search result;

[0287] The second graph neural network is used to process the second heterogeneous graph, and the tenth feature data of the second query term is updated to obtain the twelfth feature data, and the eleventh feature data of the third search result is updated to obtain the thirteenth feature data.

[0288] Calculate the first similarity between the twelfth feature data and the thirteenth feature data;

[0289] The training loss is obtained based on the first difference between the first similarity and the first label; the first difference is positively correlated with the training loss; and the first label represents whether the second query term is related to the third search result.

[0290] Based on the training loss, the parameters of the second graph neural network are updated to obtain the first graph neural network.

[0291] In conjunction with any embodiment of this application, the acquisition unit 11 is further configured to:

[0292] The second graph neural network is used to process the second heterogeneous graph, and the ninth feature data of the second user is updated to obtain the fourteenth feature data;

[0293] Calculate the second similarity between the thirteenth feature data and the fourteenth feature data;

[0294] Determine the second difference between the second similarity and the second tag; the second tag indicates whether the second user is interested in the third search result.

[0295] The training loss is obtained based on the first difference and the second difference; the second difference is positively correlated with the training loss.

[0296] In conjunction with any embodiment of this application, the acquisition unit 11 is further configured to:

[0297] Before obtaining the training loss based on the first difference between the first similarity and the first label, the method further includes:

[0298] The second graph neural network is used to process the second heterogeneous graph, and the ninth feature data of the second user is updated to obtain the fourteenth feature data;

[0299] Calculate the third similarity between the twelfth feature data and the fourteenth feature data;

[0300] Determine the third difference between the third similarity and the third tag; the third tag indicates whether the second query term is a historical query term of the second user;

[0301] The training loss is obtained based on the first difference and the third difference; the third difference is positively correlated with the training loss.

[0302] In conjunction with any embodiment of this application, the acquisition unit 11 is further configured to:

[0303] Calculate the third similarity between the twelfth feature data and the fourteenth feature data;

[0304] Determine the third difference between the third similarity and the third tag; the third tag indicates whether the second query term is a historical query term of the second user;

[0305] The training loss is obtained based on the first difference, the second difference, and the third difference; the third difference is positively correlated with the training loss.

[0306] In this embodiment, both the first feature data and the fourth feature data can represent the first user information, but the first feature data only carries the first user information. The fourth feature data is obtained by fusing the information carried by the first feature data, the second feature data, and the third feature data. Therefore, the fourth feature data carries not only the first user information but also the semantic information of the first query term and the semantic information of the first search result. Since both the first query term and the first search result are related to the first user (i.e., the first query term is a historical query term of the first user, and the first user is interested in the first search result), the semantic information of both the first query term and the first search result helps to enrich the first user's user information.

[0307] Therefore, compared with the first feature data, the fourth feature data can more accurately represent the first user. That is, when the first user searches using any query term, the fourth feature data can be used to determine the search results that are suitable for the first user, thereby improving the matching degree between the search results and the first user.

[0308] In other words, the search device obtains the fourth feature data by weighted fusion of the first feature data, the second feature data, and the third feature data. This improves the expressive power of the fourth feature data, thereby enhancing the accuracy of the representation of the first user by the feature data of the first user information.

[0309] In some embodiments, the functions or modules of the apparatus provided in this application can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0310] Figure 5This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device 2 includes a processor 21 and a memory 22. Optionally, the electronic device 2 also includes an input device 23 and an output device 24. The processor 21, memory 22, input device 23, and output device 24 are coupled together via connectors, which include various interfaces, transmission lines, or buses, etc., and are not limited in this embodiment. It should be understood that in the various embodiments of this application, coupling refers to mutual connection in a specific way, including direct connection or indirect connection through other devices, such as through various interfaces, transmission lines, buses, etc.

[0311] Processor 21 may include one or more processors, such as one or more central processing units (CPUs). If the processor is a CPU, it can be a single-core CPU or a multi-core CPU. Optionally, processor 21 may be a processor group composed of multiple GPUs, with the multiple processors coupled to each other via one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in this embodiment.

[0312] The memory 22 can be used to store computer program instructions, as well as various types of computer program code, including program code for executing the scheme of this application. Optionally, the memory includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM), which is used for related instructions and data.

[0313] Input device 23 is used to input data and / or signals, and output device 24 is used to output data and / or signals. Input device 23 and output device 24 can be independent devices or an integrated device.

[0314] It is understood that in this embodiment of the application, the memory 22 can be used not only to store related instructions, but also to store related data. For example, the memory 22 can be used to store the first feature data of the first user information obtained through the input device 23, the second feature data of the first query term, the third feature data of the first search result, or the memory 22 can also be used to store the fourth feature data obtained through the processor 21, etc. This embodiment of the application does not limit the specific data stored in the memory.

[0315] Understandable Figure 5 This is merely a simplified design of an electronic device. In practical applications, the electronic device may also include other necessary components, including, but not limited to, any number of input / output devices, processors, memories, etc., and all electronic devices that can implement the embodiments of this application are within the protection scope of this application.

[0316] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0317] Those skilled in the art will readily understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. Those skilled in the art will also readily understand that the various embodiments of this application have different focuses, and for the sake of convenience and brevity, the same or similar parts may not be repeated in different embodiments. Therefore, parts not described or not described in detail in one embodiment can be referred to the descriptions in other embodiments.

[0318] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0319] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0320] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0321] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital versatile discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).

[0322] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A search method, characterized in that, The method includes: Obtain the first feature data of the first user information, the second feature data of the first query term, and the third feature data of the first search result; The first user information is the user information of the first user, the first query term is the historical query term of the first user, the first search result is the search result of the first query term, and the first user is interested in the first search result; The step of obtaining the first feature data of the first user information, the second feature data of the first query term, and the third feature data of the first search result includes: obtaining a first heterogeneous graph; the first heterogeneous graph includes the first feature data, the second feature data, and the third feature data, and in the first heterogeneous graph, there are edges between the first feature data and the second feature data and the third feature data, and there are also edges between the second feature data and the third feature data; The first feature data, the second feature data, and the third feature data are weighted and fused to obtain updated feature data; the updated feature data includes the fourth feature data of the first user information; The step of weightedly fusing the first feature data, the second feature data, and the third feature data to obtain updated feature data includes: obtaining a first graph neural network; and using the first graph neural network to process the first heterogeneous graph to obtain the updated feature data.

2. The method according to claim 1, characterized in that, The updated feature data also includes the fifth feature data of the first query term.

3. The method according to claim 1 or 2, characterized in that, The updated feature data also includes the sixth feature data of the first search result.

4. The method according to claim 2, characterized in that, The method further includes: Upon detecting a search request for the first query term input by the first user, the fourth feature data and the fifth feature data are fused to obtain the seventh feature data; A second search result is determined from the search result database that has eighth feature data that matches the seventh feature data; the second search result is the search result for the first query term.

5. The method according to claim 3, characterized in that, The method further includes: Replace the feature data of the first search result in the search results library with the sixth feature data.

6. The method according to claim 1, characterized in that, The process of obtaining the first graph neural network includes: Obtain a second graph neural network and a second heterogeneous graph; the second heterogeneous graph includes the ninth feature data of the second user information, the tenth feature data of the second query term, and the eleventh feature data of the third search result, the second user information is the user information of the second user, the second query term is the historical query term of the second user, the third search result is the search result of the second query term, and the second user is interested in the third search result; The second graph neural network is used to process the second heterogeneous graph, and the tenth feature data of the second query term is updated to obtain the twelfth feature data, and the eleventh feature data of the third search result is updated to obtain the thirteenth feature data. Calculate the first similarity between the twelfth feature data and the thirteenth feature data; The training loss is obtained based on the first difference between the first similarity and the first label; the first difference is positively correlated with the training loss; and the first label represents whether the second query term is related to the third search result. Based on the training loss, the parameters of the second graph neural network are updated to obtain the first graph neural network.

7. The method according to claim 6, characterized in that, Before obtaining the training loss based on the first difference between the first similarity and the first label, the method further includes: The second graph neural network is used to process the second heterogeneous graph, and the ninth feature data of the second user is updated to obtain the fourteenth feature data; Calculate the second similarity between the thirteenth feature data and the fourteenth feature data; Determine the second difference between the second similarity and the second tag; the second tag indicates whether the second user is interested in the third search result. The step of obtaining the training loss based on the first difference between the first similarity and the first label includes: The training loss is obtained based on the first difference and the second difference; the second difference is positively correlated with the training loss.

8. The method according to claim 7, characterized in that, Before obtaining the training loss based on the first difference and the second difference, the method further includes: Before obtaining the training loss based on the first difference between the first similarity and the first label, the method further includes: The second graph neural network is used to process the second heterogeneous graph, and the ninth feature data of the second user is updated to obtain the fourteenth feature data; Calculate the third similarity between the twelfth feature data and the fourteenth feature data; Determine the third difference between the third similarity and the third tag; the third tag indicates whether the second query term is a historical query term of the second user; The step of obtaining the training loss based on the first difference between the first similarity and the first label includes: The training loss is obtained based on the first difference and the third difference; the third difference is positively correlated with the training loss.

9. The method according to claim 7, characterized in that, Before obtaining the training loss based on the first difference and the second difference, the method further includes: Calculate the third similarity between the twelfth feature data and the fourteenth feature data; Determine the third difference between the third similarity and the third tag; the third tag indicates whether the second query term is a historical query term of the second user; The step of obtaining the training loss based on the first difference and the second difference includes: The training loss is obtained based on the first difference, the second difference, and the third difference; the third difference is positively correlated with the training loss.

10. A search device, characterized in that, The device includes: The acquisition unit is used to acquire the first feature data of the first user information, the second feature data of the first query term, and the third feature data of the first search result; The first user information is the user information of the first user, the first query term is the historical query term of the first user, the first search result is the search result of the first query term, and the first user is interested in the first search result; The step of obtaining the first feature data of the first user information, the second feature data of the first query term, and the third feature data of the first search result includes: obtaining a first heterogeneous graph; the first heterogeneous graph includes the first feature data, the second feature data, and the third feature data, and in the first heterogeneous graph, there are edges between the first feature data and the second feature data and the third feature data, and there are also edges between the second feature data and the third feature data; The processing unit is configured to perform weighted fusion on the first feature data, the second feature data, and the third feature data to obtain updated feature data; the updated feature data includes the fourth feature data of the first user information; The step of weightedly fusing the first feature data, the second feature data, and the third feature data to obtain updated feature data includes: obtaining a first graph neural network; and using the first graph neural network to process the first heterogeneous graph to obtain the updated feature data.

11. An electronic device, characterized in that, include: A processor and a memory, the memory being used to store computer program code, the computer program code including computer instructions, wherein, when the processor executes the computer instructions, the electronic device performs the method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Resource search method, device and equipment, and storage medium

    CN111611490A

  • Apparatus, method, program and computer readable recording medium for searching content

    JP2009245382A