CN110956530A - Recommendation method and device, electronic equipment and computer-readable storage medium - Google Patents

Recommendation method and device, electronic equipment and computer-readable storage medium Download PDF

Info

Publication number
CN110956530A
CN110956530A CN201911177371.6A CN201911177371A CN110956530A CN 110956530 A CN110956530 A CN 110956530A CN 201911177371 A CN201911177371 A CN 201911177371A CN 110956530 A CN110956530 A CN 110956530A
Authority
CN
China
Prior art keywords
user
commodity
operation behavior
user data
calculating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911177371.6A
Other languages
Chinese (zh)
Inventor
方依
黄楷
陈羲
梁新敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Fengzhi Technology Co Ltd
Original Assignee
Shanghai Fengzhi Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Fengzhi Technology Co Ltd filed Critical Shanghai Fengzhi Technology Co Ltd
Priority to CN201911177371.6A priority Critical patent/CN110956530A/en
Publication of CN110956530A publication Critical patent/CN110956530A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0631Item recommendations

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a recommendation method, a recommendation device, electronic equipment and a computer-readable storage medium, and belongs to the field of data processing. The method comprises the following steps: acquiring user data to be processed of the e-commerce platform, wherein each user data to be processed comprises a user ID and an operation behavior of a user on a commodity; calculating the weight of each operation behavior corresponding to the user ID on the basis of the user data to be processed; calculating the scores of the commodities corresponding to the user according to the weight corresponding to the user ID; and determining the recommended commodity of each user ID according to the score of each commodity corresponding to each user ID and a collaborative filtering algorithm. As for each user ID, the weight of each operation behavior is determined according to the actual operation rule of the user instead of being identically defined by the system, the individual difference among the users can be better reflected in the subsequent obtained scores, and the commodity recommendation obtained based on the collaborative filtering algorithm is more accurate finally.

Description

Recommendation method and device, electronic equipment and computer-readable storage medium
Technical Field
The application belongs to the field of data processing, and particularly relates to a recommendation method, a recommendation device, electronic equipment and a computer-readable storage medium.
Background
In an e-commerce platform, a recommendation technology is often used to recommend goods to a user to increase the volume of the user's business. A commonly used recommendation method is to artificially define weights of some operation behaviors (such as clicking, collecting, adding a shopping cart, purchasing and the like) of users on commodities, for example, a clicking weight is 0.1, a collecting weight is 0.2, a shopping cart weight is 0.25, and a purchasing weight is 0.45, then calculate scores of the commodities for each user (the scores are used for representing the interest degree of the users on the commodities), and finally recommend the commodities with higher scores to the users with similar interests according to a collaborative filtering method.
In actual life, the life habits of each user are different, and correspondingly, the weight corresponding to the same operation behavior of each user should be different, for example, for the user a, the user a always likes to click for collection when browsing commodities, and for the user B, the user B only clicks for collection when browsing favorite commodities, so that for the user a and the user B, the weight of the collection corresponding to a should be smaller than that of the collection corresponding to B.
However, in the above method, the weight for calculating the product score is uniformly defined by the system, that is, the weight of the same operation behavior is the same for all users, and therefore, the product which is not interested by the user is often recommended at last, which is not beneficial to increase the volume of the e-commerce platform.
Disclosure of Invention
In view of this, an object of the present application is to provide a recommendation method, an apparatus, an electronic device, and a computer-readable storage medium, in which a weight of an operation behavior is calculated for each user through an entropy weight method, so as to improve a probability that a recommended commodity is a commodity that is of interest to the user, and contribute to improving a volume of a transaction of an e-commerce platform.
The embodiment of the application is realized as follows:
in a first aspect, an embodiment of the present application provides a recommendation method, configured to recommend a commodity for a user, where the method includes: acquiring user data to be processed of an e-commerce platform, wherein each user data to be processed comprises a user ID and an operation behavior of a user on a commodity; for each user ID, calculating the weight of each operation behavior corresponding to the user ID on the basis of the user data to be processed; calculating, for each user ID, a score for each item corresponding to the user according to the weight corresponding to the user ID; and determining the recommended commodity corresponding to each user ID according to the score of each commodity corresponding to each user ID and a collaborative filtering algorithm. As for each user ID, the weight of each operation behavior is determined according to the actual operation rule of the user corresponding to the user ID, and is not defined by the same system, the individual difference among the users can be better reflected in the subsequent obtained scores, and the commodity recommendation obtained based on the collaborative filtering algorithm is more accurate, so that the commodity volume of the E-commerce platform is increased.
With reference to the embodiment of the first aspect, in a possible implementation manner, before the obtaining of the to-be-processed user data of the merchant platform, the method further includes: acquiring a plurality of user data; and filtering the plurality of user data to obtain the user data to be processed.
With reference to the embodiment of the first aspect, in a possible implementation manner, each user data includes a timestamp, and the filtering the plurality of user data includes: calculating the time interval length between the time stamp included in each user data and the current time point; and filtering the user data with the time interval length larger than a time threshold.
With reference to the embodiment of the first aspect, in a possible implementation manner, each user data includes an article ID, and the filtering the plurality of user data includes: calculating the number of users generating operation relation with the commodity aiming at the commodity corresponding to each commodity ID; determining the commodities of which the number of the users is not within a threshold interval as commodities to be filtered; and filtering user data where the commodity ID corresponding to the commodity to be filtered is located.
With reference to the embodiment of the first aspect, in a possible implementation manner, the calculating, for each user ID, a weight of each operation behavior corresponding to the user ID on the basis of the to-be-processed user data includes: screening out user data to be processed corresponding to each user ID aiming at each user ID; for each purposeA user ID, a decision matrix corresponding to the user ID is constructed through the user data to be processed corresponding to the user ID
Figure BDA0002289571140000031
Wherein d is1、…、dkFor each category of operation behavior, s1、…、snIs a commodity product and is characterized by that,
Figure BDA0002289571140000032
for the user corresponding to the user ID to aim at snMerchandise item dkThe times of operation behaviors, n and k are positive integers; and calculating the weight of each operation behavior corresponding to each user ID through the decision matrix corresponding to the user ID aiming at each user ID.
With reference to the embodiment of the first aspect, in a possible implementation manner, the calculating, for each user ID, a weight of each operation behavior corresponding to the user ID through a decision matrix corresponding to the user ID includes: for each user ID, carrying out normalization processing on the decision matrix corresponding to the user ID to obtain a normalization matrix, wherein each element in the normalization matrix is
Figure BDA0002289571140000033
For each user ID, based on a formula
Figure BDA0002289571140000034
Calculating the feature proportion of each element in the normalized matrix corresponding to the user ID to obtain a feature proportion matrix; for each user ID, based on a formula
Figure BDA0002289571140000035
Calculating the entropy value of the operation behavior corresponding to each row of elements in the characteristic proportion matrix corresponding to the user ID to obtain the entropy value of each operation behavior aiming at the user ID; for each user ID, based on formula dj=1-ejCalculating a difference coefficient of an entropy value of each operation behavior corresponding to the user ID; for each user ID, based on a formula
Figure BDA0002289571140000036
Calculating the entropy weight of each operation behavior corresponding to the user ID, and determining the entropy weight as weight; wherein i, j and m are positive integers.
With reference to the embodiment of the first aspect, in a possible implementation manner, the calculating, for each user ID, a score of each product corresponding to the user according to a weight corresponding to the user ID includes: for each user ID, based on a formula
Figure BDA0002289571140000041
Calculating the scores of the commodities corresponding to the user; wherein, I (u)i→ij) Is a binary function when I (u)i→ij) When 1, the user ID is characterized as uiCorresponding user to commodity ijThere is an operation behavior when I (u)i→ij) When 0, the user ID is characterized as uiCorresponding user to commodity ijThere is no operational behavior.
In a second aspect, an embodiment of the present application provides a recommendation apparatus, where the apparatus includes: for recommending merchandise to a user, the apparatus comprising: the device comprises an acquisition module, a calculation module and a determination module; the acquisition module is used for acquiring to-be-processed user data of the e-commerce platform, wherein each to-be-processed user data comprises a user ID and an operation behavior of a user on a commodity; the calculation module is used for calculating the weight of each operation behavior corresponding to each user ID on the basis of the user data to be processed aiming at each user ID; the calculation module is further used for calculating the scores of the commodities corresponding to the user according to the weight corresponding to the user ID aiming at each user ID; and the determining module is used for determining the recommended commodity corresponding to each user ID according to the score of each commodity corresponding to each user ID and a collaborative filtering algorithm.
With reference to the second aspect, in a possible implementation manner, the obtaining module is further configured to obtain a plurality of user data, and the apparatus further includes a filtering module, configured to filter the plurality of user data to obtain the to-be-processed user data.
With reference to the embodiment of the second aspect, in a possible implementation manner, each user data includes a timestamp, and the filtering module is configured to calculate a length of a time interval between the timestamp included in each user data and a current time point; and filtering the user data with the time interval length larger than a time threshold.
With reference to the second aspect, in a possible implementation manner, each user data includes a product ID, and the filtering module is configured to calculate, for a product corresponding to each product ID, the number of users who generate an operation relationship with the product; determining the commodities of which the number of the users is not within a threshold interval as commodities to be filtered; and filtering user data where the commodity ID corresponding to the commodity to be filtered is located.
With reference to the second aspect, in a possible implementation manner, the computing module is configured to, for each user ID, filter out to-be-processed user data corresponding to the user ID; aiming at each user ID, a decision matrix corresponding to the user ID is constructed through the to-be-processed user data corresponding to the user ID
Figure BDA0002289571140000051
Wherein d is1、…、dkFor each category of operation behavior, s1、…、snIs a commodity product and is characterized by that,
Figure BDA0002289571140000052
for the user corresponding to the user ID to aim at snMerchandise item dkThe times of operation behaviors, n and k are positive integers; and calculating the weight of each operation behavior corresponding to each user ID through the decision matrix corresponding to the user ID aiming at each user ID.
With reference to the second aspect, in a possible implementation manner, the computing module is configured to, for each user ID, perform normalization processing on a decision matrix corresponding to the user ID to obtain a normalized matrix, where each element in the normalized matrix is a single element in the matrixIs prepared from
Figure BDA0002289571140000053
For each user ID, based on a formula
Figure BDA0002289571140000054
Calculating the feature proportion of each element in the normalized matrix corresponding to the user ID to obtain a feature proportion matrix; for each user ID, based on a formula
Figure BDA0002289571140000055
Calculating the entropy value of the operation behavior corresponding to each row of elements in the characteristic proportion matrix corresponding to the user ID to obtain the entropy value of each operation behavior aiming at the user ID; for each user ID, based on formula dj=1-ejCalculating a difference coefficient of an entropy value of each operation behavior corresponding to the user ID; for each user ID, based on a formula
Figure BDA0002289571140000056
Calculating the entropy weight of each operation behavior corresponding to the user ID, and determining the entropy weight as weight; wherein i, j and m are positive integers.
With reference to the second aspect, in one possible implementation manner, the calculating module is configured to calculate, for each user ID, a formula based on the formula
Figure BDA0002289571140000061
Calculating the scores of the commodities corresponding to the user; wherein, I (u)i→ij) Is a binary function when I (u)i→ij) When 1, the user ID is characterized as uiCorresponding user to commodity ijThere is an operation behavior when I (u)i→ij) When 0, the user ID is characterized as uiCorresponding user to commodity ijThere is no operational behavior.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a memory and a processor, the memory and the processor connected; the memory is used for storing programs; the processor calls a program stored in the memory to perform the method of the first aspect embodiment and/or any possible implementation manner of the first aspect embodiment.
In a fourth aspect, the present application further provides a non-transitory computer-readable storage medium (hereinafter, referred to as a computer-readable storage medium), on which a computer program is stored, where the computer program is executed by a computer to perform the method in the foregoing first aspect and/or any possible implementation manner of the first aspect.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and drawings.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts. The foregoing and other objects, features and advantages of the application will be apparent from the accompanying drawings. Like reference numerals refer to like parts throughout the drawings. The drawings are not intended to be to scale as practical, emphasis instead being placed upon illustrating the subject matter of the present application.
Fig. 1 shows a flowchart of a recommendation method provided in an embodiment of the present application.
Fig. 2 shows a schematic diagram of a vector provided in an embodiment of the present application.
Fig. 3 shows a block diagram of a recommendation device according to an embodiment of the present application.
Fig. 4 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Further, the term "and/or" in the present application is only one kind of association relationship describing the associated object, and means that three kinds of relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone.
In addition, the defects existing in the product recommendation method in the prior art (calculating the scores of the products by the user through a universal weight distribution so that the recommended products are not interesting for the user and are not beneficial to improving the volume of the e-commerce platform) are the results obtained after the applicant has been practiced and studied carefully, and therefore, the discovery process of the above defects and the solutions proposed in the embodiments of the present application below for the above defects should be contributions of the applicant to the present application in the process of the present application.
In order to solve the above problem, embodiments of the present application provide a recommendation method, an apparatus, an electronic device, and a computer-readable storage medium, where a weight of an operation behavior of each user is calculated by an entropy weight method, so as to improve a probability that a recommended commodity is a commodity that is of interest to the user, and help to improve a volume of a trading of an e-commerce platform. The technology can be realized by adopting corresponding software, hardware and a combination of software and hardware.
The following description will be made with respect to the recommendation method provided in the present application.
Referring to fig. 1, an embodiment of the present application provides a recommendation method for recommending a commodity for a user. The method can be applied to the electronic device itself, an Application (APP) installed in the electronic device, or an applet embedded in a public platform installed in the electronic device.
The steps involved will be described below with reference to fig. 1.
Step S110: and acquiring user data to be processed of the commercial platform.
Each piece of user data to be processed comprises a user ID, a commodity ID and the operation behavior of the user on the commodity.
The user ID represents which user generates the data, the commodity ID represents the data generated after the user operates which commodity, and the operation behaviors of the user on the commodity can include but are not limited to clicking, collecting, shopping cart adding, purchasing and the like. In a piece of user data to be processed, the operation behavior of the user on the commodity comprises one operation behavior of clicking, collecting, adding a shopping cart, purchasing and the like.
In an optional implementation manner, the electronic device may directly obtain user data stored in a background server or a cloud server of the e-commerce platform, and determine the obtained user data as user data to be processed.
Certainly, in another optional implementation manner, because the data volume of the user data is too large, a large calculation pressure is caused to subsequent calculations, the electronic device may first acquire the user data stored in the background server or the cloud server of the e-commerce platform, and then filter the user data to obtain the user data to be processed, so as to reduce the data volume of the user data used for subsequent calculations and reduce the calculation pressure of the electronic device.
It is to be noted that each piece of user data includes a user ID, a product ID, and a user operation behavior on a product.
The user data may be filtered based on time, or based on commodity popularity, or based on both time and commodity popularity.
Filtering the user data based on time and filtering the user data based on commodity popularity will be described below.
Because the user's preference is usually variable, and the data with a long time is usually not the user's latest preference, the user data in a nearby time period can be calculated, that is, the user data with a long time period is filtered out, so as to reduce the data volume.
In this embodiment, each piece of user data further includes a time stamp corresponding to the generation time of the piece of user data. When the user data needs to be filtered based on time, the electronic device first acquires a plurality of user data, then calculates the time interval length between the time stamp included in each user data and the current time point, and then filters the user data of which the time interval length is greater than the time threshold.
For a certain hot commodity, even if the hot commodity is not recommended to the user, the user still searches the commodity through other ways, that is, whether the hot commodity is recommended to the user or not has no practical significance for the user, and the sales volume of the e-commerce platform cannot be increased. In addition, the user data corresponding to the popular commodity is incorporated into the subsequent calculation, so that the matrix constructed in the subsequent calculation becomes dense and is not beneficial to calculation, and therefore, the user data corresponding to the popular commodity can be filtered.
In addition, when an operation relationship exists between a certain commodity and only one user (when a certain user performs the operation behavior on a certain commodity, that is, the operation relationship is generated between the user and the commodity is represented), the user data corresponding to the commodity is not necessary to be calculated, so that commodities having the operation relationship with only one user can be filtered.
Therefore, when the user data needs to be filtered based on the commodity popularity, the user data which only has an operation relationship with one user and the user data corresponding to popular commodities can be filtered.
Optionally, the electronic device may obtain a plurality of user data, then calculate, for each commodity corresponding to each commodity ID, the number of users who generate an operation relationship with the commodity, then determine, as the commodity to be filtered, the commodity whose number of users is not within the threshold interval, and then filter, by the electronic device, the user data of the commodity ID corresponding to the commodity to be filtered. When the number of users in operation relation with a certain commodity is smaller than the lower limit value of the threshold interval, the fact that the commodity only has operation relation with one user is represented, and when the number of users in operation relation with the certain commodity is larger than the upper limit value of the threshold interval, the fact that the commodity is a hot commodity is represented. Optionally, the threshold interval may be 2-500000, where the lower limit value of the threshold interval is 2 and the upper limit value of the threshold interval is 500000.
Step S120: and calculating the weight of each operation behavior corresponding to the user ID on the basis of the user data to be processed aiming at each user ID.
After the user data to be processed is obtained, all the user data to be processed are classified according to the user IDs, so that the user data to be processed corresponding to each user ID is obtained, for example, 180 pieces of user data to be processed corresponding to the user 1, 120 pieces of user data to be processed corresponding to the user 2, and 300 pieces of user data to be processed corresponding to the user 3.
After obtaining the to-be-processed user data corresponding to each user ID, the electronic device may construct a decision matrix X corresponding to each user ID based on the to-be-processed user data corresponding to each user ID with each user ID as a unit.
Taking user 1 as an example, the following introduces the construction of the decision matrix corresponding to each user ID.
In the above, there are 180 pieces of user data to be processed corresponding to the user 1. Each piece of to-be-processed user data in the 180 pieces of to-be-processed user data includes a commodity ID and an operation behavior of the user on the commodity. The electronic device counts all the product IDs in the 180 pieces of user data to be processed to determine the products, such as product 1, product 2, and product 3. Then, the electronic device is constructed and usedDecision matrix corresponding to household 1
Figure BDA0002289571140000101
Wherein d is1、…、dkThe category of the operation behavior of the user on the commodity is determined by electronics in a unified way, for example, the category is determined to be clicking, collecting, adding a shopping cart and purchasing in a unified way, and correspondingly, the category of the operation behavior of the decision matrix corresponding to each user ID is clicking, collecting, adding a shopping cart and purchasing. s1、…、snAnd determining different commodities for the electronic equipment according to the 180 pieces of to-be-processed user data corresponding to the user 1.
Figure BDA0002289571140000111
For user 1 to snMerchandise item dkThe number of operation behaviors, n and k are positive integers, for example, the user 1 purchases the commodity 13 times, and accordingly, in the decision matrix, the data corresponding to the commodity 1 and the purchase operation behavior is 3.
It is understood that the electronic device may construct the decision matrix X corresponding to each of the other user IDs according to the same steps as the decision matrix of user 1 is constructed1
After obtaining the decision matrix X corresponding to each user ID, the electronic device may calculate the weight of each operation behavior corresponding to each user ID according to the decision matrix X corresponding to each user ID.
The following will continue to use user 1 as an example to describe the calculation of the weights of the respective operation behaviors of user 1.
Decision matrix X for user 11The electronic device first determines the matrix X1Carrying out normalization processing to obtain a normalization matrix
Figure BDA0002289571140000112
Wherein d is1、…、djThe category of the operation behavior of the user on the commodity corresponds to the decision matrix X1D in (1)1、…、dk;s1、…、siFor a commodity, corresponding to decision matrix X1S in1、…、sn
Figure BDA0002289571140000113
Corresponding to decision matrix X1In (1)
Figure BDA0002289571140000114
The purpose of normalization is to eliminate the influence of different dimensions of the categories of the operation behaviors on the weight.
In an alternative embodiment, the formula may be based on
Figure BDA0002289571140000115
To decision matrix X1Carrying out a normalization process, wherein,
Figure BDA0002289571140000116
i.e. the decision matrix X1In (1)
Figure BDA0002289571140000117
In another alternative embodiment, the formula may be based on
Figure BDA0002289571140000118
To decision matrix X1Carrying out a normalization process, wherein,
Figure BDA0002289571140000121
i.e. the decision matrix X1In (1)
Figure BDA0002289571140000122
Furthermore, due to the decision matrix X1Is a sparse matrix (the number of 0 elements in the matrix is greater than the number of non-0 elements), and therefore, the decision matrix X is being made1When normalization is performed, it can be determined whether the element to be processed is 0, and if so, the element is in the normalization matrix G1Is also 0 in (1), and no calculation is needed to reduce the calculation amount.
Obtaining a decision matrix X1Normalized matrix G of1Then, in decision matrix G1In the column where a certain operation behavior index j is located, the corresponding operation behavior index j is
Figure BDA0002289571140000123
The larger the difference between the values of (a) and (b), the greater the role that the indicator plays in evaluating the commodity, i.e., the more useful information the indicator provides to the evaluation object (commodity).
According to the concept of entropy, the increase of information means the decrease of entropy, and the entropy can be used for measuring the size of information quantity, so that for an index j corresponding to a certain operation behavior, the electronic equipment is based on a formula
Figure BDA0002289571140000124
The characteristic specific gravity of the ith evaluation object of the index j is calculated as
Figure BDA0002289571140000125
Obtaining a decision matrix X1Characteristic proportion matrix of
Figure BDA0002289571140000126
Wherein d is1、…、djThe categories of the operation behaviors of the user on the commodity correspond to the decision matrix G1D in (1)1、…、dj,s1、…、siFor goods, corresponding to decision matrix G1S in1、…、si
Figure BDA0002289571140000127
Corresponding to the normalized matrix G1In (1)
Figure BDA0002289571140000128
Obtaining a decision matrix X1Characteristic proportion matrix T of1Then, the electronic device is based on the formula
Figure BDA0002289571140000129
Calculating the index j pairEntropy e of the corresponding column of elementsjAnd based on formula dj=1-ejCalculating a difference coefficient d of entropy values of the jth operation behavior corresponding to the user 1j
Obtaining the difference coefficient d of each operation behavior of the user 1jThen, the electronic device is based on the formula
Figure BDA0002289571140000131
The entropy weight of each operation behavior corresponding to user 1 is calculated. The entropy weight of a certain operation behavior of the user 1 is the weight of the operation behavior in all the operation behaviors of the user 1.
It is noted that i, j, and m are positive integers. Further, by the above method, the weight of each operation behavior of the user 1 can be determined.
It is to be understood that the electronic device may determine the weights of the respective operation behaviors of each of the other user IDs according to the same procedure as the determination of the weights of the respective operation behaviors of the user 1.
Step S130: for each user ID, a score is calculated for each product corresponding to the user based on the weight corresponding to the user ID.
After determining the weight of the respective operation behavior for each user ID, the electronic device may be based on a formula for each user ID
Figure BDA0002289571140000132
The scores of the respective products corresponding to the user are calculated. Wherein, I (u)i→ij) Is a binary function when I (u)i→ij) When 1, the user ID is characterized as uiCorresponding user to commodity ijThere is an operation behavior when I (u)i→ij) When 0, the user ID is characterized as uiCorresponding user to commodity ijThere is no operational behavior.
After the score is calculated, the electronic device obtains the score (i.e., the interestingness) of each user ID for each commodity.
Step S140: and determining the recommended commodity corresponding to each user ID according to the score of each commodity corresponding to each user ID and a collaborative filtering algorithm.
The collaborative filtering algorithm is also called a User collaborative filtering algorithm (UserCF), and mainly refers to calculating which users are interested in similar goods by analyzing the operation behaviors of the users on the goods (such as clicking, collecting, shopping cart adding and purchasing … …), and then recommending the goods concerned by the users with similar interests to each other.
The following will briefly describe the collaborative filtering algorithm.
Specifically, a scoring matrix shown in table 1 may be obtained for each user ID scoring each product.
Table 1: scoring matrix
User/goods Commodity A Commodity B Commodity N
User 1 Score 1 → A Score 1 → B Score 1 → N
User 2 Score 2 → A Score 2 → B Score 2 → N
User n Score n → A Score n → B Score N → N
For the above scoring matrix, the similarity between the respective users may be calculated.
There are various ways to calculate the similarity, such as cosine similarity, chebyshev distance, etc.
The cosine similarity is used as an example for description.
As shown in FIG. 2, assuming that there are two-dimensional vectors a (x1, y1) and b (x2, y2), their cosine similarity is
Figure BDA0002289571140000141
Generalized to multidimensional vectors a (a1, a2, a3, a4, … an), b (b1, b2, b3, b4, … bn), can obtain
Figure BDA0002289571140000142
For each user in the scoring matrix, it can be considered as a multi-dimensional vector, e.g., the multi-dimensional vector for user N is (score N → a, score N → B, …, score N → N). Cosine similarity is calculated between every two multidimensional vectors formed by each user, and therefore a similarity matrix between each user can be obtained.
Table 2: similarity matrix
Figure BDA0002289571140000143
After the similarity matrix and the scoring matrix are obtained, a recommendation list can be further obtained, namely the similarity matrix x the scoring matrix.
In the recommendation list, for each user ID, there is a recommendation value for characterizing the recommendation degree corresponding to each commodity. Because the user ID has already operated in relation to the multiple commodities before the recommendation list corresponding to the user ID is obtained for each user ID, the electronic device eliminates the commodities having already operated in relation to the recommendation list corresponding to the user ID, and obtains the filtered recommendation list. Subsequently, for each user ID, the electronic equipment recommends the commodity with the front recommended value in the recommendation list to the user ID, and the commodity recommendation of the user ID is completed.
In addition, as an optional implementation manner, for each score in the score matrix, the score mean Rn of the user may also be calculated in units of users. Subsequently, the electronic device subtracts the score mean Rn corresponding to the user from all the scores for the same user, so as to centralize each score mean, and obtain a mean score matrix, as shown in table 3.
Table 3: mean score matrix
User/goods Commodity A Commodity B Commodity N
User 1 (score 1 → A) -R1 (score 1 → B) -R1 (score 1 → N) -R1
User 2 (score 2 → A) -R2 (score 2 → B) -R2 (score 2 → N) -R2
User n (score n → A) -Rn (score n → B) -Rn (score N → N) -Rn
The idea of mean centering is to determine whether a score is positive or negative by comparing average scores. Subsequently, the electronic device can directly observe the positive and negative conditions of the score value to obtain the like or dislike degree of the user for a certain commodity.
Subsequently, the electronic device replaces the scoring matrix in the commodity recommendation process for obtaining each user ID with a mean scoring matrix, so as to obtain the commodity recommendation of each user ID based on the mean scoring matrix.
According to the recommendation method provided by the embodiment of the application, the weight of each operation behavior corresponding to the actual situation of each user ID is calculated through the user data to be processed, then the score of each commodity corresponding to each user is calculated according to the weight corresponding to each user ID, and subsequently, the recommended commodity corresponding to each user ID is determined according to the score of each commodity corresponding to each user ID and a collaborative filtering algorithm. As for each user ID, the weight of each operation behavior is determined according to the actual operation rule of the user corresponding to the user ID, and is not defined by the same system, the individual difference among the users can be better reflected in the subsequent obtained scores, and the commodity recommendation obtained based on the collaborative filtering algorithm is more accurate, so that the commodity volume of the E-commerce platform is increased.
In addition, referring to fig. 3 in correspondence to fig. 1, an embodiment of the present application further provides a recommendation apparatus 400 for recommending a product for a user, where the recommendation apparatus 400 may include: an acquisition module 410, a calculation module 420, and a determination module 430.
The obtaining module 410 is configured to obtain to-be-processed user data of an e-commerce platform, where each to-be-processed user data includes a user ID and an operation behavior of a user on a commodity;
the calculating module 420 is configured to calculate, for each user ID, a weight of each operation behavior corresponding to the user ID on the basis of the to-be-processed user data;
the calculating module 420 is further configured to calculate, for each user ID, a score of each product corresponding to the user according to the weight corresponding to the user ID;
the determining module 430 is configured to determine, according to the score of each product corresponding to each user ID and a collaborative filtering algorithm, a recommended product corresponding to each user ID.
In a possible implementation manner, the obtaining module 410 is further configured to obtain a plurality of user data, and the apparatus further includes a filtering module, configured to filter the plurality of user data to obtain the user data to be processed.
In a possible embodiment, each user data includes a time stamp, and the filtering module is configured to calculate a length of a time interval between the time stamp included in each user data and the current time point; and filtering the user data with the time interval length larger than a time threshold.
In a possible implementation manner, each user data includes a commodity ID, and the filtering module is configured to calculate, for a commodity corresponding to each commodity ID, the number of users who generate an operation relationship with the commodity; determining the commodities of which the number of the users is not within a threshold interval as commodities to be filtered; and filtering user data where the commodity ID corresponding to the commodity to be filtered is located.
In a possible implementation manner, the computing module 420 is configured to, for each user ID, filter out to-be-processed user data corresponding to the user ID; aiming at each user ID, a decision matrix corresponding to the user ID is constructed through the to-be-processed user data corresponding to the user ID
Figure BDA0002289571140000171
Wherein d is1、…、dkFor each category of operation behavior, s1、…、snIs a commodity product and is characterized by that,
Figure BDA0002289571140000172
for the user corresponding to the user ID to aim at snMerchandise item dkThe times of operation behaviors, n and k are positive integers; and calculating the weight of each operation behavior corresponding to each user ID through the decision matrix corresponding to the user ID aiming at each user ID.
In a possible implementation manner, the calculating module 420 is configured to, for each user ID, perform normalization processing on a decision matrix corresponding to the user ID to obtain a normalized matrix, where each element in the normalized matrix is
Figure BDA0002289571140000173
For each user ID, based on a formula
Figure BDA0002289571140000174
Calculating the feature proportion of each element in the normalized matrix corresponding to the user ID to obtain a feature proportion matrix; for each user ID, based on a formula
Figure BDA0002289571140000175
Calculating the entropy value of the operation behavior corresponding to each row of elements in the characteristic proportion matrix corresponding to the user ID to obtain the entropy value of each operation behavior aiming at the user ID; for each user ID, based on formula dj=1-ejCalculating a difference coefficient of an entropy value of each operation behavior corresponding to the user ID; for each user ID, based on a formula
Figure BDA0002289571140000176
Calculating the entropy weight of each operation behavior corresponding to the user ID, and determining the entropy weight as weight; wherein i, j and m are positive integers.
In a possible embodiment, the calculation module 420 is configured to calculate, for each user ID, a formula based on
Figure BDA0002289571140000181
Calculating the scores of the commodities corresponding to the user; wherein, I (u)i→ij) Is a binary function when I (u)i→ij) When 1, the user ID is characterized as uiCorresponding user to commodity ijThere is an operation behavior when I (u)i→ij) When 0, the user ID is characterized as uiCorresponding user to commodity ijThere is no operational behavior.
The implementation principle and the resulting technical effect of the recommendation device 400 provided in the embodiment of the present application are the same as those of the foregoing method embodiments, and for the sake of brief description, reference may be made to corresponding contents in the foregoing method embodiments for parts of the embodiment that are not mentioned.
In addition, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a computer, the steps included in the recommendation method as described above are executed.
In addition, please refer to fig. 4, an embodiment of the present application further provides an electronic device 100 for implementing the recommendation method and apparatus of the embodiment of the present application.
Alternatively, the electronic Device 100 may be, but is not limited to, a Personal Computer (PC), a smart phone, a tablet PC, a Mobile Internet Device (MID), a Personal digital assistant, a server, and the like.
Among them, the electronic device 100 may include: a processor 110, a memory 120.
It should be noted that the components and structure of electronic device 100 shown in FIG. 4 are exemplary only, and not limiting, and electronic device 100 may have other components and structures as desired.
The processor 110, memory 120, and other components that may be present in the electronic device 100 are electrically connected to each other, directly or indirectly, to enable the transfer or interaction of data. For example, the processor 110, the memory 120, and other components that may be present may be electrically coupled to each other via one or more communication buses or signal lines.
The memory 120 is used for storing programs, such as programs corresponding to the recommendation methods presented above or recommendation devices presented above. Optionally, when the recommendation device is stored in the memory 120, the recommendation device includes at least one software function module that can be stored in the memory 120 in the form of software or firmware (firmware).
Alternatively, the software function module included in the recommendation device may also be solidified in an Operating System (OS) of the electronic device 100.
The processor 110 is adapted to execute executable modules stored in the memory 120, such as software functional modules or computer programs comprised by the recommendation device. When the processor 110 receives the execution instruction, it may execute the computer program, for example, to perform: acquiring user data to be processed of an e-commerce platform, wherein each user data to be processed comprises a user ID and an operation behavior of a user on a commodity; for each user ID, calculating the weight of each operation behavior corresponding to the user ID on the basis of the user data to be processed; calculating, for each user ID, a score for each item corresponding to the user according to the weight corresponding to the user ID; and determining the recommended commodity corresponding to each user ID according to the score of each commodity corresponding to each user ID and a collaborative filtering algorithm.
Of course, the method disclosed in any of the embodiments of the present application can be applied to the processor 110, or implemented by the processor 110.
In summary, according to the recommendation method, the recommendation device, the electronic device, and the computer-readable storage medium provided in the embodiments of the present invention, the method first calculates the weight of each operation behavior corresponding to the actual situation of each user ID according to the user data to be processed, then calculates the score of each product corresponding to each user ID according to the weight corresponding to the user ID for each user ID, and then determines the recommended product corresponding to each user ID according to the score of each product corresponding to each user ID and the collaborative filtering algorithm. As for each user ID, the weight of each operation behavior is determined according to the actual operation rule of the user corresponding to the user ID, and is not defined by the same system, the individual difference among the users can be better reflected in the subsequent obtained scores, and the commodity recommendation obtained based on the collaborative filtering algorithm is more accurate, so that the commodity volume of the E-commerce platform is increased.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a notebook computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application.

Claims (10)

1. A recommendation method for recommending a commodity for a user, the method comprising:
acquiring user data to be processed of an e-commerce platform, wherein each user data to be processed comprises a user ID and an operation behavior of a user on a commodity;
for each user ID, calculating the weight of each operation behavior corresponding to the user ID on the basis of the user data to be processed;
calculating, for each user ID, a score for each item corresponding to the user according to the weight corresponding to the user ID;
and determining the recommended commodity corresponding to each user ID according to the score of each commodity corresponding to each user ID and a collaborative filtering algorithm.
2. The method of claim 1, wherein prior to said obtaining user data to be processed for a merchant platform, the method further comprises:
acquiring a plurality of user data;
and filtering the plurality of user data to obtain the user data to be processed.
3. The method of claim 2, wherein each user data includes a timestamp, and wherein filtering the plurality of user data comprises:
calculating the time interval length between the time stamp included in each user data and the current time point;
and filtering the user data with the time interval length larger than a time threshold.
4. The method of claim 2 or 3, wherein each user data comprises an item ID, and wherein filtering the plurality of user data comprises:
calculating the number of users generating operation relation with the commodity aiming at the commodity corresponding to each commodity ID;
determining the commodities of which the number of the users is not within a threshold interval as commodities to be filtered;
and filtering user data where the commodity ID corresponding to the commodity to be filtered is located.
5. The method according to claim 1, wherein the calculating, for each user ID, a weight of each operation behavior corresponding to the user ID on the basis of the user data to be processed comprises:
screening out user data to be processed corresponding to each user ID aiming at each user ID;
aiming at each user ID, a decision matrix corresponding to the user ID is constructed through the to-be-processed user data corresponding to the user ID
Figure FDA0002289571130000021
Wherein d is1、…、dkFor each category of operation behavior, s1、…、snIs a commodity product and is characterized by that,
Figure FDA0002289571130000022
for the user corresponding to the user ID to aim at snMerchandise item dkThe times of operation behaviors, n and k are positive integers;
and calculating the weight of each operation behavior corresponding to each user ID through the decision matrix corresponding to the user ID aiming at each user ID.
6. The method according to claim 5, wherein the calculating, for each user ID, a weight of each operation behavior corresponding to the user ID through a decision matrix corresponding to the user ID comprises:
for each user ID, carrying out normalization processing on the decision matrix corresponding to the user ID to obtain a normalization matrix, wherein each element in the normalization matrix is
Figure FDA0002289571130000023
For each user ID, based on a formula
Figure FDA0002289571130000024
Calculating the feature proportion of each element in the normalized matrix corresponding to the user ID to obtain a feature proportion matrix;
for each user ID, based on a formula
Figure FDA0002289571130000025
Calculating the entropy value of the operation behavior corresponding to each row of elements in the characteristic proportion matrix corresponding to the user ID to obtain the entropy value of each operation behavior aiming at the user ID;
for each user ID, based on formula dj=1-ejCalculating a difference coefficient of an entropy value of each operation behavior corresponding to the user ID;
for each user ID, based on a formula
Figure FDA0002289571130000031
Calculating the entropy weight of each operation behavior corresponding to the user ID, and determining the entropy weight as weight;
wherein i, j and m are positive integers.
7. The method according to claim 6, wherein the calculating, for each user ID, a score for each item corresponding to the user based on the weight corresponding to the user ID comprises:
for each user ID, based on a formula
Figure FDA0002289571130000032
Calculating the scores of the commodities corresponding to the user;
wherein, I (u)i→ij) Is a binary function when I (u)i→ij) When 1, the user ID is characterized as uiApplication of time correspondenceHousehold to commodity ijThere is an operation behavior when I (u)i→ij) When 0, the user ID is characterized as uiCorresponding user to commodity ijThere is no operational behavior.
8. A recommendation device for recommending an item for a user, the device comprising: the device comprises an acquisition module, a calculation module and a determination module;
the acquisition module is used for acquiring to-be-processed user data of the e-commerce platform, wherein each to-be-processed user data comprises a user ID and an operation behavior of a user on a commodity;
the calculation module is used for calculating the weight of each operation behavior corresponding to each user ID on the basis of the user data to be processed aiming at each user ID;
the calculation module is further used for calculating the scores of the commodities corresponding to the user according to the weight corresponding to the user ID aiming at each user ID;
and the determining module is used for determining the recommended commodity corresponding to each user ID according to the score of each commodity corresponding to each user ID and a collaborative filtering algorithm.
9. An electronic device, comprising: a memory and a processor, the memory and the processor connected;
the memory is used for storing programs;
the processor calls a program stored in the memory to perform the method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored which, when executed by a computer, performs the method of any one of claims 1-7.
CN201911177371.6A 2019-11-26 2019-11-26 Recommendation method and device, electronic equipment and computer-readable storage medium Pending CN110956530A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911177371.6A CN110956530A (en) 2019-11-26 2019-11-26 Recommendation method and device, electronic equipment and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911177371.6A CN110956530A (en) 2019-11-26 2019-11-26 Recommendation method and device, electronic equipment and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN110956530A true CN110956530A (en) 2020-04-03

Family

ID=69976964

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911177371.6A Pending CN110956530A (en) 2019-11-26 2019-11-26 Recommendation method and device, electronic equipment and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN110956530A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111681086A (en) * 2020-06-16 2020-09-18 上海风秩科技有限公司 Commodity recommendation method and device, computer equipment and readable storage medium
CN116503126A (en) * 2023-03-22 2023-07-28 中国船舶集团有限公司综合技术经济研究院 Product recommendation method and device, electronic equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103824213A (en) * 2014-03-13 2014-05-28 北京理工大学 Individualized recommendation method based on user preferences and commodity properties
CN106570008A (en) * 2015-10-09 2017-04-19 阿里巴巴集团控股有限公司 Recommendation method and device
CN106651546A (en) * 2017-01-03 2017-05-10 重庆邮电大学 Intelligent community oriented electronic commerce information recommendation method
CN107123014A (en) * 2017-03-03 2017-09-01 德基网络科技南京有限公司 One kind is based on e-commerce platform personalized recommendation algorithm
CN107766484A (en) * 2017-10-16 2018-03-06 南京师范大学 The knowledge chain that a kind of learning objective is oriented to recommends method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103824213A (en) * 2014-03-13 2014-05-28 北京理工大学 Individualized recommendation method based on user preferences and commodity properties
CN106570008A (en) * 2015-10-09 2017-04-19 阿里巴巴集团控股有限公司 Recommendation method and device
CN106651546A (en) * 2017-01-03 2017-05-10 重庆邮电大学 Intelligent community oriented electronic commerce information recommendation method
CN107123014A (en) * 2017-03-03 2017-09-01 德基网络科技南京有限公司 One kind is based on e-commerce platform personalized recommendation algorithm
CN107766484A (en) * 2017-10-16 2018-03-06 南京师范大学 The knowledge chain that a kind of learning objective is oriented to recommends method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
曹建新等: "用户特征协同过滤方法在个性化商品推荐中的应用研究", 《电脑知识与技术》 *
熊聪聪等: "基于协同过滤的美食推荐算法", 《计算机应用研究》 *
贺超波等, 中山大学出版社 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111681086A (en) * 2020-06-16 2020-09-18 上海风秩科技有限公司 Commodity recommendation method and device, computer equipment and readable storage medium
CN116503126A (en) * 2023-03-22 2023-07-28 中国船舶集团有限公司综合技术经济研究院 Product recommendation method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN109559208B (en) Information recommendation method, server and computer readable medium
US11087413B2 (en) Identity mapping between commerce customers and social media users
US11170395B2 (en) Digital banking platform and architecture
US10846775B1 (en) Identifying item recommendations through recognized navigational patterns
CN105701191B (en) Pushed information click rate estimation method and device
JP6422617B2 (en) Network access operation identification program, server, and storage medium
US9672556B2 (en) Systems and methods for programatically classifying text using topic classification
CN107464132B (en) Similar user mining method and device and electronic equipment
CN108805598B (en) Similarity information determination method, server and computer-readable storage medium
WO2019196261A1 (en) Method for pushing protocol file, and terminal device
TW201501059A (en) Method and system for recommending information
CN110197404B (en) Personalized long-tail commodity recommendation method and system capable of reducing popularity deviation
US9542480B2 (en) Systems and methods for programatically classifying text using category filtration
US20200098031A1 (en) Product recommending apparatus and non-transitory computer readable medium
WO2020063114A1 (en) Method and apparatus for detecting security awareness of user
CN111242709A (en) Message pushing method and device, equipment and storage medium thereof
CN111611496A (en) Product recommendation method and device
CN111125376A (en) Knowledge graph generation method and device, data processing equipment and storage medium
CN104111969B (en) The method and system of a kind of similarity measurement
CN110956530A (en) Recommendation method and device, electronic equipment and computer-readable storage medium
TWI634499B (en) Data analysis method, system and non-transitory computer readable medium
CN110599281A (en) Method and device for determining target shop
CN106952111B (en) Personalized recommendation method and device
CN105512914B (en) Information processing method and electronic equipment
CN107239456B (en) Age group identification method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200403