Resource similarity updating method, resource recommendation method and device, and electronic device
By introducing resource weights and user weights into the item-based collaborative filtering algorithm and adjusting the similarity calculation, the problem of high noise in resource recommendations in existing technologies is solved, and more accurate resource recommendations are achieved.
Patent Information
- Application Number
- CN202210704812.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-21
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2042-06-21
AI Technical Summary
Existing item-based collaborative filtering algorithms fail to fully consider the interaction network between users and items when calculating resource similarity, resulting in high recommendation noise.
By introducing resource weights and user weights, the similarity calculation is adjusted to reduce the correlation between similarity and shared resources, thereby improving the accuracy of similarity.
It improves the relevance of resource recommendations, reduces recommendation noise, and ensures that recommended resources are more relevant to reference resources.
Smart Images

Figure CN115187326B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of resource recommendation technology, and in particular to a resource similarity update method, a resource recommendation method and apparatus, and an electronic device. Background Technology
[0002] Item-based collaborative filtering is a commonly used method in recommendation systems. Its basic idea is to pre-calculate the similarity between items based on the user's historical preference data, and then recommend other items similar to the user's favorites. For example, if video A and video B are found to be very similar by calculating video similarity, then video B can be recommended to users who have viewed video A. The key technology here is the algorithm for calculating similarity.
[0003] In related technologies, Jaccard's Coefficient, Cosine Similarity, and Swing Score are commonly used to measure the similarity between two items. However, Jaccard's Coefficient and Cosine Similarity only consider the number of users who interact with the item (point information), neglecting the interaction network between users and items (side information). This may lead to insufficient accuracy in the calculated similarity, resulting in the inclusion of irrelevant items in recommendations. The Swing Score works by considering users who interact with both items as co-occurring users. The fewer other items these co-occurring users have interacted with, the higher the similarity between the two items. Swing Score significantly improves similarity by considering side information. However, Swing Score only depends on the number of other items co-occurring users have interacted with. In scenarios where this number is insufficient to accurately reflect the similarity between two items, such as video browsing and recommendation scenarios, the calculated similarity may be inaccurate. The direct result is the inclusion of irrelevant videos and high noise in the resulting recommendations. Summary of the Invention
[0004] This disclosure provides a resource similarity update method, a resource recommendation method and apparatus, and an electronic device to at least solve the problem of high noise in recommended videos in related technologies, or it may not solve any of the above problems.
[0005] According to a first aspect of this disclosure, a resource similarity update method is provided, the resource similarity update method comprising: obtaining a resource pair to be processed, the resource pair including a first resource and a second resource; obtaining users who have interaction relationships with both the first resource and the second resource as co-occurring users of the resource pair to be processed; taking any two co-occurring users as a user pair, obtaining resources that have interaction relationships with both co-occurring users in the user pair as shared resources of the user pair; obtaining at least one of the resource weights of the first resource and the second resource and the user weights of each co-occurring user; and determining the similarity between the first resource and the second resource based on at least one of the resource weights and the user weights, and the shared resources of each user pair of the resource pair to be processed.
[0006] Optionally, the resource weight is obtained based on the number of users who have an interaction relationship with the corresponding resource, wherein users who have an interaction relationship with the corresponding resource are recorded as interactive users of the corresponding resource, and the resource weight is negatively correlated with the number of interactive users of the corresponding resource.
[0007] Optionally, the resource weight is obtained through the following steps: for each resource whose resource weight needs to be determined, the sum of the number of interactive users of the corresponding resource and the first auxiliary parameter is determined as the first sum; the first sum is subjected to a first exponentialization process to obtain the resource weight of the corresponding resource.
[0008] Optionally, the user weight is obtained based on the number of resources that have an interaction relationship with the corresponding user, wherein the resources that have an interaction relationship with the corresponding user are denoted as the corresponding user's interaction resources, and the user weight is negatively correlated with the number of the corresponding user's interaction resources.
[0009] Optionally, the user weight is obtained through the following steps: for each user whose user weight needs to be determined, the sum of the number of interactive resources of the corresponding user and the second auxiliary parameter is determined as the second sum; the second sum is subjected to a second exponentialization process to obtain the user weight of the corresponding user.
[0010] Optionally, determining the similarity between the first resource and the second resource based on at least one of the resource weights and the user weights, and the shared resources of each user pair of the resource pair to be processed, includes: determining a weighted sum of reference similarities for each user pair of the resource pair to be processed, as the similarity between the first resource and the second resource; wherein the reference similarities are obtained from the shared resources of the corresponding user pairs, and the weights of the user pairs used in determining the weighted sum are obtained from at least one of the resource weights and the user weights.
[0011] Optionally, the weight of the user pair is the product or sum of at least one type of weight among the resource weight and the user weight of the corresponding user pair.
[0012] Optionally, the reference similarity is the reciprocal of the sum of the number of shared resources of the corresponding user pair and the third auxiliary parameter.
[0013] Optionally, before obtaining the resource pairs to be processed, the resource similarity update method further includes: obtaining a first resource set; wherein the first resource set includes multiple resources; wherein obtaining the resource pairs to be processed includes: determining at least one of the resource pairs to be processed based on the multiple resources in the first resource set.
[0014] Optionally, before obtaining users who have interaction relationships with both the first resource and the second resource as co-occurring users of the resource pair to be processed, the resource similarity update method further includes: querying mapping information to obtain a set of users who have interaction relationships with each resource in the first resource set, as a first user set; wherein, the mapping information records the interaction relationships between resources and users; filtering the first user set to remove users who only have interaction relationships with one resource in the first resource set, to obtain a second user set; wherein, the second user set is used to determine the co-occurring users of the resource pair to be processed; querying the mapping information to obtain a set of resources that have interaction relationships with each user in the second user set, as a second resource set; wherein, the second resource set is used to determine the shared resources of the user pair.
[0015] Optionally, the step of obtaining users who have interaction relationships with both the first resource and the second resource as co-occurring users of the resource pair to be processed includes: for each resource pair to be processed, determining users who have interaction relationships with both the first resource and the second resource according to the second user set, as co-occurring users of the corresponding resource pair to be processed; the step of taking any two co-occurring users as user pairs and obtaining resources that have interaction relationships with both co-occurring users in the user pair as shared resources of the user pair includes: for each resource pair to be processed, determining resources that have interaction relationships with both co-occurring users in each user pair of the corresponding resource pair to be processed according to the second resource set, as shared resources of the corresponding user pair of the corresponding resource pair to be processed.
[0016] Optionally, the resource similarity update method further includes: acquiring an interaction data stream; wherein the interaction data stream includes user-resource interaction data; and continuously updating the mapping information based on the interaction data stream.
[0017] Optionally, continuously updating the mapping information according to the interaction data stream includes: continuously updating the first mapping information and the second mapping information according to the interaction data stream; wherein the first mapping information records the resources that have an interaction relationship with each user, and the second mapping information records the users that have an interaction relationship with each resource.
[0018] Optionally, the first resource set, the second resource set, the first user set, and the second user set are updated according to a set period; the mapping information, the first resource set, the second resource set, the first user set, and the second user set are stored in online storage.
[0019] Optionally, obtaining the first resource set includes: obtaining a message queue according to a set period, wherein the message queue records users who have performed interactive behaviors in the current period; querying the mapping information to obtain a set of several resources that have recently interacted with each user recorded in the message queue, as the first resource set.
[0020] According to a second aspect of this disclosure, a resource recommendation method is provided, the resource recommendation method comprising: receiving a resource recommendation request, the resource recommendation request including a reference resource; and, according to the resource recommendation request, obtaining at least one resource whose similarity to the reference resource meets a set condition, as a recommended resource, wherein the similarity between the reference resource and other resources is obtained by the resource similarity update method of this disclosure.
[0021] According to a third aspect of this disclosure, a resource similarity update apparatus is provided, the resource similarity update apparatus comprising: an acquisition unit configured to: acquire a resource pair to be processed, the resource pair including a first resource and a second resource; the acquisition unit further configured to: acquire users who have interaction relationships with both the first resource and the second resource as co-occurring users of the resource pair to be processed; the acquisition unit further configured to: take any two co-occurring users as a user pair, and acquire resources that have interaction relationships with both co-occurring users in the user pair as shared resources of the user pair; the acquisition unit further configured to: acquire at least one of the resource weights of the first resource and the second resource and the user weights of each co-occurring user; and a determination unit configured to: determine the similarity between the first resource and the second resource based on at least one of the resource weights and the user weights, and the shared resources of each user pair of the resource pair to be processed.
[0022] Optionally, the resource weight is obtained based on the number of users who have an interaction relationship with the corresponding resource, where users who have an interaction relationship with the corresponding resource are recorded as interactive users of the corresponding resource, and the resource weight is negatively correlated with the number of interactive users of the corresponding resource.
[0023] Optionally, the resource weight is obtained through the following steps: for each resource whose resource weight needs to be determined, the sum of the number of interactive users of the corresponding resource and the first auxiliary parameter is determined as the first sum; the first sum is subjected to a first exponentialization process to obtain the resource weight of the corresponding resource.
[0024] Optionally, the user weight is obtained based on the number of resources that have an interaction relationship with the corresponding user, where resources that have an interaction relationship with the corresponding user are denoted as the corresponding user's interaction resources, and the user weight is negatively correlated with the number of the corresponding user's interaction resources.
[0025] Optionally, user weights are obtained through the following steps: for each user whose user weight needs to be determined, the sum of the number of interactive resources of the corresponding user and the second auxiliary parameter is determined as the second sum; the second sum is subjected to a second exponentialization process to obtain the user weight of the corresponding user.
[0026] Optionally, the determining unit may also determine a weighted sum of the reference similarities of each user pair of the resource pair to be processed, as the similarity between the first resource and the second resource. The reference similarity is obtained from the shared resources of the corresponding user pairs, and the weights of the user pairs used to determine the weighted sum are obtained from at least one of the resource weights and user weights.
[0027] Optionally, the weight of a user pair is the product or sum of at least one type of weight among the resource weight and the user weight of the corresponding user pair.
[0028] Optionally, the reference similarity is the reciprocal of the sum of the number of shared resources for the corresponding user pair and a third auxiliary parameter.
[0029] Optionally, the acquisition unit may also acquire a first resource set; wherein the first resource set includes multiple resources; and based on the multiple resources in the first resource set, at least one pair of resources to be processed is determined.
[0030] Optionally, the resource similarity update device further includes a query unit and a filtering unit. The query unit can query mapping information to obtain a set of users who have interaction relationships with each resource in the first resource set, as the first user set; wherein, the mapping information records the interaction relationships between resources and users. The filtering unit can filter the first user set to remove users who only have interaction relationships with one resource in the first resource set, resulting in a second user set; wherein, the second user set is used to determine the co-occurring users of the resource pairs to be processed. The query unit can also query mapping information to obtain a set of resources that have interaction relationships with each user in the second user set, as the second resource set. Herein, the second resource set is used to determine the shared resources of the user pairs.
[0031] Optionally, the acquisition unit may also, for each pair of resources to be processed, determine, according to the second user set, users who have interaction relationships with both the corresponding first resource and the second resource, as co-occurring users of the corresponding pair of resources to be processed; and for each pair of resources to be processed, determine, according to the second resource set, resources that have interaction relationships with both co-occurring users in each user pair of the corresponding pair of resources to be processed, as shared resources of the corresponding user pair of the corresponding pair of resources to be processed.
[0032] Optionally, the acquisition unit may also acquire an interactive data stream; wherein the interactive data stream includes user-resource interaction data; the resource similarity update device further includes an update unit that can continuously update the mapping information based on the interactive data stream.
[0033] Optionally, the updating unit may also continuously update the first mapping information and the second mapping information according to the interactive data stream; wherein the first mapping information records the resources that have an interactive relationship with each user, and the second mapping information records the users that have an interactive relationship with each resource.
[0034] Optionally, the first resource set, the second resource set, the first user set, and the second user set are updated according to a set period; the mapping information, the first resource set, the second resource set, the first user set, and the second user set are stored in an online storage format.
[0035] Optionally, the acquisition unit can also acquire a message queue according to a set period. The message queue records users who have performed interactive behaviors in the current period; query the mapping information to obtain a set of several resources that have recently interacted with each user recorded in the message queue, as the first resource set.
[0036] According to a fourth aspect of this disclosure, a resource recommendation apparatus is provided, the resource recommendation apparatus comprising: a receiving unit configured to: receive a resource recommendation request, the resource recommendation request including a reference resource; and a recommendation unit configured to: according to the resource recommendation request, acquire at least one resource whose similarity to the reference resource meets a set condition, as a recommended resource, wherein the similarity between the reference resource and other resources is obtained by the resource similarity update method of this disclosure.
[0037] According to a fifth aspect of this disclosure, an electronic device is provided, the electronic device comprising: at least one processor; at least one memory storing computer-executable instructions, wherein the computer-executable instructions, when executed by the at least one processor, cause the at least one processor to perform a resource similarity update method or a resource recommendation method according to this disclosure.
[0038] According to a sixth aspect of this disclosure, a computer-readable storage medium is provided that, when instructions in the computer-readable storage medium are executed by at least one processor, causes the at least one processor to perform a resource similarity update method or a resource recommendation method according to this disclosure.
[0039] According to a seventh aspect of this disclosure, a computer program product is provided, including computer instructions that, when executed by at least one processor, implement a resource similarity update method or a resource recommendation method according to this disclosure.
[0040] The technical solutions provided by the embodiments of this disclosure bring at least the following beneficial effects:
[0041] According to the resource similarity update method and apparatus, resource recommendation method and apparatus of the present disclosure, based on shared resources, by introducing resource weights and user weights, the similarity can be adjusted by weights, reducing the correlation strength between similarity and shared resources, improving the accuracy of similarity, thereby obtaining recommended resources that are more relevant to the reference resources, and reducing recommendation noise.
[0042] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0043] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0044] Figure 1 This is a flowchart illustrating a resource similarity update method according to an exemplary embodiment of the present disclosure.
[0045] Figure 2 This is a flowchart illustrating a resource similarity update method according to an exemplary embodiment of the present disclosure.
[0046] Figure 3 This is a flowchart illustrating a resource recommendation method according to an exemplary embodiment of the present disclosure.
[0047] Figure 4 This is a schematic diagram illustrating the process of a resource recommendation platform according to an exemplary embodiment of the present disclosure.
[0048] Figure 5 This is a block diagram illustrating a resource similarity updating apparatus according to an exemplary embodiment of the present disclosure.
[0049] Figure 6 This is a block diagram illustrating a resource recommendation apparatus according to an exemplary embodiment of the present disclosure.
[0050] Figure 7 This is a block diagram illustrating an electronic device according to exemplary embodiments of the present disclosure. Detailed Implementation
[0051] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0052] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following examples do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0053] It should be noted that the phrase "at least one of several items" in this disclosure refers to three parallel cases: "any one of the several items", "a combination of any number of the several items", and "all of the several items". For example, "including at least one of A and B" includes the following three parallel cases: (1) including A; (2) including B; (3) including A and B. As another example, "performing at least one of step one and step two" indicates the following three parallel cases: (1) performing step one; (2) performing step two; (3) performing both step one and step two.
[0054] Item-based collaborative filtering is a commonly used method in recommendation systems. Its basic idea is to pre-calculate the similarity between items based on the user's historical preference data, and then recommend other items similar to the user's favorites. It is often used in the recall phase of recommendations. For example, if video A and video B are found to be very similar by calculating video similarity, then video B can be recommended to users who have viewed video A. The key technology here is the algorithm for calculating similarity.
[0055] In related technologies, Jaccard's Coefficient, Cosine similarity, and Swing score are commonly used to measure the similarity between two items.
[0056] The formulas for calculating Jaccard's Coefficient and Cosine similarity are as follows:
[0057]
[0058]
[0059] Taking video browsing and recommendation scenarios as an example, Ui in the above formula refers to the set of users who have clicked on video i; Uj refers to the set of users who have clicked on video j, and the absolute value sign represents the number of users in the corresponding set. For example, in the Jaccard formula, the user click list for video i is [user a, user b, user c], and the user click list for video j is [user a, user c, user d]. Then, the number of users in the intersection of video i and video j, Ui∩Uj, is 2, namely users a and c, which refer to users who have clicked on both video i and video j, called co-occurring users of video i and video j; the number of users in the union of video i and video j, Ui∪Uj, is 4, namely users a, b, c, and d. Therefore, the Jaccard's Coefficient for video i and video j is 2 / 4 = 0.5. The cosine similarity between video i and video j is then...
[0060] It is evident that both Jaccard's Coefficient and Cosine similarity only consider the number of users (point information) and do not take into account the edge information between users and items, which may lead to insufficient accuracy in the calculated similarity and the inclusion of some irrelevant items during recommendation.
[0061] The formula for calculating Swing scores is as follows:
[0062]
[0063] Taking video browsing and recommendation scenarios as an example, Ui and Uj are as described above. u and v represent two different users selected from the co-occurring user set Ui∩Uj, forming a user pair. Iu refers to the set of videos clicked by user u, and Iv refers to the set of videos clicked by user v. All user pairs are identified from Ui∩Uj, their similarity is calculated separately, and then summed together to obtain the Swing score for video i and video j. The principle of the Swing score formula is that for video i and video j, if two users have both clicked on both videos, the fewer other videos both users have clicked, the higher the similarity between video i and video j. The Swing score significantly improves similarity by considering the side information established by the relationship between items and users. However, the Swing score only depends on the number of other videos both users in the user pair have clicked. In video click scenarios, this number is often insufficient to properly reflect the similarity between two videos, potentially leading to inaccurate similarity calculations. The direct result is that irrelevant videos appear in the resulting recommendations, resulting in high noise levels.
[0064] The resource similarity update method and resource recommendation method according to the exemplary embodiments of this disclosure, based on shared resources, can adjust the similarity by introducing resource weights and user weights, thereby reducing the correlation strength between similarity and shared resources, improving the accuracy of similarity, and thus obtaining recommended resources that are more relevant to the reference resources, which can reduce recommendation noise.
[0065] Below, we will refer to Figures 1 to 7 The present disclosure provides a detailed description of a resource similarity update method and apparatus, a resource recommendation method and apparatus, and an exemplary embodiment of the present disclosure.
[0066] Figure 1 This is a flowchart illustrating a resource similarity update method according to an exemplary embodiment of the present disclosure. Figure 2 This is a flowchart illustrating a resource similarity update method according to exemplary embodiments of the present disclosure. It should be understood that the resource similarity update method according to exemplary embodiments of the present disclosure can be implemented in terminal devices such as smartphones, tablets, and personal computers (PCs), or in devices such as servers.
[0067] Reference Figure 1In step 101, a resource pair to be processed is obtained, which includes a first resource and a second resource. The resource pair includes two different resources, namely the first resource and the second resource. Referring to i and j mentioned earlier, these can be multimedia resources, such as video or audio. It should be understood that the first resource and the second resource refer to the two resources whose similarity needs to be calculated. In practical applications, multiple resources whose similarity needs to be determined can be obtained first, and then multiple resource pairs can be identified from them, and then calculated separately. The acquisition of these multiple resources can be done offline, acquiring resources from the resource recommendation platform at regular intervals (e.g., once a day), or online, acquiring corresponding resources based on real-time user-resource interaction data.
[0068] In step 102, users who have interaction relationships with both the first and second resources are identified as co-occurring users of the resource pairs to be processed. Co-occurring users can be referred to as users in Ui∩Uj above. It should be understood that when multiple resource pairs for which similarity needs to be calculated are identified from multiple resources as described above, resource pairs with only one co-occurring user may be temporarily excluded from the calculation, i.e., not considered as resource pairs to be processed.
[0069] In step 103, any two co-occurring users are considered as a user pair, and resources that have interaction relationships with both co-occurring users in the user pair are identified as shared resources of the user pair. Shared resources can be referenced from Iu∩Iv mentioned earlier.
[0070] In step 104, at least one of the resource weights of the first resource and the second resource, and the user weight of each co-occurring user is obtained.
[0071] In step 105, the similarity between the first resource and the second resource is determined based on at least one of the resource weight and the user weight, as well as the shared resources of each user pair of the resource pair to be processed. By introducing resource weight and user weight based on the shared resources, the similarity can be adjusted using these weights, reducing the correlation strength between the similarity and the shared resources, improving the accuracy of the similarity, and thus obtaining recommended resources that are more relevant to the reference resource, thereby reducing recommendation noise.
[0072] Regarding steps 101 to 103, taking the online mode as an example, the following describes the steps for obtaining the resource pair to be processed, the co-occurring users of the resource pair to be processed, and the shared resources of the user pair of the resource pair to be processed, according to the exemplary embodiments of this disclosure. These steps can be taken in an asynchronous and parallel manner, which helps to improve operating efficiency.
[0073] First, let's introduce mapping information. Mapping information records the interaction relationship between resources and users, and serves as the information foundation for subsequent data processing. (Refer to...) Figure 2The mapping information can be obtained through the following steps: First, acquire the interaction data stream. This interaction data stream includes user-resource interaction data, which is a real-time data stream generated by the resource recommendation platform. For example, in video browsing and recommendation scenarios, when a user engages in real-time interaction (such as clicking, prolonged playback, liking, or commenting), this interaction data stream is updated. Second, continuously update the mapping information based on the interaction data stream. By combining real-time interaction data streams to continuously and independently update the mapping information, the timeliness of the mapping information can be guaranteed.
[0074] Optionally, the interactive data stream records edge information based on interactive behaviors. The edge information can be established based on a single interactive behavior, such as a click. If the user performs a click, edge information is established. Alternatively, the edge information can be established based on multiple behaviors. In practice, weights can be configured for different interactive behaviors, and the number of occurrences of multiple interactive behaviors can be weighted and summed. Then, the sum is compared with a set threshold. If the sum is greater than the threshold, edge information is established; otherwise, edge information is not established.
[0075] Optionally, refer to Figure 2 The operation of continuously updating mapping information based on the interactive data stream can be performed by the corresponding update service. This operation includes: continuously updating the first mapping information and the second mapping information respectively (performed by the first update service and the second update service respectively); wherein, the first mapping information records the resources that have an interaction relationship with each user, and the second mapping information records the users that have an interaction relationship with each resource. By further splitting the mapping information into the first mapping information and the second mapping information, they can be indexed by users and resources respectively, which facilitates on-demand querying and helps improve data processing efficiency. In addition, the first mapping information and the second mapping information are continuously updated by their respective update services, that is, they still adopt an asynchronous parallel approach, which can ensure that they are updated independently and help improve operating efficiency.
[0076] Then, the first resource set, the first user set, the second user set, and the second resource set are introduced. These sets are the foundation for obtaining the pairs of resources to be processed, the co-occurring users of the pairs of resources to be processed, and the shared resources of the user pairs of the pairs of resources to be processed. Obtaining these sets requires accessing mapping information. Since an asynchronous parallel approach is still used, this does not affect the updating of mapping information. When mapping information is needed, it can be directly queried. It should be understood that these sets are related and are obtained one by one in the above order; therefore, sequential execution is used. (Refer to...) Figure 2 From obtaining these sets to determining the final similarity, everything is done by the similarity update service.
[0077] The first step is to obtain the first resource set. This first resource set includes multiple resources and can be used as a resource pool. Randomly selecting two different resources from this pool yields a pair of resources to be processed, which helps in batching these pairs and improves data processing efficiency. Furthermore, the first resource set specifically comprises resources whose similarity needs to be updated based on real-time user-resource interaction data. This allows for timely updates to similarity, improving the awareness of new resources and enhancing the timeliness and accuracy of recommendations.
[0078] Reference Figure 2 Obtaining the first resource set specifically includes: retrieving a message queue according to a set period. The message queue records users who have performed interactive behaviors within the current period, such as user IDs; querying mapping information to obtain a set of resources that have recently interacted with each user recorded in the message queue, which serves as the first resource set. The amount of user data will be much smaller than the amount of resource data. By recording users who have performed interactive behaviors in the message queue, the amount of recorded data can be significantly reduced, helping to save resources. By querying the mapping information for users in the message queue, specifically querying the first mapping information, the set of resources that have recently been interacted with can be obtained. As an example, the resources that users have historically interacted with in the message queue can be queried, and the top 200 most recent resources for each user can be selected to form the first resource set. It should be understood that the first resource set can record several resources that each user has recently interacted with in a nested manner to reflect the interaction relationship between users and resources. For example, the users recorded in the message queue form a set {a1, a2, ..., an}. After truncating the top 200 resources for each user, the first resource set is {a1{b1-1, b1-2, ..., b1-200}, a2{b2-1, b2-2, ..., b2-200}, ..., an{bn-1, bn-2, ..., bn-200}}. Subsequent sets can be nested based on the first resource set.
[0079] Optionally, consistent with the acquisition of message queues, the first resource set, the second resource set, the first user set, and the second user set are updated according to a set period, which is less than 1 minute and is usually at the second level, such as 2 seconds, so that online updates can be achieved.
[0080] Accordingly, the mapping information, the first resource set, the second resource set, the first user set, and the second user set are stored online, abandoning the offline storage method. This saves Redis storage resources used for storing offline data, achieving cost reduction and efficiency improvement. Therefore, querying the mapping information specifically involves accessing the online storage device that stores the mapping information.
[0081] The second step is to query the mapping information, specifically the second mapping information, to obtain the set of users who have interaction relationships with each resource in the first resource set, which serves as the first user set. As an example, for each resource in the first resource set, we can query the users who have historically interacted with it, and select the top 1000 users with the most recent interactions to form the first user set.
[0082] The third step involves filtering the first user set to remove users who interact with only one resource in the first resource set (referred to as non-co-occurring users), resulting in a second user set. This second user set is used to determine the co-occurring users of the resource pairs to be processed. To obtain the co-occurring users of the resource pairs, it is necessary to find the intersection of the interacting users corresponding to the first and second resources. This operation can be completed based on the first user set, but non-co-occurring users will not be co-occurring users of any resource pairs to be processed. By first filtering out non-co-occurring users from the first user set and then determining the co-occurring users based on the obtained second user set, the subsequent computational load can be significantly reduced, improving operational efficiency. Continuing the previous example, the second user set can be represented as:
[0083] {a1{b1-1{c1-1-1,c1-1-2,…},
[0084] b1-2{c1-2-1,c1-2-2,…},
[0085] ...
[0086] b1-200{c1-200-1,c1-200-2,…}},
[0087] a2{b2-1{c2-1-1,c2-1-2,…},
[0088] b2-2{c2-2-1,c2-2-2,…},
[0089] ...
[0090] b2-200{c2-200-1,c2-200-2,…}},
[0091] ...
[0092] an{bn-1{cn-1-1,cn-1-2,…},
[0093] bn-2{cn-2-1,cn-2-2,…},
[0094] ...
[0095] bn-200{cn-200-1,cn-200-2,…}}}
[0096] The fourth step involves querying the mapping information, specifically the first mapping information, to obtain a set of resources that have interactive relationships with each user in the second user set. This second resource set is used to determine the shared resources of user pairs. Each user in the second user set has the opportunity to be a co-occurring user of a certain resource pair to be processed. By obtaining the second resource set, the shared resources of the user pairs of the resource pairs to be processed can be determined.
[0097] By progressively identifying the associated first resource set, second user set, and second resource set in the above steps, a unified and stable data foundation can be provided for determining the resource pairs to be processed, the co-occurring users of the resource pairs to be processed, and the shared resources of the user pairs of the resource pairs to be processed, which helps to improve the accuracy of similarity.
[0098] Finally, we will explain how to obtain the pairs of resources to be processed, the co-occurring users of the pairs of resources to be processed, and the shared resources of each user pair of the pairs of resources to be processed.
[0099] Based on multiple resources in the first resource set, at least one pair of resources to be processed is identified. To improve computational efficiency, multiple pairs of resources to be processed can be identified. As an example, to ensure the timeliness of the data, all resource pairs corresponding to the first resource set can be identified.
[0100] For each pair of resources to be processed, users who have interaction relationships with both the corresponding first and second resources are identified based on the second user set, and these users are considered co-occurring users of the corresponding resource pair. Since the second user set records users with interaction relationships for each resource and filters out non-co-occurring users, users with interaction relationships with the first resource and users with interaction relationships with the second resource can be identified separately, and their intersection can be determined. This reliably yields the co-occurring users of the corresponding resource pair, ensuring a stable information source, a clear calculation process, and guaranteeing the accuracy of the obtained co-occurring users.
[0101] For each pair of resources to be processed, based on the second resource set, resources that have interaction relationships with both co-occurring users in each user pair of the corresponding resource pair are identified as the shared resources of the corresponding user pair. Since the second resource set records the resources that have interaction relationships with each user in the second user set, the resources that have interaction relationships with each of the two co-occurring users in the user pair can be identified separately, and their intersection can be determined. This reliably yields the shared resources of the corresponding user pair, and also has the advantages of stable information sources and a clear calculation process, ensuring the accuracy of the obtained shared resources.
[0102] It should be understood that, as an example, in actual operation, to obtain information such as multiple pairs of resources to be processed, co-occurring users of each pair of resources to be processed, and shared resources of user pairs of each pair of resources to be processed, the following steps can be taken: first, prepare a first user set, a second user set, and a second resource set by combining message queues and mapping information; then, obtain the above information based on these sets to ensure that the sets used are stable. After obtaining this information, the resource pairs to be processed that need to have their similarity calculated can be determined in step 101, and subsequent steps can be performed based on these resource pairs. After the calculation is completed, return to step 101 to determine the next resource pair to be processed, until all resource pairs to be processed have been calculated. Of course, when entering the next set cycle, a new first resource set can be obtained to perform a new round of cyclical calculations to continue updating the similarity of each resource pair in the resource recommendation platform. In addition, as an example, each pair of resources to be processed can be determined first. When calculating the similarity of a particular pair of resources, the co-occurring users and shared resources of the user pairs of that resource pair can be determined by combining the second user set and the second resource set. Alternatively, the update frequency of the mapping information can be increased by first determining the first user set and multiple pairs of resources to be processed, and then, when calculating the similarity of a particular pair of resources, determining the second user set and the second resource set by combining the latest mapping information, thereby determining the co-occurring users and shared resources of the user pairs of that resource pair. All of the above are implementation methods of this disclosure and fall within the protection scope of this disclosure.
[0103] Next, we will introduce the resource weights and user weights involved in step 104.
[0104] Optionally, the resource weight is obtained based on the number of users who have interacted with the corresponding resource. Users who have interacted with the corresponding resource are denoted as interactive users of that resource, and the resource weight is negatively correlated with the number of interactive users of that resource. By negatively correlated with the number of interactive users of the corresponding resource, popular resources with multiple interactive users can be downweighted. Since many interactive users in popular resources may only interact due to popularity, these interactions have low reference value in similarity calculations. This situation is very common in scenarios like video browsing. By actively reducing the weight of the above-mentioned situations, the weight can reflect the reference value of the interaction data of the corresponding resource, helping to improve the accuracy of the obtained similarity. It should be understood that the resource weight is obtained based on the interactive users of each resource. The interactive users used here can be taken from the aforementioned first user set or the aforementioned second user set, both of which can reflect the popularity of the resource. This disclosure does not impose any restrictions on this.
[0105] Resource weights can be obtained through the following steps: For each resource whose resource weight needs to be determined, the sum of the number of interactive users for that resource and a first auxiliary parameter is determined as the first sum; the first sum is then subjected to a first exponentialization process to obtain the resource weight of the corresponding resource. The first auxiliary parameter can be positive; configuring the first auxiliary parameter avoids the situation where the resource weight equals 0, ensuring the validity of the obtained resource weight. Specifically, the number of interactive users is a natural number; to maintain consistency, the first auxiliary parameter can be a positive integer to reduce computational load. By performing the first exponentialization process, the first sum can be numerically scaled, facilitating adjustments to the order of magnitude of the resource weight, thereby adjusting the impact of the resource weight on similarity. This makes the calculation of similarity more flexible, better adaptable to the values of shared resources, and helps improve the accuracy of the obtained similarity. Specifically, the exponent of the first exponentialization process can be less than 0, achieving the effect of taking the reciprocal, ensuring that the resource weight is negatively correlated with the number of interactive users for the corresponding resource.
[0106] Optionally, user weights are derived from the number of resources interacting with a given user. These resources are categorized as the user's interactive resources, and the user weight is negatively correlated with the number of such resources. By negatively correlated with the number of interactive resources, users with multiple interactive resources can be weighted less. Since these users' interactive resources are more dispersed, their interactions have lower reference value in similarity calculations. Such users with dispersed interactive resources are also very common in video browsing scenarios. By actively reducing the weights in this case, the weights can better reflect the reference value of the user's interaction data, thus improving the accuracy of the obtained similarity scores.
[0107] User weights can be obtained through the following steps: For each user whose weight needs to be determined, determine the sum of the number of interactive resources for that user and the second auxiliary parameter, as the second sum; perform a second exponentialization on the second sum to obtain the user weight for that user. This calculation method is similar to that of resource weights and will not be elaborated here.
[0108] As an example, the absolute values of the exponents in the first and second exponentiation processes can be less than 1 to appropriately reduce the denominator of the reciprocal, thereby appropriately increasing the obtained weights, increasing the similarity, and avoiding excessive weight reduction. As an example, the calculation formulas for the resource weight Wi of resource i, the resource weight Wj of resource j, the user weight Wu of user u, and the user weight Wv of user v are as follows:
[0109]
[0110]
[0111]
[0112]
[0113] Where the first auxiliary parameter and the second auxiliary parameter are both 1, len represents the number of elements in the set, β is the exponent of the first exponentiation process and the second exponentiation process, for example, 0.5, and other symbols are the same as above.
[0114] The following section describes how to determine the similarity between the first resource and the second resource in step 105.
[0115] Optionally, step 105 includes: determining a weighted sum of the reference similarities of each user pair of the resource pair to be processed, as the similarity between the first resource and the second resource; wherein the reference similarity is obtained from the shared resources of the corresponding user pairs, and the weights of the user pairs used in determining the weighted sum are obtained from at least one of the resource weights and user weights. By calculating the weighted sum of the reference similarities of each user pair based on the weights of the user pairs, the reference similarity can be reasonably adjusted, thereby optimizing the reference similarity in related technologies and improving the similarity accuracy in scenarios such as video browsing and recommendation.
[0116] Optionally, the weight of a user pair is the product or sum of at least one type of weight among the resource weight and the user weight of the corresponding user pair. Since the resource pairs to be processed involve only two resources, the resource weights are common data for different user pairs. User pairs, however, are obtained based on all co-occurring users, and therefore, a co-occurring user often appears in multiple user pairs. By determining the resource weight of each resource and the user weight of each co-occurring user separately, and then performing summation or multiplication operations to combine them, the weight of the user pair can be obtained. This not only reuses the resource weights and user weights, reducing computational load and improving computational efficiency, but also ensures the stability and reliability of the characteristics of the user pair weights, thereby guaranteeing the accuracy of the similarity.
[0117] Optionally, the reference similarity is the reciprocal of the sum of the number of shared resources for the corresponding user pair and the third auxiliary parameter. The third auxiliary parameter serves a similar purpose to the first and second auxiliary parameters mentioned above, ensuring the validity of the obtained reference similarity. By taking the reciprocal, it can be ensured that the reference similarity is negatively correlated with the number of shared resources for each user pair.
[0118] As an example, the similarity between the first resource and the second resource can be calculated using the following formula:
[0119]
[0120] In the above formula, the weight of a user pair is the product of the resource weights of the two resources and the user weights of the two co-occurring users. The reference similarity uses the Swing score calculation method. The Swing score in the formula... ′ This represents the optimized Swing score, which is the similarity score as defined in this disclosure.
[0121] Furthermore, the similarity scores of each resource pair with its corresponding first and second resources can be stored together. Each time the resource similarity update method disclosed herein is executed, the stored similarity scores associated with resource pairs can be updated, or new resource pairs and their associated similarity scores can be added for resource recommendation.
[0122] Figure 3 This is a flowchart illustrating a resource recommendation method according to exemplary embodiments of the present disclosure. It should be understood that the resource recommendation method according to exemplary embodiments of the present disclosure can be implemented in terminal devices such as smartphones, tablets, and personal computers (PCs), or in devices such as servers.
[0123] Reference Figure 3 In step 301, a resource recommendation request is received, which includes a reference resource. As an example, the reference resource carried in the resource recommendation request may specifically be a reference resource ID. For the video browsing and recommendation domain, the reference resource may be, for example, a video recently viewed by the user, or the video with the longest recent viewing time; this disclosure does not impose any limitations on this.
[0124] In step 302, based on the resource recommendation request, at least one resource whose similarity to the reference resource meets a set condition is obtained as a recommended resource. The similarity between the reference resource and other resources is obtained through a resource similarity update method according to an exemplary embodiment of this disclosure. Specifically, the reference resource can be sorted according to its similarity to other resources, and the resources with the highest similarity are selected as recommended resources. The specific number of recommended resources can be set as needed, and this disclosure does not impose any limit on this. Since the similarity obtained through the resource similarity update method of this disclosure is highly accurate, it ensures that the recommended resources obtained at this time are relatively relevant to the reference resource, thereby reducing recommendation noise. As an example, the execution entity of the resource recommendation method according to an exemplary embodiment of this disclosure is a recommendation server. Each time a user enters the resource recommendation platform, the backend server sends a resource recommendation request to the recommendation server. The recommendation server requests to query the stored resource pairs and their associated similarities, specifically by accessing the storage device containing the relevant information. The storage device then selects the resources with the top N similarities to the reference resource as recommended resources and returns them to the recommendation server, which then returns the results to the user.
[0125] Figure 4 This is a schematic diagram illustrating the process of a resource recommendation platform according to an exemplary embodiment of the present disclosure. (Refer to...) Figure 4 While the resource similarity update method disclosed herein updates similarity information online (the similarity information records the similarity of each resource pair on the platform and can be stored online) in the process on the right, the resource recommendation platform can also asynchronously run the process on the left, using the resource recommendation method disclosed herein to determine recommended resources similar to the reference resources, and return them to the corresponding users. The resource similarity update method disclosed herein can run asynchronously with the resource recommendation method.
[0126] Figure 5 This is a block diagram illustrating a resource similarity update apparatus according to exemplary embodiments of the present disclosure. It should be understood that the resource similarity update apparatus according to exemplary embodiments of the present disclosure can be implemented in terminal devices such as smartphones, tablets, and personal computers (PCs) in a software, hardware, or a combination of software and hardware, or in devices such as servers.
[0127] Reference Figure 5 The resource similarity update device 500 includes an acquisition unit 501 and a determination unit 502.
[0128] The acquisition unit 501 can acquire a pair of resources to be processed, which includes a first resource and a second resource.
[0129] The acquisition unit 501 can also acquire users who have interaction relationships with both the first resource and the second resource as co-occurring users of the resource pair to be processed.
[0130] The acquisition unit 501 can also take any two co-occurring users as a user pair and acquire resources that have an interaction relationship with both co-occurring users in the user pair as shared resources of the user pair.
[0131] The acquisition unit 501 can also acquire at least one of the resource weights of the first resource and the second resource, and the user weight of each co-occurring user.
[0132] The determining unit 502 may determine the similarity between the first resource and the second resource based on at least one of the resource weight and the user weight, as well as the common resources of each user pair of the resource pair to be processed.
[0133] Optionally, the acquisition unit 501 may also acquire a first resource set; wherein the first resource set includes multiple resources; and based on the multiple resources in the first resource set, at least one pair of resources to be processed is determined.
[0134] Optionally, the resource similarity update device further includes a query unit (not shown in the figure) and a filtering unit (not shown in the figure). The query unit can query mapping information to obtain a set of users who have interaction relationships with each resource in the first resource set, as the first user set; wherein, the mapping information records the interaction relationships between resources and users. The filtering unit can filter the first user set to remove users who only have interaction relationships with one resource in the first resource set, to obtain a second user set; wherein, the second user set is used to determine the co-occurring users of the resource pairs to be processed. The query unit can also query mapping information to obtain a set of resources that have interaction relationships with each user in the second user set, as the second resource set. wherein, the second resource set is used to determine the shared resources of the user pairs.
[0135] Optionally, the acquisition unit 501 may also, for each pair of resources to be processed, determine, according to the second user set, users who have interactive relationships with both the corresponding first resource and the second resource, as co-occurring users of the corresponding pair of resources to be processed; and for each pair of resources to be processed, determine, according to the second resource set, resources that have interactive relationships with both co-occurring users in each user pair of the corresponding pair of resources to be processed, as shared resources of the corresponding user pair of the corresponding pair of resources to be processed.
[0136] Optionally, the acquisition unit 501 may also acquire an interactive data stream; wherein the interactive data stream includes user-resource interaction data; the resource similarity update device further includes an update unit that can continuously update the mapping information based on the interactive data stream.
[0137] Optionally, the updating unit may also continuously update the first mapping information and the second mapping information according to the interactive data stream; wherein the first mapping information records the resources that have an interactive relationship with each user, and the second mapping information records the users that have an interactive relationship with each resource.
[0138] Optionally, the first resource set, the second resource set, the first user set, and the second user set are updated according to a set period; the mapping information, the first resource set, the second resource set, the first user set, and the second user set are stored in an online storage format.
[0139] Optionally, the acquisition unit 501 can also acquire a message queue according to a set period. The message queue records users who have performed interactive behaviors in the current period; query the mapping information to obtain a set of several resources that have recently interacted with each user recorded in the message queue, as the first resource set.
[0140] Optionally, the resource weight is obtained based on the number of users who have an interaction relationship with the corresponding resource, where users who have an interaction relationship with the corresponding resource are recorded as interactive users of the corresponding resource, and the resource weight is negatively correlated with the number of interactive users of the corresponding resource.
[0141] Optionally, the resource weight is obtained through the following steps: for each resource whose resource weight needs to be determined, the sum of the number of interactive users of the corresponding resource and the first auxiliary parameter is determined as the first sum; the first sum is subjected to a first exponentialization process to obtain the resource weight of the corresponding resource.
[0142] Optionally, the user weight is obtained based on the number of resources that have an interaction relationship with the corresponding user, where resources that have an interaction relationship with the corresponding user are denoted as the corresponding user's interaction resources, and the user weight is negatively correlated with the number of the corresponding user's interaction resources.
[0143] Optionally, user weights are obtained through the following steps: for each user whose user weight needs to be determined, the sum of the number of interactive resources of the corresponding user and the second auxiliary parameter is determined as the second sum; the second sum is subjected to a second exponentialization process to obtain the user weight of the corresponding user.
[0144] Optionally, the determining unit 502 may further determine a weighted sum of the reference similarities of each user pair of the resource pair to be processed, as the similarity between the first resource and the second resource. The reference similarity is obtained from the shared resources of the corresponding user pairs, and the weights of the user pairs used to determine the weighted sum are obtained from at least one of the resource weights and user weights.
[0145] Optionally, the weight of a user pair is the product or sum of at least one type of weight among the resource weight and the user weight of the corresponding user pair.
[0146] Optionally, the reference similarity is the reciprocal of the sum of the number of shared resources for the corresponding user pair and a third auxiliary parameter.
[0147] Figure 6 This is a block diagram illustrating a resource recommendation apparatus according to exemplary embodiments of the present disclosure. It should be understood that the resource recommendation apparatus according to exemplary embodiments of the present disclosure can be implemented in terminal devices such as smartphones, tablets, and personal computers (PCs) in a software, hardware, or a combination of software and hardware, or in devices such as servers.
[0148] Reference Figure 6 The resource recommendation device 600 includes a receiving unit 601 and a recommendation unit 602.
[0149] The receiving unit 601 can receive resource recommendation requests, which include reference resources.
[0150] The recommendation unit 602 can obtain at least one resource whose similarity to a reference resource meets a set condition, based on a resource recommendation request, as a recommended resource, wherein the similarity between the reference resource and other resources is obtained by a resource similarity update method according to an exemplary embodiment of the present disclosure.
[0151] Regarding the apparatus in the above embodiments, the specific manner in which each unit performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0152] Figure 7 This is a block diagram of an electronic device according to exemplary embodiments of the present disclosure.
[0153] Reference Figure 7 The electronic device 700 includes at least one memory 701 and at least one processor 702. The at least one memory 701 stores a set of computer-executable instructions. When the set of computer-executable instructions is executed by the at least one processor 702, a resource similarity update method or a resource recommendation method according to exemplary embodiments of the present disclosure is executed.
[0154] As an example, electronic device 700 may be a PC, tablet, personal digital assistant, smartphone, or other device capable of executing the aforementioned set of instructions. Here, electronic device 700 is not necessarily a single electronic device, but may be a collection of any devices or circuits capable of executing the aforementioned instructions (or instruction sets) individually or in combination. Electronic device 700 may also be part of an integrated control system or system manager, or may be configured to interconnect with a portable electronic device locally or remotely (e.g., via wireless transmission) through an interface.
[0155] In electronic device 700, processor 702 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. By way of example and not limitation, processor may also include analog processors, digital processors, microprocessors, multi-core processors, processor arrays, network processors, etc.
[0156] The processor 702 can execute instructions or code stored in the memory 701, which can also store data. Instructions and data can also be sent and received via a network through a network interface device, which can employ any known transmission protocol.
[0157] The memory 701 can be integrated with the processor 702, for example, by placing RAM or flash memory within an integrated circuit microprocessor. Alternatively, the memory 701 can include a separate device, such as an external disk drive, a storage array, or other storage device usable by any database system. The memory 701 and the processor 702 can be operatively coupled, or can communicate with each other, for example, via I / O ports, network connections, etc., enabling the processor 702 to read files stored in the memory.
[0158] In addition, the electronic device 700 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). All components of the electronic device 700 can be interconnected via a bus and / or network.
[0159] According to exemplary embodiments of the present disclosure, a computer-readable storage medium may also be provided, which, when executed by at least one processor, causes at least one processor to perform a resource similarity update method or a resource recommendation method according to exemplary embodiments of the present disclosure. Examples of computer-readable storage media include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disc storage, hard disk drive (HDD), solid-state drive (SSD), card storage (such as multimedia cards, secure digital (SD) cards, or ultra-fast digital (XD) cards), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid-state drive, and any other device configured to store a computer program and any associated data, data files, and data structures in a non-transitory manner and to provide the computer program and any associated data, data files, and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the aforementioned computer-readable storage medium can run in an environment deployed in computer devices such as clients, hosts, agent devices, servers, etc. Furthermore, in one example, the computer program and any associated data, data files, and data structures are distributed across a networked computer system, such that the computer program and any associated data, data files, and data structures are stored, accessed, and executed in a distributed manner through one or more processors or computers.
[0160] According to exemplary embodiments of the present disclosure, a computer program product may also be provided, the computer program product including computer instructions, which, when executed by at least one processor, cause at least one processor to perform a resource similarity update method or a resource recommendation method according to exemplary embodiments of the present disclosure.
[0161] The resource similarity update method, resource recommendation method and apparatus, and electronic device according to the exemplary embodiments of this disclosure, based on shared resources, can adjust the similarity by introducing resource weights and user weights, thereby reducing the correlation strength between similarity and shared resources, improving the accuracy of similarity, and thus obtaining recommended resources that are more relevant to the reference resources, which can reduce recommendation noise.
[0162] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0163] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A resource similarity update method, characterized in that, The resource similarity update method includes: Obtain a pair of resources to be processed, the pair of resources to be processed including a first resource and a second resource; Users who have interaction relationships with both the first resource and the second resource are identified as co-occurring users of the resource pair to be processed. Take any two co-occurring users as a user pair, and obtain the resources that have an interaction relationship with both co-occurring users in the user pair as the shared resources of the user pair; Obtain at least one of the resource weights of the first resource and the second resource and the user weight of each co-occurring user, wherein the user weight is obtained based on the number of interactive resources of the corresponding user, and the interactive resources of the corresponding user are resources that have an interactive relationship with the corresponding user; The similarity between the first resource and the second resource is determined based on at least one of the resource weight and the user weight, and the shared resources of each user pair of the resource pair to be processed.
2. The resource similarity update method as described in claim 1, characterized in that, The resource weight is obtained based on the number of users who have an interaction relationship with the corresponding resource. Users who have an interaction relationship with the corresponding resource are recorded as interactive users of the corresponding resource. The resource weight is negatively correlated with the number of interactive users of the corresponding resource.
3. The resource similarity update method as described in claim 2, characterized in that, The resource weights are obtained through the following steps: For each resource whose resource weight needs to be determined, the sum of the number of interactive users of the corresponding resource and the first auxiliary parameter is determined as the first sum. The first sum is subjected to a first exponentialization process to obtain the resource weight of the corresponding resource.
4. The resource similarity update method as described in claim 1, characterized in that, The user weight is negatively correlated with the number of interactive resources for the corresponding user.
5. The resource similarity update method as described in claim 4, characterized in that, The user weight is obtained through the following steps: For each user whose user weight needs to be determined, the sum of the number of interaction resources of the corresponding user and the second auxiliary parameter is determined as the second sum. The second sum is subjected to a second exponentialization process to obtain the user weight of the corresponding user.
6. The resource similarity update method as described in claim 1, characterized in that, Determining the similarity between the first resource and the second resource based on at least one of the resource weights and the user weights, and the shared resources of each user pair of the resource pair to be processed, includes: The weighted sum of the reference similarities of each user pair of the resource pair to be processed is determined as the similarity between the first resource and the second resource; wherein the reference similarity is obtained from the shared resources of the corresponding user pairs, and the weight of the user pair used when determining the weighted sum is obtained from at least one of the resource weight and the user weight.
7. The resource similarity update method as described in claim 6, characterized in that, The weight of the user pair is the product or sum of the resource weight and the user weight of the corresponding user pair; and / or The reference similarity is the reciprocal of the sum of the number of shared resources for the corresponding user pair and the third auxiliary parameter.
8. The resource similarity update method according to any one of claims 1 to 7, characterized in that, Before obtaining the resource pairs to be processed, the resource similarity update method further includes: Obtain a first resource set; wherein the first resource set includes multiple resources; The acquisition of resource pairs to be processed includes: Based on multiple resources in the first resource set, at least one of the resource pairs to be processed is determined.
9. The resource similarity update method as described in claim 8, characterized in that, Before acquiring users who have interaction relationships with both the first and second resources as co-occurring users of the resource pair to be processed, the resource similarity update method further includes: The mapping information is queried to obtain a set of users who have interaction relationships with each resource in the first resource set, which is taken as the first user set; wherein, the mapping information records the interaction relationships between resources and users; The first user set is filtered to remove users who only interact with one resource in the first resource set, resulting in a second user set; wherein, the second user set is used to determine the co-occurring users of the resource pairs to be processed; The mapping information is queried to obtain a set of resources that have interaction relationships with each user in the second user set, which is used as the second resource set; wherein, the second resource set is used to determine the shared resources of user pairs.
10. The resource similarity update method as described in claim 9, characterized in that, The step of acquiring users who have interaction relationships with both the first and second resources as co-occurring users of the resource pair to be processed includes: For each of the resource pairs to be processed, users who have interaction relationships with both the corresponding first and second resources are determined according to the second user set, and are regarded as co-occurring users of the corresponding resource pairs to be processed; The step of taking any two co-occurring users as a user pair and obtaining resources that have interaction relationships with both co-occurring users in the user pair as the shared resources of the user pair includes: For each pair of resources to be processed, based on the second resource set, resources that have an interaction relationship with two co-occurring users in each user pair of the corresponding resource pair to be processed are determined as the shared resources of the corresponding user pair of the corresponding resource pair to be processed.
11. The resource similarity update method as described in claim 10, characterized in that, The resource similarity update method further includes: Acquire interactive data streams; wherein, the interactive data streams include user-resource interaction data; The mapping information is continuously updated based on the interactive data stream.
12. The resource similarity update method as described in claim 11, characterized in that, The step of continuously updating the mapping information based on the interactive data stream includes: Based on the interactive data stream, the first mapping information and the second mapping information are continuously updated respectively; wherein, the first mapping information records the resources that have an interactive relationship with each user, and the second mapping information records the users that have an interactive relationship with each resource.
13. The resource similarity update method as described in claim 10, characterized in that, The first resource set, the second resource set, the first user set, and the second user set are updated according to a set period. The mapping information, the first resource set, the second resource set, the first user set, and the second user set are stored in an online storage format.
14. The resource similarity update method as described in claim 9, characterized in that, The acquisition of the first resource set includes: The message queue is retrieved according to a set period, and the message queue records users who have performed interactive behaviors within the current period; The mapping information is queried to obtain a set of resources that have recently interacted with each user recorded in the message queue, which is used as the first resource set.
15. A resource recommendation method, characterized in that, The resource recommendation method includes: Receive a resource recommendation request, the resource recommendation request including reference resources; Based on the resource recommendation request, at least one resource whose similarity to the reference resource meets a set condition is obtained and used as the recommended resource. The similarity between the reference resource and other resources is obtained by the resource similarity update method as described in any one of claims 1 to 14.
16. A resource similarity updating device, characterized in that, The resource similarity update device includes: The acquisition unit is configured to acquire a pair of resources to be processed, wherein the pair of resources to be processed includes a first resource and a second resource; The acquisition unit is further configured to: acquire users who have interaction relationships with both the first resource and the second resource as co-occurring users of the resource pair to be processed; The acquisition unit is further configured to: take any two co-occurring users as a user pair, and acquire resources that have an interaction relationship with both co-occurring users in the user pair as the shared resources of the user pair; The acquisition unit is further configured to: acquire at least one of the resource weights of the first resource and the second resource and the user weight of each co-occurring user, wherein the user weight is obtained based on the number of interactive resources of the corresponding user, and the interactive resources of the corresponding user are resources that have an interactive relationship with the corresponding user; The determining unit is configured to: determine the similarity between the first resource and the second resource based on at least one of the resource weight and the user weight, and the shared resources of each user pair of the resource pair to be processed.
17. The resource similarity updating device as described in claim 16, characterized in that, The resource weight is obtained based on the number of users who have an interaction relationship with the corresponding resource. Users who have an interaction relationship with the corresponding resource are recorded as interactive users of the corresponding resource. The resource weight is negatively correlated with the number of interactive users of the corresponding resource.
18. The resource similarity updating device as described in claim 17, characterized in that, The resource weights are obtained through the following steps: For each resource whose resource weight needs to be determined, the sum of the number of interactive users of the corresponding resource and the first auxiliary parameter is determined as the first sum. The first sum is subjected to a first exponentialization process to obtain the resource weight of the corresponding resource.
19. The resource similarity updating device as described in claim 16, characterized in that, The user weight is negatively correlated with the number of interactive resources for the corresponding user.
20. The resource similarity updating device as described in claim 19, characterized in that, The user weight is obtained through the following steps: For each user whose user weight needs to be determined, the sum of the number of interaction resources of the corresponding user and the second auxiliary parameter is determined as the second sum. The second sum is subjected to a second exponentialization process to obtain the user weight of the corresponding user.
21. The resource similarity updating device as described in claim 16, characterized in that, The determining unit is further configured to: The weighted sum of the reference similarities of each user pair of the resource pair to be processed is determined as the similarity between the first resource and the second resource; wherein the reference similarity is obtained from the shared resources of the corresponding user pairs, and the weight of the user pair used when determining the weighted sum is obtained from at least one of the resource weight and the user weight.
22. The resource similarity updating device as described in claim 21, characterized in that, The weight of the user pair is the product or sum of the resource weight and the user weight of the corresponding user pair; and / or The reference similarity is the reciprocal of the sum of the number of shared resources for the corresponding user pair and the third auxiliary parameter.
23. The resource similarity updating apparatus according to any one of claims 16 to 22, characterized in that, The acquisition unit is further configured to: Obtain a first resource set; wherein the first resource set includes multiple resources; Based on multiple resources in the first resource set, at least one of the resource pairs to be processed is determined.
24. The resource similarity updating device as described in claim 23, characterized in that, The resource similarity update device further includes: The query unit is configured to: query mapping information to obtain a set of users who have interaction relationships with each resource in the first resource set, as the first user set; wherein, the mapping information records the interaction relationships between resources and users; The filtering unit is configured to: perform filtering processing on the first user set, filtering out users who only have an interaction relationship with one resource in the first resource set, to obtain a second user set; wherein, the second user set is used to determine the co-occurring users of the resource pair to be processed; The query unit is further configured to: query the mapping information to obtain a set of resources that have interactive relationships with each user in the second user set, as the second resource set; wherein, the second resource set is used to determine the shared resources of the user pair.
25. The resource similarity updating device as described in claim 24, characterized in that, The acquisition unit is further configured to: For each of the resource pairs to be processed, users who have interaction relationships with both the corresponding first and second resources are determined according to the second user set, and are regarded as co-occurring users of the corresponding resource pairs to be processed; For each pair of resources to be processed, based on the second resource set, resources that have an interaction relationship with two co-occurring users in each user pair of the corresponding resource pair to be processed are determined as the shared resources of the corresponding user pair of the corresponding resource pair to be processed.
26. The resource similarity updating device as described in claim 25, characterized in that, The acquisition unit is further configured to: acquire an interactive data stream; wherein the interactive data stream includes user-resource interaction data; The resource similarity update device further includes an update unit configured to continuously update the mapping information based on the interactive data stream.
27. The resource similarity updating device as described in claim 26, characterized in that, The update unit is also configured to: Based on the interactive data stream, the first mapping information and the second mapping information are continuously updated respectively; wherein, the first mapping information records the resources that have an interactive relationship with each user, and the second mapping information records the users that have an interactive relationship with each resource.
28. The resource similarity updating device as described in claim 25, characterized in that, The first resource set, the second resource set, the first user set, and the second user set are updated according to a set period. The mapping information, the first resource set, the second resource set, the first user set, and the second user set are stored in an online storage format.
29. The resource similarity updating device as described in claim 24, characterized in that, The acquisition unit is further configured to: The message queue is retrieved according to a set period, and the message queue records users who have performed interactive behaviors within the current period; The mapping information is queried to obtain a set of resources that have recently interacted with each user recorded in the message queue, which is used as the first resource set.
30. A resource recommendation device, characterized in that, The resource recommendation device includes: The receiving unit is configured to receive a resource recommendation request, wherein the resource recommendation request includes reference resources; The recommendation unit is configured to: based on the resource recommendation request, obtain at least one resource whose similarity to the reference resource meets a set condition, and use it as a recommended resource. The similarity between the reference resource and other resources is obtained by the resource similarity update method as described in any one of claims 1 to 14.
31. An electronic device, characterized in that, include: At least one processor; At least one memory that stores computer-executable instructions. Wherein, when the computer-executable instructions are executed by the at least one processor, the at least one processor causes the at least one processor to perform the resource similarity update method as described in any one of claims 1 to 14 or the resource recommendation method as described in claim 15.
32. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor causes the at least one processor to perform the resource similarity update method as claimed in any one of claims 1 to 14 or the resource recommendation method as claimed in claim 15.
Citation Information
Patent Citations
Personal interactive data retrieval method and system based on tag technology
CN102880687A
A method and apparatus for recommend electronic resources
CN109471978A