Resource retrieval method and training method and device of resource retrieval model
By predicting two-level encoding information of user-preferred resources and using inverted index technology, the problem of low retrieval efficiency of user-interested resources in existing resource recommendation systems is solved, achieving more accurate resource recommendations and improved user experience.
Patent Information
- Application Number
- CN202511631171.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-02-27
AI Technical Summary
Existing resource recommendation systems struggle to efficiently retrieve resources of interest to users from massive resource databases, especially due to computational limitations, where vector retrieval and recall lack the ability to deeply characterize content.
By receiving retrieval requests from clients, the system predicts two-level encoding information of user-preferred resources based on user information and historical behavior sequences. It then uses an inverted index to retrieve and return resources that match user preferences from the index, and combines user information and resource vectors to perform multi-objective scoring and filtering.
It enables a more accurate description of user preferences, improves the comprehensiveness and efficiency of resource retrieval, ensures that recommended resources better meet user needs, and enhances the user experience.
Smart Images

Figure CN121579737A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, specifically to the fields of information retrieval, intelligent retrieval, document retrieval, and intelligent agents, and particularly to a resource retrieval method, a training method for a resource retrieval model, and an apparatus. Background Technology
[0002] The primary goal of resource recommendation systems is to efficiently retrieve the resources most relevant to users from a massive resource database. However, due to computational limitations, complex models struggle to directly rank all candidate sets. Recommendation systems typically employ a multi-stage architecture encompassing recall, coarse / fine ranking, and re-ranking. Currently, a common recall method is vector retrieval, which calculates vector similarity using simple inner products, lacking the ability to deeply characterize the content. Summary of the Invention This disclosure provides a method and apparatus for training resource retrieval methods and resource retrieval models.
[0003] According to one aspect of this disclosure, a resource retrieval method is provided, comprising: receiving a retrieval request sent by a client, wherein the retrieval request includes user information and historical behavior sequence of a target user, the historical behavior sequence including historical resources for which the target user has performed interactive operations; predicting first encoding information corresponding to user-preferred resources based on the historical behavior sequence, the first encoding information including at least two levels of first encoding; performing an inverted index on an index library based on the first encoding information to obtain a resource vector of a first resource; determining a second resource from the first resource according to the user information and the resource vector, and feeding back the second resource to the client.
[0004] According to another aspect of this disclosure, a method for training a resource retrieval model is provided, comprising: acquiring sample data and inputting the sample data into a resource retrieval model, wherein the sample data includes user information of sample users and sample behavior sequences, the sample behavior sequences include sample resources that have been interacted with by the sample users and tag data, and the resource retrieval model includes a preference prediction network, a resource quantization network, and a resource evaluation network; performing preference prediction on the sample behavior sequences through the preference prediction network to obtain predicted encoding information; acquiring a first resource vector of the sample resources based on the resource quantization network, and determining candidate encoding information based on the first resource vector and a code table, and acquiring a second resource vector of candidate push resources based on the candidate encoding information; acquiring evaluation parameters of the candidate push resources based on the user information and the second resource vector through the resource evaluation network; and performing reverse adjustment on the resource retrieval model based on the predicted encoding information, the evaluation parameters, and the tag data until training is completed to obtain a target resource retrieval model; wherein each type of encoding information includes at least two levels of encoding.
[0005] According to another aspect of this disclosure, another resource retrieval method is provided, comprising: receiving a retrieval request sent by a client, wherein the retrieval request includes user information and historical behavior sequence of a target user, the historical behavior sequence including historical resources for which the target user has performed interactive operations; obtaining first encoding information corresponding to user-preferred resources according to the retrieval request using a target resource retrieval model, the first encoding information including at least two levels of first encoding; performing an inverted index on an index library based on the first encoding information to obtain a resource vector of a first resource; determining a second resource from the first resource using the target resource retrieval model based on the user information and the resource vector; and feeding back the second resource to the client; wherein the target resource retrieval model is a model trained using the training method of this disclosure.
[0006] According to another aspect of this disclosure, a resource retrieval apparatus is provided, comprising: a receiving module, configured to receive a retrieval request sent by a client, wherein the retrieval request includes user information and a historical behavior sequence of a target user, the historical behavior sequence including historical resources for which the target user has performed interactive operations; a prediction module, configured to predict first encoding information corresponding to a user-preferred resource based on the historical behavior sequence, the first encoding information including at least two levels of first encoding; an indexing module, configured to perform an inverted index on an index library based on the first encoding information to obtain a resource vector of a first resource; and a determining module, configured to determine a second resource from the first resource based on the user information and the resource vector, and to feed back the second resource to the client.
[0007] According to another aspect of this disclosure, a training apparatus for a resource retrieval model is provided, comprising: an acquisition module for acquiring sample data and inputting the sample data into a resource retrieval model, wherein the sample data includes user information of a sample user and a sample behavior sequence, the sample behavior sequence includes sample resources that have been interacted with by the sample user and tag data, and the resource retrieval model includes a preference prediction network, a resource quantization network, and a resource evaluation network; a prediction module for performing preference prediction on the sample behavior sequence through the preference prediction network to obtain prediction encoding information; a first determination module for acquiring a first resource vector of the sample resource based on the resource quantization network, determining candidate encoding information based on the first resource vector and a code table, and acquiring a second resource vector of a candidate push resource based on the candidate encoding information; a second determination module for acquiring evaluation parameters of the candidate push resource based on the user information and the second resource vector through the resource evaluation network; and an adjustment module for performing reverse adjustment on the resource retrieval model based on the prediction encoding information, the evaluation parameters, and the tag data until training is completed and a target resource retrieval model is obtained; wherein each type of encoding information includes at least two levels of encoding.
[0008] According to another aspect of this disclosure, another resource retrieval apparatus is provided, comprising: a receiving module, configured to receive a retrieval request sent by a client, wherein the retrieval request includes user information and historical behavior sequence of a target user, the historical behavior sequence including historical resources for which the target user has performed interactive operations; an acquisition module, configured to acquire first encoding information corresponding to user-preferred resources according to the retrieval request using a target resource retrieval model, the first encoding information including at least two levels of first encoding; an indexing module, configured to perform an inverted index on an index library based on the first encoding information to obtain a resource vector of a first resource; a determination module, configured to determine a second resource from the first resource using the target resource retrieval model based on the user information and the resource vector; and a feedback module, configured to provide feedback of the second resource to the client; wherein the target resource retrieval model is a model trained using the training method of this disclosure.
[0009] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the resource retrieval method and the resource retrieval model training method described in one aspect of the embodiments above.
[0010] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein computer programs / instructions are stored thereon, the computer instructions being used to cause the computer to execute the resource retrieval method and the resource retrieval model training method described in the above-mentioned embodiment.
[0011] According to another aspect of this disclosure, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the resource retrieval method and the resource retrieval model training method described in the above-mentioned embodiment.
[0012] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0013] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 A flowchart illustrating a resource retrieval method provided in an embodiment of this disclosure; Figure 2 A flowchart illustrating another resource retrieval method provided in this embodiment of the disclosure; Figure 3 A flowchart illustrating the index database construction process in a resource retrieval method provided in this embodiment of the disclosure; Figure 4 A schematic diagram illustrating the process of updating the index library provided in this embodiment of the disclosure; Figure 5 A flowchart illustrating another resource retrieval method provided in this embodiment of the disclosure; Figure 6 A schematic diagram of the process for determining a second resource provided in an embodiment of this disclosure; Figure 7 A flowchart illustrating a training method for a resource retrieval model provided in an embodiment of this disclosure; Figure 8 A flowchart illustrating another resource retrieval method provided in this embodiment of the disclosure; Figure 9 This is a schematic diagram illustrating the process of resource retrieval based on a target resource retrieval model, provided in an embodiment of this disclosure. Figure 10 This is a schematic diagram of the structure of a resource retrieval device provided in an embodiment of the present disclosure; Figure 11 A schematic diagram of the structure of a training device for a resource retrieval model provided in an embodiment of this disclosure; Figure 12This is a schematic diagram of another resource retrieval device provided in an embodiment of the present disclosure; Figure 13 This is a block diagram of an electronic device used to implement the resource retrieval method of the embodiments of this disclosure. Detailed Implementation
[0014] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0015] The resource retrieval method, apparatus, electronic device, and storage medium of this disclosure are described below with reference to the accompanying drawings.
[0016] Artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It involves both hardware and software technologies. AI hardware technologies generally include computer vision, speech recognition, natural language processing, and related technologies such as deep learning, big data processing, and knowledge graphs.
[0017] Figure 1 This is a flowchart illustrating a resource retrieval method provided in an embodiment of this disclosure.
[0018] like Figure 1 As shown, this resource retrieval method may include: S101, receive a retrieval request sent by the client, wherein the retrieval request includes the target user's user information and historical behavior sequence.
[0019] It should be noted that the executing entity of the resource retrieval method in this embodiment can be a hardware device with data processing capabilities and / or the necessary software to drive the hardware device. Optionally, the executing entity may include a server, a user terminal, and other smart devices. Optionally, the user terminal includes, but is not limited to, mobile phones, computers, smart voice interaction devices, etc. Optionally, the server includes, but is not limited to, a network server, an application server, or a server of a distributed system, or a server combined with blockchain, etc. This embodiment does not impose specific limitations.
[0020] In some embodiments, a search request can be triggered when a target user performs a target operation on the client. Optionally, a search request can be generated by obtaining the target user's user information and the target user's historical behavior sequence.
[0021] For example, in response to a target user opening a target application on a client, user information and historical resources of interactions performed by the target user within the target application are obtained, thereby generating a historical behavior sequence. Further, a retrieval request is generated based on the user information and the historical behavior sequence.
[0022] In some embodiments, user information includes, but is not limited to, the target user's user identifier, the target user's operation identifier, and other information. Historical behavior sequences refer to records of the target user's behavior over a set period of time. In this embodiment, historical behavior sequences include historical resources of interactions performed by the target user.
[0023] Optionally, a historical behavior sequence can be generated by determining the target user's interactive operations and obtaining historical resources that have performed those operations. For example, historical resources that have been interacted with by the target user, such as liking or saving, can be obtained, and a historical behavior sequence can be generated based on the timestamps of the interactions performed on those historical resources.
[0024] In some embodiments, by receiving a search request sent by a client, the resource information corresponding to the search request can be determined based on the search request, and then feedback can be sent to the client to recommend the resource information to the target user.
[0025] S102, based on historical behavior sequences, predict the first coding information corresponding to user preference resources, the first coding information including at least two levels of first coding.
[0026] In some embodiments, user preference information can be determined based on historical behavior sequences, thereby predicting the target user's user preference resources based on the user preference information, and thus determining a two-level first code for the user preference resources as first code information.
[0027] In some embodiments, the first encoded information corresponding to the user preference resource can be predicted based on historical resources contained in the historical behavior sequence. Optionally, multi-layer self-attention encoding can be performed on the historical resources to predict and encode the user preference resource, thereby obtaining the first encoded information.
[0028] In some embodiments, two-level coding refers to a method of classifying and encoding information or data according to a hierarchical structure. By combining primary and secondary classifications, a structured representation of information is achieved, facilitating storage, retrieval, and analysis.
[0029] In some embodiments, feature extraction is performed on historical resources, and the feature vectors are quantized and encoded by an encoder to obtain a two-level first encoding, which serves as the first encoding information corresponding to the user-preferred resource. Optionally, for each historical resource in the historical behavior sequence, the feature vector of the historical resource is self-attention encoded by an encoder to obtain the first encoding information corresponding to the user-preferred resource.
[0030] In this embodiment of the disclosure, by generating first encoding information including at least two levels of first encoding, user preferences can be described more accurately, improving the comprehensiveness of preferences. Simultaneously, the structured two-level encoding facilitates subsequent retrieval based on the first encoding information, improving resource retrieval efficiency.
[0031] S103, based on the first encoding information, perform an inverted index on the index library to obtain the resource vector of the first resource.
[0032] In some embodiments, the first encoded information can be used as an index key to perform an inverted index in the index library to retrieve the resource identifier associated with the first encoded information from the index library, thereby determining the resource vector of the first resource based on the resource identifier.
[0033] The first resource refers to the candidate resource reported back to the client.
[0034] In some embodiments, the resource name, description, attributes, and other information of the first resource can be integrated into a vector representation, which serves as the resource vector of the first resource.
[0035] It should be noted that an inverted index is a mapping structure between encoding and resource lists, consisting of encoding information and an inverted list, where the inverted list contains the resource identifiers for the encodings. The resource list can be retrieved directly from the encoding information using the inverted index.
[0036] In other words, by determining the target inverted list corresponding to the first encoded information, the resource identifier corresponding to the first encoded information is determined based on the target inverted list, and the resource vector of the first resource is determined based on the resource identifier.
[0037] In some embodiments, before performing inverted indexing on the index library based on the first encoding information, the index library can be pre-built. The index library contains resource identifiers for the resources. An inverted list of encoded information resource identifiers can be pre-built based on the encoding information corresponding to different resources, thereby associating the encoding information with the inverted list to obtain the index library. The inverted list consists of resource identifiers.
[0038] S104: Based on the user information and resource vector, determine the second resource from the first resource and feed the second resource back to the client.
[0039] In some embodiments, a first resource can be scored using multiple objectives based on user information and resource vectors, and the final score of the first resource can be determined based on the multi-objective scoring results. Furthermore, the first resource can be filtered based on this score to determine a second resource from among the first resources.
[0040] The second resource refers to the target resource pushed to the client.
[0041] In some embodiments, by determining the user vector corresponding to the user information, a multi-objective score is performed on the first resource based on the user vector and the resource vector.
[0042] In some embodiments, after determining the multi-objective scoring results of the first resource, the scoring results can be fused to obtain the final score of the first resource. For example, a weight value can be determined for each scoring result, and the results can be weighted and fused according to the weight values to obtain the final score of the first resource.
[0043] In some embodiments, filtering criteria can be predetermined, and the first resource that meets the filtering criteria can be used as the second resource to be fed back to the client. Optionally, the filtering criteria can be determined based on the score. For example, the N first resources with the highest scores can be used as filtering criteria, and then the N first resources with the highest scores can be determined as the second resources based on the filtering criteria. Here, N is a natural number greater than 1.
[0044] In some embodiments, after determining the second resource, the second resource can be fed back to the client, thereby recommending the second resource that is more in line with the user's preferences to the target user, achieving more accurate resource recommendation to the target user and improving the user experience.
[0045] In this embodiment of the disclosure, resources refer to objects that can be used or consumed. Resources are accessible, have value, and can be quantified and described. Resources include, but are not limited to, video resources, audio resources, text resources, image resources, item resources, and service resources.
[0046] According to the resource retrieval method provided in this disclosure, by receiving a retrieval request from a client and predicting first encoding information of user-preferred resources based on the historical behavior sequence in the retrieval request, and performing an inverted index in the index database based on the first encoding information, a resource vector of the first resource can be obtained. Furthermore, by combining user information and the resource vector, a second resource is determined from the first resource to be fed back to the client. Thus, this solution can achieve the retrieval of second resources recommended to the user based on user preferences, improving the accuracy of the retrieved second resources. Resource retrieval through two-level encoding can more accurately describe user preferences, improving the comprehensiveness and efficiency of resource retrieval.
[0047] Figure 2 This is a flowchart illustrating a resource retrieval method provided in an embodiment of this disclosure.
[0048] like Figure 2 As shown, this resource retrieval method may include: S201, Receive a retrieval request sent by the client, wherein the retrieval request includes the target user's user information and historical behavior sequence.
[0049] S202, based on historical behavior sequences, predict the first coding information corresponding to user preference resources, the first coding information including at least two levels of first coding.
[0050] The details of steps S201-S202 can be found in the above embodiments and will not be repeated here.
[0051] S203, perform an inverted index on the index library based on the first encoding information to obtain the target inverted list corresponding to the first encoding information.
[0052] In some embodiments, the index is a database pre-built based on a data structure that maps encoding to resources. It is typically organized in the form of an inverted index, which consists of a mapping between encoding information and an inverted list.
[0053] Optionally, by performing an inverted index based on the first encoding information, a target inverted list corresponding to the first encoding information can be determined from the index library, and the resource identifier corresponding to the first encoding information can be determined from the target inverted list.
[0054] In some embodiments, the first encoded information can be used as a search keyword to find the corresponding target inverted list in the index, thereby achieving efficient retrieval of the index and improving the retrieval efficiency of resources.
[0055] In some embodiments, since different indexes support different retrieval modes, search keywords can be determined based on the first encoding information and the retrieval modes supported by the index. Optionally, the retrieval mode can be determined based on the index design of the index. For example, if the index design includes full encoding and single-level encoding, the corresponding retrieval modes are full retrieval and single-level retrieval.
[0056] For example, taking code1 and code2 as the first encoding information, where code1 and code2 are two-level first encodings. If the index supports a complete search mode, code1 and code2 can be used as search keywords; if the index supports a single-level search mode, code1 and code2 can be combined as search keywords, or either code1 or code2 can be used as search keywords.
[0057] Optionally, in order to improve retrieval efficiency, the first coding information can be standardized, which is helpful in determining retrieval keywords based on the standardized first coding information.
[0058] In some embodiments, a dictionary index and a partition index can be performed in the index library based on the search keywords to obtain the target inverted list corresponding to the first encoded information. Here, the dictionary index refers to searching for the search keywords in the dictionary portion of the index library to determine whether an inverted list corresponding to the search keywords exists in the dictionary portion, where the dictionary portion is the set of all unique terms.
[0059] Partitioned indexing refers to dividing the index into multiple partitions and determining the target partition based on the search keywords in order to determine whether an inverted list corresponding to the search keywords exists in the target partition.
[0060] In some embodiments, a first inverted list obtained by dictionary indexing of search keywords can be determined based on dictionary indexing of search keywords in the index library; a second inverted list obtained by partition indexing of search keywords can be determined based on partition indexing of search keywords in the index library, and the first inverted list and the second inverted list can be used as the target inverted list corresponding to the first encoded information.
[0061] S204, determine the first resource and the resource vector of the first resource based on the resource identifier corresponding to the first encoding information.
[0062] In some embodiments, if the target inverted list includes a resource identifier corresponding to the first encoded information, then after determining the target inverted list, the first resource and the resource vector of the first resource can be determined based on the resource identifier corresponding to the first encoded information.
[0063] In some embodiments, the resource identifier can be a string that uniquely identifies a resource, and the first resource can be determined from the resource identifier list based on this string. The resource identifier list is a list of resources and their corresponding resource identifiers.
[0064] In some embodiments, feature information of the first resource can be obtained and converted into a vector to obtain a resource vector of the first resource. For example, feature information includes text features, image features, attribute features, etc.
[0065] In some embodiments, the index library also includes a pre-built code table, which can pre-obtain the two-level codes of different resources, use the two-level codes as the encoding information of the resources, generate the code table, and generate the index library based on the code table and the inverted list.
[0066] In some embodiments, a code table can be pre-constructed based on the two-level encoding, and when determining the first encoding information, a second encoding information similar to the first encoding information can be determined based on the pre-constructed code table, and an inverted index can be performed based on the second encoding information.
[0067] In this embodiment of the disclosure, by pre-determining a code table containing encoding information and determining second encoding information similar to the first encoding information from the code table, and performing an inverted index based on the second encoding information, retrieval based on standard encoding information can be achieved, thereby improving retrieval efficiency and accuracy.
[0068] Optionally, a nearest neighbor search can be performed on the first encoded information in a pre-constructed code table to obtain the second encoded information. The code table includes multiple encoded information entries, each containing at least two levels of encoding.
[0069] The second encoded information is one of multiple encoded information. In other words, by performing a nearest neighbor search on the first encoded information, a encoded information similar to the first encoded information can be determined from the multiple encoded information included in the code table as the second encoded information.
[0070] Furthermore, an inverted index can be performed on the index database based on the second encoding information to obtain the resource vector of the first resource. For a detailed implementation of the inverted indexing of the index database based on the second encoding information, please refer to the above description of inverted indexing of the index database based on the first encoding information, which will not be repeated here.
[0071] S205: Based on the user information and resource vector, determine the second resource from the first resource and feed the second resource back to the client.
[0072] The details of step S205 can be found in the above embodiments and will not be repeated here.
[0073] According to the resource retrieval method provided in this disclosure, an inverted index is performed in the index database based on the first encoding information to determine the target inverted list corresponding to the first encoding information. Then, based on the resource identifier corresponding to the first encoding information in the target inverted list, the resource vector of the first resource is determined. This allows for retrieval in the index database based on two levels of first encoding, thereby improving the comprehensiveness of the retrieval. By performing an inverted index on the index database, the retrieval speed can be accelerated, and the retrieval efficiency can be improved.
[0074] Based on any of the above embodiments, the present disclosure embodiments can further explain and illustrate the construction process of the index library, such as... Figure 3 As shown, the process of building an index library may include: S301, determine the resource identifier corresponding to each encoded information in the pre-built code table.
[0075] S302, Generate an inverted list corresponding to the coded information based on the resource identifier.
[0076] S303, build an index library based on the encoding information and the corresponding inverted list.
[0077] In some embodiments, two-level codes for different resources can be obtained in advance, and these two-level codes can be used as the encoding information for the resources to generate a code table. Optionally, the encoding information for the resources can be obtained by converting the original features of the resources into discrete two-level codes, thereby generating the code table.
[0078] Furthermore, a resource identifier is determined for each resource, and the resource identifier corresponding to each encoded information in the code table is also determined. For example, there are resources 1, 2, and 3, whose corresponding resource identifiers are A, B, and C, and whose encoded information is information 1, information 2, and information 3. A code table can be generated based on information 1, information 2, and information 3, and the resource identifiers corresponding to information 1, information 2, and information 3 can be determined to be A, B, and C.
[0079] In some embodiments, encoded information can be used as keywords to establish a mapping between encoded information and resource identifiers, thereby obtaining an inverted list corresponding to the encoded information. Resource identifiers associated with the same encoded information can be identified and written into an initialized list to obtain the inverted list. In other words, the inverted list stores all resource identifiers containing a specific keyword.
[0080] In some embodiments, when generating the inverted list, the resource identifiers can be sorted according to their relevance. For example, the resource identifier most relevant to the encoded information can be ranked first in the list. Alternatively, the weights of the resource identifiers can be predetermined, and the inverted list can be obtained by sorting them according to their weights.
[0081] In some embodiments, an index is generated by integrating the code table and the inverted index into a queryable index structure. Alternatively, an index can be obtained by initializing the index structure and loading the code table and the inverted index into the index structure.
[0082] In some embodiments, since the code table consists of encoded information, the encoded information and the inverted list can be loaded into the index structure to obtain an index library. Optionally, the correspondence between the encoded information and the inverted list can also be added to the index library, thereby enabling the determination of the target inverted list corresponding to the first encoded information from the index library based on the first encoded information and the correspondence.
[0083] In some embodiments, after obtaining the index, the index can be updated in real time, which can improve the real-time nature of the encoding information of resources in the index, thereby improving the real-time nature of resource retrieval and thus improving the adaptability of the index.
[0084] In some embodiments, resources can be obtained from real-time streaming data, and the encoding information of the resources can be updated in the index. That is, by receiving real-time streaming data and obtaining a resource set based on the real-time streaming data, the resource set includes a third resource, which is a hot resource.
[0085] In some embodiments, hot resources refer to resources whose popularity exceeds a set threshold. By updating resources with higher popularity, the index can be made to conform to the current popularity trend.
[0086] It should be noted that real-time streaming data refers to a continuous, unbounded sequence of data arriving in chronological order, capable of capturing events, behaviors, or status updates in real time. For example, real-time user action information can be received as real-time streaming data.
[0087] In some embodiments, real-time streaming data can be received through a message queue in a streaming data management component. Furthermore, the real-time streaming data can be parsed and verified, and the popularity of resources within the real-time streaming data can be obtained.
[0088] In some embodiments, a third resource can be selected based on the popularity of the resource. By selecting resources with popularity higher than a set popularity threshold as the third resource, a resource set can be obtained, which can update the index library with highly popular resources.
[0089] In some embodiments, the index is updated based on the resource set if it is determined whether the update conditions are met. The index includes a temporary storage layer and a resource provisioning layer, and the resource set can be updated in the index based on the temporary storage layer and the resource provisioning layer.
[0090] In some embodiments, after obtaining the resource set, the third resource can be stored in the temporary storage layer, and the temporary storage layer can migrate the third resource to the resource supply library, and then the resource supply library can update the third resource in the index library.
[0091] In some embodiments, updating resources through a temporary storage layer and a resource supply repository can achieve read-write separation, avoid read-write conflicts, and improve query performance.
[0092] In some embodiments, the temporary storage layer may migrate a third resource to the resource supply repository when certain conditions are met, that is, in response to the fulfillment of the resource migration trigger condition, the third resource is migrated from the temporary storage layer to the resource supply repository.
[0093] In some embodiments, the resource supply library may also update the third resource in the index library when certain conditions are met, that is, in response to the fulfillment of the index update triggering condition, the index library is updated based on the resource supply library.
[0094] Optionally, the index update triggering conditions can be determined based on a set time interval. In other words, the index update triggering conditions can be automatically met according to the set time interval.
[0095] In some embodiments, the temporary storage layer is also configured with resource cleanup rules to automatically clean up state-owned enterprise resources or resources with a popularity level below a set popularity threshold, thereby reducing storage usage and improving resource utilization.
[0096] For example, if the number of third resources exceeds a certain threshold, it can be used as a resource cleanup rule. Then, when the number of third resources exceeds the threshold, the third resource can be deleted.
[0097] Figure 4 The diagram illustrates the process of updating the index repository. The streaming data management component receives real-time streaming data and stores the resource sets within it in a temporary storage layer. This temporary storage layer can perform resource cleanup, thereby reducing resource consumption. When the resource migration trigger condition is met, the third resource in the temporary storage layer is migrated to the resource provisioning repository. And when the index update trigger condition is met, the third resource is updated to the index repository.
[0098] According to the resource retrieval method provided in this disclosure, by determining the resource identifier corresponding to each encoded information in the code table and generating an inverted list based on the resource identifier, an index library is constructed based on the inverted list and the encoded information, thereby realizing the association between the encoded information and the resource identifier, so as to improve the efficiency of retrieval based on the encoded information.
[0099] Figure 5 This is a flowchart illustrating a resource retrieval method provided in an embodiment of this disclosure.
[0100] like Figure 5 As shown, this resource retrieval method may include: S501, receive a retrieval request sent by the client, wherein the retrieval request includes the target user's user information and historical behavior sequence.
[0101] The details of step S501 can be found in the above embodiments and will not be repeated here.
[0102] S502, based on historical behavior sequences, predict the first coding information corresponding to user preferred resources, the first coding information including at least two levels of first coding.
[0103] In some embodiments, the historical behavior sequence includes historical resources of interactions performed by the target user. The relationships between historical resources can be obtained to determine the user's preferences and thus predict user preference resources.
[0104] In some embodiments, by extracting and encoding the association relationships of historical resources, a context encoding vector is obtained, thereby determining the user's preferred resources based on the context encoding vector. By obtaining the encoding information of the first resource in the user's preferred resources as the starting encoding, step-by-step encoding prediction can be performed based on the context encoding vector and the starting encoding to determine the first encoding information corresponding to the user's preferred resources.
[0105] In some embodiments, the relationships between historical resources may be semantic similarity, sequence correlation, etc.
[0106] In some embodiments, a multi-layer self-attention mechanism can be used to extract and encode the relationships between historical resources to obtain a context encoding vector. During the encoding process, for any layer, the relationship between the first historical resource in the historical behavior sequence and the historical resource input to the current layer, as well as the relationship output by the previous layer, are encoded. This can achieve more accurate preference prediction to determine the first encoded information corresponding to the user's preferred resource.
[0107] For example, consider a three-layer self-attention mechanism. The second layer encodes the first historical resource and the relationship between the first and second historical resources to obtain encoding vector 1, which is then input into the third layer. The third layer encodes the context encoding vector based on encoding vector 1 and the relationship between the first and third historical resources.
[0108] S503, based on the first encoding information, perform an inverted index on the index library to obtain the resource vector of the first resource.
[0109] The details of step S503 can be found in the above embodiments and will not be repeated here.
[0110] S504, Based on the user information, determine the vector set of the target user, wherein the vector set includes user vectors of at least two dimensions of the target user.
[0111] In some embodiments, in order to improve the quality and coverage of the second resource and enable the second resource to more accurately match the target user, a user vector with at least two dimensions can be determined, thereby determining the second resource from the first resource based on the user vector.
[0112] In some embodiments, target users can be clustered to divide them into different clusters, resulting in high similarity among users within the same cluster and significant differences among users in different clusters. Furthermore, the user vectors corresponding to different cluster identifiers can serve as at least two dimensions of the target user's user vector, thereby improving the diversity of user vectors.
[0113] In some embodiments, target users can be clustered based on user information to obtain one or more cluster identifiers corresponding to the target users. This involves dividing target users into different clusters based on user information and determining the cluster identifiers corresponding to each cluster.
[0114] Optionally, target users can be divided into a fixed number of clusters based on Euclidean distance and user information. Alternatively, hierarchical clustering can be used to divide target users into different clusters, or a neural network model can be used to divide target users into different clusters based on user information. This disclosure does not specifically limit the clustering method.
[0115] In some embodiments, for each cluster identifier, a user vector corresponding to the cluster identifier is obtained, thereby determining the vector set of the target users based on the user vectors corresponding to the cluster identifiers. Optionally, the user vectors corresponding to each cluster identifier can be merged to obtain the vector set of the target users.
[0116] For example, if the target user belongs to cluster 1 and cluster 2, the user vectors corresponding to cluster 1 are vector A and vector B, and the user vector corresponding to cluster 2 is vector C, then the vector set of the target user is a set containing vectors A, B, and C.
[0117] In some embodiments, by pre-establishing a correspondence between cluster identifiers and user vectors, after determining the cluster identifier of a target user, the user vector corresponding to the cluster identifier can be determined by querying the correspondence.
[0118] S505, Based on the vector set and the resource vector, determine the second resource from the first resource.
[0119] In some embodiments, a first resource can be scored based on user vectors and resource vectors in a vector set, thereby filtering the first resource based on its score to determine a second resource from among the first resources.
[0120] In some embodiments, multiple evaluation parameters can be predetermined, and the scores of the first resource under the multiple evaluation parameters can be determined, thereby achieving scoring diversity, improving the accuracy of evaluation, making the second resource more in line with user preferences, and making the coverage of the second resource wider.
[0121] In some embodiments, the evaluation parameters include at least the relevance of the first resource to the target user, the click-through rate (CTR) of the first resource, and the interaction duration.
[0122] In some embodiments, evaluation parameters of a first resource are predicted based on user vectors and resource vectors. For example, the similarity between user vectors and resource vectors can be calculated as the relevance of the first resource to the target user. Alternatively, the CTR of the first resource can be determined based on the similarity between user vectors and resource vectors and the linear relationship between CTR. Furthermore, the interaction duration of the first resource can be determined based on the similarity between user vectors and resource vectors and the linear relationship between interaction duration.
[0123] In other words, the more similar the user vector is to the resource vector, the more interested the target user is in the content of the first resource, the longer the interaction time may be, and the higher the CTR.
[0124] In some embodiments, the score of the first resource can be determined based on the evaluation parameters of the first resource. The evaluation parameters can be fused to obtain the score of the first resource. For example, the weights of different evaluation parameters can be determined, and a weighted fusion can be performed based on these weights to obtain the score of the first resource.
[0125] Furthermore, the first resources are sorted according to their scores, and the second resources are determined based on the sorting results. Optionally, the first resources can be sorted from largest to smallest according to their scores to obtain a sorting result, and the top N first resources in the sorting result can be selected as the second resources, where N is a natural number greater than 1.
[0126] Figure 6 The diagram illustrates the process of determining the second resource. A neural network model is used to cluster the user information of the target user, identifying multiple cluster identifiers corresponding to the target user: identifier 1, identifier 2, and identifier 3. User vector 1 corresponding to identifier 1, user vector 2 corresponding to identifier 2, and user vector 3 corresponding to identifier 3 are determined as the vector set of the target user.
[0127] Furthermore, based on user vector 1, user vector 2, user vector 3 and the first resources: resource 1, resource 2, resource 3, and resource 4, resource evaluation parameters are predicted, and the score of the first resource is determined based on the resource evaluation parameters. Based on the score of the first resource, resource 1, resource 2, and resource 3 are selected as the second resource from resource 1, resource 2, resource 3, and resource 4.
[0128] S506 sends a second resource back to the client.
[0129] The details of step S506 can be found in the above embodiments and will not be repeated here.
[0130] According to the resource retrieval method provided in this disclosure, a vector set containing multi-dimensional user vectors is determined based on the user information of the target user, and a second resource is determined from the first resource based on the vector set and the resource vector of the first resource. This can improve the quality and coverage of the second resource, enabling the second resource to more accurately match the target user, more accurately describe user preferences, and improve the comprehensiveness and efficiency of resource retrieval.
[0131] Figure 7 This is a flowchart illustrating a training method for a resource retrieval model provided in an embodiment of the present disclosure.
[0132] like Figure 7 As shown, the training method for this resource retrieval model may include: S701, Obtain sample data and input the sample data into the resource retrieval model.
[0133] In some embodiments, the sample data includes user information of the sample user and a sample behavior sequence, wherein the sample behavior sequence includes sample resources that have been interacted with by the sample user and tag data. Optionally, any user can be used as a sample user, and the sample user's behavior data within a set time period can be obtained to generate the sample behavior sequence.
[0134] For example, sample resources that have been interacted with by sample users can be obtained, and sample behavior sequences can be generated based on the timestamps of the sample resources.
[0135] In some embodiments, the label data of the sample resources can also be obtained and added to the sample behavior sequence, wherein the label data can be the relevance between the sample resources and the sample users, the CTR of the sample resources, and the interaction duration.
[0136] In some embodiments, the resource retrieval model includes a preference prediction network, a resource quantification network, and a resource evaluation network. The preference prediction network, the resource quantification network, and the resource evaluation network can be trained separately to obtain a trained resource retrieval model.
[0137] S702 uses a preference prediction network to predict preferences in the sample behavior sequence and obtains the prediction encoding information.
[0138] In some embodiments, by inputting the sample behavior sequence into the preference prediction network of the resource retrieval model, the preference prediction network obtains the association relationship of sample resources in the sample behavior sequence, and performs preference prediction on sample users based on the association relationship, thereby obtaining prediction encoding information.
[0139] In some embodiments, the preference prediction network includes an encoder and a decoder, wherein the encoder includes multiple layers of self-attention, so that the association can be encoded by the self-attention mechanism of the encoder and the encoded prediction can be performed by the decoder to obtain the predicted encoded information.
[0140] In other words, the encoder in the preference prediction network can extract and encode the association relationship of the sample resources to obtain the context encoding vector, and the decoder in the preference prediction network can perform step-by-step encoding prediction based on the context encoding vector and the initial encoding to determine the predicted encoding information.
[0141] In this embodiment of the disclosure, the extraction of context encoding vectors through an encoder can efficiently capture the correlation between sample resources, thereby improving the accuracy and scalability of stepwise encoding prediction.
[0142] In some embodiments, the encoder consists of N self-attention layers, which can be used to extract the context encoding vector. By converting sample resources into sample resource vectors, each layer can calculate attention based on the sample resource vectors to obtain the weight values corresponding to the associations, and then perform weighted fusion of the associations based on the weight values to obtain the context encoding vector.
[0143] It should be noted that each type of encoded information includes at least two levels of encoding.
[0144] S703, based on the resource quantization network, obtains the first resource vector of the sample resources, and determines the candidate coding information based on the first resource vector and the code table, and obtains the second resource vector of the candidate push resources based on the candidate coding information.
[0145] In some embodiments, the sample resources can be quantized based on a resource quantization network to obtain a first resource vector of the sample resources. Optionally, the first resource vector of the sample resources can be obtained based on a multilayer perceptron (MLP) in the resource quantization network.
[0146] In this embodiment of the disclosure, the first resource vector is obtained by quantizing the sample resources based on the MLP in the resource quantization network. The sample resources can be transformed into a more efficient, computable and information-rich vector representation through nonlinear transformation and hierarchical feature extraction.
[0147] In some embodiments, after obtaining the first resource vector, candidate coding information similar to the first resource vector can be obtained from the code table. By encoding the first resource vector, sample coding information corresponding to the first resource is obtained, and then candidate coding information similar to the first resource vector is obtained from the code table based on the sample coding information. The code table includes coding information corresponding to different resource vectors, and the coding information is a two-level coding.
[0148] In some embodiments, the first resource vector can be quantized and compressed to obtain the sample encoding information of the sample resource. For example, based on the Residual Quantized Variational Autoencoder (RQ-VAE) in the resource quantization network, the first resource vector can be quantized and compressed to obtain the sample encoding information of the sample resource. This can achieve efficient discrete representation through hierarchical residual quantization, while improving information fidelity, computational efficiency, and semantic expression capabilities.
[0149] Furthermore, in the code table, a nearest neighbor search is performed on the sample coding information to determine the corresponding candidate coding information. By performing a nearest neighbor search on the sample coding information, coding information similar to the sample coding information can be identified from the code table as candidate coding information, thereby achieving efficient and semantically rich candidate coding information through discretization matching.
[0150] In some embodiments, obtaining candidate encoding information allows us to determine that the resource vector corresponding to the candidate encoding information is the second resource vector of the candidate push resource. In other words, the second resource vector can be determined by querying the correspondence between encoding information and resource vectors.
[0151] In some embodiments, after determining the first resource vector and sample coding information of the sample resource, the resource vector associated with the sample coding information can be updated based on the first resource vector of the sample resource, and the code table can be iteratively updated based on the sample coding information corresponding to the sample resource.
[0152] In this embodiment of the disclosure, by updating the resource vector and optimizing the code table, the efficiency of resource retrieval is improved, and the quality of resources retrieved by the resource retrieval model is enhanced, thereby improving the recommendation effect of resources.
[0153] S704, based on the resource evaluation network, obtains evaluation parameters for candidate push resources according to user information and the second resource vector.
[0154] In some embodiments, a resource evaluation network can be used to obtain sample user vectors of sample users based on user information, and then the evaluation parameters of candidate push resources can be calculated based on the sample user vectors and the second resource vector.
[0155] Optionally, the resource evaluation network can cluster sample users based on user information to determine multiple cluster identifiers corresponding to the sample users, and obtain the user vector corresponding to the cluster identifier as the sample user vector of the sample user.
[0156] In some embodiments, the evaluation parameters for candidate push resources include the relevance of the candidate push resources to the sample users, the CTR of the candidate push resources, and the interaction duration.
[0157] In some embodiments, evaluation parameters for candidate push resources can be obtained by calculating the similarity between the second resource vector and the sample user vector. Optionally, this similarity can be used as the relevance between the candidate push resource and the sample user, and the detailed relationship between similarity and CTR, as well as the linear relationship between similarity and interaction time, can be obtained to determine the CTR and interaction time of the candidate push resource.
[0158] S705, based on predictive coding information, evaluation parameters and label data, performs reverse adjustment on the resource retrieval model until the training ends and the target resource retrieval model is obtained.
[0159] In some embodiments, a loss function for the resource retrieval model can be determined based on predictive coding information, evaluation parameters, and label data. The resource retrieval model can then be adjusted in reverse according to the loss function, and the adjusted resource retrieval model can continue to be trained based on sample data until the training is completed and the target resource retrieval model is obtained. This allows the target resource retrieval model to accurately retrieve resources that better match the user's preferences based on the input retrieval request.
[0160] In some embodiments, training may end when the number of training iterations reaches a set number; training may end when the loss function is less than a threshold; or training may end when the accuracy of the model output reaches a set value.
[0161] In some embodiments, the corresponding target coding information is determined by performing a nearest neighbor search on the predicted coding information in the code table, and the first loss of the resource retrieval model is determined based on the predicted coding information and the target coding information.
[0162] Furthermore, based on the evaluation parameters and label data, the second loss of the resource retrieval model is determined, so that the resource retrieval model can be adjusted in reverse based on the first and second losses.
[0163] In some embodiments, the first loss and the second loss can be used to inversely adjust different networks in the resource retrieval model. Optionally, the preference prediction network can be inversely adjusted based on the first loss, and the resource evaluation network can be inversely adjusted based on the second loss, thereby obtaining an adjusted resource retrieval model.
[0164] According to the training method of the resource retrieval model provided in this disclosure, sample data is acquired, and the sample behavior sequence is used to predict preferences through the resource retrieval model to obtain predicted encoding information. Sample resources are then quantized and encoded to obtain candidate encoding information for the sample resources. Based on the candidate encoding information, a second resource vector for candidate push resources is determined. Further, evaluation parameters for candidate push resources can be determined based on the second resource vector. A loss function for the model is then determined based on the predicted encoding information, evaluation parameters, and tag data. The model is trained based on the loss function to obtain the target resource retrieval model. Back-adjusting the model based on the loss function can improve the efficiency and accuracy of the model in retrieving resources.
[0165] Figure 8 This is a flowchart illustrating a resource retrieval method provided in an embodiment of this disclosure.
[0166] like Figure 8 As shown, this resource retrieval method may include: S801, receive a retrieval request sent by the client, wherein the retrieval request includes the target user's user information and historical behavior sequence, and the historical behavior sequence includes historical resources in which the target user has performed interactive operations.
[0167] The details of step S801 can be found in the above embodiments and will not be repeated here.
[0168] S802, based on the retrieval request, the target resource retrieval model obtains the first encoding information corresponding to the user's preferred resource, the first encoding information including at least two levels of first encoding.
[0169] S803, based on the first encoding information, perform an inverted index on the index library to obtain the resource vector of the first resource.
[0170] S804: Based on user information and resource vectors, the target resource retrieval model determines the second resource from the first resource.
[0171] It should be noted that the target resource retrieval model adopts, for example... Figure 7 The training method for the resource retrieval model shown is obtained, and will not be elaborated here.
[0172] In some embodiments, by inputting a retrieval request into a target resource retrieval model, the preference prediction network in the target resource retrieval model can predict preferences based on historical behavior sequences, thereby obtaining the first encoded information corresponding to the user's preferred resources.
[0173] In some embodiments, the encoder in the preference prediction network can extract and encode the associations of historical resources in the historical behavior sequence to obtain a context encoding vector, and the decoder in the preference prediction network can perform step-by-step encoding prediction based on the context encoding vector and the initial encoding to determine the first encoding information.
[0174] Optionally, the first coding information includes at least two levels of first coding, which enables the first coding information to more accurately describe user preferences and improve the comprehensiveness of preferences. At the same time, the structured two-level coding facilitates subsequent retrieval based on the first coding information, improving resource retrieval efficiency.
[0175] In some embodiments, the resource vector of the first resource to be pushed to the client can be determined by using the resource quantization network in the target resource retrieval model to perform an inverted index on the index library based on the first encoding information. Specific implementation methods for the inverted index can be found in the above embodiments and will not be repeated here.
[0176] Furthermore, the resource evaluation network in the target resource retrieval model can be used to evaluate the first resource based on user information and resource vectors, thereby determining the score of the first resource. Further, a second resource can be determined from the first resources based on their scores. Optionally, the N highest-scoring first resources can be selected as the second resources, where N is a natural number greater than 1.
[0177] In some embodiments, the score of the first resource can be determined based on the evaluation parameters of the first resource. For specific implementation methods for determining the score of the first resource, please refer to the above embodiments, which will not be repeated here.
[0178] S805 sends a second resource back to the client.
[0179] The details of step S805 can be found in the above embodiments and will not be repeated here.
[0180] According to the resource retrieval method provided in this disclosure, by receiving a retrieval request from a client, a target resource retrieval model performs resource retrieval based on the retrieval request, thereby determining a second resource and feeding it back to the client. Thus, this solution can achieve the retrieval of second resources recommended to the user by combining user preferences, improving the accuracy of the retrieved second resources. Using two-level encoding for resource retrieval can more accurately describe user preferences, improving the comprehensiveness and efficiency of resource retrieval.
[0181] Figure 9 The diagram illustrates the process of resource retrieval based on a target resource retrieval model. This model includes a preference prediction network, a resource quantification network, and a resource evaluation network.
[0182] By acquiring the historical behavior sequence of the target user and inputting the historical behavior sequence into the preference prediction network, the encoder in the preference prediction network extracts and encodes the historical resources in the historical behavior sequence to obtain the context encoding vector. Then, the decoder in the preference prediction network performs step-by-step encoding prediction based on the context encoding vector and the initial encoding to determine the first encoding information.
[0183] Furthermore, the resource quantization network performs an inverted index on the index database based on the first encoded information to obtain the resource vector of the first resource. The resource evaluation network then uses user information and the resource vector to determine the relevance of the first resource to the target user, the CTR of the first resource, and the interaction duration as evaluation parameters. Based on these evaluation parameters, a score for the first resource is determined, and a second resource is selected from the first resource based on this score, which is then fed back to the client.
[0184] Corresponding to the resource retrieval methods provided in the above embodiments, one embodiment of this disclosure also provides a resource retrieval device. Since the resource retrieval device provided in this disclosure corresponds to the resource retrieval methods provided in the above embodiments, the implementation methods of the above resource retrieval methods are also applicable to the resource retrieval device provided in this disclosure, and will not be described in detail in the following embodiments.
[0185] Figure 10 This is a schematic diagram of the structure of a resource retrieval device provided in an embodiment of the present disclosure.
[0186] like Figure 10 As shown, the resource retrieval device 100 of this embodiment includes a receiving module 101, a prediction module 102, an indexing module 103, and a determining module 104.
[0187] The receiving module 101 is used to receive a retrieval request sent by the client, wherein the retrieval request includes the target user's user information and historical behavior sequence, and the historical behavior sequence includes historical resources that have been interactively operated by the target user; Prediction module 102 is used to predict the first encoding information corresponding to user preferred resources based on historical behavior sequences. The first encoding information includes at least two levels of first encoding. Index module 103 is used to perform an inverted index on the index library based on the first encoded information to obtain the resource vector of the first resource; The determination module 104 is used to determine the second resource from the first resource based on user information and resource vector, and to feed back the second resource to the client.
[0188] In one embodiment of this disclosure, the indexing module 103 is further configured to: perform an inverted index on the index library according to the first encoding information to obtain a target inverted list corresponding to the first encoding information, wherein the target inverted list includes a resource identifier corresponding to the first encoding information; and determine a first resource and a resource vector of the first resource according to the resource identifier corresponding to the first encoding information.
[0189] In one embodiment of this disclosure, the index module 103 is further configured to: determine search keywords based on the first encoding information and the search modes supported by the index library; and perform dictionary indexing and partition indexing in the index library based on the search keywords to obtain the target inverted list corresponding to the first encoding information.
[0190] In one embodiment of this disclosure, the index module 103 is further configured to: perform a nearest neighbor search on the first encoded information in a pre-constructed code table to obtain the second encoded information, wherein the code table includes multiple encoded information, each encoded information includes at least two levels of encoding, and the second encoded information is one of the multiple encoded information; and perform an inverted index on the index library based on the second encoded information to obtain the resource vector of the first resource.
[0191] In one embodiment of this disclosure, the index module 103 is further configured to: determine the resource identifier corresponding to each encoded information in the pre-built code table; generate an inverted list corresponding to the encoded information based on the resource identifier; and construct an index library based on the encoded information and the corresponding inverted list.
[0192] In one embodiment of this disclosure, the indexing module 103 is further configured to: receive real-time streaming data and obtain a resource set based on the real-time streaming data, wherein the resource set includes a third resource, the third resource being a hot resource; store the third resource in a temporary storage layer; migrate the third resource from the temporary storage layer to the resource supply library in response to meeting the resource migration triggering condition; and update the index library based on the resource supply library in response to meeting the index update triggering condition.
[0193] In one embodiment of this disclosure, the indexing module 103 is further configured to: invoke the streaming data management component, receive real-time streaming data through the message queue in the streaming data management component; parse and verify the real-time streaming data, and obtain the popularity of resources in the real-time streaming data; select resources with popularity higher than a set popularity threshold as third resources to obtain a resource set.
[0194] In one embodiment of this disclosure, the determining module 104 is further configured to: determine a vector set of a target user based on user information, wherein the vector set includes user vectors of at least two dimensions of the target user; and determine a second resource from a first resource based on the vector set and resource vectors.
[0195] In one embodiment of this disclosure, the determining module 104 is further configured to: cluster the target users according to the user information to obtain one or more cluster identifiers corresponding to the target users; for each cluster identifier, obtain the user vector corresponding to the cluster identifier; and determine the vector set of the target users according to the user vectors corresponding to the cluster identifiers.
[0196] In one embodiment of this disclosure, the determining module 104 is further configured to: predict evaluation parameters of a first resource based on the user vector and the resource vector, wherein the evaluation parameters include at least the relevance of the first resource to the target user, the click-through rate (CTR) of the first resource, and the interaction duration; determine the score of the first resource based on the evaluation parameters of the first resource; sort the first resource based on the score of the first resource, and determine the second resource based on the sorting result.
[0197] In one embodiment of this disclosure, the prediction module 102 is further configured to: extract and encode the association relationships of historical resources to obtain a context encoding vector; and perform step-by-step encoding prediction based on the context encoding vector and the initial encoding to determine the first encoding information corresponding to the user's preferred resources.
[0198] According to the resource retrieval apparatus provided in this disclosure, by receiving a retrieval request from a client and predicting first encoding information of user-preferred resources based on the historical behavior sequence in the retrieval request, and performing an inverted index in an index database based on the first encoding information, a resource vector of the first resource can be obtained. Furthermore, by combining user information and the resource vector, a second resource is determined from the first resource to be fed back to the client. Thus, this solution can achieve the retrieval of second resources recommended to the user based on user preferences, improving the accuracy of the retrieved second resources. Using two-level encoding for resource retrieval can more accurately describe user preferences, improving the comprehensiveness and efficiency of resource retrieval.
[0199] Figure 11 This is a schematic diagram of the structure of a training device for a resource retrieval model provided in an embodiment of this disclosure.
[0200] like Figure 11 As shown, the training device 200 for the resource retrieval model in this embodiment includes an acquisition module 201, a prediction module 202, a first determination module 203, a second determination module 204, and an adjustment module 205.
[0201] The acquisition module 201 is used to acquire sample data and input the sample data into the resource retrieval model. The sample data includes user information and sample behavior sequences of sample users. The sample behavior sequences include sample resources that have been interacted with by the sample users and tag data. The resource retrieval model includes a preference prediction network, a resource quantification network and a resource evaluation network. Prediction module 202 is used to predict preferences for sample behavior sequences through a preference prediction network to obtain prediction encoding information; The first determining module 203 is used to obtain a first resource vector of sample resources based on the resource quantization network, determine candidate coding information based on the first resource vector and the code table, and obtain a second resource vector of candidate push resources based on the candidate coding information. The second determining module 204 is used to obtain evaluation parameters of candidate push resources based on user information and the second resource vector through the resource evaluation network. The adjustment module 205 is used to reverse adjust the resource retrieval model based on the prediction coding information, evaluation parameters and label data until the training ends and the target resource retrieval model is obtained. Each type of encoded information includes at least two levels of encoding.
[0202] In one embodiment of this disclosure, the first determining module 203 is further configured to: quantize and compress the first resource vector to obtain sample encoding information of the sample resource; and perform nearest neighbor search on the sample encoding information in the code table to determine the corresponding candidate encoding information.
[0203] In one embodiment of this disclosure, the adjustment module 205 is further configured to: perform a nearest neighbor search on the predicted coding information in the code table to determine the corresponding target coding information; determine a first loss of the resource retrieval model based on the predicted coding information and the target coding information; determine a second loss of the resource retrieval model based on the evaluation parameters and label data; and perform reverse adjustment on the resource retrieval model based on the first loss and the second loss.
[0204] In one embodiment of this disclosure, the first determining module 203 is further configured to: update the resource vector associated with the sample encoding information based on the first resource vector of the sample resource; and iteratively update the code table based on the sample encoding information corresponding to the sample resource.
[0205] In one embodiment of this disclosure, the first determining module 203 is further configured to: obtain a first resource vector of the sample resource based on the multilayer perceptron (MLP) in the resource quantization network; and quantize and compress the first resource vector based on the residual quantization variational autoencoder (RQ-VAE) in the resource quantization network to obtain the sample encoding information of the sample resource.
[0206] In one embodiment of this disclosure, the prediction module 202 is further configured to: extract and encode the association relationship of the sample resources through the encoder in the preference prediction network to obtain the context encoding vector; and perform step-by-step encoding prediction based on the context encoding vector and the initial encoding through the decoder in the preference prediction network to determine the prediction encoding information.
[0207] According to the training apparatus for the resource retrieval model provided in this disclosure, sample data is acquired, and the sample behavior sequence is predicted using the resource retrieval model to obtain predicted encoding information. Sample resources are then quantized and encoded to obtain candidate encoding information for the sample resources. Based on the candidate encoding information, a second resource vector for candidate push resources is determined. Furthermore, evaluation parameters for the candidate push resources can be determined based on the second resource vector. A loss function for the model is then determined based on the predicted encoding information, evaluation parameters, and tag data. The model is trained using the loss function to obtain the target resource retrieval model. Back-adjusting the model based on the loss function can improve the efficiency and accuracy of the model's resource retrieval.
[0208] Figure 12 This is a schematic diagram of the structure of a resource retrieval device provided in an embodiment of the present disclosure.
[0209] like Figure 12 As shown, the resource retrieval device 300 of this embodiment includes a receiving module 301, an acquisition module 302, an indexing module 303, a determining module 304, and a feedback module 305.
[0210] The receiving module 301 is used to receive a retrieval request sent by the client, wherein the retrieval request includes the target user's user information and historical behavior sequence, and the historical behavior sequence includes historical resources that have been interactively operated by the target user; The acquisition module 302 is used to acquire the first encoding information corresponding to the user's preferred resource according to the retrieval request through the target resource retrieval model. The first encoding information includes at least two levels of first encoding. The index module 303 is used to perform an inverted index on the index library based on the first encoded information to obtain the resource vector of the first resource; The determination module 304 is used to determine the second resource from the first resource based on user information and resource vector using the target resource retrieval model; Feedback module 305 is used to provide feedback on the second resource to the client.
[0211] According to the resource retrieval apparatus provided in this disclosure, by receiving a retrieval request from a client, a target resource retrieval model performs resource retrieval based on the retrieval request, thereby determining a second resource and feeding it back to the client. Thus, this solution can achieve the retrieval of second resources recommended to the user by combining user preferences, improving the accuracy of the retrieved second resources. Using two-level encoding for resource retrieval can more accurately describe user preferences, improving the comprehensiveness and efficiency of resource retrieval.
[0212] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0213] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0214] Figure 13 A schematic block diagram of an example electronic device 400 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0215] like Figure 13 As shown, device 400 includes a computing unit 401, which can perform various appropriate actions and processes based on computer programs / instructions stored in read-only memory (ROM) 402 or loaded from storage unit 406 into random access memory (RAM) 403. RAM 403 may also store various programs and data required for the operation of device 400. The computing unit 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.
[0216] Multiple components in device 400 are connected to I / O interface 405, including: input units 406 such as keyboard, mouse, etc.; output units 407 such as various types of displays, speakers, etc.; storage units 408 such as disks, optical disks, etc.; and communication units 409 such as network cards, modems, wireless transceivers, etc. Communication unit 409 allows device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0217] The computing unit 401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above, such as resource retrieval methods. For example, in some embodiments, the resource retrieval method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 406. In some embodiments, part or all of the computer program / instructions may be loaded and / or installed on device 400 via ROM 402 and / or communication unit 409. When the computer program / instructions are loaded into RAM 403 and executed by the computing unit 401, one or more steps of the resource retrieval method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform resource retrieval methods by any other suitable means (e.g., by means of firmware).
[0218] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs / instructions that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
[0219] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0220] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0221] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0222] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.
[0223] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. The client-server relationship is created by computer programs / instructions running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0224] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in the disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this document does not impose any restrictions.
[0225] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A resource retrieval method, wherein, The method includes: Receive a retrieval request sent by a client, wherein the retrieval request includes user information and historical behavior sequence of the target user, and the historical behavior sequence includes historical resources in which the target user has performed interactive operations; Based on the historical behavior sequence, predict the first encoding information corresponding to the user's preferred resources, wherein the first encoding information includes at least two levels of first encoding; Based on the first encoded information, an inverted index is performed on the index library to obtain the resource vector of the first resource; Based on the user information and the resource vector, a second resource is determined from the first resource, and the second resource is fed back to the client.
2. The method according to claim 1, wherein, The step of performing an inverted index on the index library based on the first encoded information to obtain the resource vector of the first resource includes: Based on the first encoding information, an inverted index is performed on the index library to obtain the target inverted list corresponding to the first encoding information, wherein the target inverted list includes the resource identifier corresponding to the first encoding information; Based on the resource identifier corresponding to the first encoding information, determine the first resource and the resource vector of the first resource.
3. The method according to claim 2, wherein, The step of performing an inverted index on the index library based on the first encoding information to obtain the target inverted list corresponding to the first encoding information includes: Based on the first encoding information and the retrieval modes supported by the index, determine the retrieval keywords; Based on the search keywords, a dictionary index and a partition index are performed in the index library to obtain the target inverted list corresponding to the first encoded information.
4. The method according to claim 2 or 3, wherein, The step of performing an inverted index on the index library based on the first encoded information to obtain the resource vector of the first resource includes: In a pre-constructed code table, a nearest neighbor search is performed on the first encoded information to obtain the second encoded information, wherein the code table includes multiple encoded information, each of the encoded information includes at least two levels of encoding, and wherein the second encoded information is one of the multiple encoded information; Based on the second encoding information, an inverted index is performed on the index library to obtain the resource vector of the first resource.
5. The method according to claim 1, wherein, The process of building the index library includes: Determine the resource identifier corresponding to each encoded piece of information in the pre-built code table; Based on the resource identifier, generate an inverted list corresponding to the encoded information; The index library is constructed based on the encoded information and the corresponding inverted list.
6. The method according to claim 5, wherein, After constructing the index library based on the encoded information and the corresponding inverted list, the method further includes: Receive real-time streaming data and obtain a resource set based on the real-time streaming data, wherein the resource set includes a third resource, and the third resource is a hot resource; The third resource is stored in the temporary storage layer; In response to the fulfillment of the resource migration trigger condition, the third resource is migrated from the temporary storage layer to the resource supply pool; In response to the fulfillment of the index update triggering condition, the index library is updated based on the resource supply library.
7. The method according to claim 5, wherein, The process of receiving real-time streaming data and obtaining a resource set based on the real-time streaming data includes: Invoke the streaming data management component and receive real-time streaming data through the message queue in the streaming data management component; The real-time streaming data is parsed and verified, and the popularity of resources in the real-time streaming data is obtained; Resources with a popularity level higher than a set popularity threshold are selected as third resources to obtain the resource set.
8. The method according to any one of claims 1-7, wherein, The step of determining a second resource from the first resource based on the user information and the resource vector, and then feeding back the second resource to the client, includes: Based on the user information, a vector set of the target user is determined, wherein the vector set includes user vectors of the target user in at least two dimensions; Based on the vector set and the resource vector, the second resource is determined from the first resource.
9. The method according to claim 8, wherein, Determining the vector set of the target user based on the user information includes: Based on the user information, the target users are clustered to obtain one or more cluster identifiers corresponding to the target users; For each cluster identifier, obtain the user vector corresponding to the cluster identifier; The vector set of the target user is determined based on the user vector corresponding to the cluster identifier.
10. The method according to any one of claims 1-7, wherein, The step of determining the second resource from the first resource based on the vector set and the resource vector includes: Based on the user vector and the resource vector, the evaluation parameters of the first resource are predicted, wherein the evaluation parameters include at least the relevance of the first resource to the target user, the click-through rate (CTR) of the first resource, and the interaction duration. The score of the first resource is determined based on the evaluation parameters of the first resource; Based on the score of the first resource, the first resource is sorted, and the second resource is determined based on the sorting result.
11. The method according to any one of claims 1-7, wherein, The step of predicting the first encoded information corresponding to user preferred resources based on the historical behavior sequence includes: The historical resources are subjected to association extraction and encoding to obtain a context encoding vector; Based on the context encoding vector and the initial encoding, a step-by-step encoding prediction is performed to determine the first encoding information corresponding to the user preference resource.
12. A training method for a resource retrieval model, wherein, The method includes: Acquire sample data and input the sample data into the resource retrieval model. The sample data includes user information and sample behavior sequences of sample users. The sample behavior sequences include sample resources that have been interacted with by the sample users and tag data. The resource retrieval model includes a preference prediction network, a resource quantification network, and a resource evaluation network. The preference prediction network is used to predict the preferences of the sample behavior sequence to obtain the prediction encoding information; Based on the resource quantization network, a first resource vector of the sample resource is obtained, and based on the first resource vector and the code table, candidate coding information is determined, and based on the candidate coding information, a second resource vector of the candidate push resource is obtained. Based on the resource evaluation network, the evaluation parameters of the candidate push resources are obtained according to the user information and the second resource vector; Based on the predicted coding information, the evaluation parameters, and the label data, the resource retrieval model is adjusted in reverse until the training ends and the target resource retrieval model is obtained. Each type of encoded information includes at least two levels of encoding.
13. The method according to claim 12, wherein, The step of determining candidate coding information based on the first resource vector and code table includes: The first resource vector is quantized and compressed to obtain the sample encoding information of the sample resource; In the code table, a nearest neighbor search is performed on the sample encoding information to determine the corresponding candidate encoding information.
14. The method according to claim 12, wherein, The step of adjusting the resource retrieval model in reverse based on the predicted coding information, the evaluation parameters, and the label data includes: In the code table, a nearest neighbor search is performed on the predicted coding information to determine the corresponding target coding information; Based on the predicted encoding information and the target encoding information, the first loss of the resource retrieval model is determined; Based on the evaluation parameters and label data, determine the second loss of the resource retrieval model; The resource retrieval model is adjusted in reverse based on the first loss and the second loss.
15. The method according to claim 13, wherein, The method further includes at least one of the following operations: Based on the first resource vector of the sample resource, the resource vector associated with the sample encoding information is updated; The code table is iteratively updated based on the sample encoding information corresponding to the sample resources.
16. The method according to claim 13, wherein, The method further includes: Based on the multilayer perceptron (MLP) in the resource quantization network, the first resource vector of the sample resource is obtained. Based on the residual quantization variational autoencoder RQ-VAE in the resource quantization network, the first resource vector is quantized and compressed to obtain the sample encoding information of the sample resource.
17. The method according to claim 16, wherein, The method further includes: The encoder in the preference prediction network extracts and encodes the associations of the sample resources to obtain a context encoding vector. The decoder in the preference prediction network performs step-by-step encoding prediction based on the context encoding vector and the initial encoding to determine the predicted encoding information.
18. A resource retrieval method, wherein, The method includes: Receive a retrieval request sent by a client, wherein the retrieval request includes user information and historical behavior sequence of the target user, and the historical behavior sequence includes historical resources in which the target user has performed interactive operations; Based on the retrieval request, the target resource retrieval model obtains the first encoding information corresponding to the user's preferred resource, wherein the first encoding information includes at least two levels of first encoding. Based on the first encoded information, an inverted index is performed on the index library to obtain the resource vector of the first resource; Based on the user information and the resource vector, the target resource retrieval model determines the second resource from the first resource; The second resource is fed back to the client; The target resource retrieval model is a model obtained using the training method described in any one of 12-17.
19. A resource retrieval device, wherein, The device includes: The receiving module is used to receive a retrieval request sent by the client, wherein the retrieval request includes the target user's user information and historical behavior sequence, and the historical behavior sequence includes historical resources that have been interactively operated by the target user; The prediction module is used to predict the first encoding information corresponding to the user's preferred resources based on the historical behavior sequence, wherein the first encoding information includes at least two levels of first encoding; The indexing module is used to perform an inverted index on the index library based on the first encoded information to obtain the resource vector of the first resource; The determination module is used to determine a second resource from the first resource based on the user information and the resource vector, and to feed back the second resource to the client.
20. A training device for a resource retrieval model, wherein, The device includes: The acquisition module is used to acquire sample data and input the sample data into the resource retrieval model. The sample data includes user information and sample behavior sequences of sample users. The sample behavior sequences include sample resources that have been interacted with by the sample users and tag data. The resource retrieval model includes a preference prediction network, a resource quantification network, and a resource evaluation network. The prediction module is used to predict preferences for the sample behavior sequence through the preference prediction network to obtain prediction encoding information; The first determining module is used to obtain a first resource vector of the sample resource based on the resource quantization network, determine candidate coding information based on the first resource vector and the code table, and obtain a second resource vector of the candidate push resource based on the candidate coding information. The second determining module is used to obtain the evaluation parameters of the candidate push resource based on the resource evaluation network according to the user information and the second resource vector; The adjustment module is used to reverse-adjust the resource retrieval model based on the predicted encoding information, the evaluation parameters, and the label data until the training ends and the target resource retrieval model is obtained. Each type of encoded information includes at least two levels of encoding.
21. A resource retrieval device, wherein, The device includes: The receiving module is used to receive a retrieval request sent by the client, wherein the retrieval request includes the target user's user information and historical behavior sequence, and the historical behavior sequence includes historical resources that have been interactively operated by the target user; The acquisition module is used to acquire first encoding information corresponding to user-preferred resources according to the retrieval request through the target resource retrieval model. The first encoding information includes at least two levels of first encoding. The indexing module is used to perform an inverted index on the index library based on the first encoded information to obtain the resource vector of the first resource; The determining module is used to determine a second resource from the first resource based on the user information and the resource vector using the target resource retrieval model; The feedback module is used to provide feedback on the second resource to the client. The target resource retrieval model is a model obtained using the training method described in any one of 12-17.
22. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-18.
23. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-18.
24. A computer program product comprising a computer program / instructions, wherein, When the computer program / instructions are executed by the processor, they implement the method of any one of claims 1-18.
Citation Information
Patent Citations
Archive management system, method and equipment for intelligent miniature archive room
CN119226226A
Customer self service subsystem for adaptive indexing of resource solutions and resource lookup
US20020152190A1