A commodity similarity calculation method and device, and a commodity recall method and system
By dividing the set of products clicked by users into two parts, first calculating the original similarity of product pairs in the first set, and then updating the similarity using the second set, the problem of computational complexity of product pairs in existing technologies is solved, thereby improving product recall efficiency. In particular, personalized operations for popular users enhance the accuracy and efficiency of product recall.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-05
- Publication Date
- 2026-04-14
AI Technical Summary
The existing Swing algorithm has a huge computational load when calculating tens of millions of products and users, resulting in unacceptable time complexity and affecting the efficiency of product similarity calculation and recall.
The set of products clicked by users is divided into two parts. First, the original similarity score of the product pairs in the first set is calculated. Then, the similarity score of the first set is updated with the data in the second set. The similarity score of the first set is updated with the user data in the second set. The Swing algorithm is used to calculate and update the similarity.
By splitting the similarity calculation into two stages, computational complexity is reduced, and computational efficiency and product recall efficiency are improved, especially for data of tens of millions.
Smart Images

Figure CN116091078B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet applications, and in particular to a product similarity calculation method, apparatus, and product recall method and system. Background Technology
[0002] With the development of internet applications and the logistics industry, more and more merchants and consumers tend to complete transactions on e-commerce platforms. To improve user experience and sales, most e-commerce platforms offer product recommendation services, recommending one or more products to users when they meet certain recommendation criteria. One recommendation algorithm used is the Swing algorithm, which calculates the similarity between items (such as products on an e-commerce platform) and uses this similarity to recall and recommend products. The principle of the Swing algorithm is: when two or more users click on product i and simultaneously click on another product j, it can be determined that product i and product j are strongly related. The Swing algorithm uses this strong association passed down through users to determine the similarity between two products. Specifically, in the Swing algorithm, the similarity score between two products is calculated according to formula 1-2:
[0003]
[0004] Among them, I i I j U represents the identifiers for product i and product j; u and v represent users; U i Let U be the set of users who click on product i. j Let I be the set of users who clicked on product j; u For the product clicked by user u, I v Let α be the product clicked by user v; α is a constant.
[0005] As can be seen from the above formula, calculating the similarity score between two items (hereinafter referred to as item pairs) requires multiple traversals and calculations of the user set and item set. Therefore, when the number of users / items is huge, the computational load of this algorithm is also huge. Assuming there are millions of users and tens of millions of items, when the I... i and I j When both are relatively popular, their user overlap may be close to the millions, and the corresponding user's product set may be close to the tens of millions. Even if both are at the millions level, the computational workload for just one product pair is as high as millions * millions = tens of billions of times, so the required time complexity is unacceptable. Summary of the Invention
[0006] In view of the technical problems existing in the prior art, the present invention proposes a product similarity calculation method, device, product recall method and system to reduce the complexity of product similarity calculation and improve calculation efficiency and product recall efficiency.
[0007] To address the aforementioned technical problems, according to one aspect of the present invention, a method for calculating product similarity is provided, comprising the following steps:
[0008] Obtain the clicked product sequence of each user in the platform's full user set to form a user clicked product set;
[0009] The set of products clicked by users is divided into a first set and a second set, wherein the number of product sequences clicked by users in the first set is less than the number of product sequences clicked by users in the second set;
[0010] First, obtain the first product pairs clicked by the same first user from the first set to form the first product pair set and the first user set for each first product pair; second, obtain the second product pairs clicked by the same second user from the second set to form the second product pair set and the second user set for each second product pair.
[0011] Calculate the original similarity score of the first item pair in the first item pair set using the Swing algorithm; and
[0012] Update the original similarity score of the first product pair based on the second product pair in the second product pair set and its corresponding second user set.
[0013] Preferably, the step of updating the similarity score of the first product pair based on the second product pair in the second product pair set and its corresponding second user set includes the following steps:
[0014] Each second item pair is compared with each first item pair separately;
[0015] In response to the second product pair being identical to the first product pair, multiple third user pairs are formed by pairing each second user in the second user set of the second product pair with each first user in the first user set of the first product pair, and a similarity score for the second product pair is calculated based on each third user pair using the Swing algorithm; and
[0016] Calculate the sum of the original similarity score of the first product pair and the sum of multiple similarity scores of the second product pair obtained based on the third user pair; update the similarity score of the first product pair with the sum, and add the corresponding second user to the first user set of the first product pair.
[0017] Preferably, the steps of calculating the original similarity score of the first item pair in the first set according to the Swing algorithm and calculating the similarity score of the second item pair based on each third user pair include:
[0018] Obtain the users who clicked on the target product pair and their clicked product sequence I, wherein the users form user pairs in pairs; wherein the target product pair is a first product pair or a second product pair, and the user pair is a first user pair consisting of two first users who jointly clicked on the first product pair or a third user pair consisting of a second user who clicked on the second product pair and a first user who clicked on the same first product pair as the second product pair;
[0019] Get the number of common products n in the product sequence I clicked by two users in a user pair; and
[0020] Calculate the similarity score of the target product pair corresponding to the user pair according to Formula 1-1:
[0021]
[0022] Where Sim(i,j) is the similarity score of the product pair consisting of the i-th and j-th products; α is a constant.
[0023] Preferably, when the target product pair is a first product pair, if the number of first users corresponding to it is less than 2, the similarity score of the first product pair is not calculated; when the number of first users of the first product pair is greater than 2, multiple first users constitute multiple first user pairs; the similarity score of the first product pair corresponding to each first user pair is calculated according to Formula 1-1; and the sum of all similarity scores of the first product pair is calculated as the similarity score of the first product pair.
[0024] Preferably, when calculating the similarity score of the target product pair for each user pair, if the number of common products n in the product sequence clicked by the two users is greater than a threshold, the similarity score of the target product pair for the corresponding user pair is counted as 0.
[0025] Preferably, when the second product pair is different from any first product pair in the first product pair set, the second product pair is added to the first product pair set to become a new first product pair.
[0026] In one embodiment, the platform is a second-hand goods platform, and the goods are second-hand goods.
[0027] According to another aspect of the present invention, a product recall method is also provided, comprising the following steps:
[0028] The similarity score of the product pair is calculated according to the aforementioned method, wherein the product pair consists of a first product and a second product;
[0029] Obtain multiple product pairs with the target product as the first product and their similarity scores;
[0030] The multiple product pairs are sorted in descending order of similarity score; and
[0031] The second item in the top-ranked, pre-defined item pair is selected as the item to be recalled.
[0032] According to another aspect of the present invention, a product similarity calculation device is also provided, including a user-clicked product set acquisition module, a product pair construction module, a first similarity calculation module, and a similarity update module. The user-clicked product set acquisition module acquires the clicked product sequences of each user in the full user set of the platform to form a user-clicked product set, and divides the user-clicked product set into a first set and a second set, wherein the number of user-clicked product sequences in the first set is less than the number of user-clicked product sequences in the second set. The product pair construction module acquires first product pairs clicked by the same first user in the first set to form a first product pair set and a first user set for each first product pair; and acquires second product pairs clicked by the same second user in the second set to form a second product pair set and a second user set for each second product pair. The first similarity calculation module is connected to the product pair construction module and configured to calculate the original similarity score of the first product pairs in the first product pair set according to the Swing algorithm. The similarity update module is connected to the product pair construction module and the first similarity calculation module and configured to update the original similarity score of the first product pairs based on the second product pairs in the second product pair set and their corresponding second user sets.
[0033] Preferably, the similarity update module includes a product pair comparison unit, a third user pair construction unit, a second similarity calculation unit, and an update unit. The product pair comparison unit is configured to compare each second product pair in the second product pair set with each first product pair to determine second product pairs identical to the first product pairs. The third user pair construction unit is connected to the product pair comparison unit and configured to, in response to a second product pair being identical to a first product pair, form multiple third user pairs with each second user in the second user set of the second product pair and each first user in the first user set of the first product pair. The second similarity calculation unit is connected to the third user pair construction unit and configured to calculate a similarity score for each third user pair based on the Swing algorithm. The update unit is connected to the second similarity calculation unit and configured to calculate the sum of the original similarity score of the first product pair and the multiple similarity scores of the second product pair obtained based on the third user pairs, update the original similarity score of the first product pair with the sum, and add the corresponding second user to the first user set of the first product pair.
[0034] According to another aspect of the present invention, a product recall system is also provided, comprising the aforementioned product similarity calculation device, target product pair acquisition module, sorting module, and product acquisition module, wherein the product similarity calculation device is configured to obtain similarity scores for multiple product pairs, wherein each product pair consists of a first product and a second product; the target product pair acquisition module is connected to the product similarity calculation device and is configured to acquire multiple product pairs with the target product as the first product and their similarity scores; the sorting module is connected to the target product pair acquisition module and is configured to sort the multiple product pairs in descending order of scores; the product acquisition module is connected to the sorting module and is configured to acquire the second product from a preset number of product pairs ranked first as the product to be recalled.
[0035] This invention reduces the complexity of similarity calculation by splitting the calculation process into two stages, effectively improving the execution efficiency of the Swing algorithm. Even when dealing with tens of millions of products and users, it can calculate results within an acceptable time, thereby improving the efficiency of product recall. On the other hand, some personalized operations can be added when updating the similarity score in the second stage. For example, special weight calculations can be customized for the historical access records of popular users (who are likely cheating users), or some historical records can be selectively skipped or discarded, in order to reduce the impact of malicious user behavior on the recalled products. Attached Figure Description
[0036] The preferred embodiments of the present invention will now be described in further detail with reference to the accompanying drawings, wherein:
[0037] Figure 1 This is a flowchart of a product similarity calculation method according to an embodiment of the present invention;
[0038] Figure 2 This is a flowchart of a method for calculating the similarity score of a first item pair in a first item pair set according to an embodiment of the present invention;
[0039] Figure 3 This is a flowchart of a method for updating the similarity score of a first product pair according to an embodiment of the present invention;
[0040] Figure 4 This is a flowchart of a product recall method according to an embodiment of the present invention;
[0041] Figure 5 This is a schematic diagram of a product similarity calculation device according to an embodiment of the present invention;
[0042] Figure 6 This is a block diagram illustrating the principle of a similarity update module according to an embodiment of the present invention;
[0043] Figure 7 This is a block diagram of a similarity update module according to another embodiment of the present invention; and
[0044] Figure 8 This is a block diagram illustrating the principle of a product recall system according to an embodiment of the present invention; Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0046] In the following detailed description, reference can be made to the accompanying drawings, which form part of this application and illustrate specific embodiments of the present application. In the drawings, similar reference numerals describe substantially similar components in different figures. Specific embodiments of the present application are described in sufficient detail below to enable those skilled in the art to implement the technical solutions of the present application. It should be understood that other embodiments may also be utilized, or structural, logical, or electrical changes may be made to the embodiments of the present application.
[0047] This invention provides a product similarity calculation method based on the Swing algorithm, such as... Figure 1 The diagram shown is a flowchart of a product similarity calculation method according to an embodiment of the present invention. The product similarity calculation method includes the following steps:
[0048] Step S1a: Obtain the clicked product sequence for each user in the platform's full user set to form a user-clicked product set. In one embodiment, the e-commerce platform sets up tracking points at the corresponding product display locations on the page. When a user clicks a product, the tracking points can be used to obtain the user's click data for that product, which is then stored in the user log. In this step, by reading the user logs over a period of time, the products clicked by the user within that time period can be obtained and arranged into a sequence according to the click time, as shown in Table 1 below. The time period for reading the data can be determined by setting different time windows, such as the last 3 days, the last 1 day, etc. New data is read periodically or in real time according to the time window, and old data exceeding the time window is deleted, thereby dynamically maintaining the data in Table 1 within the specified time period.
[0049] Table 1 User Click Sequence
[0050] Serial Number User ID Product sequence (product ID) 1 U1 id1, id2 2 U2 id1, id2, id3 3 U3 id2, id3, id4 4 U4 id3, id4, id5 5 U5 id2, id3, id4 6 U6 id3, id4, id5 7 U7 id4, id5, id6 …… …… ……
[0051] The data in Table 1 above constitutes the set of products clicked by the user. In this embodiment, it consists of multiple data entries, each of which includes the user's identity identifier and the identifier of the product they clicked.
[0052] Step S2a: Divide the set of user-clicked items into a first set and a second set. The number of user-clicked item sequences in the first set is less than the number of user-clicked item sequences in the second set. As shown in Table 1 above, assuming there are a total of 7 data entries, entries 1-3 are divided into the first set, and entries 4-7 are divided into the second set. It should be noted that the data and data volume in this embodiment are for the purpose of clearly and concisely illustrating the method of the present invention. In practical applications, the amount of data in the platform is enormous; for example, there may be millions of users and millions or tens of millions of items. Therefore, when dividing the sets, the data volume of the first set can be significantly smaller than the data volume of the second set, such as one-thousandth or one-ten-thousandth of the data volume of the second set, depending on the total amount of data.
[0053] Step S3a: Determine the product pairs clicked by the same user in each set. Specifically, in the first set, obtain the first product pairs clicked by the same first user to form a first product pair set and a first user set for each first product pair; in the second set, obtain the second product pairs clicked by the same second user to form a second product pair set and a second user set for each second product pair. Taking the data in Table 1 as an example, the following product pairs and corresponding user sets are obtained in the first set:
[0054] The first set of product pairs: {(id1,id2):[u1,u2];(id2,id3):[u2,u3];(id3,id4):[u3];……}
[0055] The second set of product pairs: {(id2,id3):[u5];(id3,id4):[u4,u5,u6];
[0056] (id4,id5):[u4,u6,u7]; (id5,id6):[u7]……}
[0057] To distinguish between product pairs and user / user pairs in the two sets, the products in the first and second sets are referred to as the first product and the second product, respectively, and the users in the first and second sets are referred to as the first user and the second user, respectively. Two products combined together are called a product pair. There may be one or more users clicking on a product pair; therefore, each product pair corresponds to a user set.
[0058] Step S4a: Calculate the original similarity scores of multiple first product pairs in the first product pair set using the Swing algorithm. According to the Swing algorithm shown in Formulas 1-2, to calculate the similarity score of a product pair, it is necessary to determine its user pair and the number of products clicked by each user. Therefore, in one embodiment, the step of calculating the similarity score of a first product pair in the first product pair set is as follows: Figure 2 As shown:
[0059] Step S41a: Obtain a target product pair, such as the first product pair (id1, id2).
[0060] Step S42a: Obtain the users who clicked the target product pair and their clicked product sequence I. For example, the first user set that clicked the first product pair (id1, id2) is [u1, u2], and their respective clicked product sequences are:
[0061] I1:id1,id2;
[0062] I2:id1,id2,id3
[0063] Step S43a: Obtain the number of common products n in the product sequences clicked by the two users in the user pair. For the first product pair (id1, id2), there is a user pair [u1, u2], and the common products in the clicked product sequences are id1 and id2, so the number n = 2.
[0064] Step S44a: Calculate the similarity score of the target product pair corresponding to the user pair according to Formula 1-1:
[0065]
[0066] Wherein, α is a constant. In one embodiment, α = 0.5, which can be many values. In practical applications, a suitable value can be selected through algorithms such as grid search.
[0067] The original similarity score for the first product pair (id1, id2) is:
[0068]
[0069] Similarly, the original similarity score Sim(2,3)1 for the first product pair (id2,id3) can be calculated to be 0.4. When there is only one user in the user set of a product pair, formula 1-2 cannot be used for calculation, so its score can be temporarily ignored, for example, set to 0. For example, the score of product pair (id3,id4) is 0.
[0070] Therefore, the following data is obtained after the above calculations:
[0071] Score={(id1,id2):0.4,(id2,id3):0.4; (id3,id4):0……}
[0072] Since the product pairs in the first product pair set represent only a small portion of the total data, the original similarity scores for all product pairs can be obtained quickly.
[0073] The user set for each product pair obtained from the data in Table 1 includes either two users or one user. When there are two users, they form a user pair, and the similarity score for the product pair can be obtained by applying the Swing algorithm formula. If the user set includes multiple users, in one embodiment, these multiple users are grouped into multiple user pairs, and a similarity score is calculated for each user pair using the Swing algorithm formula. Then, the similarity scores calculated based on all user pairs are summed, and the sum is used as the similarity score for the product pair.
[0074] Step S5a: Update the original similarity score of the first product pair based on the second product pair in the second product pair set and its corresponding second user set, and add the corresponding second user to the first user set corresponding to the first product. Since there is still a large amount of data in the second product pair set, including product pairs from the first product pair set and more clicked users, the product pairs in the first product pair set can be found in the second product pair set, and their similarity scores can be further calculated based on their clicked users and clicked product sequences. The newly calculated similarity scores are then used to update the original calculated scores, thus obtaining the final similarity score. Specifically, taking the data in Table 1 as an example, the update process is as follows: Figure 3 As shown:
[0075] Step S51a: Take a second product pair from the second product pair set, such as the first product pair (id2, id3) in the second product pair set.
[0076] Step S52a: Compare the second product pair with each of the first product pairs in the first product pair set.
[0077] Step S53a: Determine if the second product pair is the same as any first product pair in the first product pair set. If they are the same, then in step S54a, take the user sets of both to form multiple third user pairs. For example, the user sets of product pair (id2, id3) in the first product pair set are u2 and u3, and the user set of the second product pair set is u5, thus forming two user pairs (u2, u5) and (u3, u5) respectively. If they are different, then in step S55a, add them to the first product pair set. For example, product pairs (id4, id5) and (id5, id6) in the second product pair set are not the same as any product pair in the first product pair set, so add them and their user sets to the first product pair set.
[0078] Step S56a: Calculate the similarity score for each third user pair for that product pair. For example, for product pair (id2, id3), calculate the similarity scores when the user pairs are (u2, u5) and (u3, u5). For example, by consulting Table 1 and determining that users u2 and u5 have clicked on 2 products together, substitute the results into Formula 1-2 to obtain their similarity scores. The query shows that users u3 and u5 clicked on 3 items together. Substituting this into formula 1-2, we obtain their similarity score.
[0079] Step S57a: Calculate the sum of the original similarity score of the first product pair and the multiple similarity scores of the second product pair obtained based on the third user pair. Taking product pair (id2, id3) as an example, its total similarity score is: Sim 总(2,3)=Sim(2,3)1+Sim(2,3) 21 +Sim(2,3) 22 =0.4+0.4+0.3=1.1.
[0080] Step S58a: Replace the original similarity score of the first product pair with the total similarity score, and add the users of that product pair from the second product pair set to the original user set of the first product pair set. Using the data from Table 1 as an example, add u5 to the original user set. After processing in step S57a, we get:
[0081] Score={(id1,id2):0.4,(id2,id3):1.1;(id3,id4):0}
[0082] The first set of product pairs: {(id1,id2):[u1,u2];(id2,id3):[u2,u3,u5];(id3,id4):[u3]}
[0083] The second set of product pairs: {(id2,id3):[u5];(id3,id4):[u4,u5,u6];
[0084] (id4,id5):[u4,u6,u7]; (id5,id6):[u7]}
[0085] Step S59a: Determine if there are any unprocessed second product pairs in the second product pair set. If there are, return to step S51a. If not, update all product pairs and end the process.
[0086] The final product pair similarity score set is as follows:
[0087] Score={(id1,id2):0.4,(id2,id3):1.1; (id3,id4):1.8; (id4,id5):1.1; (id5,id6):0...}
[0088] The user set is: {(id1,id2):[u1,u2];(id2,id3):[u2,u3,u5];(id3,id4):[u3,u4,u5,u6];(id4,id5):[u4,u6,u7];(id5,id6):[u7]……}
[0089] In another embodiment, in order to speed up the calculation, when calculating the similarity score of the target product pair for each user pair, if the number of common products n in the product sequence clicked by the two users is greater than a threshold, the similarity score of the target product pair corresponding to the user pair is not calculated, that is, its similarity score can be approximated as 0.
[0090] As data on the platform is updated—such as the addition or disappearance of users, the increase in user clicks on products, and the passage of time causing the earliest data in the current dataset to exceed the data acquisition time window—it is necessary to update the similarity scores of the aforementioned product pairs in a timely manner based on data updates in order to ensure accurate product recall. For example, data can be updated periodically to obtain incremental data from the original data and feed the incremental data back into the product pair set. For product pairs that have changed, such as changes in the users of the product pair or changes in user clicks on products, the similarity score of the product pair can be recalculated.
[0091] Figure 4 This is a flowchart of a product recall method according to an embodiment of the present invention, including:
[0092] Step S1b: Calculate the similarity scores for all product pairs in the platform to obtain the product pair similarity score set. The calculation process is as described above. Figures 1-3 As shown, this will not be repeated here. Taking the data in Table 1 above as an example, the product pair similarity score set is as follows:
[0093] Score={(id1,id2):0.4,(id2,id3):1.1; (id3,id4):1.8; (id4,id5):1.1; (id5,id6):0...}
[0094] The user set is: {(id1,id2):[u1,u2];(id2,id3):[u2,u3,u5];(id3,id4):[u3,u4,u5,u6];(id4,id5):[u4,u6,u7];(id5,id6):[u7]……}
[0095] Step S2b: Obtain the target product, such as the product currently clicked by the user. Taking the data in Table 1 as an example, when user U1 clicks on product ID3 and the current product matches the recommendation, product ID3 is obtained.
[0096] Step S3b: Update the click data of the target user. For example, in Table 1, when user U1 clicks on product ID 3, add it to Table 1, as shown in Table 2:
[0097] Table 2 User Click Sequence
[0098] Serial Number User ID Product sequence (product ID) 1 U1 id1, id2, id3 2 U2 id1, id2, id3 3 U3 id2, id3, id4 4 U4 id3, id4, id5 5 U5 id2, id3, id4 6 U6 id3, id4, id5 7 U7 id4, id5, id6 …… …… ……
[0099] Step S4b: Obtain product pairs based on the current user's click data and retrieve the changed data. As shown in Table 2, three product pairs are obtained: (id1, id2), (id2, id3), and (id1, id3). Comparing these with the original data, the changed data is as follows:
[0100] [(id1,id3):[u1]; (id2,id3):[u1,u2,u3,u5]
[0101] Step S5b: Calculate the similarity score of the product pairs based on the updated data, and update the original product pair score set. For example, taking the product pair (id2, id3) with updated data, the similarity score is calculated based on the new user pair:
[0102] (u1,u2):
[0103] (u1,u3):
[0104] (u1,u5):
[0105] Then sum this with the original similarity score:
[0106] Sim 总新 (2,3) = Sim(2,3) 11 +Sim(2,3) 12 +Sim(2,3) 13 +Sim(2,3) 总旧
[0107] =0.3 + 0.4 + 0.4 + 1.1 = 2.2
[0108] Therefore, by replacing the original 1.1 with 2.2, a new set of similarity scores for product pairs is obtained:
[0109] Score 新 ={(id1,id2):0.4; (id2,id3):2.2; (id1,id3):0.4; (id3,id4):1.8; (id4,id5):1.1; (id5,id6):0...}
[0110] User collection: {(id1,id2):[u1,u2]; (id2,id3):[u1,u2,u3,u5]; (id1,id3):[u1,u2]; (id3,id4):[u3,u4,u5,u6]; (id4,id5):[u4,u6,u7]; (id5,id6):[u7]......}
[0111] Step S6b: Query the multiple product pairs including the target product and their similarity scores. By querying product id3, the following product pairs are obtained: (id2, id3): 2.2; (id1, id3): 0.4; (id3, id4): 1.8. When the number of users and products is large, multiple product pairs can be obtained in this step.
[0112] Step S7b: Sort the product pairs according to their scores in descending order. For example, after sorting, the results are: (id2, id3), (id3, id4), (id1, id3).
[0113] Step S8b: Select the second product from the top-ranked product pair according to the recommended or preset quantity as the recall product. For example, if only one product is needed, select product ID2 as the recall product.
[0114] Figure 5 This is a schematic diagram of a product similarity calculation device according to an embodiment of the present invention. The product similarity calculation device includes: a user-clicked product set acquisition module 1a, a product pair construction module 2a, a first similarity calculation module 3a, and a similarity update module 4a. The user-clicked product set acquisition module 1a is used to acquire the clicked product sequence of each user in the platform's full user set to form a user-clicked product set, and divides the user-clicked product set into a first set and a second set, wherein the number of user-clicked product sequences in the first set is less than the number of user-clicked product sequences in the second set. The product pair construction module 2a is connected to the user-clicked product set acquisition module 1a, and acquires first product pairs clicked by the same first user in the first set to form a first product pair set and a first user set for each first product pair; and acquires second product pairs clicked by the same second user in the second set to form a second product pair set and a second user set for each second product pair. The first similarity calculation module 3a is connected to the product pair construction module 2a. It calculates the similarity score of each first product pair in the first product pair set using the Swing algorithm, thereby obtaining a product pair similarity score set. For details, please refer to the embodiments in the aforementioned scheme. The similarity update module 4a is connected to the product pair construction module 2a and the first similarity calculation module 3a. It updates the similarity score of the first product pair based on the second product pair in the second product pair set and its corresponding second user set, and adds the corresponding second user to the first user set corresponding to the first product.
[0115] like Figure 6The diagram shows a block diagram of a similarity update module according to an embodiment of the present invention. The similarity update module 4a includes: a product pair comparison unit 41a, a third user pair construction unit 42a, a second similarity calculation unit 43a, and an update unit 44a. The product pair comparison unit 41a compares each second product pair in the second product pair set with each first product pair to identify second product pairs identical to the first product pairs, and sends these second product pairs to the third user pair construction unit 42a. The third user pair construction unit 42a is connected to the product pair comparison unit 41a, receives identical second and first product pairs from the product pair comparison unit 41a, constructs multiple third user pairs with each second user in the second user set of the second product pair and each first user in the first user set of the first product pair, and sends these multiple third user pairs to the second similarity calculation unit 43a. The second similarity calculation unit 43a is connected to the third user pair construction unit 42a, calculates the similarity score of the second product pair based on each received third user pair using the Swing algorithm, and sends the similarity score to the update unit 44a. The update unit 44a calculates the sum of the original similarity score of the first product pair and the sum of multiple similarity scores of the second product pair obtained based on the third user pair, updates the similarity score of the first product pair with the sum, and adds the corresponding second user to the first user set of the first product pair, thereby finally obtaining the similarity score of the product pair.
[0116] In another embodiment of the invention, such as Figure 7 The diagram shown is a principle block diagram of another embodiment of the similarity update module 4a. In this embodiment, when updating the first product pair using the second product pair and its second user, additional calculation logic can be added to the update calculation process according to business needs. For example, other systems on the platform can statistically analyze the clicked products of users, determine the probability of a user being a cheater based on the statistical results or other logic, and set the calculation weight of product similarity based on the probability of being a cheater. The weight value is any value in [0-1]. When it is determined that the user is a cheater, its weight value is set to 0; when it is determined that the user is not a cheater, its weight value is set to 1. Therefore, in this embodiment, the similarity update module 4a also includes a weight acquisition unit 45a, which queries the user's calculation weight when updating the similarity score of the first product pair and sends it to the second similarity calculation unit 43a. The second similarity calculation unit 43a multiplies the score based on the Swing algorithm by the weighted score to obtain the final similarity score. Therefore, this embodiment can reduce or even eliminate the influence of cheaters, thereby further improving the accuracy of the final product recall.
[0117] Figure 8This is a block diagram illustrating the principle of a product recall system according to an embodiment of the present invention. The product recall system includes a product similarity calculation device 1b, a target product pair acquisition module 2b, a sorting module 3b, and a product acquisition module 4b. The product similarity calculation device 1b is as follows: Figure 5-6 As shown, this is used to obtain similarity scores for multiple product pairs, where each product pair includes a first product and a second product. The target product pair acquisition module 2b is connected to the product similarity calculation device 1b, and acquires multiple product pairs with the target product as the first product and their similarity scores based on the target product. For example, it executes... Figure 4 Steps S2b-S6b in the process yield multiple product pairs with the target product as the first product and their similarity scores. The sorting module 3b, connected to the target product pair acquisition module 2b, sorts the multiple product pairs according to their scores from highest to lowest. The product acquisition module 4b, connected to the sorting module 3b, acquires the second product from the top-ranked product pairs as the recalled product, according to a preset quantity.
[0118] In a specific application, the goods mentioned in the foregoing embodiments of this invention are second-hand goods, i.e., goods on second-hand e-commerce platforms. Since goods on second-hand platforms are essentially unique items, even two mobile phones of the same brand and model, when new, would have the same product ID on a regular e-commerce platform. However, after use, when sold by different sellers on a second-hand e-commerce platform, they become two different products with two different product IDs. Therefore, the number of product IDs on second-hand e-commerce platforms is significantly larger than on regular e-commerce platforms. Consequently, using the system and method provided by this invention on second-hand e-commerce platforms can recall goods within an acceptable timeframe, meeting the timeliness requirements of product recommendations. Furthermore, additional operations based on data storage, such as identifying fraudulent users, can be added in the second stage of updating similarity scores, thereby achieving better product recall results.
[0119] The above embodiments are for illustrative purposes only and are not intended to limit the invention. Those skilled in the art can make various changes and modifications without departing from the scope of the invention. Therefore, all equivalent technical solutions should also fall within the scope of the invention.
Claims
1. A method for calculating product similarity, comprising: Obtain the clicked product sequence of each user in the platform's full user set to form a user clicked product set; The set of products clicked by users is divided into a first set and a second set, wherein the number of product sequences clicked by users in the first set is less than the number of product sequences clicked by users in the second set; First, obtain the first product pairs clicked by the same first user from the first set to form the first product pair set and the first user set for each first product pair; second, obtain the second product pairs clicked by the same second user from the second set to form the second product pair set and the second user set for each second product pair. The original similarity score of the first item pair in the first item pair set is calculated according to the Swing algorithm; Each second item pair is compared with each first item pair separately; In response to the fact that the second product pair is the same as the first product pair, each second user in the second user set of the second product pair and each first user in the first user set of the first product pair are used to form multiple third user pairs, and a second similarity score of the second product pair is calculated based on each third user pair according to the Swing algorithm. as well as Calculate the sum of the original similarity score of the first item pair and the sum of multiple second similarity scores of the second item pair obtained based on the third user pair; The similarity score of the first product pair is updated with the sum, and the corresponding second user is added to the first user set of the first product pair; The steps of calculating the original similarity score of the first item pair in the first set according to the Swing algorithm and calculating the second similarity score of the second item pair based on each third user pair include: Obtain the users who clicked on the target product pair and their clicked product sequence I, wherein multiple users constitute user pairs; wherein the target product pair is a first product pair or a second product pair, and the user pair is a first user pair or a third user pair; Get the number of common products n in the product sequence I clicked by two users in a user pair; and Calculate the similarity score of the target product pair corresponding to the user pair according to Formula 1-1: Where Sim(i,j) is the similarity score of the product pair consisting of the i-th product and the j-th product; α is a constant.
2. The method according to claim 1, wherein when the target product pair is a first product pair, if the number of first users corresponding to it is less than 2, the original similarity score of the first product pair is not calculated; When the number of first users in the first product pair is greater than 2, multiple first users constitute multiple first user pairs; Calculate the first original similarity score for the first item pair corresponding to each first user pair according to Formula 1-1; as well as The sum of all the first original similarity scores for the first item pair is calculated as the original similarity score for the first item pair.
3. The method according to claim 1 or 2, wherein when calculating the similarity score of the target product pair for each user pair, if the number of common products n in the product sequence clicked by the two users is greater than a threshold, the similarity score of the target product pair for the user pair is counted as 0.
4. The method according to claim 1, wherein when the second product pair is different from any first product pair in the first product pair set, the second product pair is added to the first product pair set to become a new first product pair.
5. The method according to claim 1, further comprising: Obtain the calculated weight of each user in the third user pair; When calculating the second similarity score of the second product pair based on each third user pair using the Swing algorithm, the similarity score calculated based on the Swing algorithm is multiplied by the calculated weight of the user to obtain the second similarity score.
6. The method according to claim 1, wherein the platform is a second-hand goods platform, and the goods are second-hand goods.
7. A product recall method, comprising: The similarity score of the product pair is calculated according to any one of claims 1-6, wherein the product pair consists of a first product and a second product; Obtain multiple product pairs with the target product as the first product and their similarity scores; The multiple product pairs are sorted in descending order of similarity score; as well as The second item in the top-ranked, pre-defined item pair is selected as the item to be recalled.
8. A product similarity calculation device, comprising: The user clicked product set acquisition module is configured to acquire the clicked product sequence of each user in the full user set of the platform to form a user clicked product set, and divide the user clicked product set into a first set and a second set, wherein the number of user clicked product sequences in the first set is less than the number of user clicked product sequences in the second set; The product pair construction module is configured to obtain first product pairs clicked by the same first user in a first set to form a first product pair set and a first user set for each first product pair; and to obtain second product pairs clicked by the same second user in a second set to form a second product pair set and a second user set for each second product pair. The first similarity calculation module is connected to the product pair construction module and is configured to calculate the original similarity score of the first product pair in the first product pair set according to the Swing algorithm. as well as A similarity update module, which is connected to the product pair construction module and the first similarity calculation module, is configured to update the original similarity score of the first product pair based on the second product pair in the second product pair set and its corresponding second user set; The product pair comparison unit is configured to compare each second product pair in the second product pair set with each first product pair to determine the second product pair that is the same as the first product pair; The third user pair construction unit, which is connected to the product pair comparison unit, is configured to, in response to the second product pair being the same as the first product pair, form multiple third user pairs with each second user in the second user set of the second product pair and each first user in the first user set of the first product pair. The second similarity calculation unit, which is connected to the third user pair construction unit, is configured to calculate the second similarity score of the second product pair based on each third user pair according to the Swing algorithm; as well as An update unit, connected to the second similarity calculation unit, is configured to calculate the sum of the original similarity score of the first product pair and multiple second similarity scores of the second product pair obtained based on the third user pair, and update the original similarity score of the first product pair with the sum of the scores. The first similarity calculation module and the second similarity calculation unit are configured to calculate the original similarity score and the second similarity score according to the following steps: Obtain the users who clicked on the target product pair and their clicked product sequence I, wherein multiple users constitute user pairs; wherein the target product pair is a first product pair or a second product pair, and the user pair is a first user pair or a third user pair; Get the number of common products n in the product sequence I clicked by two users in a user pair; and Calculate the similarity score of the target product pair corresponding to the user pair according to Formula 1-1: Where Sim(i,j) is the similarity score of the product pair consisting of the i-th product and the j-th product; α is a constant.
9. The apparatus according to claim 8, wherein the similarity update module further comprises a weight acquisition unit connected to the second similarity calculation unit, configured to acquire the calculated weight of the third user in the middle user pair, and send it to the second similarity calculation unit; correspondingly, the second similarity calculation unit receives the calculated weight of the user, and multiplies the score calculated based on the Swing algorithm by the calculated weight of the user as the second similarity score.
10. A product recall system, comprising: The product similarity calculation device according to any one of claims 8-9 is configured to obtain similarity scores for multiple product pairs, wherein the product pair consists of a first product and a second product; The target product pair acquisition module is connected to the product similarity calculation device and is configured to acquire multiple product pairs with the target product as the first product and their similarity scores based on the target product. A sorting module, connected to the target product pair acquisition module, is configured to sort the multiple product pairs in descending order of product pair similarity scores; and The product acquisition module is connected to the sorting module and is configured to acquire the second product from a preset number of product pairs that are ranked first as the product to be recalled.
Citation Information
Patent Citations
A recommending method and device based on a knowledge map
CN109447713A
Recommendation information generation method and device, electronic equipment and storage medium
CN111414533A