Product recommendation method, device, electronic device and computer-readable storage medium
By constructing a key pair for an asymmetric encryption algorithm and using the public key to encrypt user rating sequences, the problem of similarity calculation when adding new products to the recommendation system is solved, enabling cross-platform product recommendations, improving the flexibility and convenience of recommendations, and protecting user privacy.
Patent Information
- Application Number
- CN202011385258.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-01
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2040-12-01
AI Technical Summary
Existing technologies cannot effectively recommend new products when adding them to the recommendation system because they lack users' historical rating data and cannot calculate the similarity between users. Furthermore, using third-party data for recommendations may leak privacy and limit the scope of application.
By constructing a key pair for an asymmetric encryption algorithm, encrypting user rating sequences using the public key, and calculating similarity on the server side to obtain a user similarity set, cross-platform product recommendations are achieved while protecting user privacy.
This approach enhances the flexibility and convenience of product recommendations without leaking user data, expands the scope of recommendation applications, and ensures data privacy and security.
Smart Images

Figure CN112446765B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to a product recommendation method, device, electronic device and computer-readable storage medium. Background Art
[0002] With the rapid development of big data and e-commerce, recommendation systems have become an important tool for companies to improve their market competitiveness. However, when a new product is added, there is no historical rating data of the product in the system. Therefore, the similarity between users cannot be calculated according to traditional algorithms, and recommendations cannot be made to users.
[0003] Currently, a feasible approach is to use the data of the other party to make collaborative product recommendations. For example, if product F is newly added to platform A, but product F has been sold on platform B for some time, the data in platform B can be used to recommend products to users on platform A. However, this method will leak data privacy and is only applicable to collaborative product recommendations on two platforms that share data. It has a narrow scope of application and is not conducive to promotion. Summary of the invention
[0004] The present invention provides a product recommendation method, device, electronic device and computer-readable storage medium, the main purpose of which is to improve the flexibility and convenience of product recommendation.
[0005] To achieve the above object, the present invention provides a product recommendation method, which is applied to a first client and includes:
[0006] Acquire a first product set, receive a second product set sent by a second client, and filter the first product set and the second product set to obtain a target product sequence, wherein both the first product set and the second product set include products to be recommended;
[0007] Acquire a first user set, and construct a first product rating sequence for each user in the first user set according to the target product sequence;
[0008] Receive the public key sent by the server, and use the public key to perform an encryption operation on each of the first product rating sequences to obtain a corresponding first encrypted product sequence;
[0009] Sending all the first encrypted product sequences to the server;
[0010] receiving an initial user recommendation sequence sent by the second client, and performing a restoration operation on the initial user recommendation sequence to obtain a recommended user sequence;
[0011] The product to be recommended is pushed to the terminal device of each user in the recommended user sequence.
[0012] Optionally, using the public key to perform an encryption operation on each of the first product rating sequences to obtain a corresponding first encrypted product sequence includes:
[0013] Using a pre-built first user name mapping table to perform a user name replacement operation on the first product rating sequence to obtain a first standard product sequence;
[0014] The first standard product sequence is encrypted using the public key to obtain the corresponding first encrypted product sequence.
[0015] To achieve the above object, the present invention further provides a product recommendation method, which is applied to a second client and includes:
[0016] Acquire the second product set, and send the second product set to the first client;
[0017] receiving the target product sequence sent by the first client;
[0018] Acquire a second user set, and construct a second product rating sequence for each user in the second user set according to the target product sequence;
[0019] Receive the public key sent by the server, and use the public key to perform an encryption operation on each of the second product rating sequences to obtain a corresponding second encrypted product sequence;
[0020] Sending all the second encrypted product sequences to the server, and receiving the user similarity set sent by the server;
[0021] The recommendation priority values are calculated and screened according to the user similarity set and the second user set to obtain an initial user recommendation sequence, and the initial user recommendation sequence is sent to the first client.
[0022] Optionally, the calculating and screening the recommendation priority values according to the user similarity set and the second user set to obtain an initial user recommendation sequence includes:
[0023] Obtain users in the second user set whose product ratings include the product to be recommended, to obtain a recommended user set;
[0024] Performing a username restoration operation on the user similarity set using a preset second username mapping table to obtain a target similarity set;
[0025] The recommendation priority values are calculated and screened according to the target similarity set and the recommended user set to obtain an initial user recommendation sequence.
[0026] To achieve the above object, the present invention further provides a product recommendation method, which is applied to a server and includes:
[0027] Constructing a key pair using an asymmetric encryption algorithm, and distributing a public key in the key pair to the first client and the second client;
[0028] Receive all the first encrypted product sequences and
[0029] All second encrypted product sequences sent by the second client;
[0030] Decrypt all the first encrypted product sequences using the private key in the key pair to obtain the corresponding first decrypted product sequences and
[0031] Performing a decryption operation on all received second encrypted product sequences to obtain corresponding second decrypted product sequences;
[0032] Similarity calculation is performed according to all the first decryption product sequences and all the second decryption product sequences to obtain the user similarity set, and the user similarity set is sent to the second client.
[0033] In order to solve the above problem, the present invention further provides a product recommendation device, which runs on a first client and includes:
[0034] A product screening module, configured to obtain a first product set, receive a second product set sent by a second client, and screen the first product set and the second product set to obtain a target product sequence, wherein both the first product set and the second product set contain products to be recommended;
[0035] The encryption and restoration module is used to obtain a first user set, construct a first product rating sequence for each user in the first user set according to the target product sequence; receive a public key sent by the server, use the public key to perform an encryption operation on each of the first product rating sequences to obtain a corresponding first encrypted product sequence, and send all the first encrypted product sequences to the server; receive an initial user recommendation sequence sent by the second client, perform a restoration operation on the initial user recommendation sequence to obtain a recommended user sequence;
[0036] The product push module is used to push the product to be recommended to the terminal device of each user in the recommended user sequence.
[0037] In order to solve the above problem, the present invention further provides a product recommendation device, which runs on a second client and includes:
[0038] The scoring calculation module is used to obtain the second product set and send the second product set to the first client; receive the target product sequence sent by the first client; obtain the second user set, and construct a second product scoring sequence for each user in the second user set according to the target product sequence; receive the public key sent by the server, and use the public key to encrypt each second product scoring sequence to obtain a corresponding second encrypted product sequence; send all the second encrypted product sequences to the server, and receive the user similarity set sent by the server;
[0039] The priority value calculation and screening module is used to calculate and screen the recommendation priority values according to the user similarity set and the second user set to obtain an initial user recommendation sequence, and send the initial user recommendation sequence to the first client.
[0040] In order to solve the above problem, the present invention further provides a product recommendation device, which runs on a server and includes:
[0041] A key distribution module, used to construct a key pair using an asymmetric encryption algorithm, and distribute the public key in the key pair to the first client and the second client;
[0042] A similarity calculation module is used to receive all the first encrypted product sequences sent by the first client and all the second encrypted product sequences sent by the second client; use the private key in the key pair to decrypt all the first encrypted product sequences to obtain the corresponding first decrypted product sequences and decrypt all the received second encrypted product sequences to obtain the corresponding second decrypted product sequences; perform similarity calculation based on all the first decrypted product sequences and all the second decrypted product sequences to obtain the user similarity set, and send the user similarity set to the second client.
[0043] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0044] a memory storing at least one computer program; and
[0045] The processor executes the computer program stored in the memory to implement the product recommendation method described above.
[0046] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the product recommendation method described above.
[0047] The embodiment of the present invention performs screening according to the first product set and the second product set to obtain a target product sequence; constructs a first product rating sequence for each user in the first user set according to the target product sequence, and constructs a second product rating sequence for each user in the second user set according to the target product sequence; encrypts and calculates similarity values of each user in the first user set and each user in the second user set according to the first product rating sequence and the second product rating sequence to obtain a user similarity set; calculates and screens recommendation priority values according to the user similarity set and the second user set to obtain a recommended user sequence; pushes the product to be recommended to the terminal device of each user in the recommended user sequence. The embodiment of the present invention encrypts and calculates the similarity of both users, and realizes collaborative recommendation of new products without leaking data of both parties, thereby improving the flexibility and convenience of product recommendation. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A system architecture diagram of a product recommendation provided by an embodiment of the present invention;
[0049] Figure 2 A schematic diagram of a process of applying a product recommendation method provided by an embodiment of the present invention to a first client;
[0050] Figure 3 A schematic diagram of a process of applying a product recommendation method provided by an embodiment of the present invention to a second client;
[0051] Figure 4 A schematic diagram of a process of applying a product recommendation method provided by an embodiment of the present invention to a server; Figure 5 A schematic diagram of a module of a product recommendation device provided by an embodiment of the present invention applied to a first client;
[0052] Figure 6 A schematic diagram of a module of a product recommendation device provided by an embodiment of the present invention applied to a second client;
[0053] Figure 7 A schematic diagram of a module of a product recommendation device provided by an embodiment of the present invention applied to a server;
[0054] Figure 8 A schematic diagram of the internal structure of an electronic device for implementing a product recommendation method provided by an embodiment of the present invention;
[0055] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0056] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0057] The embodiment of the present invention provides a product recommendation method. The execution subject of the product recommendation method includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the product recommendation method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
[0058] The present invention provides a product recommendation method. Figure 1 As shown, in an embodiment of the present invention, the product recommendation method can be implemented by a product recommendation system, and the product recommendation system includes a first client 1, a second client 2, and a server 3. Among them, the first client 1 is a product monitoring program of a first shopping platform, and the second client 2 is a product monitoring program of a second platform. In an embodiment of the present invention, a new product on the shelves of the first client 1 is recommended according to the user purchase information of a certain product that has been sold in the second client 2. For example, the first client 1 knows that the user's preference for the newly-listed product A cannot be recommended to the user in the first client 1, but the product A has been sold in the second client 2, and the user recommendation of the product A in the first client 1 is performed according to the user purchase information of the product A in the second client 2.
[0059] In detail, the first client 1 obtains a first product set and the second client 2 obtains a second product set, the first client 1 performs screening according to the first product set and the second product set to obtain a target product sequence, wherein the first product set and the second product set both contain products to be recommended; the first client 1 obtains a first user set and the second client 2 obtains a second user set, the first client 1 constructs a first product rating sequence for each user in the first user set according to the target product sequence, and the second client 2 constructs a second product rating sequence for each user in the second user set according to the target product sequence; the server encrypts and calculates the similarity value of each user in the first user set and each user in the second user set according to the first product rating sequence and the second product rating sequence to obtain a user similarity set; the second client 2 performs recommendation priority value calculation and screening according to the user similarity set and the second user set to obtain an initial user recommendation sequence; the first client 1 performs a restore operation on the initial user recommendation sequence to obtain a recommended user sequence; the first client 1 pushes the products to be recommended to the terminal device of each user in the recommended user sequence.
[0060] Reference Figure 2FIG. 1 is a flow chart of a product recommendation method applied to a first client provided by an embodiment of the present invention. In the embodiment of the present invention, the product recommendation method includes:
[0061] S11, obtaining a first product set, receiving a second product set sent by a second client, and filtering according to the first product set and the second product set to obtain a target product sequence, wherein both the first product set and the second product set include products to be recommended;
[0062] In an embodiment of the present invention, the first product set and the second product set are product sets sold by different companies, wherein the products include virtual products and physical products. For example, the first product set is a set of products sold by Company A, and the second product set is a set of products sold by Company B.
[0063] Furthermore, in an embodiment of the present invention, the products to be recommended in the first product set are eliminated to obtain a third product set, wherein the products to be recommended are products that are newly listed and unsold in the first product set, and the products to be recommended are products that have been sold in the second product set; the same products in the second product set and the third product set are screened out and randomly sorted to obtain a target product sequence, for example: the third product set contains products B, C, and D, and the second product set contains products C, D, and F. The same products are C and D. C and D are randomly sorted to obtain a target product sequence of product No. 1 C and product No. 2 D.
[0064] S12, obtaining a first user set, and constructing a first product rating sequence for each user in the first user set according to the target product sequence;
[0065] In the embodiment of the present invention, the first user set is a collection of user information of the company corresponding to the first product set, wherein the user information includes a user name and a product rating of a product purchased by the user.
[0066] Furthermore, in the embodiment of the present invention, constructing the first product rating sequence of each user in the first user set according to the target product sequence includes:
[0067] Step A: acquiring the product rating corresponding to each user in the first user set according to the target product sequence, and obtaining the corresponding initial first product rating sequence;
[0068] For example: the target product sequence is product No. 1 C and product No. 2 D. The first user set includes user A, and user A's product ratings are product C 4.5 points and product F 3 points. The initial first product rating sequence of user A is product No. 1 C 4.5 points and product No. 2 D score is missing.
[0069] Step B: Filling the missing scores in the initial first product rating sequence to obtain the first product rating sequence.
[0070] Preferably, in the embodiment of the present invention, the median filling method is used to fill the missing scores of the initial first product rating sequence to obtain the first product rating sequence. For example, if the initial first product rating sequence of user A is that product C 1 has 4.5 points and product D 2 has missing scores, and the median score of product D in the first user set is 3 points, then the missing scores are filled in the initial first product rating sequence of user A, and the first product rating sequence of user A is that product C 1 has 4.5 points and product D 2 has 3 points.
[0071] S13, receiving a public key sent by the server, using the public key to perform an encryption operation on each of the first product rating sequences to obtain a corresponding first encrypted product sequence, and sending all the first encrypted product sequences to the server;
[0072] In the embodiment of the present invention, in order to protect the privacy of the user information of the first client from being leaked, the public key sent by the receiving server is used to perform an encryption operation on each of the first product rating sequences using the public key to obtain a corresponding first encrypted product sequence.
[0073] In detail, in an embodiment of the present invention, the use of the public key to perform an encryption operation on each of the first product rating sequences to obtain a corresponding first encrypted product sequence includes: using a pre-constructed first user name mapping table to perform a user name replacement operation on the first product rating sequence to obtain a first standard product sequence; wherein the first user name mapping table is a table containing virtual user name mappings corresponding to each user name in the first user set, for example: the first product rating sequence is the data of Company A, and Company A uses the first user name mapping table to replace the user name corresponding to the first product rating sequence with a preset virtual user name to obtain a first standard product sequence. Further, in order to further ensure the security of the data, the first standard product sequence is encrypted using the public key to obtain the corresponding first encrypted product sequence. Further, in order to use the first encrypted product sequence for subsequent product recommendations, the embodiment of the present invention sends all the first encrypted product sequences to the server.
[0074] S14, receiving the initial user recommendation sequence sent by the second client, and performing a restoration operation on the initial user recommendation sequence to obtain a recommended user sequence;
[0075] In detail, in an embodiment of the present invention, the user names of the users in the initial user recommendation sequence are virtual user names in the first user name mapping table, and the first user name mapping table is also needed to perform a username restoration operation on the initial user recommendation sequence to replace the virtual user names with real user names to obtain a recommended user sequence.
[0076] For example: the initial user recommendation sequence includes a virtual user name Zhang San, and the real user name corresponding to the virtual user name Zhang San in the first user name mapping table is Li Si, then the second user name mapping table is used to replace the user name Zhang San in the initial user recommendation sequence with the user name Li Si to obtain the recommended user sequence.
[0077] In another embodiment of the present invention, in order to protect the privacy of data, the recommended user sequence can be stored in a blockchain node.
[0078] S15: Push the product to be recommended to the terminal device of each user in the recommended user sequence.
[0079] In the embodiment of the present invention, the to-be-recommended product is pushed to the terminal device of each user in the recommended user sequence, and the terminal device includes but is not limited to: a mobile phone, a computer, and a tablet.
[0080] See also Figure 3 FIG. 1 is a flow chart of a product recommendation method applied to a second client provided by an embodiment of the present invention. In this embodiment, the product recommendation method includes:
[0081] S21, obtaining the second product set, and sending the second product set to the first client;
[0082] In the embodiment of the present invention, in order for the first client to recommend the product to be recommended, the second product set is sent to the first client.
[0083] S22, receiving the target product sequence sent by the first client;
[0084] In order to perform subsequent product recommendation calculations, the embodiment of the present invention receives the target product sequence sent by the first client.
[0085] S23, obtaining a second user set, and constructing a second product rating sequence for each user in the second user set according to the target product sequence;
[0086] In this embodiment of the present invention, the second user set is a collection of user information of the company corresponding to the second product set. Furthermore, the method of constructing a second product rating sequence for each user in the second user set based on the target product sequence is the same as the method described in S12 and will not be repeated here.
[0087] S24, receiving a public key sent by the server, and using the public key to perform an encryption operation on each of the second product rating sequences to obtain a corresponding second encrypted product sequence;
[0088] In an embodiment of the present invention, in order to protect the privacy of user information of the second client from being leaked, a public key sent by the server is received, and each of the second product rating sequences is encrypted using the public key to obtain a corresponding second encrypted product sequence, including: using a pre-built second user name mapping table to perform a user name replacement operation on the second product rating sequence to obtain a second standard product sequence, wherein the second user name mapping table is a table containing virtual user name mappings corresponding to each user name in the second user set, and the second standard product sequence is encrypted using the public key to obtain a corresponding second encrypted product sequence.
[0089] S25, sending all the second encrypted product sequences to the server, and receiving the user similarity set sent by the server;
[0090] In order to facilitate the server to calculate the user similarity set, the embodiment of the present invention sends all the second encrypted product sequences to the server, and receives the user similarity set sent by the server.
[0091] S26. Calculate and screen recommendation priority values according to the user similarity set and the second user set to obtain an initial user recommendation sequence, and send the initial user recommendation sequence to the first client.
[0092] In an embodiment of the present invention, only users in the second user set who have purchased the product to be recommended can help the first client to recommend the product to be recommended. Therefore, users whose product ratings include the product to be recommended in the second user set are obtained to obtain a recommended user set; further, in order to facilitate the subsequent screening of the similarities corresponding to the recommended user set in the user similarity set, better product recommendations are made to users in the first user set, such as: user A in the recommended user set has purchased product D to be recommended, and the similarity between user A and user B in the first user set is high, then the possibility of user B purchasing product D to be recommended is also high, therefore, it is necessary to find the similarities corresponding to the users in the recommended user set, so the user name restoration operation is performed on the user similarity set using the second user name mapping table to obtain a target similarity set; further, the higher the similarity between two users, the more similar the interests of the two users in the same product are; further, the product rating of one user for a product is used to judge the interest of another user in the product to make product recommendations, in order to calculate the users in the first user set who can recommend the product to be recommended, the recommendation priority value is calculated and screened according to the target similarity set and the recommended user set to obtain an initial user recommendation sequence. The method includes: calculating the recommendation priority value according to the target similarity set and the recommended user set using a preset priority value algorithm to obtain a recommendation priority value set; sorting the recommendation priority value set to obtain a standard recommendation priority value set; obtaining an initial user recommendation sequence from the users corresponding to the recommendation priority value set within the preset ranking range of the standard recommendation priority value set. For example, the company corresponding to the first user set is A, and the company corresponding to the second user set is B. It is proved that B has the similarity value of user y in the recommended user set in the target similarity set and the similarity value of user y in the recommended user set in the target similarity set. The product rating of the recommended product is calculated for the corresponding user The recommendation priority value of the recommended priority value is summarized, and a recommendation priority value set is obtained. The recommendation priority value set is sorted from large to small to obtain a standard recommendation priority value set. Finally, the user names corresponding to the first N recommendation priority values with the highest recommendation priority values in the standard recommendation priority value set are summarized to obtain an initial user recommendation sequence. The priority value algorithm is as follows:
[0093]
[0094] Wherein, n is the number of users in the recommended user set, y is a user in the recommended user set, j is a product to be recommended, and x is a user corresponding to the virtual user name x in the first user name mapping table. The similarity value between user y and user x in the target similarity set, For users Product ratings of the recommended products, is the recommendation priority value of the product to be recommended to user x.
[0095] Furthermore, the user name in the initial user recommendation sequence is also virtualized by the first client. In order to restore the virtual user name, the initial user recommendation sequence is sent to the first client.
[0096] See also Figure 4 FIG. 1 is a flow chart of a product recommendation method applied to a server provided by an embodiment of the present invention. In this embodiment, the product recommendation method includes:
[0097] S31, constructing a key pair using an asymmetric encryption algorithm, and distributing a public key in the key pair to the first client and the second client;
[0098] In order to ensure the security of data interaction between the first client and the second client and the server, the embodiment of the present invention uses an asymmetric encryption algorithm to construct a key pair, and distributes the public key in the key pair to the first client and the second client.
[0099] S32, receiving all the first encrypted product sequences and
[0100] All second encrypted product sequences sent by the second client;
[0101] S33, using the private key in the key pair to decrypt all the first encrypted product sequences, and obtaining the corresponding first decrypted product sequences and
[0102] Performing a decryption operation on all received second encrypted product sequences to obtain corresponding second decrypted product sequences;
[0103] S34: Perform similarity calculation based on all the first decryption product sequences and all the second decryption product sequences to obtain the user similarity set, and send the user similarity set to the second client.
[0104] For example: the first standard product rating sequence is the data of Company A, and the second standard product rating sequence is the data of Company B. The server is a third-party server trusted by both Companies A and B. The server constructs a key pair, distributes the public key in the key pair to the first client of Company A and the second client of Company B, and retains the private key in the key pair. Company A uses the obtained public key to encrypt the first standard product sequence to obtain the corresponding first encrypted product sequence, and Company B uses the obtained public key to encrypt the second standard product sequence to obtain the corresponding second encrypted product sequence; all the first encrypted product sequences encrypted by Company A and all the second encrypted product sequences encrypted by Company B received by the server are decrypted using the private key to obtain the corresponding first decrypted product sequence and the corresponding second decrypted product sequence; the server performs similarity calculation based on all the first decrypted product sequences and all the second decrypted product sequences to obtain the user similarity set.
[0105] In detail, in the embodiment of the present invention, the similarity between two users is calculated based on the similarity of their ratings on the same product, and the similarity is calculated using the following formula:
[0106]
[0107] in, represents the i-th product rating in the first decrypted product sequence corresponding to user X, Score the i-th product in the second decrypted product sequence corresponding to user Y, Indicates the similarity between users X and Y.
[0108] like Figure 5 , which is a functional module diagram of a product recommendation device applied to a first client of the present invention.
[0109] The product recommendation device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the product recommendation device can include a product screening module 101, an encryption and restoration module 102, and a product push module 103. The module described in the present invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, and is stored in the memory of the electronic device.
[0110] In this embodiment, the functions of each module / unit are as follows:
[0111] The product screening module 101 is used to obtain a first product set, receive a second product set sent by a second client, and screen according to the first product set and the second product set to obtain a target product sequence, wherein the first product set and the second product set both contain products to be recommended.
[0112] In an embodiment of the present invention, the first product set and the second product set are product sets sold by different companies, wherein the products include virtual products and physical products. For example, the first product set is a set of products sold by Company A, and the second product set is a set of products sold by Company B.
[0113] Furthermore, in an embodiment of the present invention, the product screening module 101 eliminates the products to be recommended in the first product set to obtain a third product set, wherein the products to be recommended are products that are newly listed and unsold in the first product set, and the products to be recommended are products that have been sold in the second product set; the product screening module 101 screens out the same products in the second product set and the third product set and sorts them randomly to obtain a target product sequence, for example: the third product set contains products B, C, and D, and the second product set contains products C, D, and F. The same products are C and D, and C and D are randomly sorted to obtain a target product sequence of product No. 1 C and product No. 2 D.
[0114] The encryption and restoration module 102 is used to obtain a first user set, construct a first product rating sequence for each user in the first user set according to the target product sequence; receive a public key sent by the server, use the public key to perform an encryption operation on each of the first product rating sequences to obtain a corresponding first encrypted product sequence, and send all the first encrypted product sequences to the server; receive an initial user recommendation sequence sent by the second client, restore the initial user recommendation sequence to obtain a recommended user sequence.
[0115] In the embodiment of the present invention, the first user set is a collection of user information of the company corresponding to the first product set, wherein the user information includes a user name and a product rating of a product purchased by the user.
[0116] Furthermore, in the embodiment of the present invention, the encryption restoration module 102 constructs the first product rating sequence of each user in the first user set by using the following means, including:
[0117] Acquire the product rating corresponding to each user in the first user set according to the target product sequence to obtain a corresponding initial first product rating sequence;
[0118] For example: the target product sequence is product No. 1 C and product No. 2 D. The first user set includes user A, and user A's product ratings are product C 4.5 points and product F 3 points. The initial first product rating sequence of user A is product No. 1 C 4.5 points and product No. 2 D score is missing.
[0119] The initial first product rating sequence is filled with missing ratings to obtain the first product rating sequence.
[0120] Preferably, in the embodiment of the present invention, the median filling method is used to fill the missing scores of the initial first product rating sequence to obtain the first product rating sequence. For example, if the initial first product rating sequence of user A is that product C 1 has 4.5 points and product D 2 has missing scores, and the median score of product D in the first user set is 3 points, then the missing scores are filled in the initial first product rating sequence of user A, and the first product rating sequence of user A is that product C 1 has 4.5 points and product D 2 has 3 points.
[0121] In the embodiment of the present invention, in order to protect the privacy of the user information of the first client from being leaked, the encryption and restoration module 102 receives the public key sent by the server, and uses the public key to encrypt each of the first product rating sequences to obtain a corresponding first encrypted product sequence.
[0122] In detail, in an embodiment of the present invention, the encryption and restoration module 102 uses the following means to perform an encryption operation on each of the first product rating sequences to obtain a corresponding first encrypted product sequence, including: using a pre-constructed first user name mapping table to perform a user name replacement operation on the first product rating sequence to obtain a first standard product sequence; wherein the first user name mapping table is a table containing virtual user name mappings corresponding to each user name in the first user set, for example: the first product rating sequence is the data of Company A, and Company A uses the first user name mapping table to replace the user name corresponding to the first product rating sequence with a preset virtual user name to obtain a first standard product sequence. Further, in order to further ensure the security of the data, the first standard product sequence is encrypted using the public key to obtain the corresponding first encrypted product sequence. Further, in order to use the first encrypted product sequence for subsequent product recommendations, the embodiment of the present invention sends all the first encrypted product sequences to the server.
[0123] In detail, in an embodiment of the present invention, the user names of the users in the initial user recommendation sequence are virtual user names in the first user name mapping table, and the encryption restoration module 102 also needs to use the first user name mapping table to perform a user name restoration operation on the initial user recommendation sequence, replacing the virtual user names with real user names to obtain a recommended user sequence.
[0124] For example: the initial user recommendation sequence includes a virtual user name Zhang San, and the real user name corresponding to the virtual user name Zhang San in the first user name mapping table is Li Si, then the second user name mapping table is used to replace the user name Zhang San in the initial user recommendation sequence with the user name Li Si to obtain the recommended user sequence.
[0125] In another embodiment of the present invention, in order to protect the privacy of data, the recommended user sequence can be stored in a blockchain node.
[0126] The product push module 103 is used to push the to-be-recommended product to the terminal device of each user in the recommended user sequence.
[0127] In the embodiment of the present invention, the to-be-recommended product is pushed to the terminal device of each user in the recommended user sequence, and the terminal device includes but is not limited to: a mobile phone, a computer, and a tablet.
[0128] like Figure 6 , which is a functional module diagram of a product recommendation device applied to a second client of the present invention.
[0129] The product recommendation device 200 of the present invention can be installed in an electronic device. According to the functions to be implemented, the product recommendation device can include a score calculation module 201 and a priority value calculation and screening module 202. The module described in the present invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, and is stored in the memory of the electronic device.
[0130] In this embodiment, the functions of each module / unit are as follows:
[0131] The rating calculation module 201 is used to obtain the second product set and send the second product set to the first client; receive the target product sequence sent by the first client; obtain the second user set, and construct a second product rating sequence for each user in the second user set according to the target product sequence; receive the public key sent by the server, and use the public key to encrypt each second product rating sequence to obtain a corresponding second encrypted product sequence; send all the second encrypted product sequences to the server, and receive the user similarity set sent by the server;
[0132] In the embodiment of the present invention, in order for the first client to recommend the product to be recommended, the score calculation module 201 sends the second product set to the first client.
[0133] In order to perform subsequent product recommendation calculation, the score calculation module 201 in the embodiment of the present invention receives the target product sequence sent by the first client.
[0134] In the embodiment of the present invention, the second user set is a collection of user information of the company corresponding to the second product set. Further, the rating calculation module 201 constructs a second product rating sequence for each user in the second user set according to the target product sequence.
[0135] In an embodiment of the present invention, in order to protect the privacy of user information of the second client from being leaked, the public key sent by the receiving server is received, and the score calculation module 201 uses the following means to perform an encryption operation on each of the second product score sequences to obtain a corresponding second encrypted product sequence, including: using a pre-built second user name mapping table to perform a username replacement operation on the second product score sequence to obtain a second standard product sequence, wherein the second user name mapping table is a table containing virtual user name mappings corresponding to each user name in the second user set, and the second standard product sequence is encrypted using the public key to obtain a corresponding second encrypted product sequence.
[0136] In order to facilitate the server to calculate the user similarity set, the score calculation module 201 in the embodiment of the present invention sends all the second encrypted product sequences to the server, and receives the user similarity set sent by the server.
[0137] The priority value calculation and screening module 202 is used to calculate and screen the recommendation priority values according to the user similarity set and the second user set to obtain an initial user recommendation sequence, and send the initial user recommendation sequence to the first client.
[0138] In the embodiment of the present invention, only users who have purchased the product to be recommended in the second user set can help the first client to recommend the product to be recommended. Therefore, the priority value calculation and screening module 202 obtains users whose product ratings in the second user set include the product to be recommended, and obtains the recommended user set; further, in order to facilitate the subsequent screening of the similarities corresponding to the recommended user set in the user similarity set to better recommend products to users in the first user set, such as: user A in the recommended user set has purchased product D to be recommended, and the similarity between user A and user B in the first user set is high, then the possibility of user B purchasing product D to be recommended is also high. Therefore, it is necessary to find the similarities corresponding to the users in the recommended user set, so the priority value calculation and screening module 202 uses the second user name mapping table to perform user name screening on the user similarity set. The original operation is performed to obtain the target similarity set; further, the higher the similarity between two users, the more similar the interests of the two users in the same product are; further, the product rating of a user for a product is used to judge the interest of another user in the product to make product recommendations. In order to calculate the users in the first user set who can recommend the product to be recommended, the priority value calculation and screening module 202 calculates and screens the recommendation priority values according to the target similarity set and the recommended user set to obtain an initial user recommendation sequence, including: calculating the recommendation priority value according to the target similarity set and the recommended user set using a preset priority value algorithm to obtain a recommendation priority value set; sorting the recommendation priority value set to obtain a standard recommendation priority value set; obtaining the initial user recommendation sequence from the users corresponding to the recommendation priority value set within the preset ranking range of the standard recommendation priority value set. For example: the company corresponding to the first user set is A, and the company corresponding to the second user set is B. It is proved that B is based on the similarity value of user y in the recommended user set in the target similarity set and the similarity of user y in the recommended user set. The product rating of the recommended product is calculated for the corresponding user The recommendation priority value of the recommended priority value is summarized, and a recommendation priority value set is obtained. The recommendation priority value set is sorted from large to small to obtain a standard recommendation priority value set. Finally, the user names corresponding to the first N recommendation priority values with the highest recommendation priority values in the standard recommendation priority value set are summarized to obtain an initial user recommendation sequence. The priority value algorithm is as follows:
[0139]
[0140] Wherein, n is the number of users in the recommended user set, y is a user in the recommended user set, j is a product to be recommended, and x is a user corresponding to the virtual user name x in the first user name mapping table. The similarity value between user y and user x in the target similarity set, For users Product ratings of the recommended products, is the recommendation priority value of the product to be recommended to user x.
[0141] Furthermore, the user names in the initial user recommendation sequence are virtualized by the first client. In order to restore the virtualized user names, the priority value calculation and screening module 202 sends the initial user recommendation sequence to the first client.
[0142] like Figure 7 , which is a functional module diagram of a product recommendation device applied to a server side according to the present invention.
[0143] The product recommendation device 300 of the present invention can be installed in an electronic device. According to the functions to be implemented, the product recommendation device can include a key distribution module 301 and a similarity calculation module 302. The module described in the present invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, and is stored in the memory of the electronic device.
[0144] In this embodiment, the functions of each module / unit are as follows:
[0145] The key distribution module 301 is used to construct a key pair using an asymmetric encryption algorithm, and distribute the public key in the key pair to the first client and the second client;
[0146] In order to ensure the security of data interaction between the first client and the second client and the server, the key distribution module 301 uses an asymmetric encryption algorithm to construct a key pair and distributes the public key in the key pair to the first client and the second client.
[0147] The similarity calculation module 302 is used to receive all the first encrypted product sequences sent by the first client and all the second encrypted product sequences sent by the second client; use the private key in the key pair to decrypt all the first encrypted product sequences to obtain the corresponding first decrypted product sequences and decrypt all the received second encrypted product sequences to obtain the corresponding second decrypted product sequences; perform similarity calculation based on all the first decrypted product sequences and all the second decrypted product sequences to obtain the user similarity set, and send the user similarity set to the second client.
[0148] For example: the first standard product rating sequence is the data of Company A, and the second standard product rating sequence is the data of Company B. The server is a third-party server trusted by both Companies A and B. The server constructs a key pair, distributes the public key in the key pair to the first client of Company A and the second client of Company B, and retains the private key in the key pair. Company A uses the obtained public key to encrypt the first standard product sequence to obtain the corresponding first encrypted product sequence, and Company B uses the obtained public key to encrypt the second standard product sequence to obtain the corresponding second encrypted product sequence; all the first encrypted product sequences encrypted by Company A and all the second encrypted product sequences encrypted by Company B received by the server are decrypted using the private key to obtain the corresponding first decrypted product sequence and the corresponding second decrypted product sequence; the server performs similarity calculation based on all the first decrypted product sequences and all the second decrypted product sequences to obtain the user similarity set.
[0149] In detail, the similarity calculation module 302 in the embodiment of the present invention calculates the similarity between two users according to the similarity of the product ratings of the two users on the same product, and uses the following formula to calculate the similarity:
[0150]
[0151] in, represents the i-th product rating in the first decrypted product sequence corresponding to user X, Score the i-th product in the second decrypted product sequence corresponding to user Y, Indicates the similarity between users X and Y.
[0152] like Figure 8 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing the product recommendation method of the present invention.
[0153] The electronic device 10 may include a processor 11 , a memory 12 , and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 11 , such as a product recommendation program 13 .
[0154] The memory 12 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 12 may be an internal storage unit of the electronic device 10, such as a mobile hard disk of the electronic device 10. In other embodiments, the memory 12 may also be an external storage device of the electronic device 10, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 10. Further, the memory 12 may also include both an internal storage unit of the electronic device 10 and an external storage device. The memory 12 may not only be used to store application software and various types of data installed in the electronic device 10, such as the code of a product recommendation program, etc., but may also be used to temporarily store data that has been output or is to be output.
[0155] The processor 11 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 11 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules (such as product recommendation programs, etc.) stored in the memory 12, and calls data stored in the memory 12 to execute various functions of the electronic device 10 and process data.
[0156] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 12 and at least one processor 11, etc.
[0157] Figure 8 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 8The structure shown does not constitute a limitation on the electronic device 10 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0158] For example, although not shown, the electronic device 10 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 11 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators. The electronic device 10 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0159] Furthermore, the electronic device 10 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 10 and other electronic devices.
[0160] Optionally, the electronic device 10 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 10 and to display a visual user interface.
[0161] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0162] The product recommendation program 13 stored in the memory 12 in the electronic device 10 is a combination of multiple computer programs, and when running in the processor 11, a product recommendation method can be implemented.
[0163] Optionally, when the electronic device 10 is a first client, the product recommendation method includes:
[0164] Acquire a first product set, receive a second product set sent by a second client, and filter the first product set and the second product set to obtain a target product sequence, wherein both the first product set and the second product set include products to be recommended;
[0165] Acquire a first user set, and construct a first product rating sequence for each user in the first user set according to the target product sequence;
[0166] Receive the public key sent by the server, use the public key to perform an encryption operation on each of the first product rating sequences to obtain a corresponding first encrypted product sequence, and send all the first encrypted product sequences to the server;
[0167] receiving an initial user recommendation sequence sent by the second client, and performing a restoration operation on the initial user recommendation sequence to obtain a recommended user sequence;
[0168] The product to be recommended is pushed to the terminal device of each user in the recommended user sequence.
[0169] Optionally, when the electronic device 10 is a second client, the product recommendation method includes:
[0170] Acquire the second product set, and send the second product set to the first client;
[0171] receiving the target product sequence sent by the first client;
[0172] Acquire a second user set, and construct a second product rating sequence for each user in the second user set according to the target product sequence;
[0173] Receive the public key sent by the server, and use the public key to perform an encryption operation on each of the second product rating sequences to obtain a corresponding second encrypted product sequence;
[0174] Sending all the second encrypted product sequences to the server, and receiving the user similarity set sent by the server;
[0175] The recommendation priority values are calculated and screened according to the user similarity set and the second user set to obtain an initial user recommendation sequence, and the initial user recommendation sequence is sent to the first client.
[0176] Optionally, when the electronic device 10 is a server, the product recommendation method includes:
[0177] Constructing a key pair using an asymmetric encryption algorithm, and distributing a public key in the key pair to the first client and the second client;
[0178] Receive all the first encrypted product sequences and
[0179] All second encrypted product sequences sent by the second client;
[0180] Decrypt all the first encrypted product sequences using the private key in the key pair to obtain the corresponding first decrypted product sequences and
[0181] Performing a decryption operation on all received second encrypted product sequences to obtain corresponding second decrypted product sequences;
[0182] Similarity calculation is performed according to all the first decryption product sequences and all the second decryption product sequences to obtain the user similarity set, and the user similarity set is sent to the second client.
[0183] Specifically, the specific implementation method of the processor 11 for the above-mentioned computer program can refer to Figure 5 , Figure 6 and Figure 7 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0184] Furthermore, if the module / unit integrated in the electronic device 10 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. The computer-readable medium can be non-volatile or volatile. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0185] Furthermore, the computer-usable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.
[0186] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0187] The modules described as separate components may or may not be physically separated, and the components shown as modules 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0188] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, 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 hardware plus software functional modules.
[0189] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0190] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0191] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0192] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.
[0193] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A product recommendation method, characterized in that: Applied to a first client, the method includes: Acquire a first product set, receive a second product set sent by a second client, perform screening according to the first product set and the second product set, obtain a target product sequence and send it to the second client, wherein the first product set and the second product set both contain products to be recommended, and the first client and the second client are product monitoring programs of the first platform and the second platform respectively; Acquire a first user set, construct a first product rating sequence for each user in the first user set according to the target product sequence, perform an encryption operation on each first product rating sequence using a public key sent by the server to obtain a corresponding first encrypted product sequence, and send all first encrypted product sequences to the server; Receive an initial user recommendation sequence sent by the second client, the initial user recommendation sequence is obtained by the second client calculating and screening the recommendation priority value according to the user similarity set and the second user set sent by the server, the second client constructs a second product rating sequence for each user in the second user set according to the target product sequence, and uses the public key to encrypt each second product rating sequence to obtain a corresponding second encrypted product sequence and then sends it to the server, the server uses the private key to decrypt all first encrypted product sequences to obtain a corresponding first decrypted product sequence and decrypt all second encrypted product sequences to obtain a corresponding second decrypted product sequence, and performs similarity calculation according to all first decrypted product sequences and second decrypted product sequences to obtain the user similarity set; Performing a username restoration operation on the initial user recommendation sequence by using a pre-built first username mapping table, replacing the virtual username with the real username, and obtaining a recommended user sequence; The product to be recommended is pushed to the terminal device of each user in the recommended user sequence.
2. The product recommendation method according to claim 1, characterized in that: The method of using the public key sent by the server to perform an encryption operation on each first product rating sequence to obtain a corresponding first encrypted product sequence includes: Using the first user name mapping table to perform a user name replacement operation on the first product rating sequence to obtain a first standard product sequence; The first standard product sequence is encrypted using the public key to obtain the corresponding first encrypted product sequence.
3. A product recommendation method, characterized in that: Applied to the second client, the method includes: Obtain a second product set, and send the second product set to a first client; the first client obtains a first product set and a first user set, and obtains a target product sequence based on the first product set and the second product set, and sends the target product sequence to the second client; and constructs a first product rating sequence for each user in the first user set based on the target product sequence, and performs an encryption operation on each first product rating sequence using a public key sent by a server to obtain a corresponding first encrypted product sequence and send the encrypted product sequence to the server, wherein both the first product set and the second product set include products to be recommended, and the first client and the second client are product monitoring programs for a first platform and a second platform, respectively; Acquire a second user set, and construct a second product rating sequence for each user in the second user set according to the target product sequence; Receive the public key sent by the server, and use the public key to perform an encryption operation on each of the second product rating sequences to obtain a corresponding second encrypted product sequence; Sending all second encrypted product sequences to the server, the server uses the private key to decrypt all first encrypted product sequences to obtain corresponding first decrypted product sequences and to decrypt all second encrypted product sequences to obtain corresponding second decrypted product sequences, and performs similarity calculation based on all first decrypted product sequences and second decrypted product sequences to obtain a user similarity set and sends it to the second client; Receiving the user similarity set sent by the server; The recommendation priority values are calculated and screened according to the user similarity set and the second user set to obtain an initial user recommendation sequence, and the initial user recommendation sequence is sent to the first client. The first client uses a pre-built first user name mapping table to perform a username restoration operation on the initial user recommendation sequence, replaces the virtual user name with the real user name to obtain a recommended user sequence, and pushes the to-be-recommended product to a terminal device of each user in the recommended user sequence.
4. The product recommendation method according to claim 3, characterized in that: The calculating and screening of recommendation priority values according to the user similarity set and the second user set to obtain an initial user recommendation sequence includes: Obtain users in the second user set whose product ratings include the product to be recommended, to obtain a recommended user set; Performing a username restoration operation on the user similarity set using a preset second username mapping table to obtain a target similarity set; The recommendation priority values are calculated and screened according to the target similarity set and the recommended user set to obtain an initial user recommendation sequence.
5. A product recommendation method, characterized in that: Applied to the server, the method includes: A key pair is constructed using an asymmetric encryption algorithm, and a public key in the key pair is distributed to a first client and a second client. The first client obtains a first product set and a first user set, and the second client obtains a second product set and a second user set. The first client selects a target product sequence based on the first product set and the second product set and sends it to the second client, and constructs a first product rating sequence for each user in the first user set based on the target product sequence, and encrypts each first product rating sequence using the public key sent by the server to obtain a corresponding first encrypted product sequence and sends it to the server. The second client constructs a second product rating sequence for each user in the second user set based on the target product sequence, and encrypts each second product rating sequence using the public key to obtain a corresponding second encrypted product sequence and sends it to the server, wherein both the first product set and the second product set contain products to be recommended, and the first client and the second client are product monitoring programs for the first platform and the second platform, respectively. receiving all first encrypted product sequences sent by the first client and all second encrypted product sequences sent by the second client; Using the private key in the key pair to decrypt all first encrypted product sequences to obtain corresponding first decrypted product sequences, and decrypt all received second encrypted product sequences to obtain corresponding second decrypted product sequences; Similarity calculation is performed based on all first decrypted product sequences and all second decrypted product sequences to obtain a user similarity set, and the user similarity set is sent to the second client. The second client calculates and filters the recommendation priority value based on the user similarity set and the second user set to obtain an initial user recommendation sequence and sends it to the first client. The first client uses a pre-built first user name mapping table to perform a username restoration operation on the initial user recommendation sequence, replaces the virtual user name with the real user name to obtain a recommended user sequence, and pushes the to-be-recommended product to a terminal device of each user in the recommended user sequence.
6. A product recommendation device, running on a first client, for executing the product recommendation method according to claim 1 or 2, characterized in that: The device comprises: A product screening module, configured to obtain a first product set, receive a second product set sent by a second client, and screen the first product set and the second product set to obtain a target product sequence, wherein both the first product set and the second product set contain products to be recommended; The encryption and restoration module is used to obtain a first user set, construct a first product rating sequence for each user in the first user set according to the target product sequence; receive a public key sent by the server, use the public key to perform an encryption operation on each of the first product rating sequences to obtain a corresponding first encrypted product sequence, and send all the first encrypted product sequences to the server; receive an initial user recommendation sequence sent by the second client, use a pre-constructed first user name mapping table to perform a user name restoration operation on the initial user recommendation sequence, replace the virtual user name with the real user name, and obtain a recommended user sequence; The product push module is used to push the product to be recommended to the terminal device of each user in the recommended user sequence.
7. A product recommendation device, running on a second client, for executing the product recommendation method according to claim 3 or 4, characterized in that: The device comprises: The scoring calculation module is used to obtain the second product set and send the second product set to the first client; receive the target product sequence sent by the first client; obtain the second user set, and construct a second product scoring sequence for each user in the second user set according to the target product sequence; receive the public key sent by the server, and use the public key to encrypt each second product scoring sequence to obtain a corresponding second encrypted product sequence; send all the second encrypted product sequences to the server, and receive the user similarity set sent by the server; The priority value calculation and screening module is used to calculate and screen the recommendation priority values according to the user similarity set and the second user set to obtain an initial user recommendation sequence, and send the initial user recommendation sequence to the first client.
8. A product recommendation device, running on a server, for executing the product recommendation method according to claim 5, characterized in that: The device comprises: A key distribution module, used to construct a key pair using an asymmetric encryption algorithm, and distribute the public key in the key pair to the first client and the second client; The similarity calculation module is used to receive all first encrypted product sequences sent by the first client and all second encrypted product sequences sent by the second client; use the private key in the key pair to decrypt all the first encrypted product sequences to obtain corresponding first decrypted product sequences and decrypt all the received second encrypted product sequences to obtain corresponding second decrypted product sequences; perform similarity calculation based on all the first decrypted product sequences and all the second decrypted product sequences to obtain a user similarity set, and send the user similarity set to the second client.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the product recommendation method described in any one of claims 1 to 5.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the product recommendation method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Information push method and apparatus
CN105279204A
Novel privacy protection method in collaborative filtering recommendation system
CN105574430A