Product recommendation method and device, electronic equipment and storage medium
By building a hash table for product users and user products, updating the parent node array, and determining the target product sequence, the problem of low product recommendation efficiency in the existing technology is solved, and efficient and accurate product recommendation is achieved.
Patent Information
- Application Number
- CN202411765336.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-03
AI Technical Summary
In the field of intelligent recommendation, the existing technology requires similarity calculations to other users when recommending products to each user, resulting in high time complexity and affecting the efficiency of product recommendation.
By obtaining the original product data, user data and click behavior data, a product user mapping hash table and user product mapping hash table are constructed, and the preset parent node array is updated based on these hash tables, the target product sequence of each user is determined, and product recommendations are made.
提高了产品推荐的效率和准确性,能够在一次处理后确定每个用户的产品推荐序列,降低了时间复杂度。
Smart Images

Figure CN119648340A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, is applicable to the field of financial technology, and particularly relates to a product recommendation method and device, electronic equipment, and storage medium. Background Art
[0002] In the field of intelligent recommendation, the recommendation system can recommend corresponding content, such as articles, videos, products, etc., to target users based on the preferences of similar users. It can be applied to multiple scenarios. For example, in financial scenarios, business personnel can make financial product recommendations based on this.
[0003] However, in actual applications, when recommending products to each user, it is necessary to calculate similarity with other users in order to screen out the target recommended products. This process has a high time complexity, which affects the efficiency of product recommendations.
[0004] Therefore, how to improve the efficiency of product recommendations has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The main purpose of the embodiments of the present application is to propose a product recommendation method and device, an electronic device and a storage medium, aiming to improve the efficiency of product recommendation.
[0006] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a product recommendation method, the method comprising:
[0007] Obtaining original product data, original user data of original users, and user click behavior data, and obtaining product click heat data; wherein the user click behavior data is used to characterize the click behavior of the original user on the original product data;
[0008] A hash table is constructed based on the product click popularity data and the user click behavior data to obtain a product-user mapping hash table between the original product data and the original user data;
[0009] Constructing a hash table based on the user click behavior data to obtain a user-product mapping hash table between the original user data and the original product data;
[0010] Based on the product-user mapping hash table and the user-product mapping hash table, a preset original parent node array is updated with a parent node to obtain a target parent node array; wherein the original parent node array is constructed based on the original user data;
[0011] Determine the target product sequence of each of the original users according to the target parent node array and the user-product mapping hash table;
[0012] Product recommendations are made based on the target product sequence.
[0013] In some embodiments, updating the parent nodes of a preset original parent node array based on the product-user mapping hash table and the user-product mapping hash table to obtain a target parent node array includes:
[0014] Perform product traversal on the product-user mapping hash table to obtain a product-user set;
[0015] Based on the user-product mapping hash table, a union-find process is performed on the product-user set to obtain a target user relationship tree;
[0016] The original parent node array is updated based on the target user relationship tree to obtain the target parent node array.
[0017] In some embodiments, performing a union-find process on the product-user set based on the user-product mapping hash table to obtain a target user relationship tree includes:
[0018] Extracting user pairs from the product user set to obtain original user relationship pairs; wherein the original user relationship pairs include a first user and a second user;
[0019] Performing root node detection on the first user and the second user pair in the same original user relationship pair to obtain root node similarity and difference data; wherein the root node similarity and difference data indicates whether the root node of the first user and the root node of the second user in the same original user relationship pair are the same or different;
[0020] The original user relationship pairs are heuristically merged based on the user-product mapping hash table and the root node similarity and difference data to obtain the target user relationship tree.
[0021] In some embodiments, the heuristic merging of the original user relationship pairs based on the user-product mapping hash table and the root node similarity and difference data to obtain the target user relationship tree includes:
[0022] If the root node difference data indicates that the root node of the first user is different from the root node of the second user, the product quantity is calculated for the user-product mapping hash table to obtain click product statistics; wherein the click product statistics include the click quantity of the first product of the first user and the click quantity of the second product of the second user;
[0023] Compare the number of clicks on the first product with the number of clicks on the second product to obtain user click number comparison data;
[0024] The relationship between the first user and the second user is adjusted according to the user click quantity comparison data to obtain the target user relationship tree.
[0025] In some embodiments, determining the target product sequence of each original user according to the target parent node array and the user-product mapping hash table includes:
[0026] For each of the original users, performing a root node query on the target parent node array based on the original user data to obtain target root node data;
[0027] A product query is performed on the user-product mapping hash table based on the target root node data to obtain the target product sequence.
[0028] In some embodiments, constructing a hash table based on the product click popularity data and the user click behavior data to obtain a product-user mapping hash table between the original product data and the original user data includes:
[0029] Sort the original product data based on the product click popularity data to obtain an original product sequence;
[0030] Performing product screening on the original product sequence to obtain a target product sequence;
[0031] Constructing an initial product hash table based on the target product sequence;
[0032] The initial product hash table is filled with data based on the user click behavior data and the original user data to obtain the product-user mapping hash table.
[0033] In some embodiments, constructing a hash table based on the user click behavior data to obtain a user-product mapping hash table between the original user data and the original product data includes:
[0034] Building an initial user hash table based on the original user data;
[0035] The initial user hash table is filled with data based on the user click behavior data and the original product data to obtain the user-product mapping hash table.
[0036] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a product recommendation device, the device comprising:
[0037] A data acquisition module is used to acquire original product data, original user data of original users and user click behavior data, and acquire product click popularity data; wherein the user click behavior data is used to characterize the click behavior of the original user on the original product data;
[0038] A first hash table construction module is used to construct a hash table based on the product click popularity data and the user click behavior data to obtain a product-user mapping hash table between the original product data and the original user data;
[0039] A second hash table construction module is used to construct a hash table based on the user click behavior data to obtain a user-product mapping hash table between the original user data and the original product data;
[0040] A parent node update module, used to update the parent node of a preset original parent node array based on the product-user mapping hash table and the user-product mapping hash table to obtain a target parent node array; wherein the original parent node array is constructed based on the original user data;
[0041] A product determination module, configured to determine a target product sequence for each of the original users according to the target parent node array and the user-product mapping hash table;
[0042] The target recommendation module is used to make product recommendations based on the target product sequence.
[0043] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0044] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0045] The product recommendation method and device, electronic device and storage medium proposed in the present application obtain original product data, original user data of original users and user click behavior data, and product click heat data; and construct a hash table based on the product click heat data and the user click behavior data to obtain a product-user mapping hash table and a user-product mapping hash table between the original product data and the original user data, so as to efficiently mine the correlation between user preferences and product heat, and then update the parent node of the preset original parent node array based on the product-user mapping hash table and the user-product mapping hash table to obtain a target parent node array; finally, determine the target product sequence of each original user according to the target parent node array and the user-product mapping hash table, and make product recommendations based on the target product sequence, which not only improves the pertinence and accuracy of product recommendations, but also determines the product recommendation sequence of each original user after one processing, thereby improving the efficiency of product recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is a flow chart of a product recommendation method provided in an embodiment of the present application;
[0047] Figure 2 yes Figure 1 Flow chart of step S102 in FIG.
[0048] Figure 3 yes Figure 1 Flow chart of step S103 in FIG.
[0049] Figure 4 yes Figure 1 Flow chart of step S104 in FIG.
[0050] Figure 5 yes Figure 4 Flow chart of step S402 in FIG.
[0051] Figure 6 yes Figure 5 Flow chart of step S503 in FIG.
[0052] Figure 7 yes Figure 1 Flow chart of step S105 in FIG.
[0053] Figure 8 is a schematic diagram of the structure of a product recommendation device provided in an embodiment of the present application;
[0054] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0058] First, some nouns involved in this application are analyzed:
[0059] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0060] Hash Table: Hash table is also called hash table. Hash table is a kind of access record by mapping key code value to the position in the table to speed up the search. Specifically, hash table uses a hash function to calculate the hash value (Hash Value) corresponding to each key code value. The hash value is usually an integer and is used as the index (Index) in the array, so that the record at the storage location can be directly accessed. Since the hash function may map different key code values to the same hash value (i.e. hash conflict), hash table needs to design a strategy to resolve the conflict, such as chain address method (zipper method) or open address method. Hash table is widely used in database index, cache system, set operation and other fields due to its efficient search, insertion and deletion operations. By reasonably designing hash function and conflict resolution strategy, hash table can achieve average complexity operation close to constant time.
[0061] Union-Find Set (UFS): Union-Find Set is a data structure that is mainly used to handle the merging and querying of some disjoint sets. Union-Find Set is based on a tree structure and can efficiently implement set merging and search operations. In a Union-Find Set, each element initially constitutes a single-element set, and then the sets of elements belonging to the same group can be merged in a certain order. The search operation is used to determine which set an element belongs to, or to determine whether two elements are in the same set. Union-Find Set is widely used in graph theory, social network analysis, computer networks, image processing and other fields, and is an effective tool for handling set merging and querying problems.
[0062] Heuristic Merge: Heuristic merge is a commonly used technique in computer science, especially in the field of data structures and algorithms. The basic idea is that when merging two data structures or data sets, instead of simply merging them one by one, a certain "heuristic" strategy is used to select the merge method in order to optimize the merge efficiency and results. Specifically, heuristic merge usually merges a set with fewer elements into a set with more elements to reduce the overhead in the merge process. This method can significantly improve the efficiency of the merge operation, and is particularly effective when processing large amounts of data.
[0063] In the field of intelligent recommendation, the recommendation system can find similar users based on user behavior, and recommend corresponding content to target users based on the displayed user preferences, such as articles, videos, products, etc. It can be applied to multiple scenarios. For example, in financial scenarios, business personnel can make financial product recommendations based on this.
[0064] At present, the recommendation method based on similar users (U2U2I) is mainly used for product recommendation. However, in actual applications, when recommending products to each user, it is necessary to calculate the similarity with other users to screen out the target recommended products. The time complexity of this process is relatively high, which affects the efficiency of product recommendation.
[0065] Based on this, the embodiments of the present application provide a product recommendation method and device, an electronic device and a storage medium, aiming to improve the efficiency of product recommendation.
[0066] The product recommendation method and device, electronic device and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the product recommendation method in the embodiments of the present application is described.
[0067] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0068] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0069] The product recommendation method provided in the embodiment of the present application relates to the field of artificial intelligence technology and is applicable to the field of financial technology. The product recommendation method provided in the embodiment of the present application can be applied to the terminal, can be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the product recommendation method, etc., but is not limited to the above forms.
[0070] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0071] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0072] Figure 1 is an optional flowchart of the product recommendation method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0073] Step S101, obtaining original product data, original user data of original users, and user click behavior data, and obtaining product click heat data; wherein the user click behavior data is used to characterize the click behavior of the original user on the original product data;
[0074] Step S102, constructing a hash table based on the product click popularity data and the user click behavior data to obtain a product-user mapping hash table between the original product data and the original user data;
[0075] Step S103, constructing a hash table based on the user click behavior data to obtain a user-product mapping hash table between the original user data and the original product data;
[0076] Step S104, updating the parent node of the preset original parent node array based on the product-user mapping hash table and the user-product mapping hash table to obtain a target parent node array; wherein the original parent node array is constructed based on the original user data;
[0077] Step S105, determining the target product sequence of each original user according to the target parent node array and the user-product mapping hash table;
[0078] Step S106: recommend products based on the target product sequence.
[0079] Steps S101 to S106 shown in the embodiment of the present application, by obtaining the original product data, the original user data of the original user and the user click behavior data, and the product click heat data; and constructing a hash table based on the product click heat data and the user click behavior data, to obtain a product-user mapping hash table and a user-product mapping hash table between the original product data and the original user data, so as to efficiently mine the correlation between the user's preference and the product heat, and then update the parent node of the preset original parent node array based on the product-user mapping hash table and the user-product mapping hash table to obtain a target parent node array; finally, the target product sequence of each original user is determined according to the target parent node array and the user-product mapping hash table, and product recommendations are made based on the target product sequence, which not only improves the pertinence and accuracy of the product recommendation, but also determines the product recommendation sequence of each original user after one processing, thereby improving the efficiency of the product recommendation.
[0080] In step S101 of some embodiments, the original product data is used to characterize relevant information of the product (such as product ID, product name, etc.), wherein these products can be referred to as original products.
[0081] Original user data: information used to represent the original user (such as user ID, name, etc.);
[0082] The user click behavior data represents the original user's click behavior on the original product corresponding to the original product data.
[0083] In some embodiments, the original product may be a financial product, insurance product, etc. in a fintech scenario, and may be displayed in a preset financial application or financial web page.
[0084] In some embodiments, the step of "obtaining product click popularity data" may include but is not limited to the following steps:
[0085] The original product data is heat-calculated based on the user click behavior data to obtain the product click heat data.
[0086] Specifically, the product click heat data is used to reflect the click behavior of all original users on multiple original product data, and can reflect the popularity of the original products. If an original user has clicked on an original product, the product click heat data corresponding to the original product will be increased by 1, or the product click heat data corresponding to the original product will be increased by a preset heat value, but is not limited to this.
[0087] See also Figure 2 In some embodiments, step S102 may include but is not limited to steps S201 to S204:
[0088] Step S201, sorting the original product data based on the product click popularity data to obtain an original product sequence;
[0089] Step S202, screening the original product sequence to obtain a target product sequence;
[0090] Step S203, constructing an initial product hash table based on the target product sequence;
[0091] Step S204, filling the initial product hash table with data based on the user click behavior data and the original user data to obtain a product-user mapping hash table.
[0092] In steps S201 to S204 shown in the embodiment of the present application, the original product data is sorted based on the product click popularity data to obtain the original product sequence, and some popular products are screened out from the original product sequence to obtain the target product sequence, which can further narrow the scope of product recommendation to improve the efficiency and effectiveness of product recommendation; further, an initial product hash table is constructed based on the target product sequence, and the initial product hash table is filled with data based on the user click behavior data and the original user data to obtain a product-user mapping hash table, and the hash table's efficient data processing performance is utilized to quickly respond to the needs of personalized recommendations and service optimization, thereby improving the efficiency of product recommendations.
[0093] In some embodiments, the original product data can be sorted from high to low according to the click popularity to form an original product sequence, and the original product sequence can be screened based on a preset quantity to obtain a target product sequence, thereby preliminarily screening out products with high user attention.
[0094] For example, the top 100 / 200 / 300 products in terms of click popularity are selected from the original product sequence to obtain the target product sequence.
[0095] In step S203 of some embodiments, an initial product hash table is constructed using product information (such as product ID, product name, etc.) in the target product sequence, which can quickly implement indexing and querying of product information.
[0096] In step S204 of some embodiments, it is determined which original users clicked on a certain original product based on the user click behavior data, and the users who clicked on the original product are stored in a hash table to expand the initial product hash table, increase user dimension information, and form a product-user mapping hash table.
[0097] For example:
[0098] Original product 1 → original user 1 → original user 4 → original user 9;
[0099] Original product 2 → original user 2 → original user 4;
[0100] Original product 3 → original user 1 → original user 5 → original user 8;
[0101] It can be understood that the product-user mapping hash table can be understood as a set of users corresponding to the product.
[0102] See also Figure 3 In some embodiments, step S103 may include but is not limited to steps S301 to S302:
[0103] Step S301, constructing an initial user hash table based on original user data;
[0104] Step S302: fill the initial user hash table with data based on the user click behavior data and the original product data to obtain a user-product mapping hash table.
[0105] In steps S301 to S302 shown in the embodiment of the present application, an initial user hash table is constructed based on the original user data, and data is filled in the initial user hash table based on the user click behavior data and the original product data to obtain a user-product mapping hash table. By utilizing the efficient data processing performance of the hash table, it is possible to quickly respond to the needs of personalized recommendations and service optimization, thereby improving the efficiency of product recommendations.
[0106] In step S301 of some embodiments, an initial user hash table is constructed using user information (such as user ID, name, etc.) of the original user data, which can quickly implement indexing and querying of product information.
[0107] In step S302 of some embodiments, it is determined which original users clicked on a certain original product based on the user click behavior data, and the clicked original products are stored in a hash table to expand the initial user hash table, add product dimension information, and form a user-product mapping hash table.
[0108] For example:
[0109] Original user 1 → original product 1 → original product 3 → original product 5;
[0110] Original user 2 → original product 2 → original product 4;
[0111] Original user 3 → original product 1 → original product 2 → original product 6 → original product 7;
[0112] It can be understood that the user-product mapping hash table can be understood as a set of products corresponding to the user.
[0113] It is understandable that the original products in the user-product mapping hash table do not need to be sorted and filtered according to the product click popularity data. Including some products with lower click popularity can more comprehensively reflect the user's behavior.
[0114] In step S104 of some embodiments, the original parent node array is constructed based on the original user data, and the initial value of each element in the original parent node array points to itself, that is, there is no parent node. Specifically, the array structure can be two rows, where each element in the first row corresponds to the information of the original user, and each element in the second row is the parent node information corresponding to the original user.
[0115] See also Figure 4 In some embodiments, step S104 may include but is not limited to steps S401 to S403:
[0116] Step S401, traverse the product-user mapping hash table to obtain a product-user set;
[0117] Step S402, performing a union-find process on the product-user set based on the user-product mapping hash table to obtain a target user relationship tree;
[0118] Step S403: update the original parent node array based on the target user relationship tree to obtain a target parent node array.
[0119] In steps S401 to S403 shown in the embodiment of the present application, a product user set is obtained by traversing each product pair in the product-user mapping hash table; the product user set is subjected to a union-find process according to the user-product mapping hash table, so as to effectively identify the association between users, and merge the relationships to obtain a target user relationship tree; and then the original parent node array is updated according to the target user relationship tree to obtain a target parent node array, so as to effectively sort out the association between all users and provide strong data support for subsequent personalized product recommendations.
[0120] In step S401 of some embodiments, since the product-user mapping hash table records all users corresponding to each product, each product pair in the product-user mapping hash table can be traversed to obtain the user set corresponding to the product, that is, the product-user set.
[0121] In step S402 of some embodiments, a union-find algorithm is applied to merge and search the user relationship of the user-product mapping hash table and the product-user set, which can efficiently identify and merge user groups with direct or indirect associations, and finally construct a target user relationship tree. The target user relationship tree can intuitively display the connections between users.
[0122] See also Figure 5 In some embodiments, step S402 may also include but is not limited to steps S501 to S503:
[0123] Step S501, extracting user pairs from the product user set to obtain original user relationship pairs; wherein the original user relationship pairs include a first user and a second user;
[0124] Step S502, performing root node detection on the first user and the second user pair in the same original user relationship pair to obtain root node similarity and difference data; wherein the root node similarity and difference data indicates whether the root node of the first user and the root node of the second user in the same original user relationship pair are the same or different;
[0125] Step S503: Heuristically merge the original user relationship pairs based on the user-product mapping hash table and the root node similarity and difference data to obtain a target user relationship tree.
[0126] In steps S501 to S503 shown in the embodiment of the present application, for a certain original product, user pairs are extracted from the product user set corresponding to the original product to obtain original user relationship pairs; wherein the original user relationship pairs include a first user and a second user, thereby linking the first user and the second user, and then performing root node detection on the first user and the second user pair to determine whether the root node of the first user is the same or different from the root node of the second user, and obtaining root node difference data, and finally performing heuristic merging on the original user relationship pairs based on the user-product mapping hash table and the root node difference data to obtain a target user relationship tree, thereby improving the accuracy and efficiency of user relationship analysis.
[0127] In step S501 of some embodiments, two users are randomly selected from the product user set to form an original user relationship pair. If the product user set only includes one user, there is no original user relationship pair, which means that the user has no other related users under the original product.
[0128] For example, if the product user set of the original product 1 includes the three users, original user 1, original user 4 and original user 9, then after combination, three pairs of original user relationship pairs are obtained, namely {original user 1, original user 4}, {original user 1, original user 9}, and {original user 4, original user 9}.
[0129] It is understandable that the two users in the original user relationship pair can be recorded as the first user and the second user, and the first user and the second user are connected because of the original product, that is, the relationship of user1-item-user2, and therefore can be considered to be in a "user relationship tree".
[0130] Furthermore, it is necessary to determine whether the user relationship tree where the first user and the second user are located is the same tree, that is, whether there is a same root node, and obtain root node similarity and difference data.
[0131] In some embodiments, if the root node difference data indicates that the root node of the first user is different from the root node of the second user, the process jumps to step S503.
[0132] See also Figure 6 In some embodiments, step S503 includes but is not limited to steps S601 to S603:
[0133] Step S601: If the root node difference data indicates that the root node of the first user is different from the root node of the second user, the product quantity is calculated in the user-product mapping hash table to obtain click product statistics; wherein the click product statistics include the click quantity of the first product of the first user and the click quantity of the second product of the second user;
[0134] Step S602, comparing the number of clicks on the first product with the number of clicks on the second product to obtain user click number comparison data;
[0135] Step S603: adjusting the relationship between the first user and the second user according to the comparison data of the number of user clicks, and obtaining a target user relationship tree.
[0136] In steps S601 to S603 shown in the embodiment of the present application, when the root node difference data indicates that the root node of the first user is different from the root node of the second user, the product quantity calculation is performed on the user-product mapping hash table to obtain click product statistics; wherein the click product statistics include the number of clicks on the first product of the first user and the number of clicks on the second product of the second user, the number of clicks on the first product and the number of clicks on the second product are compared to obtain user click quantity comparison data, the relationship between the first user and the second user is adjusted according to the user click quantity comparison data to obtain a target user relationship tree, and the user relationship tree can be dynamically adjusted based on the user's product click data, thereby more accurately reflecting the interest association between users, which helps to enhance the accuracy and relevance of product recommendations.
[0137] It can be understood that if the root node difference data indicates that the root node of the first user is different from the root node of the second user, it means that the first user and the second user are not in the same "user relationship tree". Therefore, it is necessary to adjust the relationship between the first user and the second user, and the "heuristic merge" method is adopted.
[0138] Specifically, the number of clicks on the first product by the first user and the number of clicks on the second product by the second user are counted from the user-product mapping hash table respectively;
[0139] For example, if the first user is original user 1, the product set of original user 1 is read from the user-product mapping hash table, which is {original product 1, original product 3, original product 5}, then the number of clicks on the first product is 3;
[0140] If the second user is the original user 3, the product set of the original user 3 is read from the user-product mapping hash table, which is {original product 1, original product 2, original product 6, original product 7}, and the number of clicks on the first product is 4.
[0141] Compare the number of clicks on the first product with the number of clicks on the second product to obtain user click number comparison data; wherein the user click number comparison data includes three situations: the number of clicks on the first product is greater than the number of clicks on the second product, the number of clicks on the first product is less than the number of clicks on the second product, and the number of clicks on the first product is equal to the number of clicks on the second product.
[0142] In step S603 of some embodiments, the relationship between the first user and the second user is adjusted based on the user click quantity comparison data, for example, the first user is used as the parent node of the second user, or the second user is used as the parent node of the first user, thereby adjusting the user relationship tree to obtain the target user relationship tree.
[0143] Specifically:
[0144] If the user click quantity comparison data indicates that the number of clicks on the first product is greater than the number of clicks on the second product, the first user is taken as the parent node of the second user to obtain a target user relationship tree;
[0145] If the user click quantity comparison data indicates that the click quantity of the first product is less than the click quantity of the second product, the second user is taken as the parent node of the first user to obtain the target user relationship tree;
[0146] If the user click quantity comparison data indicates that the number of clicks on the first product is equal to the number of clicks on the second product, the first user can be used as the parent node of the second user, or the second user can be used as the parent node of the first user, or other merging strategies can be used, the specific selection needs to be made in combination with the actual application scenario, and is not limited to this.
[0147] It should be noted that after confirming the parent node of the first user and the second user at any time, the user as the parent node, its corresponding product set will be equal to the product set of the first user plus the product set of the second user, and the user-product mapping hash table will be adjusted to achieve heuristic merging.
[0148] Finally, when the target user relationship tree is constructed, the product set of the root node will contain the product sets of all users in the target user relationship tree.
[0149] In some embodiments, after step S502, if the root node difference data indicates that the root node of the first user is the same as the root node of the second user, there is no need to perform heuristic merging on the original user relationship pairs, and the user relationship tree of the first user and the second user continues to be maintained. There is no need to modify the content in the original parent node array, and the above steps S502 to S503 are jumped for the next original user relationship pair until all original user relationship pairs of all original products are completed and the query processing and heuristic merging are completed to obtain the final target user relationship tree, and the parent node of the original parent node array is updated based on the target user relationship tree to obtain the target parent node array.
[0150] In step S403 of some embodiments, each element in the original parent node array is modified based on the target user relationship tree to the index value of the parent node (eg, array subscript), thereby obtaining the target parent node array.
[0151] See also Figure 7 In some embodiments, step S105 may include but is not limited to steps S701 to S702:
[0152] Step S701, for each original user, perform a root node query on the target parent node array based on the original user data to obtain the target root node data;
[0153] Step S702: perform product query on the user-product mapping hash table based on the target root node data to obtain a target product sequence.
[0154] In steps S701 to S702 shown in the embodiment of the present application, a root node query is performed on the target parent node array based on the original user data to obtain the target root node data; then a product query is performed on the user-product mapping hash table based on the target root node data to obtain the target product sequence corresponding to each original user, thereby giving full play to the efficient data processing performance of the hash table, being able to quickly query and obtain the recommended product sequence, and helping to improve the efficiency of product recommendations.
[0155] It can be understood that after obtaining the target user relationship tree, all original users are divided into multiple "groups", each target user relationship tree corresponds to a "group", and all users in each "group" can be understood as users with the same needs, so the same products can be recommended, that is, all products clicked in each "group" can be used as recommended products.
[0156] In step S701 of some embodiments, for each original user, a root node query is performed from the target parent node array according to the original user data of the original user to obtain the root node information of the target user relationship tree where the original user is located, that is, the target root node data;
[0157] It can be understood that the target root node data can represent a complete target user relationship tree, and the product set of the root node will contain the product sets of all users in this target user relationship tree. Therefore, you only need to query the product set corresponding to the target root node data from the user-product mapping hash table to obtain the products clicked by all users in this target user relationship tree and obtain the target product sequence, which may be the products liked by the original user.
[0158] In step S106 of some embodiments, after determining the target product sequence corresponding to each original user, a product recommendation is made to the original user based on the target product sequence.
[0159] In some embodiments, step S106 may also include but is not limited to the following steps:
[0160] For each original user, perform product query on the user-product mapping hash table based on the original user data to obtain the user-clicked product sequence;
[0161] Based on the user's clicked product sequence, the original user's target product sequence is reduced to obtain the final recommended product sequence;
[0162] Make product recommendations to original users based on the recommended product sequence.
[0163] The product recommendation method provided in the embodiment of the present application uses the union-find and heuristic merging methods to retain the maximum product set at the root node of each target user relationship tree, without requiring each node to retain all the data of the maximum set, which can greatly save space storage; and when searching for the product set corresponding to each user, it is only necessary to find the root node through the search function, which can shorten the time of product recommendation and improve the efficiency of product recommendation. Compared with the existing U2U2I solution, the time complexity can be reduced from O(N 2 ) is reduced to O(N*α+MlogM), where N is the number of original users, M is the number of original products, and a is the path compression time of the search function, which can be regarded as a constant.
[0164] See also Figure 8 The embodiment of the present application also provides a product recommendation device, which can implement the above-mentioned product recommendation method, and the device includes:
[0165] The data acquisition module 801 is used to acquire the original product data, the original user data of the original user and the user click behavior data, and acquire the product click popularity data; wherein the user click behavior data is used to characterize the original user's click behavior on the original product data;
[0166] The first hash table construction module 802 is used to construct a hash table based on the product click popularity data and the user click behavior data to obtain a product-user mapping hash table between the original product data and the original user data;
[0167] The second hash table construction module 803 is used to construct a hash table based on the user click behavior data to obtain a user-product mapping hash table between the original user data and the original product data;
[0168] The parent node update module 804 is used to update the parent node of the preset original parent node array based on the product-user mapping hash table and the user-product mapping hash table to obtain a target parent node array; wherein the original parent node array is constructed based on the original user data;
[0169] The product determination module 805 is used to determine the target product sequence of each original user according to the target parent node array and the user-product mapping hash table;
[0170] The target recommendation module 806 is used to make product recommendations based on the target product sequence.
[0171] The specific implementation of the product recommendation device is basically the same as the specific implementation of the above-mentioned product recommendation method, and will not be repeated here.
[0172] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above product recommendation method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.
[0173] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0174] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0175] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the product recommendation method of the embodiment of this application;
[0176] Input / output interface 903, used to implement information input and output;
[0177] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0178] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0179] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0180] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned product recommendation method is implemented.
[0181] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0182] The product recommendation method and device, electronic device and storage medium provided by the embodiments of the present application obtain original product data, original user data and user click behavior data of original users, and product click popularity data; and construct a hash table based on the product click popularity data and the user click behavior data to obtain a product-user mapping hash table and a user-product mapping hash table between the original product data and the original user data, so as to efficiently mine the correlation between user preferences and product popularity, and then update the parent node of the preset original parent node array based on the product-user mapping hash table and the user-product mapping hash table to obtain a target parent node array; finally, determine the target product sequence of each original user according to the target parent node array and the user-product mapping hash table, and make product recommendations based on the target product sequence, which not only improves the pertinence and accuracy of product recommendations, but also determines the product recommendation sequence of each original user after one processing, thereby improving the efficiency of product recommendations.
[0183] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0184] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0185] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0186] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0187] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0188] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0189] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0190] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0191] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0192] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0193] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A product recommendation method, characterized in that: The method comprises: Obtaining original product data, original user data of original users, and user click behavior data, and obtaining product click heat data; wherein the user click behavior data is used to characterize the click behavior of the original user on the original product data; A hash table is constructed based on the product click popularity data and the user click behavior data to obtain a product-user mapping hash table between the original product data and the original user data; Constructing a hash table based on the user click behavior data to obtain a user-product mapping hash table between the original user data and the original product data; Based on the product-user mapping hash table and the user-product mapping hash table, a preset original parent node array is updated with a parent node to obtain a target parent node array; wherein the original parent node array is constructed based on the original user data; Determine the target product sequence of each of the original users according to the target parent node array and the user-product mapping hash table; Product recommendations are made based on the target product sequence.
2. The method according to claim 1, characterized in that The updating of the parent nodes of the preset original parent node array based on the product-user mapping hash table and the user-product mapping hash table to obtain the target parent node array includes: Perform product traversal on the product-user mapping hash table to obtain a product-user set; Based on the user-product mapping hash table, a union-find process is performed on the product-user set to obtain a target user relationship tree; The original parent node array is updated based on the target user relationship tree to obtain the target parent node array.
3. The method according to claim 2, characterized in that The step of performing a union-find process on the product user set based on the user-product mapping hash table to obtain a target user relationship tree includes: Extracting user pairs from the product user set to obtain original user relationship pairs; wherein the original user relationship pairs include a first user and a second user; Performing root node detection on the first user and the second user pair in the same original user relationship pair to obtain root node similarity and difference data; wherein the root node similarity and difference data indicates whether the root node of the first user and the root node of the second user in the same original user relationship pair are the same or different; The original user relationship pairs are heuristically merged based on the user-product mapping hash table and the root node similarity and difference data to obtain the target user relationship tree.
4. The method according to claim 3, characterized in that The heuristic merging of the original user relationship pairs based on the user-product mapping hash table and the root node similarity and difference data to obtain the target user relationship tree includes: If the root node difference data indicates that the root node of the first user is different from the root node of the second user, the product quantity is calculated for the user-product mapping hash table to obtain click product statistics; wherein the click product statistics include the click quantity of the first product of the first user and the click quantity of the second product of the second user; Compare the number of clicks on the first product with the number of clicks on the second product to obtain user click number comparison data; The relationship between the first user and the second user is adjusted according to the user click quantity comparison data to obtain the target user relationship tree.
5. The method according to any one of claims 1 to 4, characterized in that: The determining the target product sequence of each original user according to the target parent node array and the user-product mapping hash table includes: For each of the original users, performing a root node query on the target parent node array based on the original user data to obtain target root node data; A product query is performed on the user-product mapping hash table based on the target root node data to obtain the target product sequence.
6. The method according to any one of claims 1 to 4, characterized in that: The constructing of a hash table based on the product click heat data and the user click behavior data to obtain a product-user mapping hash table between the original product data and the original user data includes: Sort the original product data based on the product click popularity data to obtain an original product sequence; Performing product screening on the original product sequence to obtain a target product sequence; Constructing an initial product hash table based on the target product sequence; The initial product hash table is filled with data based on the user click behavior data and the original user data to obtain the product-user mapping hash table.
7. The method according to any one of claims 1 to 4, characterized in that: The step of constructing a hash table based on the user click behavior data to obtain a user-product mapping hash table between the original user data and the original product data includes: Building an initial user hash table based on the original user data; The initial user hash table is filled with data based on the user click behavior data and the original product data to obtain the user-product mapping hash table.
8. A product recommendation device, characterized in that: The device comprises: A data acquisition module is used to acquire original product data, original user data of original users and user click behavior data, and acquire product click popularity data; wherein the user click behavior data is used to characterize the click behavior of the original user on the original product data; A first hash table construction module is used to construct a hash table based on the product click popularity data and the user click behavior data to obtain a product-user mapping hash table between the original product data and the original user data; A second hash table construction module is used to construct a hash table based on the user click behavior data to obtain a user-product mapping hash table between the original user data and the original product data; A parent node update module, used to update the parent node of a preset original parent node array based on the product-user mapping hash table and the user-product mapping hash table to obtain a target parent node array; wherein the original parent node array is constructed based on the original user data; A product determination module, configured to determine a target product sequence for each of the original users according to the target parent node array and the user-product mapping hash table; The target recommendation module is used to make product recommendations based on the target product sequence.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Product recommendation method and device
CN111369306A
Article recommendation method, device, equipment and system and readable storage medium
CN111782925A
Product information recommendation method and computer equipment
CN113065071A
Article recommendation method and device, computer equipment and storage medium
CN115659051A
Real-time recommendation method, electronic device, and computer readable storage medium
WO2019071897A1