WO2022126916A1 - Product recommendation method, system, computer device and storage medium - Google Patents

Product recommendation method, system, computer device and storage medium Download PDF

Info

Publication number
WO2022126916A1
WO2022126916A1 PCT/CN2021/083745 CN2021083745W WO2022126916A1 WO 2022126916 A1 WO2022126916 A1 WO 2022126916A1 CN 2021083745 W CN2021083745 W CN 2021083745W WO 2022126916 A1 WO2022126916 A1 WO 2022126916A1
Authority
WO
WIPO (PCT)
Prior art keywords
factor matrix
parameter
product
user
product factor
Prior art date
Application number
PCT/CN2021/083745
Other languages
French (fr)
Chinese (zh)
Inventor
王健宗
李泽远
何安珣
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022126916A1 publication Critical patent/WO2022126916A1/en

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes

Definitions

  • the present application relates to the technical field of artificial intelligence, and in particular, to a product recommendation method, system, computer equipment and storage medium.
  • the present application provides a product recommendation method, system, computer equipment and storage medium to solve the problems of user privacy leakage and high model calculation cost in the prior art when recommending products to users.
  • the present application provides a product recommendation method, including:
  • the server side receives user input parameter data
  • the server side obtains the product factor matrix V and the product factor matrix parameter V t through initialization processing, and sends the product factor matrix parameter V t and part of the parameter data to multiple clients;
  • the multiple clients update the user factor matrix u i according to the product factor matrix parameter V t and part of the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference ⁇ i t and the normalization constant h i t , Returning the weighted difference value ⁇ i t and the normalized constant h i t to the server side;
  • the server uses the product factor matrix parameter V t and all received weighted differences ⁇ i t and normalization constant h i t , to the product factor matrix parameter V t Iteratively update;
  • the server side determines the target product factor matrix according to the updated product factor matrix parameter V t+1 , and sends the target product factor matrix to the target client;
  • the target client uses the target product factor matrix and the updated user factor matrix to calculate the predicted score value of the product by the user, sort the predicted score value, and recommend the top N products with the highest ranking to the product. the user.
  • the present application also provides a product recommendation system, the system includes:
  • the server includes:
  • the receiving module is used to receive the parameter data input by the user
  • an initialization module configured to obtain a product factor matrix V and a product factor matrix parameter V t through initialization, and send the product factor matrix parameter V t and part of the parameter data to multiple clients;
  • the update module uses the product factor matrix parameter V t and all received weighted differences ⁇ i t and normalization constant h i t to perform the product factor matrix parameter V t . iterative update;
  • a determination module for determining a target product factor matrix according to the updated product factor matrix parameter V t+1 , and sending the target product factor matrix to the target client;
  • the client includes:
  • the calculation module is used to update the user factor matrix u i according to the product factor matrix parameter V t and part of the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference ⁇ i t and the normalization constant h i t , The weighted difference ⁇ i t and the normalized constant h i t are returned to the server;
  • the output module uses the target product factor matrix and the updated user factor matrix, calculates the predicted score value of the product by the user, sorts the predicted score value, and recommends the top N products with the highest ranking to the user.
  • an embodiment of the present application further provides a computer device, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and the processor executes
  • the computer-readable instructions implement the following steps:
  • the server side receives the parameter data input by the user
  • the server side obtains the product factor matrix V and the product factor matrix parameter V t through initialization processing, and sends the product factor matrix parameter V t and part of the parameter data to multiple clients;
  • the multiple clients update the user factor matrix u i according to the product factor matrix parameter V t and part of the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference ⁇ i t and the normalization constant h i t , Returning the weighted difference value ⁇ i t and the normalized constant h i t to the server side;
  • the server uses the product factor matrix parameter V t and all received weighted differences ⁇ i t and normalization constant h i t , to the product factor matrix parameter V t Iteratively update;
  • the server side determines the target product factor matrix according to the updated product factor matrix parameter V t+1 , and sends the target product factor matrix to the target client;
  • the target client uses the target product factor matrix and the updated user factor matrix to calculate the predicted score value of the product by the user, sort the predicted score value, and recommend the top N products with the highest ranking to the product. the user.
  • an embodiment of the present application further provides a computer-readable storage medium, where computer-readable instructions are stored on the computer-readable storage medium, and when the computer-readable instructions are executed by a processor, the processing The device performs the following steps:
  • the server side receives the parameter data input by the user
  • the server side obtains the product factor matrix V and the product factor matrix parameter V t through initialization processing, and sends the product factor matrix parameter V t and part of the parameter data to multiple clients;
  • the multiple clients update the user factor matrix u i according to the product factor matrix parameter V t and part of the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference ⁇ i t and the normalization constant h i t , Returning the weighted difference value ⁇ i t and the normalized constant h i t to the server side;
  • the server uses the product factor matrix parameter V t and all received weighted differences ⁇ i t and normalization constant h i t , to the product factor matrix parameter V t Iteratively update;
  • the server side determines the target product factor matrix according to the updated product factor matrix parameter V t+1 , and sends the target product factor matrix to the target client;
  • the target client uses the target product factor matrix and the updated user factor matrix to calculate the predicted score value of the product by the user, sort the predicted score value, and recommend the top N products with the highest ranking to the product. the user.
  • the product recommendation method, system, computer equipment and storage medium provided according to the embodiments of the present application have at least the following beneficial effects:
  • the server receives the parameter data input by the user; the server is initialized and sends the initialized parameter data to the client, and the client calculates according to the parameter data and combined with its own data, and obtains The weighted difference ⁇ i t and the normalized constant h i t are fed back to the server; the client uses local data for calculation, avoiding the problem of data leakage when sending data to the server, and protecting the user's data; The server side updates the matrix parameters based on the weighted difference ⁇ i t and the normalization constant h i t , determines the target product factor matrix based on the updated matrix parameters and sends it to the client, and the client sends the target product factor matrix based on the target product factor matrix.
  • the user data is used to complete the accurate recommendation for the user, and the server side only uses the weighted difference ⁇ i t sent by the client and the normalized constant h i t to calculate, which reduces the model calculation cost.
  • FIG. 1 is a schematic flowchart of a product recommendation method provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a module of a product recommendation device provided by an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of a computer device according to an embodiment of the present application.
  • the present application provides a product recommendation method.
  • FIG. 1 it is a schematic flowchart of a product recommendation method according to an embodiment of the present application.
  • the product recommendation method includes:
  • the server side receives the parameter data input by the user
  • the specific parameter data includes the total number of clients n, the number of epochs E, that is, the number of stochastic gradient descent is E times, the number of loops is T, that is, the number of iterations is T times, the q-FedAvg algorithm parameter q, the Lipschitz constant L (K for functions on a subset of the set of real numbers If there is a constant such that
  • Part of the parameter data is used on the server side, that is, the total number of clients n, the number of cycles T and other parameters, and a part is sent to the client through the server side, that is, the number of epochs E, the q-FedAvg algorithm parameter q, the Lipschitz constant L, the step The length ⁇ , regularization parameter ⁇ and gain parameter ⁇ will be sent to the client.
  • the server side receives parameter data input by the user.
  • the server side obtains the product factor matrix V and the product factor matrix parameter V t through initialization processing, and sends the product factor matrix parameter V t and part of the parameter data to multiple clients;
  • the server side obtains the product factor matrix parameter V t and the product factor matrix V by randomly initializing the product factor matrix and the product factor matrix parameters , and the E, q, L, ⁇ , ⁇ and ⁇ parameters are sent to multiple clients.
  • the random initialization can be initialized by means of Gaussian distribution, Xavier, etc., the product factor matrix parameter V t and the product factor matrix V are randomly generated, and the model is more likely to find the global optimal solution through random initialization, and if the product factor matrix is fully assigned. If it is 0, symmetry will be generated, which will result in two neurons in the hidden layer generated by the input value. Due to the symmetry of the matrix, regardless of forward propagation or back propagation, these two neurons that should represent different characteristics are If the operations are done the same, there will be problems.
  • the sending of the product factor matrix parameter V t and part of the parameter data to multiple clients includes:
  • the product factor matrix parameter V t and the parameter data are sent to n clients in the set S t .
  • the product factor matrix parameter V t and the E, q, L, ⁇ , ⁇ , ⁇ parameters in the parameter data are sent to n clients in the set S t through the number of clients n, specified in the parameter data.
  • the client also needs to be initialized, and the user factor matrix and the user factor matrix parameters are also randomly initialized to obtain the user factor matrix parameter u i t and the user factor matrix u i , and the random initialization method is the same as that of the server side.
  • n clients are used as the samples for this update iteration. Using n clients to improve the uncertainty of the data, it is convenient for subsequent training to obtain the universality of the data.
  • the method further includes:
  • the partial parameter data includes the epoch number E, the q-FedAvg algorithm parameter q, the Lipschitz constant L, the step size ⁇ , the regularization parameter ⁇ and the gain parameter ⁇ .
  • the server receives all parameter data, the total number of clients n, the number of cycles T and other parameters are assigned to the server for use; epoch times E, q-FedAvg algorithm parameter q, Lipschitz constant L, step size ⁇ , regularization
  • the parameter ⁇ and the gain parameter ⁇ are used by the client.
  • the client needs to undergo homomorphic encryption before sending the weighted difference ⁇ i t and the normalized constant h i t to the server to ensure data security.
  • updating the user factor matrix ui according to the product factor matrix parameter V t and the parameter data by the multiple clients includes:
  • the loss function F i is calculated according to formula 1, and the formula 1 is:
  • the gradient of the user factor matrix ui and the gain parameter ⁇ is calculated according to the formula 2, and the formula 2 is:
  • t represents the number of iterations
  • represents the gain parameter
  • r ij represents the user i's rating value for product j
  • represents the regularization parameter
  • v j represents the product In the jth row of the factor matrix V
  • Fi is the loss function
  • ui t+1 is the user factor matrix parameter after iteration
  • ui t is the user factor matrix parameter.
  • the loss function F i is calculated by using the user factor matrix ui , the product factor matrix parameter V t and the regularization parameter ⁇ on the client; and then based on the loss function F i , the user factor matrix ui
  • the gradient and gain parameter ⁇ of calculate the updated user factor matrix parameter u i t+1 ; r ij is the existing one of the client.
  • the formula specifically calculates F i (V t , ui t ), and this formula is a specific expansion of formula one.
  • the client maintains its own data to avoid leakage caused by data transmission.
  • the use of the q-FedAvg algorithm to calculate the weighted difference ⁇ i t and the normalized constant h i t includes:
  • ⁇ V i t represents the difference between adjacent product factor matrix parameters
  • L represents the Lipschitz constant
  • q represents the q-FedAvg algorithm parameter
  • k 1,2,...,E.
  • V 0 t+1 V t ;
  • V 0 t+1 V t
  • V 1 t+1 V t
  • the client calculates the weighted difference ⁇ i t and the normalized constant h i t based on its own data characteristics and sends them to the client.
  • the data features are displayed for subsequent product recommendations.
  • the server uses the product factor matrix parameter V t and all received weighted differences ⁇ i t and normalization constant h i t , to the product factor matrix parameter V t is iteratively updated;
  • the server uses the product factor matrix parameter V t and all received weighted differences ⁇ i t and normalized constant h i t to iteratively update the product factor matrix parameter V t , including:
  • the server uses the The updated product factor matrix parameter V t+1 , i represents the number of clients, and S t represents the client set.
  • the product factor matrix parameter V t+1 is updated by collecting the weighted difference ⁇ i t and normalized constant h i t data fed back by all clients in the client set S t . Improves the universality of parameters.
  • the server side determines the target product factor matrix according to the updated product factor matrix parameter V t+1 , and sends the target product factor matrix to the target client;
  • determining the target product factor matrix according to the updated product factor matrix parameter V t+1 including:
  • a target product factor matrix is generated by using the updated product factor matrix parameter V t+1 .
  • the difference of the parameters of the product factor matrix is less than the preset value; when the difference is less than the preset value, the updated product factor matrix parameters will be used to generate the target product factor matrix; the target client needs to perform The client corresponding to the user recommended by the product, and among the clients participating in the iteration.
  • the product factor matrix parameters that meet the conditions are finally obtained, which improves the quality of product recommendation. Recommend products that are closer to their actual needs.
  • the product factor matrix parameters obtained in the last iteration are outputted only after completing the preset number of iterations, and the target product factor matrix is generated by using the product factor matrix parameters.
  • the target client uses the target product factor matrix and the updated user factor matrix to calculate the predicted score value of the product by the user, sort the predicted score value, and sort the top N products with the highest ranking recommended to the user.
  • the updated user factor matrix is the last user factor matrix after iterative update.
  • the clients are in one-to-one correspondence with the users to which they belong.
  • the target product factor matrix data can also be stored in a node of a blockchain.
  • the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • the server side receives the parameter data input by the user; the server side obtains the product factor matrix V and the product factor matrix parameter V t through initialization processing, and combines the product factor matrix parameter V t with the said product factor matrix parameter V t
  • the parameter data is sent to multiple clients; the multiple clients update the user factor matrix u i according to the product factor matrix parameter V t and the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference ⁇ i t and the normalized value.
  • the client uses the data to perform calculations by itself, avoiding the occurrence of data when the data is sent to the server side
  • the leakage problem protects the user's data
  • the server uses the product factor matrix parameter V t and all received weighted differences ⁇ i t and normalization constant h i t , to the product factor matrix parameter V t is iteratively updated;
  • the server side determines a target product factor matrix according to the updated product factor matrix parameter V t+1 , and sends the target product factor matrix to the target client;
  • the target client uses the The target product factor matrix and the updated user factor matrix are used to calculate the predicted score value of the product by the user, sort the predicted score value, and recommend the top N products with the highest ranking to the user.
  • the user data is used locally to calculate the weighted difference ⁇ i t and the normalized constant h i t on the client side, while protecting the user data, the user data is used to complete accurate user recommendations. And the server side only uses the weighted difference ⁇ i t sent by the client and the normalized constant h i t to calculate, which reduces the model calculation cost.
  • FIG. 2 it is a functional module diagram of the product recommendation system of the present application.
  • the product recommendation system 100 described in this application can be installed in an electronic device, and specifically can be installed in a server and a client.
  • the product recommendation system 100 includes a server end 110 and a client end 120.
  • the server end 110 includes a receiving module 111, an initialization module 112, an update module 113, and a determination module 114;
  • the client end 120 includes a computing module 121 and output module 122.
  • the module in the present invention can also be called a unit, which refers to an instruction segment of a series of computer-readable instructions that can be executed by the electronic device processor and can perform fixed functions, and is stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the server side 110 includes:
  • a receiving module 111 configured to receive parameter data input by a user
  • the receiving module 111 receives the total number of clients n and the number of epochs E, that is, the number of stochastic gradient descent is E times and the number of loops is T, that is, the number of iterations is T times, the q-FedAvg algorithm parameter q, the Lipschitz constant L , step size ⁇ , regularization parameter ⁇ and gain parameter ⁇ parameter.
  • an initialization module 112 configured to obtain a product factor matrix V and a product factor matrix parameter V t through initialization processing, and send the product factor matrix parameter V t and part of the parameter data to multiple clients;
  • the initialization module 112 obtains the product factor matrix parameter V t and the product factor matrix V through random initialization.
  • the server side 110 further includes a homomorphic encryption module
  • the homomorphic encryption module is used to perform homomorphic encryption on the product factor matrix parameter V t .
  • the homomorphic encryption module ensures the security of the data.
  • Update module 113 based on the remaining part of the parameter data, using the product factor matrix parameter V t and all received weighted differences ⁇ i t and normalization constant h i t , for the product factor matrix parameter V t Iteratively update;
  • the update module 113 utilizes The updated product factor matrix parameter V t+1 is obtained, i represents the number of clients, and St represents the set of clients.
  • a determination module 114 configured to determine a target product factor matrix according to the updated product factor matrix parameter V t+1 , and send the target product factor matrix to the target client;
  • the determining module 114 includes a difference judgment sub-module, an iterative sub-module and a generation sub-module;
  • the difference judgment submodule is used to judge whether the difference between the updated product factor matrix parameter V t+1 and the before updated product factor matrix parameter V t is less than a preset value
  • the iterative submodule is used to re-send the updated product factor matrix parameter V t+1 to the client to continue iterative update if the difference is greater than the preset value, until the difference is less than the preset value until;
  • the generating sub-module is configured to generate a target product factor matrix by using the updated product factor matrix parameter V t+1 if the difference is less than or equal to the preset value.
  • the difference judging sub-module compares and judges the difference between the product factor matrix parameters obtained by two adjacent iterations and the preset value to determine whether iterative update is needed. If it is greater than the preset value, the iterative sub-module will update The final product factor matrix parameter V t+1 is re-sent to the client to continue the iterative update, that is, V t+1 is replaced with the original V t , so as to obtain V t+2 , and iterate continuously until the product factor matrix obtained by adjacent iterations
  • the difference value of the parameter is less than the preset value; when the difference value is less than the preset value, the generating sub-module will use the updated product factor matrix parameter to generate the target product factor matrix;
  • the difference value is compared with the preset value, and finally the product factor matrix parameters that meet the conditions are obtained, which improves the product recommendation quality, that is, using the product factor
  • the target product factor matrix generated by the matrix parameters combined with the user factor matrix will recommend products that are closer to their actual needs to users.
  • the client 120 includes:
  • the calculation module 121 is used to update the user factor matrix u i according to the product factor matrix parameter V t , and use the q-FedAvg algorithm to calculate the weighted difference value ⁇ i t and the normalization constant h i t , and the weighted difference value ⁇ i t and normalized constant h i t are returned to the server;
  • the calculation module 121 includes a loss function calculation submodule, a user factor matrix parameter update submodule and a user factor matrix update submodule;
  • the loss function calculation sub-module calculates the loss function F i (V t , u i t ) according to the formula 1 based on the user factor matrix ui and the product factor matrix parameter V t , and the formula 1 is:
  • the user factor matrix parameter update submodule calculates the updated user factor matrix parameter u i t+ according to formula 2 based on the loss function F i (V t , u i t ), the gradient of the user factor matrix ui and the gain parameter ⁇ 1 , the second formula is:
  • the user factor matrix updating submodule updates the user factor matrix u i according to the updated user factor matrix parameter u i t+1 ;
  • t represents the number of iterations
  • represents the gain parameter
  • r ij represents the user i's rating value for product j
  • represents the regularization parameter
  • v j represents the product
  • F i is the loss function
  • ui t+1 is the user factor matrix parameter after iteration
  • ui t is the user factor matrix parameter.
  • the client can maintain its own data and avoid leakage caused by data transmission.
  • the calculation module 121 further includes a model parameter calculation sub-module, a difference calculation sub-module and a calculation sub-module based on the q-FedAvg algorithm;
  • the model parameter calculation submodule obtains the updated user factor matrix parameters by and the preset step size ⁇ , perform E times of stochastic gradient descent on the loss function F i to obtain the model parameters
  • the difference calculation submodule is based on the model parameters Calculate the parameter difference ⁇ V i t of adjacent product factor matrices:
  • the calculation sub-module based on the q-FedAvg algorithm calculates the weighted difference ⁇ i t and the normalized constant h i t according to the difference of the adjacent product factor matrix parameters according to the following q-FedAvg algorithm:
  • ⁇ V i t represents the difference between adjacent product factor matrix parameters
  • L represents the Lipschitz constant
  • q represents the q-FedAvg algorithm parameter
  • k 1,2,...,E.
  • the client can calculate the weighted difference ⁇ i t and the normalized constant h i t based on its own data characteristics And send it to the client, by using its own data to perform calculations on the local end, while ensuring data security, it displays its own data characteristics for subsequent product recommendations.
  • the output module 122 uses the target product factor matrix and the updated user factor matrix, calculates the predicted score value of the product by the user, sorts the predicted score value, and recommends the top N products with the highest ranking to all the products. described user.
  • the target product factor matrix data can also be stored in a node of a blockchain.
  • the product recommendation system 100 includes a server end 110 and a client end 120, the server end 110 includes a receiving module 111, an initialization module 112, an update module 113, and a determination module 114; the client end 120 includes The calculation module 121 and the output module 122 are used together to calculate the weighted difference ⁇ i t and the normalized constant h i t by receiving the product factor matrix parameters sent by the server and using user data locally at the client.
  • user data is used to complete accurate recommendation for users, and the server side only uses the weighted difference ⁇ i t sent by the client and the normalized constant h i t to calculate, which reduces the model calculation cost.
  • FIG. 3 is a block diagram of a basic structure of a computer device according to this embodiment.
  • the computer device 4 includes a memory 41, a processor 42, and a network interface 43 that communicate with each other through a system bus. It should be pointed out that only the computer device 4 with components 41-43 is shown in the figure, but it should be understood that it is not required to implement all of the shown components, and that more or less components may be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, special-purpose Integrated circuit (Application Specific Integrated Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processor (Digital Signal Processor, DSP), embedded equipment, etc.
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • DSP Digital Signal Processor
  • the computer equipment may be a desktop computer, a notebook computer, a palmtop computer, a cloud server and other computing equipment.
  • the computer device can perform human-computer interaction with the user through a keyboard, a mouse, a remote control, a touch pad or a voice control device.
  • the memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static Random Access Memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, etc.
  • the memory 41 may be an internal storage unit of the computer device 4 , such as a hard disk or a memory of the computer device 4 .
  • the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc.
  • the memory 41 may also include both the internal storage unit of the computer device 4 and its external storage device.
  • the memory 41 is generally used to store the operating system and various application software installed on the computer device 4 , such as computer-readable instructions for a product recommendation method.
  • the memory 41 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 42 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. This processor 42 is typically used to control the overall operation of the computer device 4 . In this embodiment, the processor 42 is configured to execute computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for executing the product recommendation method.
  • CPU Central Processing Unit
  • controller a controller
  • microcontroller a microcontroller
  • microprocessor microprocessor
  • This processor 42 is typically used to control the overall operation of the computer device 4 .
  • the processor 42 is configured to execute computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for executing the product recommendation method.
  • the network interface 43 may include a wireless network interface or a wired network interface, and the network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
  • the server receives the parameter data input by the user; the server is initialized The product factor matrix V and the product factor matrix parameter V t are obtained by processing, and the product factor matrix parameter V t and the parameter data are sent to multiple clients; the multiple clients are based on the product factor matrix parameter V t and the parameter data to update the user factor matrix u i , and use the q-FedAvg algorithm to calculate the weighted difference ⁇ i t and the normalized constant h i t , and the weighted difference ⁇ i t and the normalized constant h i t is returned to the server; the client uses the data to calculate by itself, which avoids the problem of data leakage when the data is sent to the server, and protects the user's data; the server utilizes the product factor matrix parameter V t and all received weight
  • the client By receiving the product factor matrix parameters sent by the server, the client locally uses the user data to calculate the weighted difference ⁇ i t and the normalized constant h i t . While protecting the user data, the user data is used to complete accurate user recommendations. , and the server side only uses the weighted difference ⁇ i t sent by the client and the normalized constant h i t to calculate, which reduces the model calculation cost.
  • the present application also provides another embodiment, that is, to provide a computer-readable storage medium, where the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to Make the at least one processor perform the steps of the above-mentioned product recommendation method, and through the cooperation between the server and the client, the server receives the parameter data input by the user; the server obtains the product factor matrix V and the product factor matrix through initialization processing parameter V t , and send the product factor matrix parameter V t and the parameter data to multiple clients; the multiple clients update the user factor matrix u according to the product factor matrix parameter V t and the parameter data i , and use the q-FedAvg algorithm to calculate the weighted difference ⁇ i t and the normalized constant h i t , and return the weighted difference ⁇ i t and the normalized constant h i t to the server; the client By using the data for calculation by itself, the problem of data leakage when the data is sent to the
  • the client By receiving the product factor matrix parameters sent by the server, the client locally uses the user data to calculate the weighted difference ⁇ i t and the normalized constant h i t . While protecting the user data, the user data is used to complete accurate user recommendations. , and the server side only uses the weighted difference ⁇ i t sent by the client and the normalized constant h i t to calculate, which reduces the model calculation cost.
  • the computer-readable storage medium may be non-volatile or volatile.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application relates to artificial intelligence, and discloses a product recommendation method, a system, a computer device and a storage medium. The method comprises: a server side receives parameter data; a server obtains a product factor matrix and parameters after initialization, and sends the product factor matrix parameters and the parameter data to multiple clients; the clients update a user factor matrix accordingly, calculate weighted differences and normalized constants by using a q-FedAvg algorithm, and return the weighted differences and normalized constants to the server; the server updates the product factor matrix parameters by using the product factor matrix parameters, the weighted differences and the normalized constants; the server determines a target product factor matrix according to the updated product factor matrix parameters, and sends the target product factor matrix to a target client; and the target client uses the target product factor matrix and the updated user factor matrix to calculate predicted score values and recommend the first N products having a high ranking to a user. The present application improves the fitting degree between recommended products and users while protecting user data from leakage.

Description

一种产品推荐方法、系统、计算机设备及存储介质A product recommendation method, system, computer equipment and storage medium
本申请要求于2020年12月18日提交中国专利局、申请号为202011504951.4,发明名称为“一种产品推荐方法、系统、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on December 18, 2020 with the application number 202011504951.4 and the invention title is "A product recommendation method, system, computer equipment and storage medium", the entire content of which is approved by Reference is incorporated in this application.
技术领域technical field
本申请涉及人工智能技术领域,尤其涉及一种产品推荐方法、系统、计算机设备及存储介质。The present application relates to the technical field of artificial intelligence, and in particular, to a product recommendation method, system, computer equipment and storage medium.
背景技术Background technique
随着社会的不断发展,人们对于隐私的保护越来越看重,并且各国也颁布了各种条款来加以对隐私数据的保护,例如欧盟的GDPR(General Data Protection Regulation,通用数据保护条款),和我国出台的《数据安全管理办法》(征求意见稿),面对这种情况,发明人意识到,如何保护用户数据不泄露的情况下对用户完成产品的推荐是个问题。在现有技术中,基于矩阵分解的协同过滤算法存在计算和存储成本高的问题,并且还存在用户数据可能被服务器泄露的问题,所以如何保证用户隐私不泄露的情况下完成对用户的产品推荐,且降低推荐模型计算成本成为了亟待解决的问题。With the continuous development of society, people pay more and more attention to the protection of privacy, and various countries have also promulgated various provisions to protect privacy data, such as the EU's GDPR (General Data Protection Regulation), and Facing this situation, the inventors realized that it is a problem how to recommend users to complete products without leaking user data. In the prior art, the collaborative filtering algorithm based on matrix decomposition has the problem of high computing and storage costs, and also has the problem that user data may be leaked by the server, so how to complete the product recommendation for users without leaking user privacy , and reducing the computational cost of the recommendation model has become an urgent problem to be solved.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种产品推荐方法、系统、计算机设备及存储介质,以解决现有技术中在对用户进行产品推荐时存在的用户隐私泄露且模型计算成本高的问题。The present application provides a product recommendation method, system, computer equipment and storage medium to solve the problems of user privacy leakage and high model calculation cost in the prior art when recommending products to users.
为解决上述问题,本申请提供了一种产品推荐方法,包括:In order to solve the above problems, the present application provides a product recommendation method, including:
服务器端接收用户输入参数数据;The server side receives user input parameter data;
所述服务器端经初始化处理得到产品因子矩阵V和产品因子矩阵参数V t,并将所述产品因子矩阵参数V t和部分所述参数数据发送至多个客户端; The server side obtains the product factor matrix V and the product factor matrix parameter V t through initialization processing, and sends the product factor matrix parameter V t and part of the parameter data to multiple clients;
所述多个客户端根据所述产品因子矩阵参数V t和部分所述参数数据更新用户因子矩阵u i,并利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t,将所述加权差值Δ i t和归一化常量h i t返回给所述服务器端; The multiple clients update the user factor matrix u i according to the product factor matrix parameter V t and part of the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference Δ i t and the normalization constant h i t , Returning the weighted difference value Δ i t and the normalized constant h i t to the server side;
所述服务器端基于剩余部分所述参数数据,利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新; Based on the remaining part of the parameter data, the server uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalization constant h i t , to the product factor matrix parameter V t Iteratively update;
所述服务器端根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,并将所述目标产品因子矩阵发送至目标客户端; The server side determines the target product factor matrix according to the updated product factor matrix parameter V t+1 , and sends the target product factor matrix to the target client;
所述目标客户端利用所述目标产品因子矩阵和更新后的所述用户因子矩阵,计算所述用户 对产品的预测评分值,并对预测评分值排序,将排序高的前N个产品推荐给所述用户。The target client uses the target product factor matrix and the updated user factor matrix to calculate the predicted score value of the product by the user, sort the predicted score value, and recommend the top N products with the highest ranking to the product. the user.
为了解决上述问题,本申请还提供一种产品推荐系统,所述系统包括:In order to solve the above problems, the present application also provides a product recommendation system, the system includes:
服务端和客户端;server and client;
所述服务端包括:The server includes:
接收模块,用于接收用户输入的参数数据;The receiving module is used to receive the parameter data input by the user;
初始化模块,用于经初始化处理得到产品因子矩阵V和产品因子矩阵参数V t,并将所述产品因子矩阵参数V t和部分所述参数数据发送至多个客户端; an initialization module, configured to obtain a product factor matrix V and a product factor matrix parameter V t through initialization, and send the product factor matrix parameter V t and part of the parameter data to multiple clients;
更新模块,基于剩余部分所述参数数据,利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新; The update module, based on the remaining part of the parameter data, uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalization constant h i t to perform the product factor matrix parameter V t . iterative update;
确定模块,用于根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,并将所述目标产品因子矩阵发送至目标客户端; A determination module, for determining a target product factor matrix according to the updated product factor matrix parameter V t+1 , and sending the target product factor matrix to the target client;
所述客户端包括:The client includes:
计算模块,用于根据所述产品因子矩阵参数V t和部分所述参数数据更新用户因子矩阵u i,并利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t,将所述加权差值Δ i t和归一化常量h i t返回给所述服务器端; The calculation module is used to update the user factor matrix u i according to the product factor matrix parameter V t and part of the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference Δ i t and the normalization constant h i t , The weighted difference Δ i t and the normalized constant h i t are returned to the server;
输出模块,利用所述目标产品因子矩阵和更新后的所述用户因子矩阵,计算所述用户对产品的预测评分值,并对预测评分值排序,将排序高的前N个产品推荐给所述用户。The output module, using the target product factor matrix and the updated user factor matrix, calculates the predicted score value of the product by the user, sorts the predicted score value, and recommends the top N products with the highest ranking to the user.
为了解决上述问题,本申请实施例还提供一种计算机设备,包括存储器、处理器,以及存储在所述存储器中,并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:To solve the above problem, an embodiment of the present application further provides a computer device, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and the processor executes The computer-readable instructions implement the following steps:
服务器端接收用户输入的参数数据;The server side receives the parameter data input by the user;
所述服务器端经初始化处理得到产品因子矩阵V和产品因子矩阵参数V t,并将所述产品因子矩阵参数V t和部分所述参数数据发送至多个客户端; The server side obtains the product factor matrix V and the product factor matrix parameter V t through initialization processing, and sends the product factor matrix parameter V t and part of the parameter data to multiple clients;
所述多个客户端根据所述产品因子矩阵参数V t和部分所述参数数据更新用户因子矩阵u i,并利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t,将所述加权差值Δ i t和归一化常量h i t返回给所述服务器端; The multiple clients update the user factor matrix u i according to the product factor matrix parameter V t and part of the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference Δ i t and the normalization constant h i t , Returning the weighted difference value Δ i t and the normalized constant h i t to the server side;
所述服务器端基于剩余部分所述参数数据,利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新; Based on the remaining part of the parameter data, the server uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalization constant h i t , to the product factor matrix parameter V t Iteratively update;
所述服务器端根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,并将所述目标产品因子矩阵发送至目标客户端; The server side determines the target product factor matrix according to the updated product factor matrix parameter V t+1 , and sends the target product factor matrix to the target client;
所述目标客户端利用所述目标产品因子矩阵和更新后的所述用户因子矩阵,计算所述用户对产品的预测评分值,并对预测评分值排序,将排序高的前N个产品推荐给所述用户。The target client uses the target product factor matrix and the updated user factor matrix to calculate the predicted score value of the product by the user, sort the predicted score value, and recommend the top N products with the highest ranking to the product. the user.
为了解决上述问题,本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,所述计算机可读指令被处理器执行时,使得所述处理器执行如 下步骤:In order to solve the above problem, an embodiment of the present application further provides a computer-readable storage medium, where computer-readable instructions are stored on the computer-readable storage medium, and when the computer-readable instructions are executed by a processor, the processing The device performs the following steps:
服务器端接收用户输入的参数数据;The server side receives the parameter data input by the user;
所述服务器端经初始化处理得到产品因子矩阵V和产品因子矩阵参数V t,并将所述产品因子矩阵参数V t和部分所述参数数据发送至多个客户端; The server side obtains the product factor matrix V and the product factor matrix parameter V t through initialization processing, and sends the product factor matrix parameter V t and part of the parameter data to multiple clients;
所述多个客户端根据所述产品因子矩阵参数V t和部分所述参数数据更新用户因子矩阵u i,并利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t,将所述加权差值Δ i t和归一化常量h i t返回给所述服务器端; The multiple clients update the user factor matrix u i according to the product factor matrix parameter V t and part of the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference Δ i t and the normalization constant h i t , Returning the weighted difference value Δ i t and the normalized constant h i t to the server side;
所述服务器端基于剩余部分所述参数数据,利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新; Based on the remaining part of the parameter data, the server uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalization constant h i t , to the product factor matrix parameter V t Iteratively update;
所述服务器端根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,并将所述目标产品因子矩阵发送至目标客户端; The server side determines the target product factor matrix according to the updated product factor matrix parameter V t+1 , and sends the target product factor matrix to the target client;
所述目标客户端利用所述目标产品因子矩阵和更新后的所述用户因子矩阵,计算所述用户对产品的预测评分值,并对预测评分值排序,将排序高的前N个产品推荐给所述用户。The target client uses the target product factor matrix and the updated user factor matrix to calculate the predicted score value of the product by the user, sort the predicted score value, and recommend the top N products with the highest ranking to the product. the user.
根据本申请实施例提供的产品推荐方法、系统、计算机设备及存储介质,与现有技术相比至少具有以下有益效果:Compared with the prior art, the product recommendation method, system, computer equipment and storage medium provided according to the embodiments of the present application have at least the following beneficial effects:
通过服务器端与客户端的配合,服务器端接收用户输入的参数数据;所述服务器经初始化,并将初始化后的参数数据发送给客户端,客户端根据所述参数数据,并结合自身数据计算,得到加权差值Δ i t和归一化常量h i t并反馈给服务器端;客户端通过利用本地数据进行计算,避免了将数据发送至服务器端出现数据泄露的问题,保护了用户的数据;所述服务器端基于加权差值Δ i t和归一化常量h i t对矩阵参数进行更新,基于更新后的矩阵参数确定目标产品因子矩阵并再发送至客户端,客户端基于目标产品因子矩阵给用户推荐产品。在保护了用户数据的同时,利用用户数据完成对用户进行精准推荐,且服务器端只利用了客户端发送加权差值Δ i t与归一化常量h i t来计算,降低了模型计算成本。 Through the cooperation between the server and the client, the server receives the parameter data input by the user; the server is initialized and sends the initialized parameter data to the client, and the client calculates according to the parameter data and combined with its own data, and obtains The weighted difference Δ i t and the normalized constant h i t are fed back to the server; the client uses local data for calculation, avoiding the problem of data leakage when sending data to the server, and protecting the user's data; The server side updates the matrix parameters based on the weighted difference Δ i t and the normalization constant h i t , determines the target product factor matrix based on the updated matrix parameters and sends it to the client, and the client sends the target product factor matrix based on the target product factor matrix. User recommended products. While protecting the user data, the user data is used to complete the accurate recommendation for the user, and the server side only uses the weighted difference Δ i t sent by the client and the normalized constant h i t to calculate, which reduces the model calculation cost.
附图说明Description of drawings
为了更清楚地说明本申请中的方案,下面将对本申请实施例描述中所需要使用的附图做一个简单介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the solutions in the present application more clearly, the following will briefly introduce the accompanying drawings used in the description of the embodiments of the present application. For those of ordinary skill, other drawings can also be obtained from these drawings without any creative effort.
图1为本申请一实施例提供的产品推荐方法的流程示意图;1 is a schematic flowchart of a product recommendation method provided by an embodiment of the present application;
图2为本申请一实施例提供的产品推荐装置的模块示意图;FIG. 2 is a schematic diagram of a module of a product recommendation device provided by an embodiment of the present application;
图3为本申请一实施例的计算机设备的结构示意图。FIG. 3 is a schematic structural diagram of a computer device according to an embodiment of the present application.
具体实施方式Detailed ways
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员 通常理解的含义相同;本文中在申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请;本申请的说明书和权利要求书及上述附图说明中的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。本申请的说明书和权利要求书或上述附图中的术语“第一”“第二”等是用于区别不同对象,而不是用于描述特定顺序。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field of this application; the terms used herein in the specification of the application are for the purpose of describing specific embodiments only It is not intended to limit the application; the terms "comprising" and "having" and any variations thereof in the description and claims of this application and the above description of the drawings are intended to cover non-exclusive inclusion. The terms "first", "second" and the like in the description and claims of the present application or the above drawings are used to distinguish different objects, rather than to describe a specific order.
本申请提供一种产品推荐方法。参照图1所示,为本申请一实施例提供的产品推荐方法的流程示意图。The present application provides a product recommendation method. Referring to FIG. 1 , it is a schematic flowchart of a product recommendation method according to an embodiment of the present application.
在本实施例中,产品推荐方法包括:In this embodiment, the product recommendation method includes:
S1、服务器端接收用户输入的参数数据;S1. The server side receives the parameter data input by the user;
具体的所述参数数据包括总的客户端的数量n、epoch次数E,即进行随机梯度下降次数为E次、循环次数T,即利用迭代次数为T次、q-FedAvg算法参数q、Lipschitz常数L(K对于在实数集的子集的函数
Figure PCTCN2021083745-appb-000001
若存在常数,使得|f(a)-f(b)|≤K|a-b|
Figure PCTCN2021083745-appb-000002
则称f符合利普希茨条件,对于f最小的常数K称为f的利普希茨常数)、步长α、正则化参数λ和增益参数γ。
The specific parameter data includes the total number of clients n, the number of epochs E, that is, the number of stochastic gradient descent is E times, the number of loops is T, that is, the number of iterations is T times, the q-FedAvg algorithm parameter q, the Lipschitz constant L (K for functions on a subset of the set of real numbers
Figure PCTCN2021083745-appb-000001
If there is a constant such that |f(a)-f(b)|≤K|ab|
Figure PCTCN2021083745-appb-000002
Then f is said to meet the Lipschitz condition, and the constant K with the smallest f is called the Lipschitz constant of f), step size α, regularization parameter λ and gain parameter γ.
所述参数数据一部分用于服务器端,即总的客户端的数量n、循环次数T等参数,一部分通过服务器端发送给客户端,即epoch次数E、q-FedAvg算法参数q、Lipschitz常数L、步长α、正则化参数λ和增益参数γ将发送给客户端。Part of the parameter data is used on the server side, that is, the total number of clients n, the number of cycles T and other parameters, and a part is sent to the client through the server side, that is, the number of epochs E, the q-FedAvg algorithm parameter q, the Lipschitz constant L, the step The length α, regularization parameter λ and gain parameter γ will be sent to the client.
所述服务器端接收用户输入的参数数据。The server side receives parameter data input by the user.
S2、所述服务器端经初始化处理得到产品因子矩阵V和产品因子矩阵参数V t,并将所述产品因子矩阵参数V t和部分所述参数数据发送至多个客户端; S2, the server side obtains the product factor matrix V and the product factor matrix parameter V t through initialization processing, and sends the product factor matrix parameter V t and part of the parameter data to multiple clients;
所述服务器端通过随机初始化产品因子矩阵和产品因子矩阵参数,得到产品因子矩阵参数V t和产品因子矩阵V,将所述产品因子矩阵V t和参数数据中的E、q、L、α、λ、γ参数发送给多个客户端。 The server side obtains the product factor matrix parameter V t and the product factor matrix V by randomly initializing the product factor matrix and the product factor matrix parameters , and the E, q, L, α, λ and γ parameters are sent to multiple clients.
所述随机初始化可采用高斯分布、Xavier等方式进行初始化,随机产生产品因子矩阵参数V t和产品因子矩阵V,通过随机初始化使得模型更有可能找到全局最优解,并且如果产品因子矩阵全赋值0的话,会产生对称性,就导致隐藏层有两个由输入值产生的神经元,由于矩阵具有对称性,无论正向传播还是反向传播,这两个本应表示不同特征的神经元所做的运算都是一致的,就会出现问题。 The random initialization can be initialized by means of Gaussian distribution, Xavier, etc., the product factor matrix parameter V t and the product factor matrix V are randomly generated, and the model is more likely to find the global optimal solution through random initialization, and if the product factor matrix is fully assigned. If it is 0, symmetry will be generated, which will result in two neurons in the hidden layer generated by the input value. Due to the symmetry of the matrix, regardless of forward propagation or back propagation, these two neurons that should represent different characteristics are If the operations are done the same, there will be problems.
进一步的,所述将所述产品因子矩阵参数V t和部分所述参数数据发送至多个客户端,包括: Further, the sending of the product factor matrix parameter V t and part of the parameter data to multiple clients includes:
将n个客户端作为集合S tTake n clients as the set S t ;
将所述产品因子矩阵参数V t和所述参数数据发送至集合S t中的n个客户端。 The product factor matrix parameter V t and the parameter data are sent to n clients in the set S t .
具体的,通过参数数据中规定的客户数量n,,将产品因子矩阵参数V t和参数数据中的E、q、L、α、λ、γ参数发送给集合S t中的n个客户端。 Specifically, the product factor matrix parameter V t and the E, q, L, α, λ, γ parameters in the parameter data are sent to n clients in the set S t through the number of clients n, specified in the parameter data.
同时,客户端也需要进行初始化,同样对用户因子矩阵和用户因子矩阵参数,进行随机初 始化,得到用户因子矩阵参数u i t和用户因子矩阵u i,随机初始化的方式与服务器端一致。 At the same time, the client also needs to be initialized, and the user factor matrix and the user factor matrix parameters are also randomly initialized to obtain the user factor matrix parameter u i t and the user factor matrix u i , and the random initialization method is the same as that of the server side.
本案通过采用横向联邦学习,将n个客户端作为此次更新迭代的样本。采用n各客户端提高数据的不确定性,便于后续训练得出数据的普适性。In this case, by using horizontal federated learning, n clients are used as the samples for this update iteration. Using n clients to improve the uncertainty of the data, it is convenient for subsequent training to obtain the universality of the data.
在所述将所述产品因子矩阵参数V t发送至多个客户端之前,还包括: Before the sending the product factor matrix parameter V t to multiple clients, the method further includes:
将所述产品因子矩阵参数V t进行同态加密。 Homomorphically encrypt the product factor matrix parameter V t .
经同态加密后保证了数据的安全性。且同态加密的好处还在于不需要对数据进行解密,一样可以利用数据进行运算。Data security is guaranteed after homomorphic encryption. And the advantage of homomorphic encryption is that there is no need to decrypt the data, and the data can be used for operations.
S3、多个客户端根据所述产品因子矩阵参数V t和部分所述参数数据更新用户因子矩阵u i,并利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t,将所述加权差值Δ i t和归一化常量h i t返回给所述服务器端; S3. Multiple clients update the user factor matrix u i according to the product factor matrix parameter V t and part of the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference Δ i t and the normalization constant h i t , Returning the weighted difference value Δ i t and the normalized constant h i t to the server side;
所述部分参数数据包括epoch次数E、q-FedAvg算法参数q、Lipschitz常数L、步长α、正则化参数λ和增益参数γ。在服务器端接收所有参数数据时就已分好总的客户端的数量n、循环次数T等参数归服务器端使用;epoch次数E、q-FedAvg算法参数q、Lipschitz常数L、步长α、正则化参数λ和增益参数γ归客户端使用。The partial parameter data includes the epoch number E, the q-FedAvg algorithm parameter q, the Lipschitz constant L, the step size α, the regularization parameter λ and the gain parameter γ. When the server receives all parameter data, the total number of clients n, the number of cycles T and other parameters are assigned to the server for use; epoch times E, q-FedAvg algorithm parameter q, Lipschitz constant L, step size α, regularization The parameter λ and the gain parameter γ are used by the client.
客户端将加权差值Δ i t和归一化常量h i t发送给服务器端之前需经同态加密,保障数据安全。 The client needs to undergo homomorphic encryption before sending the weighted difference Δ i t and the normalized constant h i t to the server to ensure data security.
进一步的,所述多个客户端根据所述产品因子矩阵参数V t和所述参数数据更新用户因子矩阵u i包括: Further, updating the user factor matrix ui according to the product factor matrix parameter V t and the parameter data by the multiple clients includes:
基于所述用户因子矩阵u i和所述产品因子矩阵参数V t,根据公式一计算损失函数F i,所述公式一为: Based on the user factor matrix ui and the product factor matrix parameter V t , the loss function F i is calculated according to formula 1, and the formula 1 is:
Figure PCTCN2021083745-appb-000003
Figure PCTCN2021083745-appb-000003
基于损失函数F i、所述用户因子矩阵u i的梯度和增益参数γ,根据公式二计算更新后的用户因子矩阵参数u i t+1,所述公式二为; Based on the loss function F i , the gradient of the user factor matrix ui and the gain parameter γ, the updated user factor matrix parameter u i t+1 is calculated according to the formula 2, and the formula 2 is:
Figure PCTCN2021083745-appb-000004
Figure PCTCN2021083745-appb-000004
根据迭代后的所述用户因子矩阵参数u i t+1更新所述用户因子矩阵u iUpdate the user factor matrix ui according to the iterative user factor matrix parameter ui t+1 ;
其中,t表示迭代次数、γ表示增益参数、
Figure PCTCN2021083745-appb-000005
表示上一次迭代后u i t的梯度值、j=1,2,…,m,m为产品个数、r ij表示用户i对产品j的评分值、λ表示正则化参数、v j表示产品因子矩阵V的第j行、Fi为损失函数、u i t+1为经过迭代后的所述用户因子矩阵参数、u i t为用户因子矩阵参数。
Among them, t represents the number of iterations, γ represents the gain parameter,
Figure PCTCN2021083745-appb-000005
Represents the gradient value of ui t after the last iteration, j=1,2,..., m,m is the number of products, r ij represents the user i's rating value for product j, λ represents the regularization parameter, v j represents the product In the jth row of the factor matrix V, Fi is the loss function, ui t+1 is the user factor matrix parameter after iteration, and ui t is the user factor matrix parameter.
具体的,通过利用客户端上的用户因子矩阵u i、所述产品因子矩阵参数V t和正则化参数λ,来计算损失函数F i;随后基于损失函数F i、所述用户因子矩阵u i的梯度和增益参数γ,计算更新后的用户因子矩阵参数u i t+1;r ij为客户端现有的。 Specifically, the loss function F i is calculated by using the user factor matrix ui , the product factor matrix parameter V t and the regularization parameter λ on the client; and then based on the loss function F i , the user factor matrix ui The gradient and gain parameter γ of , calculate the updated user factor matrix parameter u i t+1 ; r ij is the existing one of the client.
利用
Figure PCTCN2021083745-appb-000006
use
Figure PCTCN2021083745-appb-000006
公式具体计算F i(V t,u i t),此公式为公式一的具体展开。 The formula specifically calculates F i (V t , ui t ), and this formula is a specific expansion of formula one.
通过客户端自己维护自己数据,避免了数据传输造成的泄露。The client maintains its own data to avoid leakage caused by data transmission.
再进一步的,所述利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t包括: Still further, the use of the q-FedAvg algorithm to calculate the weighted difference Δ i t and the normalized constant h i t includes:
获取所述更新后的所述用户因子矩阵参数
Figure PCTCN2021083745-appb-000007
和预设步长α,对损失函数F i进行E次随机梯度下降,得到模型参数
Figure PCTCN2021083745-appb-000008
Obtain the updated user factor matrix parameters
Figure PCTCN2021083745-appb-000007
and the preset step size α, perform E times of stochastic gradient descent on the loss function F i to obtain the model parameters
Figure PCTCN2021083745-appb-000008
基于所述模型参数
Figure PCTCN2021083745-appb-000009
计算相邻产品因子矩阵参数差值ΔV i t
based on the model parameters
Figure PCTCN2021083745-appb-000009
Calculate the parameter difference ΔV i t of the adjacent product factor matrix;
Figure PCTCN2021083745-appb-000010
Figure PCTCN2021083745-appb-000010
根据相邻产品因子矩阵参数差值,按以下q-FedAvg算法计算加权差值Δ i t和归一化常量h i tCalculate the weighted difference Δ i t and the normalized constant h i t according to the following q-FedAvg algorithm according to the difference between the adjacent product factor matrix parameters;
Figure PCTCN2021083745-appb-000011
Figure PCTCN2021083745-appb-000011
h i t=qF i q-1(V t,u i t+1)||ΔV i t|| 2+LF i q(V t,u i t+1); h i t =qF i q-1 (V t , ui t+1 )||ΔV i t || 2 +LF i q (V t , ui t+1 );
其中,ΔV i t表示相邻产品因子矩阵参数差值、L表示Lipschitz常数、q表示q-FedAvg算法参数、k=1,2,…,E。 Among them, ΔV i t represents the difference between adjacent product factor matrix parameters, L represents the Lipschitz constant, q represents the q-FedAvg algorithm parameter, k=1,2,...,E.
具体的,通过V 0 t+1=V tSpecifically, through V 0 t+1 =V t ;
Figure PCTCN2021083745-appb-000012
Figure PCTCN2021083745-appb-000012
Figure PCTCN2021083745-appb-000013
Figure PCTCN2021083745-appb-000013
当进行第一次随机梯度下降时,即
Figure PCTCN2021083745-appb-000014
由于V 0 t+1=V t,所以
Figure PCTCN2021083745-appb-000015
就可以得到V 1 t+1,从而不断迭代E次,当第E次时,
Figure PCTCN2021083745-appb-000016
即可得到模型参数
Figure PCTCN2021083745-appb-000017
When doing the first stochastic gradient descent, i.e.
Figure PCTCN2021083745-appb-000014
Since V 0 t+1 =V t , so
Figure PCTCN2021083745-appb-000015
V 1 t+1 can be obtained, so as to keep iterating E times, when the E time,
Figure PCTCN2021083745-appb-000016
to get the model parameters
Figure PCTCN2021083745-appb-000017
基于模型参数
Figure PCTCN2021083745-appb-000018
即可得到相邻产品因子矩阵参数差值ΔV i t
Based on model parameters
Figure PCTCN2021083745-appb-000018
Then the difference ΔV i t of the adjacent product factor matrix parameters can be obtained;
所述客户端基于自身的数据特征,计算出加权差值Δ i t和归一化常量h i t并发送给客户端,通过利用自己数据在本地进行计算,保障了数据安全的同时,将自己的数据特征展示出来,用于后续的产品推荐。 The client calculates the weighted difference Δ i t and the normalized constant h i t based on its own data characteristics and sends them to the client. The data features are displayed for subsequent product recommendations.
S4、所述服务器端基于剩余部分所述参数数据,利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新; S4. Based on the remaining part of the parameter data, the server uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalization constant h i t , to the product factor matrix parameter V t is iteratively updated;
所述服务端利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新包括: The server uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalized constant h i t to iteratively update the product factor matrix parameter V t , including:
所述服务端利用得到
Figure PCTCN2021083745-appb-000019
更新后的产品因子矩阵参数V t+1,i表示客户端数量,S t表示客户端集合。
The server uses the
Figure PCTCN2021083745-appb-000019
The updated product factor matrix parameter V t+1 , i represents the number of clients, and S t represents the client set.
通过收集客户端集合S t中所有客户端反馈的加权差值Δ i t与归一化常量h i t数据,来更新产品因子矩阵参数V t+1。提高了参数的普适性。 The product factor matrix parameter V t+1 is updated by collecting the weighted difference Δ i t and normalized constant h i t data fed back by all clients in the client set S t . Improves the universality of parameters.
S5、所述服务器端根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,并将所述目标产品因子矩阵发送至目标客户端; S5, the server side determines the target product factor matrix according to the updated product factor matrix parameter V t+1 , and sends the target product factor matrix to the target client;
进一步的,所述根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,包括: Further, determining the target product factor matrix according to the updated product factor matrix parameter V t+1 , including:
判断更新后的产品因子矩阵参数V t+1与更新前的产品因子矩阵参数V t的差值是否小于预设数值; Determine whether the difference between the updated product factor matrix parameter V t+1 and the pre-updated product factor matrix parameter V t is less than a preset value;
若所述差值大于预设数值,则将更新后的产品因子矩阵参数V t+1,重新发送至客户端继续进行迭代更新,直到所述差值小于所述预设数值为止; If the difference is greater than the preset value, re-send the updated product factor matrix parameter V t+1 to the client to continue iterative update until the difference is less than the preset value;
若所述差值小于等于所述预设数值,则利用更新后的所述产品因子矩阵参数V t+1生成目标产品因子矩阵。 If the difference is less than or equal to the preset value, a target product factor matrix is generated by using the updated product factor matrix parameter V t+1 .
具体的,在本申请的一实施例中,通过对两次相邻迭代得到的产品因子矩阵参数的差值与预设数值进行比较判断,来得出是否还需进行迭代更新,若大于预设数值,则将更新后的产品因子矩阵参数V t+1重新发送至客户端继续进行迭代更新,即将V t+1替换原来的V t,从而得到V t+2,不断迭代,直至相邻迭代得到的产品因子矩阵参数的差值小于预设数值;当所述差值小于预设数值时,则将利用更新后的所述产品因子矩阵参数生成目标产品因子矩阵;所述目标客户端即需要进行产品推荐的用户所对应的客户端,且在参与迭代的客户端中。 Specifically, in an embodiment of the present application, it is determined by comparing the difference between the product factor matrix parameters obtained by two adjacent iterations with a preset value to determine whether iterative update is needed, and if it is greater than the preset value , then the updated product factor matrix parameter V t+1 is re-sent to the client to continue the iterative update, that is, V t+1 is replaced with the original V t , so as to obtain V t+2 , and iterate continuously until adjacent iterations get The difference of the parameters of the product factor matrix is less than the preset value; when the difference is less than the preset value, the updated product factor matrix parameters will be used to generate the target product factor matrix; the target client needs to perform The client corresponding to the user recommended by the product, and among the clients participating in the iteration.
通过将所述差值与预设数值进行比较,最后得出满足条件的产品因子矩阵参数,提高了产品推荐质量,即利用该产品因子矩阵参数生成的目标产品因子矩阵结合用户因子矩阵将给用户推荐更贴近其实际需要的产品。By comparing the difference with the preset value, the product factor matrix parameters that meet the conditions are finally obtained, which improves the quality of product recommendation. Recommend products that are closer to their actual needs.
在本申请的另一实施例中,只需完成预设的迭代次数就将输出最后一次迭代得到的产品因子矩阵参数,并利用该产品因子矩阵参数生成目标产品因子矩阵。In another embodiment of the present application, the product factor matrix parameters obtained in the last iteration are outputted only after completing the preset number of iterations, and the target product factor matrix is generated by using the product factor matrix parameters.
S6、所述目标客户端利用所述目标产品因子矩阵和更新后的所述用户因子矩阵,计算所述用户对产品的预测评分值,并对预测评分值排序,将排序高的前N个产品推荐给所述用户。S6. The target client uses the target product factor matrix and the updated user factor matrix to calculate the predicted score value of the product by the user, sort the predicted score value, and sort the top N products with the highest ranking recommended to the user.
所述更新后的用户因子矩阵为经迭代更新后的最后一次用户因子矩阵。The updated user factor matrix is the last user factor matrix after iterative update.
所述客户端与其所属的用户一一对应。The clients are in one-to-one correspondence with the users to which they belong.
需要强调的是,为了进一步保证数据的私密性和安全性,所述目标产品因子矩阵数据还可以存储于一区块链的节点中。It should be emphasized that, in order to further ensure the privacy and security of the data, the target product factor matrix data can also be stored in a node of a blockchain.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
通过服务器端与客户端的配合,服务器端接收用户输入的参数数据;所述服务器端经初始化处理得到产品因子矩阵V和产品因子矩阵参数V t,并将所述产品因子矩阵参数V t和所述参数数据发送至多个客户端;所述多个客户端根据所述产品因子矩阵参数V t和所述参数数据更新用户因子矩阵u i,并利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t,将所述加权差值Δ i t和归一化常量h i t返回给所述服务器端;客户端通过自己利用数据进行计算,避免了将数据发送至服务器端出现数据泄露的问题,保护了用户的数据;所述服务器端利用所述产品因子 矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新;所述服务器端根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,并将所述目标产品因子矩阵发送至目标客户端;所述目标客户端利用所述目标产品因子矩阵和更新后的所述用户因子矩阵,计算所述用户对产品的预测评分值,并对预测评分值排序,将排序高的前N个产品推荐给所述用户。通过接收服务器端发送的产品因子矩阵参数在客户端本地利用用户数据计算加权差值Δ i t与归一化常量h i t在保护了用户数据的同时,利用用户数据完成对用户进行精准推荐,且服务器端只利用了客户端发送加权差值Δ i t与归一化常量h i t来计算,降低了模型计算成本。 Through the cooperation between the server side and the client side, the server side receives the parameter data input by the user; the server side obtains the product factor matrix V and the product factor matrix parameter V t through initialization processing, and combines the product factor matrix parameter V t with the said product factor matrix parameter V t The parameter data is sent to multiple clients; the multiple clients update the user factor matrix u i according to the product factor matrix parameter V t and the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference Δ i t and the normalized value. Normalize the constant h i t , and return the weighted difference Δ i t and the normalized constant h i t to the server side; the client uses the data to perform calculations by itself, avoiding the occurrence of data when the data is sent to the server side The leakage problem protects the user's data; the server uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalization constant h i t , to the product factor matrix parameter V t is iteratively updated; the server side determines a target product factor matrix according to the updated product factor matrix parameter V t+1 , and sends the target product factor matrix to the target client; the target client uses the The target product factor matrix and the updated user factor matrix are used to calculate the predicted score value of the product by the user, sort the predicted score value, and recommend the top N products with the highest ranking to the user. By receiving the product factor matrix parameters sent by the server, the user data is used locally to calculate the weighted difference Δ i t and the normalized constant h i t on the client side, while protecting the user data, the user data is used to complete accurate user recommendations. And the server side only uses the weighted difference Δ i t sent by the client and the normalized constant h i t to calculate, which reduces the model calculation cost.
如图2所示,是本申请产品推荐系统的功能模块图。As shown in FIG. 2 , it is a functional module diagram of the product recommendation system of the present application.
本申请所述产品推荐系统100可以安装于电子设备中,具体的可以安装在服务器端和客户端中。根据实现的功能,所述产品推荐系统100包括服务器端110和客户端120,所述服务器端110包括包括接收模块111、初始化模块112、更新模块113、确定模块114;所述客户端120包括计算模块121和输出模块122。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机可读指令的指令段,其存储在电子设备的存储器中。The product recommendation system 100 described in this application can be installed in an electronic device, and specifically can be installed in a server and a client. According to the implemented functions, the product recommendation system 100 includes a server end 110 and a client end 120. The server end 110 includes a receiving module 111, an initialization module 112, an update module 113, and a determination module 114; the client end 120 includes a computing module 121 and output module 122. The module in the present invention can also be called a unit, which refers to an instruction segment of a series of computer-readable instructions that can be executed by the electronic device processor and can perform fixed functions, and is stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述服务器端110包括:The server side 110 includes:
接收模块111,用于接收用户输入的参数数据;a receiving module 111, configured to receive parameter data input by a user;
具体的,接收模块111接收总的客户端的数量n、epoch次数E,即进行随机梯度下降次数为E次、循环次数T,即利用迭代次数为T次、q-FedAvg算法参数q、Lipschitz常数L、步长α、正则化参数λ和增益参数γ参数。Specifically, the receiving module 111 receives the total number of clients n and the number of epochs E, that is, the number of stochastic gradient descent is E times and the number of loops is T, that is, the number of iterations is T times, the q-FedAvg algorithm parameter q, the Lipschitz constant L , step size α, regularization parameter λ and gain parameter γ parameter.
初始化模块112,用于经初始化处理得到产品因子矩阵V和产品因子矩阵参数V t,并将所述产品因子矩阵参数V t和部分所述参数数据发送至多个客户端; an initialization module 112, configured to obtain a product factor matrix V and a product factor matrix parameter V t through initialization processing, and send the product factor matrix parameter V t and part of the parameter data to multiple clients;
初始化模块112通过随机初始化,得到产品因子矩阵参数V t和产品因子矩阵V。 The initialization module 112 obtains the product factor matrix parameter V t and the product factor matrix V through random initialization.
所述服务器端110还包括同态加密模块;The server side 110 further includes a homomorphic encryption module;
同态加密模块用于将所述产品因子矩阵参数V t进行同态加密。 The homomorphic encryption module is used to perform homomorphic encryption on the product factor matrix parameter V t .
同态加密模块保证了数据的安全性。The homomorphic encryption module ensures the security of the data.
更新模块113,基于剩余部分所述参数数据,利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新; Update module 113, based on the remaining part of the parameter data, using the product factor matrix parameter V t and all received weighted differences Δ i t and normalization constant h i t , for the product factor matrix parameter V t Iteratively update;
进一步的,所述更新模块113利用
Figure PCTCN2021083745-appb-000020
得到更新后的产品因子矩阵参数V t+1,i表示客户端数量,St表示客户端集合。
Further, the update module 113 utilizes
Figure PCTCN2021083745-appb-000020
The updated product factor matrix parameter V t+1 is obtained, i represents the number of clients, and St represents the set of clients.
确定模块114,用于根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,并将所述目标产品因子矩阵发送至目标客户端; A determination module 114, configured to determine a target product factor matrix according to the updated product factor matrix parameter V t+1 , and send the target product factor matrix to the target client;
进一步的,所述确定模块114包括差值判断子模块、迭代子模块和生成子模块;Further, the determining module 114 includes a difference judgment sub-module, an iterative sub-module and a generation sub-module;
差值判断子模块用于判断更新后的产品因子矩阵参数V t+1与更新前的产品因子矩阵参数V t的差值是否小于预设数值; The difference judgment submodule is used to judge whether the difference between the updated product factor matrix parameter V t+1 and the before updated product factor matrix parameter V t is less than a preset value;
迭代子模块用于若所述差值大于预设数值,则将更新后的产品因子矩阵参数V t+1,重新发送至客户端继续进行迭代更新,直到所述差值小于所述预设数值为止; The iterative submodule is used to re-send the updated product factor matrix parameter V t+1 to the client to continue iterative update if the difference is greater than the preset value, until the difference is less than the preset value until;
生成子模块用于若所述差值小于等于所述预设数值,则利用更新后的所述产品因子矩阵参数V t+1生成目标产品因子矩阵。 The generating sub-module is configured to generate a target product factor matrix by using the updated product factor matrix parameter V t+1 if the difference is less than or equal to the preset value.
差值判断子模块通过对两次相邻迭代得到的产品因子矩阵参数的差值与预设数值进行比较判断,来得出是否还需进行迭代更新,若大于预设数值,迭代子模块则将更新后的产品因子矩阵参数V t+1重新发送至客户端继续进行迭代更新,即将V t+1替换原来的V t,从而得到V t+2,不断迭代,直至相邻迭代得到的产品因子矩阵参数的差值小于预设数值;当所述差值小于预设数值时,生成子模块则将利用更新后的所述产品因子矩阵参数生成目标产品因子矩阵; The difference judging sub-module compares and judges the difference between the product factor matrix parameters obtained by two adjacent iterations and the preset value to determine whether iterative update is needed. If it is greater than the preset value, the iterative sub-module will update The final product factor matrix parameter V t+1 is re-sent to the client to continue the iterative update, that is, V t+1 is replaced with the original V t , so as to obtain V t+2 , and iterate continuously until the product factor matrix obtained by adjacent iterations The difference value of the parameter is less than the preset value; when the difference value is less than the preset value, the generating sub-module will use the updated product factor matrix parameter to generate the target product factor matrix;
通过差值判断子模块、迭代子模块和生成子模块的配合将所述差值与预设数值进行比较,最后得出满足条件的产品因子矩阵参数,提高了产品推荐质量,即利用该产品因子矩阵参数生成的目标产品因子矩阵结合用户因子矩阵将给用户推荐更贴近其实际需要的产品。Through the cooperation of the difference judgment sub-module, iterative sub-module and generation sub-module, the difference value is compared with the preset value, and finally the product factor matrix parameters that meet the conditions are obtained, which improves the product recommendation quality, that is, using the product factor The target product factor matrix generated by the matrix parameters combined with the user factor matrix will recommend products that are closer to their actual needs to users.
所述客户端120包括:The client 120 includes:
计算模块121,用于根据所述产品因子矩阵参数V t更新用户因子矩阵u i,并利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t,将所述加权差值Δ i t和归一化常量h i t返回给所述服务器端; The calculation module 121 is used to update the user factor matrix u i according to the product factor matrix parameter V t , and use the q-FedAvg algorithm to calculate the weighted difference value Δ i t and the normalization constant h i t , and the weighted difference value Δ i t and normalized constant h i t are returned to the server;
计算模块121包括损失函数计算子模块、用户因子矩阵参数更新子模块和用户因子矩阵更新子模块;The calculation module 121 includes a loss function calculation submodule, a user factor matrix parameter update submodule and a user factor matrix update submodule;
损失函数计算子模块基于所述用户因子矩阵u i和所述产品因子矩阵参数V t,根据公式一计算损失函数F i(V t,u i t),所述公式一为: The loss function calculation sub-module calculates the loss function F i (V t , u i t ) according to the formula 1 based on the user factor matrix ui and the product factor matrix parameter V t , and the formula 1 is:
Figure PCTCN2021083745-appb-000021
Figure PCTCN2021083745-appb-000021
用户因子矩阵参数更新子模块基于损失函数F i(V t,u i t)、所述用户因子矩阵u i的梯度和增益参数γ,根据公式二计算更新后的用户因子矩阵参数u i t+1,所述公式二为: The user factor matrix parameter update submodule calculates the updated user factor matrix parameter u i t+ according to formula 2 based on the loss function F i (V t , u i t ), the gradient of the user factor matrix ui and the gain parameter γ 1 , the second formula is:
Figure PCTCN2021083745-appb-000022
Figure PCTCN2021083745-appb-000022
用户因子矩阵更新子模块根据更新后的所述用户因子矩阵参数u i t+1更新所述用户因子矩阵u iThe user factor matrix updating submodule updates the user factor matrix u i according to the updated user factor matrix parameter u i t+1 ;
其中,t表示迭代次数、γ表示增益参数、
Figure PCTCN2021083745-appb-000023
表示上一次迭代后u i t的梯度值、j=1,2,…,m,m为产品个数、r ij表示用户i对产品j的评分值、λ表示正则化参数、v j表示产品因子矩阵V 的第j行、F i为损失函数、u i t+1为经过迭代后的所述用户因子矩阵参数、u i t为用户因子矩阵参数。
Among them, t represents the number of iterations, γ represents the gain parameter,
Figure PCTCN2021083745-appb-000023
Represents the gradient value of ui t after the last iteration, j=1,2,..., m,m is the number of products, r ij represents the user i's rating value for product j, λ represents the regularization parameter, v j represents the product The jth row of the factor matrix V, F i is the loss function, ui t+1 is the user factor matrix parameter after iteration, and ui t is the user factor matrix parameter.
通过损失函数计算子模块、用户因子矩阵参数更新子模块和用户因子矩阵更新子模块的配合实现通过客户端自己维护自己数据,避免了数据传输造成的泄露。Through the cooperation of the loss function calculation sub-module, the user factor matrix parameter update sub-module and the user factor matrix update sub-module, the client can maintain its own data and avoid leakage caused by data transmission.
计算模块121还包括模型参数计算子模块、差值计算子模块和基于q-FedAvg算法计算子模块;The calculation module 121 further includes a model parameter calculation sub-module, a difference calculation sub-module and a calculation sub-module based on the q-FedAvg algorithm;
模型参数计算子模块通过获取所述更新后的所述用户因子矩阵参数
Figure PCTCN2021083745-appb-000024
和预设步长α,对损失函数F i进行E次随机梯度下降,得到模型参数
Figure PCTCN2021083745-appb-000025
The model parameter calculation submodule obtains the updated user factor matrix parameters by
Figure PCTCN2021083745-appb-000024
and the preset step size α, perform E times of stochastic gradient descent on the loss function F i to obtain the model parameters
Figure PCTCN2021083745-appb-000025
差值计算子模块基于所述模型参数
Figure PCTCN2021083745-appb-000026
计算相邻产品因子矩阵参数差值ΔV i t
The difference calculation submodule is based on the model parameters
Figure PCTCN2021083745-appb-000026
Calculate the parameter difference ΔV i t of adjacent product factor matrices:
Figure PCTCN2021083745-appb-000027
Figure PCTCN2021083745-appb-000027
基于q-FedAvg算法计算子模块根据相邻产品因子矩阵参数差值,按以下q-FedAvg算法计算加权差值Δ i t和归一化常量h i tThe calculation sub-module based on the q-FedAvg algorithm calculates the weighted difference Δ i t and the normalized constant h i t according to the difference of the adjacent product factor matrix parameters according to the following q-FedAvg algorithm:
Figure PCTCN2021083745-appb-000028
Figure PCTCN2021083745-appb-000028
h i t=qF i q-1(V t,u i t+1)||ΔV i t|| 2+LF i q(V t,u i t+1); h i t =qF i q-1 (V t , ui t+1 )||ΔV i t || 2 +LF i q (V t , ui t+1 );
其中,ΔV i t表示相邻产品因子矩阵参数差值、L表示Lipschitz常数、q表示q-FedAvg算法参数、k=1,2,…,E。 Among them, ΔV i t represents the difference between adjacent product factor matrix parameters, L represents the Lipschitz constant, q represents the q-FedAvg algorithm parameter, k=1,2,...,E.
通过参数计算子模块、差值计算子模块和基于q-FedAvg算法计算子模块的配合,实现所述客户端基于自身的数据特征,计算出加权差值Δ i t和归一化常量h i t并发送给客户端,通过利用自己数据再本端进行计算,保障了数据安全的同时,将自己的数据特征展示出来,用于后续的产品推荐。 Through the cooperation of the parameter calculation sub-module, the difference calculation sub-module and the calculation sub-module based on the q-FedAvg algorithm, the client can calculate the weighted difference Δ i t and the normalized constant h i t based on its own data characteristics And send it to the client, by using its own data to perform calculations on the local end, while ensuring data security, it displays its own data characteristics for subsequent product recommendations.
输出模块122,利用所述目标产品因子矩阵和更新后的所述用户因子矩阵,计算所述用户对产品的预测评分值,并对预测评分值排序,将排序高的前N个产品推荐给所述用户。The output module 122, using the target product factor matrix and the updated user factor matrix, calculates the predicted score value of the product by the user, sorts the predicted score value, and recommends the top N products with the highest ranking to all the products. described user.
需要强调的是,为了进一步保证数据的私密性和安全性,所述目标产品因子矩阵数据还可以存储于一区块链的节点中。It should be emphasized that, in order to further ensure the privacy and security of the data, the target product factor matrix data can also be stored in a node of a blockchain.
通过采用上述装置,通过所述产品推荐系统100包括服务器端110和客户端120,所述服务器端110包括包括接收模块111、初始化模块112、更新模块113、确定模块114;所述客户端120包括计算模块121和输出模块122,各模块的配合使用,通过接收服务器端发送的产品因子矩阵参数在客户端本地利用用户数据计算加权差值Δ i t与归一化常量h i t,在保护了用户数据的同时,利用用户数据完成对用户进行精准推荐,且服务器端只利用了客户端发送加权差值Δ i t与归一化常量h i t来计算,降低了模型计算成本。 By using the above device, the product recommendation system 100 includes a server end 110 and a client end 120, the server end 110 includes a receiving module 111, an initialization module 112, an update module 113, and a determination module 114; the client end 120 includes The calculation module 121 and the output module 122 are used together to calculate the weighted difference Δ i t and the normalized constant h i t by receiving the product factor matrix parameters sent by the server and using user data locally at the client. At the same time of user data, user data is used to complete accurate recommendation for users, and the server side only uses the weighted difference Δ i t sent by the client and the normalized constant h i t to calculate, which reduces the model calculation cost.
为解决上述技术问题,本申请实施例还提供计算机设备。具体请参阅图3,图3为本实施例计算机设备基本结构框图。To solve the above technical problems, the embodiments of the present application also provide computer equipment. For details, please refer to FIG. 3 , which is a block diagram of a basic structure of a computer device according to this embodiment.
所述计算机设备4包括通过系统总线相互通信连接存储器41、处理器42、网络接口43。需要指出的是,图中仅示出了具有组件41-43的计算机设备4,但是应理解的是,并不要求实 施所有示出的组件,可以替代的实施更多或者更少的组件。其中,本技术领域技术人员可以理解,这里的计算机设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that communicate with each other through a system bus. It should be pointed out that only the computer device 4 with components 41-43 is shown in the figure, but it should be understood that it is not required to implement all of the shown components, and that more or less components may be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, special-purpose Integrated circuit (Application Specific Integrated Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processor (Digital Signal Processor, DSP), embedded equipment, etc.
所述计算机设备可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述计算机设备可以与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互。The computer equipment may be a desktop computer, a notebook computer, a palmtop computer, a cloud server and other computing equipment. The computer device can perform human-computer interaction with the user through a keyboard, a mouse, a remote control, a touch pad or a voice control device.
所述存储器41至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,所述存储器41可以是所述计算机设备4的内部存储单元,例如该计算机设备4的硬盘或内存。在另一些实施例中,所述存储器41也可以是所述计算机设备4的外部存储设备,例如该计算机设备4上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,所述存储器41还可以既包括所述计算机设备4的内部存储单元也包括其外部存储设备。本实施例中,所述存储器41通常用于存储安装于所述计算机设备4的操作系统和各类应用软件,例如产品推荐方法的计算机可读指令等。此外,所述存储器41还可以用于暂时地存储已经输出或者将要输出的各类数据。The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static Random Access Memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4 , such as a hard disk or a memory of the computer device 4 . In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc. Of course, the memory 41 may also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4 , such as computer-readable instructions for a product recommendation method. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or will be output.
所述处理器42在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器42通常用于控制所述计算机设备4的总体操作。本实施例中,所述处理器42用于运行所述存储器41中存储的计算机可读指令或者处理数据,例如运行所述产品推荐方法的计算机可读指令。The processor 42 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. This processor 42 is typically used to control the overall operation of the computer device 4 . In this embodiment, the processor 42 is configured to execute computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for executing the product recommendation method.
所述网络接口43可包括无线网络接口或有线网络接口,该网络接口43通常用于在所述计算机设备4与其他电子设备之间建立通信连接。The network interface 43 may include a wireless network interface or a wired network interface, and the network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
本实施例通过处理器执行存储在存储器的计算机可读指令时实现如上述实施例产品推荐方法的步骤,通过服务器端与客户端的配合,服务器端接收用户输入的参数数据;所述服务器端经初始化处理得到产品因子矩阵V和产品因子矩阵参数V t,并将所述产品因子矩阵参数V t和所述参数数据发送至多个客户端;所述多个客户端根据所述产品因子矩阵参数V t和所述参数数据更新用户因子矩阵u i,并利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t,将所述加权差值Δ i t和归一化常量h i t返回给所述服务器端;客户端通过自己利用数据进行计算,避免了将数据发送至服务器端出现数据泄露的问题,保护了用户的数据;所述服务器端利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新;所述服务器端根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,并将所 述目标产品因子矩阵发送至目标客户端;所述目标客户端利用所述目标产品因子矩阵和更新后的所述用户因子矩阵,计算所述用户对产品的预测评分值,并对预测评分值排序,将排序高的前N个产品推荐给所述用户。通过接收服务器端发送的产品因子矩阵参数在客户端本地利用用户数据计算加权差值Δ i t与归一化常量h i t,在保护了用户数据的同时,利用用户数据完成对用户进行精准推荐,且服务器端只利用了客户端发送加权差值Δ i t与归一化常量h i t来计算,降低了模型计算成本。 In this embodiment, when the processor executes the computer-readable instructions stored in the memory, the steps of the product recommendation method in the above-mentioned embodiment are implemented. Through the cooperation between the server and the client, the server receives the parameter data input by the user; the server is initialized The product factor matrix V and the product factor matrix parameter V t are obtained by processing, and the product factor matrix parameter V t and the parameter data are sent to multiple clients; the multiple clients are based on the product factor matrix parameter V t and the parameter data to update the user factor matrix u i , and use the q-FedAvg algorithm to calculate the weighted difference Δ i t and the normalized constant h i t , and the weighted difference Δ i t and the normalized constant h i t is returned to the server; the client uses the data to calculate by itself, which avoids the problem of data leakage when the data is sent to the server, and protects the user's data; the server utilizes the product factor matrix parameter V t and all received weighted differences Δ i t and normalized constant h i t , iteratively update the product factor matrix parameter V t ; the server side determines according to the updated product factor matrix parameter V t+1 target product factor matrix, and send the target product factor matrix to the target client; the target client uses the target product factor matrix and the updated user factor matrix to calculate the user's predicted score for the product value, and sort the predicted score value, and recommend the top N products with the highest ranking to the user. By receiving the product factor matrix parameters sent by the server, the client locally uses the user data to calculate the weighted difference Δ i t and the normalized constant h i t . While protecting the user data, the user data is used to complete accurate user recommendations. , and the server side only uses the weighted difference Δ i t sent by the client and the normalized constant h i t to calculate, which reduces the model calculation cost.
本申请还提供了另一种实施方式,即提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令可被至少一个处理器执行,以使所述至少一个处理器执行如上述的产品推荐方法的步骤,通过服务器端与客户端的配合,服务器端接收用户输入的参数数据;所述服务器端经初始化处理得到产品因子矩阵V和产品因子矩阵参数V t,并将所述产品因子矩阵参数V t和所述参数数据发送至多个客户端;所述多个客户端根据所述产品因子矩阵参数V t和所述参数数据更新用户因子矩阵u i,并利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t,将所述加权差值Δ i t和归一化常量h i t返回给所述服务器端;客户端通过自己利用数据进行计算,避免了将数据发送至服务器端出现数据泄露的问题,保护了用户的数据;所述服务器端利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新;所述服务器端根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,并将所述目标产品因子矩阵发送至目标客户端;所述目标客户端利用所述目标产品因子矩阵和更新后的所述用户因子矩阵,计算所述用户对产品的预测评分值,并对预测评分值排序,将排序高的前N个产品推荐给所述用户。通过接收服务器端发送的产品因子矩阵参数在客户端本地利用用户数据计算加权差值Δ i t与归一化常量h i t,在保护了用户数据的同时,利用用户数据完成对用户进行精准推荐,且服务器端只利用了客户端发送加权差值Δ i t与归一化常量h i t来计算,降低了模型计算成本。所述计算机可读存储介质可以是非易失性,也可以是易失性。 The present application also provides another embodiment, that is, to provide a computer-readable storage medium, where the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to Make the at least one processor perform the steps of the above-mentioned product recommendation method, and through the cooperation between the server and the client, the server receives the parameter data input by the user; the server obtains the product factor matrix V and the product factor matrix through initialization processing parameter V t , and send the product factor matrix parameter V t and the parameter data to multiple clients; the multiple clients update the user factor matrix u according to the product factor matrix parameter V t and the parameter data i , and use the q-FedAvg algorithm to calculate the weighted difference Δ i t and the normalized constant h i t , and return the weighted difference Δ i t and the normalized constant h i t to the server; the client By using the data for calculation by itself, the problem of data leakage when the data is sent to the server side is avoided, and the user's data is protected; the server side uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalization constant h i t , iteratively update the product factor matrix parameter V t ; the server side determines the target product factor matrix according to the updated product factor matrix parameter V t+1 , and the target product factor matrix is The product factor matrix is sent to the target client; the target client uses the target product factor matrix and the updated user factor matrix to calculate the predicted score value of the product by the user, and sorts the predicted score value to The top N products with the highest ranking are recommended to the user. By receiving the product factor matrix parameters sent by the server, the client locally uses the user data to calculate the weighted difference Δ i t and the normalized constant h i t . While protecting the user data, the user data is used to complete accurate user recommendations. , and the server side only uses the weighted difference Δ i t sent by the client and the normalized constant h i t to calculate, which reduces the model calculation cost. The computer-readable storage medium may be non-volatile or volatile.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course hardware can also be used, but in many cases the former is better implementation. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products are stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in the various embodiments of this application.
显然,以上所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例,附图中给出了本申请的较佳实施例,但并不限制本申请的专利范围。本申请可以以许多不同的形式来实现,相反地,提供这些实施例的目的是使对本申请的公开内容的理解更加透彻全面。尽管参照前述实施例对本申请进行了详细的说明,对于本领域的技术人员来而言,其依然可以对前述各具体实施方式所记载的技术方案进行修改,或者对其中部分技术特征进行等效替换。凡是利用 本申请说明书及附图内容所做的等效结构,直接或间接运用在其他相关的技术领域,均同理在本申请专利保护范围之内。Obviously, the above-described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The accompanying drawings show the preferred embodiments of the present application, but do not limit the scope of the patent of the present application. This application may be embodied in many different forms, rather these embodiments are provided so that a thorough and complete understanding of the disclosure of this application is provided. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or perform equivalent replacements for some of the technical features. . Any equivalent structures made by using the contents of the description and drawings of the present application, which are directly or indirectly used in other related technical fields, are all within the scope of the patent protection of the present application.

Claims (20)

  1. 一种产品推荐方法,所述方法包括:A product recommendation method, the method includes:
    服务器端接收用户输入的参数数据;The server side receives the parameter data input by the user;
    所述服务器端经初始化处理得到产品因子矩阵V和产品因子矩阵参数V t,并将所述产品因子矩阵参数V t和部分所述参数数据发送至多个客户端; The server side obtains the product factor matrix V and the product factor matrix parameter V t through initialization processing, and sends the product factor matrix parameter V t and part of the parameter data to multiple clients;
    所述多个客户端根据所述产品因子矩阵参数V t和部分所述参数数据更新用户因子矩阵u i,并利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t,将所述加权差值Δ i t和归一化常量h i t返回给所述服务器端; The multiple clients update the user factor matrix u i according to the product factor matrix parameter V t and part of the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference Δ i t and the normalization constant h i t , Returning the weighted difference value Δ i t and the normalized constant h i t to the server side;
    所述服务器端基于剩余部分所述参数数据,利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新; Based on the remaining part of the parameter data, the server uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalization constant h i t , to the product factor matrix parameter V t Iteratively update;
    所述服务器端根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,并将所述目标产品因子矩阵发送至目标客户端; The server side determines the target product factor matrix according to the updated product factor matrix parameter V t+1 , and sends the target product factor matrix to the target client;
    所述目标客户端利用所述目标产品因子矩阵和更新后的所述用户因子矩阵,计算所述用户对产品的预测评分值,并对预测评分值排序,将排序高的前N个产品推荐给所述用户。The target client uses the target product factor matrix and the updated user factor matrix to calculate the predicted score value of the product by the user, sort the predicted score value, and recommend the top N products with the highest ranking to the product. the user.
  2. 根据权利要求1所述的产品推荐方法,其中,所述根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,包括: The product recommendation method according to claim 1, wherein, determining the target product factor matrix according to the updated product factor matrix parameter V t+1 , comprising:
    判断更新后的产品因子矩阵参数V t+1与更新前的产品因子矩阵参数V t的差值是否小于预设数值; Determine whether the difference between the updated product factor matrix parameter V t+1 and the pre-updated product factor matrix parameter V t is less than a preset value;
    若所述差值大于预设数值,则将更新后的产品因子矩阵参数V t+1,重新发送至客户端继续进行迭代更新,直到所述差值小于所述预设数值为止; If the difference is greater than the preset value, re-send the updated product factor matrix parameter V t+1 to the client to continue iterative update until the difference is less than the preset value;
    若所述差值小于等于所述预设数值,则利用更新后的所述产品因子矩阵参数V t+1生成目标产品因子矩阵。 If the difference is less than or equal to the preset value, a target product factor matrix is generated by using the updated product factor matrix parameter V t+1 .
  3. 根据权利要求1所述的产品推荐方法,其中,在所述将所述产品因子矩阵参数V t发送至多个客户端之前,还包括: The product recommendation method according to claim 1, wherein before the sending the product factor matrix parameter V t to a plurality of clients, the method further comprises:
    将所述产品因子矩阵参数V t进行同态加密。 Homomorphically encrypt the product factor matrix parameter V t .
  4. 根据权利要求1所述的产品推荐方法,其中,所述服务端基于剩余部分所述参数数据,利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新,包括: The product recommendation method according to claim 1, wherein, based on the remaining part of the parameter data, the server uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalization constants h i t , iteratively update the product factor matrix parameter V t , including:
    所述服务端利用
    Figure PCTCN2021083745-appb-100001
    得到更新后的产品因子矩阵参数V t+1,i表示客户端数量,S t表示客户端集合。
    The server uses
    Figure PCTCN2021083745-appb-100001
    The updated product factor matrix parameter V t+1 is obtained, i represents the number of clients, and S t represents the set of clients.
  5. 根据权利要求1所述的产品推荐方法,其中,所述多个客户端根据所述产品因子矩阵参数V t和部分所述参数数据更新用户因子矩阵u i,包括: The product recommendation method according to claim 1, wherein the plurality of clients update the user factor matrix ui according to the product factor matrix parameter V t and part of the parameter data, including:
    基于所述用户因子矩阵u i和所述产品因子矩阵参数V t,根据公式一计算损失函数F i,所述公式一为: Based on the user factor matrix ui and the product factor matrix parameter V t , the loss function F i is calculated according to formula 1, and the formula 1 is:
    Figure PCTCN2021083745-appb-100002
    Figure PCTCN2021083745-appb-100002
    基于损失函数F i、所述用户因子矩阵u i的梯度和增益参数γ,根据公式二计算更新后的用户因子矩阵参数u i t+1,所述公式二为: Based on the loss function F i , the gradient of the user factor matrix ui and the gain parameter γ, the updated user factor matrix parameter u i t+1 is calculated according to the formula 2, and the formula 2 is:
    Figure PCTCN2021083745-appb-100003
    Figure PCTCN2021083745-appb-100003
    根据更新后的所述用户因子矩阵参数u i t+1更新所述用户因子矩阵u iUpdate the user factor matrix ui according to the updated user factor matrix parameter ui t+1 ;
    其中,t表示迭代次数、γ表示增益参数、
    Figure PCTCN2021083745-appb-100004
    表示上一次迭代后u i t的梯度值、j=1,2,…,m,m为产品个数、r ij表示用户i对产品j的评分值、λ表示正则化参数、v j表示产品因子矩阵V的第j行、F i为损失函数、u i t+1为经过迭代后的所述用户因子矩阵参数、u i t为用户因子矩阵参数。
    Among them, t represents the number of iterations, γ represents the gain parameter,
    Figure PCTCN2021083745-appb-100004
    Represents the gradient value of ui t after the last iteration, j=1,2,..., m,m is the number of products, r ij represents the user i's rating value for product j, λ represents the regularization parameter, v j represents the product In the jth row of the factor matrix V, F i is the loss function, ui t+1 is the user factor matrix parameter after iteration, and ui t is the user factor matrix parameter.
  6. 根据权利要求5所述的产品推荐方法,其中,所述利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t包括: The product recommendation method according to claim 5, wherein the calculating the weighted difference Δ i t and the normalized constant h i t by using the q-FedAvg algorithm comprises:
    获取所述更新后的所述用户因子矩阵参数
    Figure PCTCN2021083745-appb-100005
    和所述参数数据中的预设步长α,对损失函数F i进行E次随机梯度下降,得到模型参数
    Figure PCTCN2021083745-appb-100006
    Obtain the updated user factor matrix parameters
    Figure PCTCN2021083745-appb-100005
    and the preset step size α in the parameter data, perform E times of stochastic gradient descent on the loss function F i to obtain the model parameters
    Figure PCTCN2021083745-appb-100006
    基于所述模型参数
    Figure PCTCN2021083745-appb-100007
    计算相邻产品因子矩阵参数差值ΔV i t
    based on the model parameters
    Figure PCTCN2021083745-appb-100007
    Calculate the parameter difference ΔV i t of adjacent product factor matrices:
    Figure PCTCN2021083745-appb-100008
    Figure PCTCN2021083745-appb-100008
    根据相邻产品因子矩阵参数差值ΔV i t,按以下q-FedAvg算法计算加权差值Δ i t和归一化常量h i tAccording to the adjacent product factor matrix parameter difference ΔV i t , the weighted difference value Δ i t and the normalization constant h i t are calculated according to the following q-FedAvg algorithm:
    Δ i t=F i q(V t,u i t+1)ΔV i tΔ i t =Fi q (V t , u i t+1 )ΔV i t ;
    h i t=qF i q-1(V t,u i t+1)||ΔV i t|| 2+LF i q(V t,u i t+1); h i t =qF i q-1 (V t , ui t+1 )||ΔV i t || 2 +LF i q (V t , ui t+1 );
    其中,ΔV i t表示相邻产品因子矩阵参数差值、L表示Lipschitz常数、q表示q-FedAvg算法参数、k=1,2,…,E。 Among them, ΔV i t represents the difference between adjacent product factor matrix parameters, L represents the Lipschitz constant, q represents the q-FedAvg algorithm parameter, k=1,2,...,E.
  7. 一种产品推荐系统,所述产品推荐系统包括服务端和客户端;A product recommendation system, the product recommendation system includes a server and a client;
    所述服务端包括:The server includes:
    接收模块,用于接收用户输入的参数数据;The receiving module is used to receive the parameter data input by the user;
    初始化模块,用于经初始化处理得到产品因子矩阵V和产品因子矩阵参数V t,并将所述产品因子矩阵参数V t和部分所述参数数据发送至多个客户端; an initialization module, configured to obtain a product factor matrix V and a product factor matrix parameter V t through initialization, and send the product factor matrix parameter V t and part of the parameter data to multiple clients;
    更新模块,基于剩余部分所述参数数据,利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新; The update module, based on the remaining part of the parameter data, uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalization constant h i t to perform the product factor matrix parameter V t . iterative update;
    确定模块,用于根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,并将所述目标产品因子矩阵发送至目标客户端; A determination module, for determining a target product factor matrix according to the updated product factor matrix parameter V t+1 , and sending the target product factor matrix to the target client;
    所述客户端包括:The client includes:
    计算模块,用于根据所述产品因子矩阵参数V t和部分所述参数数据更新用户因子矩阵u i, 并利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t,将所述加权差值Δ i t和归一化常量h i t返回给所述服务器端; The calculation module is used to update the user factor matrix ui according to the product factor matrix parameter V t and part of the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference Δ i t and the normalization constant h i t , The weighted difference Δ i t and the normalized constant h i t are returned to the server;
    输出模块,利用所述目标产品因子矩阵和更新后的所述用户因子矩阵,计算所述用户对产品的预测评分值,并对预测评分值排序,将排序高的前N个产品推荐给所述用户。The output module, using the target product factor matrix and the updated user factor matrix, calculates the predicted score value of the product by the user, sorts the predicted score value, and recommends the top N products with the highest ranking to the user.
  8. 根据权利要求7所述的产品推荐系统,其中,所述更新模块包括差值判断子模块、迭代子模块和生成子模块;The product recommendation system according to claim 7, wherein the update module comprises a difference judgment submodule, an iterative submodule and a generation submodule;
    所述差值判断子模块,用于判断更新后的产品因子矩阵参数V t+1与更新前的产品因子矩阵参数V t的差值是否小于预设数值; The difference judgment submodule is used to judge whether the difference between the updated product factor matrix parameter V t+1 and the before updated product factor matrix parameter V t is less than a preset value;
    所述迭代子模块,用于若所述差值大于预设数值,则将更新后的产品因子矩阵参数V t+1,重新发送至客户端继续进行迭代更新,直到所述差值小于所述预设数值为止; The iterative submodule is configured to re-send the updated product factor matrix parameter V t+1 to the client to continue iterative update if the difference is greater than a preset value, until the difference is less than the until the preset value;
    所述生成子模块,用于若所述差值小于等于所述预设数值,则利用更新后的所述产品因子矩阵参数V t+1生成目标产品因子矩阵。 The generating sub-module is configured to generate a target product factor matrix by using the updated product factor matrix parameter V t+1 if the difference is less than or equal to the preset value.
  9. 一种计算机设备,包括存储器、处理器,以及存储在所述存储器中,并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, the processor implementing the following steps when executing the computer-readable instructions:
    服务器端接收用户输入的参数数据;The server side receives the parameter data input by the user;
    所述服务器端经初始化处理得到产品因子矩阵V和产品因子矩阵参数V t,并将所述产品因子矩阵参数V t和部分所述参数数据发送至多个客户端; The server side obtains the product factor matrix V and the product factor matrix parameter V t through initialization processing, and sends the product factor matrix parameter V t and part of the parameter data to multiple clients;
    所述多个客户端根据所述产品因子矩阵参数V t和部分所述参数数据更新用户因子矩阵u i,并利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t,将所述加权差值Δ i t和归一化常量h i t返回给所述服务器端; The multiple clients update the user factor matrix u i according to the product factor matrix parameter V t and part of the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference Δ i t and the normalization constant h i t , Returning the weighted difference value Δ i t and the normalized constant h i t to the server side;
    所述服务器端基于剩余部分所述参数数据,利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新; Based on the remaining part of the parameter data, the server uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalization constant h i t , to the product factor matrix parameter V t Iteratively update;
    所述服务器端根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,并将所述目标产品因子矩阵发送至目标客户端; The server side determines the target product factor matrix according to the updated product factor matrix parameter V t+1 , and sends the target product factor matrix to the target client;
    所述目标客户端利用所述目标产品因子矩阵和更新后的所述用户因子矩阵,计算所述用户对产品的预测评分值,并对预测评分值排序,将排序高的前N个产品推荐给所述用户。The target client uses the target product factor matrix and the updated user factor matrix to calculate the predicted score value of the product by the user, sort the predicted score value, and recommend the top N products with the highest ranking to the product. the user.
  10. 根据权利要求9所述的计算机设备,其中,所述根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,包括: The computer device according to claim 9, wherein the determining the target product factor matrix according to the updated product factor matrix parameter V t+1 comprises:
    判断更新后的产品因子矩阵参数V t+1与更新前的产品因子矩阵参数V t的差值是否小于预设数值; Determine whether the difference between the updated product factor matrix parameter V t+1 and the pre-updated product factor matrix parameter V t is less than a preset value;
    若所述差值大于预设数值,则将更新后的产品因子矩阵参数V t+1,重新发送至客户端继续进行迭代更新,直到所述差值小于所述预设数值为止; If the difference is greater than the preset value, re-send the updated product factor matrix parameter V t+1 to the client to continue iterative update until the difference is less than the preset value;
    若所述差值小于等于所述预设数值,则利用更新后的所述产品因子矩阵参数V t+1生成目标产品因子矩阵。 If the difference is less than or equal to the preset value, a target product factor matrix is generated by using the updated product factor matrix parameter V t+1 .
  11. 根据权利要求9所述的计算机设备,其中,在所述将所述产品因子矩阵参数V t发送至多个客户端之前,还包括: The computer device according to claim 9, wherein before the sending the product factor matrix parameter V t to a plurality of clients, further comprising:
    将所述产品因子矩阵参数V t进行同态加密。 Homomorphically encrypt the product factor matrix parameter V t .
  12. 根据权利要求9所述的计算机设备,其中,所述服务端基于剩余部分所述参数数据,利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新,包括: The computer device according to claim 9, wherein, based on the remaining part of the parameter data, the server uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalization constant h i t , iteratively update the product factor matrix parameter V t , including:
    所述服务端利用
    Figure PCTCN2021083745-appb-100009
    得到更新后的产品因子矩阵参数V t+1,i表示客户端数量,S t表示客户端集合。
    The server uses
    Figure PCTCN2021083745-appb-100009
    The updated product factor matrix parameter V t+1 is obtained, i represents the number of clients, and S t represents the set of clients.
  13. 根据权利要求9所述的计算机设备,其中,所述多个客户端根据所述产品因子矩阵参数V t和部分所述参数数据更新用户因子矩阵u i,包括: The computer device according to claim 9, wherein the plurality of clients update the user factor matrix ui according to the product factor matrix parameter V t and part of the parameter data, comprising:
    基于所述用户因子矩阵u i和所述产品因子矩阵参数V t,根据公式一计算损失函数F i,所述公式一为: Based on the user factor matrix ui and the product factor matrix parameter V t , the loss function F i is calculated according to formula 1, and the formula 1 is:
    Figure PCTCN2021083745-appb-100010
    Figure PCTCN2021083745-appb-100010
    基于损失函数F i、所述用户因子矩阵u i的梯度和增益参数γ,根据公式二计算更新后的用户因子矩阵参数u i t+1,所述公式二为: Based on the loss function F i , the gradient of the user factor matrix ui and the gain parameter γ, the updated user factor matrix parameter u i t+1 is calculated according to the formula 2, and the formula 2 is:
    Figure PCTCN2021083745-appb-100011
    Figure PCTCN2021083745-appb-100011
    根据更新后的所述用户因子矩阵参数u i t+1更新所述用户因子矩阵u iUpdate the user factor matrix ui according to the updated user factor matrix parameter ui t+1 ;
    其中,t表示迭代次数、γ表示增益参数、
    Figure PCTCN2021083745-appb-100012
    表示上一次迭代后u i t的梯度值、j=1,2,…,m,m为产品个数、r ij表示用户i对产品j的评分值、λ表示正则化参数、v j表示产品因子矩阵V的第j行、F i为损失函数、u i t+1为经过迭代后的所述用户因子矩阵参数、u i t为用户因子矩阵参数。
    Among them, t represents the number of iterations, γ represents the gain parameter,
    Figure PCTCN2021083745-appb-100012
    Represents the gradient value of ui t after the last iteration, j=1,2,..., m,m is the number of products, r ij represents the user i's rating value for product j, λ represents the regularization parameter, v j represents the product In the jth row of the factor matrix V, F i is the loss function, ui t+1 is the user factor matrix parameter after iteration, and ui t is the user factor matrix parameter.
  14. 根据权利要求13所述的计算机设备,其中,所述利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t包括: The computer device according to claim 13, wherein said calculating the weighted difference value Δ i t and the normalization constant h i t using the q-FedAvg algorithm comprises:
    获取所述更新后的所述用户因子矩阵参数
    Figure PCTCN2021083745-appb-100013
    和所述参数数据中的预设步长α,对损失函数F i进行E次随机梯度下降,得到模型参数
    Figure PCTCN2021083745-appb-100014
    Obtain the updated user factor matrix parameters
    Figure PCTCN2021083745-appb-100013
    and the preset step size α in the parameter data, perform E times of stochastic gradient descent on the loss function F i to obtain the model parameters
    Figure PCTCN2021083745-appb-100014
    基于所述模型参数
    Figure PCTCN2021083745-appb-100015
    计算相邻产品因子矩阵参数差值ΔV i t
    based on the model parameters
    Figure PCTCN2021083745-appb-100015
    Calculate the parameter difference ΔV i t of adjacent product factor matrices:
    Figure PCTCN2021083745-appb-100016
    Figure PCTCN2021083745-appb-100016
    根据相邻产品因子矩阵参数差值ΔV i t,按以下q-FedAvg算法计算加权差值Δ i t和归一化常量h i tAccording to the adjacent product factor matrix parameter difference ΔV i t , the weighted difference value Δ i t and the normalization constant h i t are calculated according to the following q-FedAvg algorithm:
    Δ i t=F i q(V t,u i t+1)ΔV i tΔ i t =Fi q (V t , u i t+1 )ΔV i t ;
    h i t=qF i q-1(V t,u i t+1)||ΔV i t|| 2+LF i q(V t,u i t+1); h i t =qF i q-1 (V t , ui t+1 )||ΔV i t || 2 +LF i q (V t , ui t+1 );
    其中,ΔV i t表示相邻产品因子矩阵参数差值、L表示Lipschitz常数、q表示q-FedAvg算法参数、k=1,2,…,E。 Among them, ΔV i t represents the difference between adjacent product factor matrix parameters, L represents the Lipschitz constant, q represents the q-FedAvg algorithm parameter, k=1,2,...,E.
  15. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,所述计算机可读指令被处理器执行时,使得所述处理器执行如下步骤:A computer-readable storage medium, where computer-readable instructions are stored on the computer-readable storage medium, and when the computer-readable instructions are executed by a processor, the processor is caused to perform the following steps:
    服务器端接收用户输入的参数数据;The server side receives the parameter data input by the user;
    所述服务器端经初始化处理得到产品因子矩阵V和产品因子矩阵参数V t,并将所述产品因子矩阵参数V t和部分所述参数数据发送至多个客户端; The server side obtains the product factor matrix V and the product factor matrix parameter V t through initialization processing, and sends the product factor matrix parameter V t and part of the parameter data to multiple clients;
    所述多个客户端根据所述产品因子矩阵参数V t和部分所述参数数据更新用户因子矩阵u i,并利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t,将所述加权差值Δ i t和归一化常量h i t返回给所述服务器端; The multiple clients update the user factor matrix u i according to the product factor matrix parameter V t and part of the parameter data, and use the q-FedAvg algorithm to calculate the weighted difference Δ i t and the normalization constant h i t , Returning the weighted difference value Δ i t and the normalized constant h i t to the server side;
    所述服务器端基于剩余部分所述参数数据,利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新; Based on the remaining part of the parameter data, the server uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalization constant h i t , to the product factor matrix parameter V t Iteratively update;
    所述服务器端根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,并将所述目标产品因子矩阵发送至目标客户端; The server side determines the target product factor matrix according to the updated product factor matrix parameter V t+1 , and sends the target product factor matrix to the target client;
    所述目标客户端利用所述目标产品因子矩阵和更新后的所述用户因子矩阵,计算所述用户对产品的预测评分值,并对预测评分值排序,将排序高的前N个产品推荐给所述用户。The target client uses the target product factor matrix and the updated user factor matrix to calculate the predicted score value of the product by the user, sort the predicted score value, and recommend the top N products with the highest ranking to the product. the user.
  16. 根据权利要求15所述的计算机可读存储介质,其中,所述根据更新后的产品因子矩阵参数V t+1确定目标产品因子矩阵,包括: The computer-readable storage medium according to claim 15, wherein the determining the target product factor matrix according to the updated product factor matrix parameter V t+1 comprises:
    判断更新后的产品因子矩阵参数V t+1与更新前的产品因子矩阵参数V t的差值是否小于预设数值; Determine whether the difference between the updated product factor matrix parameter V t+1 and the pre-updated product factor matrix parameter V t is less than a preset value;
    若所述差值大于预设数值,则将更新后的产品因子矩阵参数V t+1,重新发送至客户端继续进行迭代更新,直到所述差值小于所述预设数值为止; If the difference is greater than the preset value, re-send the updated product factor matrix parameter V t+1 to the client to continue iterative update until the difference is less than the preset value;
    若所述差值小于等于所述预设数值,则利用更新后的所述产品因子矩阵参数V t+1生成目标产品因子矩阵。 If the difference is less than or equal to the preset value, a target product factor matrix is generated by using the updated product factor matrix parameter V t+1 .
  17. 根据权利要求15所述的计算机可读存储介质,其中,在所述将所述产品因子矩阵参数V t发送至多个客户端之前,还包括: The computer-readable storage medium of claim 15, wherein before the sending the product factor matrix parameter V t to a plurality of clients, further comprising:
    将所述产品因子矩阵参数V t进行同态加密。 Homomorphically encrypt the product factor matrix parameter V t .
  18. 根据权利要求15所述的计算机可读存储介质,其中,所述服务端基于剩余部分所述参数数据,利用所述产品因子矩阵参数V t和接收到的所有加权差值Δ i t与归一化常量h i t,对所述产品因子矩阵参数V t进行迭代更新,包括: The computer-readable storage medium according to claim 15, wherein, based on the remaining part of the parameter data, the server uses the product factor matrix parameter V t and all received weighted differences Δ i t and normalized The constant h i t is used to iteratively update the product factor matrix parameter V t , including:
    所述服务端利用
    Figure PCTCN2021083745-appb-100017
    得到更新后的产品因子矩阵参数V t+1,i表示客户端数量,S t表示客户端集合。
    The server uses
    Figure PCTCN2021083745-appb-100017
    The updated product factor matrix parameter V t+1 is obtained, i represents the number of clients, and S t represents the set of clients.
  19. 根据权利要求15所述的计算机可读存储介质,其中,所述多个客户端根据所述产品因 子矩阵参数V t和部分所述参数数据更新用户因子矩阵u i,包括: The computer-readable storage medium of claim 15, wherein the plurality of clients update the user factor matrix ui according to the product factor matrix parameter V t and part of the parameter data, comprising:
    基于所述用户因子矩阵u i和所述产品因子矩阵参数V t,根据公式一计算损失函数F i,所述公式一为: Based on the user factor matrix ui and the product factor matrix parameter V t , the loss function F i is calculated according to formula 1, and the formula 1 is:
    Figure PCTCN2021083745-appb-100018
    Figure PCTCN2021083745-appb-100018
    基于损失函数F i、所述用户因子矩阵u i的梯度和增益参数γ,根据公式二计算更新后的用户因子矩阵参数u i t+1,所述公式二为: Based on the loss function F i , the gradient of the user factor matrix ui and the gain parameter γ, the updated user factor matrix parameter u i t+1 is calculated according to the formula 2, and the formula 2 is:
    Figure PCTCN2021083745-appb-100019
    Figure PCTCN2021083745-appb-100019
    根据更新后的所述用户因子矩阵参数u i t+1更新所述用户因子矩阵u iUpdate the user factor matrix ui according to the updated user factor matrix parameter ui t+1 ;
    其中,t表示迭代次数、γ表示增益参数、
    Figure PCTCN2021083745-appb-100020
    表示上一次迭代后u i t的梯度值、j=1,2,…,m,m为产品个数、r ij表示用户i对产品j的评分值、λ表示正则化参数、v j表示产品因子矩阵V的第j行、F i为损失函数、u i t+1为经过迭代后的所述用户因子矩阵参数、u i t为用户因子矩阵参数。
    Among them, t represents the number of iterations, γ represents the gain parameter,
    Figure PCTCN2021083745-appb-100020
    Represents the gradient value of ui t after the last iteration, j=1,2,..., m,m is the number of products, r ij represents the user i's rating value for product j, λ represents the regularization parameter, v j represents the product In the jth row of the factor matrix V, F i is the loss function, ui t+1 is the user factor matrix parameter after iteration, and ui t is the user factor matrix parameter.
  20. 根据权利要求19所述的计算机可读存储介质,其中,根据权利要求5所述的产品推荐方法,其中,所述利用q-FedAvg算法计算加权差值Δ i t和归一化常量h i t包括: The computer-readable storage medium according to claim 19, wherein the product recommendation method according to claim 5, wherein the weighted difference value Δ i t and the normalization constant h i t are calculated using the q-FedAvg algorithm include:
    获取所述更新后的所述用户因子矩阵参数
    Figure PCTCN2021083745-appb-100021
    和所述参数数据中的预设步长α,对损失函数F i进行E次随机梯度下降,得到模型参数
    Figure PCTCN2021083745-appb-100022
    Obtain the updated user factor matrix parameters
    Figure PCTCN2021083745-appb-100021
    and the preset step size α in the parameter data, perform E times of stochastic gradient descent on the loss function F i to obtain the model parameters
    Figure PCTCN2021083745-appb-100022
    基于所述模型参数
    Figure PCTCN2021083745-appb-100023
    计算相邻产品因子矩阵参数差值ΔV i t
    based on the model parameters
    Figure PCTCN2021083745-appb-100023
    Calculate the parameter difference ΔV i t of adjacent product factor matrices:
    Figure PCTCN2021083745-appb-100024
    Figure PCTCN2021083745-appb-100024
    根据相邻产品因子矩阵参数差值ΔV i t,按以下q-FedAvg算法计算加权差值 According to the adjacent product factor matrix parameter difference ΔV i t , calculate the weighted difference according to the following q-FedAvg algorithm
    Δ i t和归一化常量h i tΔ i t and normalizing constant h i t :
    Δ i t=F i q(V t,u i t+1)ΔV i tΔ i t =Fi q (V t , u i t+1 )ΔV i t ;
    h i t=qF i q-1(V t,u i t+1)||ΔV i t|| 2+LF i q(V t,u i t+1); h i t =qF i q-1 (V t , ui t+1 )||ΔV i t || 2 +LF i q (V t , ui t+1 );
    其中,ΔV i t表示相邻产品因子矩阵参数差值、L表示Lipschitz常数、q表示q-FedAvg算法参数、k=1,2,…,E。 Among them, ΔV i t represents the difference between adjacent product factor matrix parameters, L represents the Lipschitz constant, q represents the q-FedAvg algorithm parameter, k=1,2,...,E.
PCT/CN2021/083745 2020-12-18 2021-03-30 Product recommendation method, system, computer device and storage medium WO2022126916A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011504951.4 2020-12-18
CN202011504951.4A CN112733181B (en) 2020-12-18 2020-12-18 Product recommendation method, system, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022126916A1 true WO2022126916A1 (en) 2022-06-23

Family

ID=75603180

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/083745 WO2022126916A1 (en) 2020-12-18 2021-03-30 Product recommendation method, system, computer device and storage medium

Country Status (2)

Country Link
CN (1) CN112733181B (en)
WO (1) WO2022126916A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116109372A (en) * 2022-12-05 2023-05-12 淮阴工学院 Cold chain logistics product federal recommendation method and device based on multi-level block chain
CN117290609A (en) * 2023-11-24 2023-12-26 中国科学技术大学 Product data recommendation method and product data recommendation device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020192896A1 (en) * 2019-03-26 2020-10-01 Huawei Technologies Co., Ltd. Apparatus and method for hyperparameter optimization of a machine learning model in a federated learning system
CN111814985A (en) * 2020-06-30 2020-10-23 平安科技(深圳)有限公司 Model training method under federated learning network and related equipment thereof

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10932003B2 (en) * 2015-01-27 2021-02-23 The Toronto-Dominion Bank Method and system for making recommendations from binary data using neighbor-score matrix and latent factors
US20170188102A1 (en) * 2015-12-23 2017-06-29 Le Holdings (Beijing) Co., Ltd. Method and electronic device for video content recommendation
CN107392049B (en) * 2017-07-26 2018-04-17 安徽大学 A kind of recommendation method based on difference secret protection
CN109510793A (en) * 2017-09-14 2019-03-22 蓝盾信息安全技术股份有限公司 A kind of security event prediction technology based on collaborative filtering
RU2763530C1 (en) * 2017-12-22 2021-12-30 Хуавей Текнолоджиз Ко., Лтд. Client, server and client-server system adapted to generate personalized recommendations
CN109670909A (en) * 2018-12-13 2019-04-23 南京财经大学 A kind of travelling products recommended method decomposed based on probability matrix with Fusion Features

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020192896A1 (en) * 2019-03-26 2020-10-01 Huawei Technologies Co., Ltd. Apparatus and method for hyperparameter optimization of a machine learning model in a federated learning system
CN111814985A (en) * 2020-06-30 2020-10-23 平安科技(深圳)有限公司 Model training method under federated learning network and related equipment thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
TIAN LI; MAZIAR SANJABI; AHMAD BEIRAMI; VIRGINIA SMITH: "Fair Resource Allocation in Federated Learning", ARXIV.ORG, CORNELL UNIVERSITY LIBRARY, 201 OLIN LIBRARY CORNELL UNIVERSITY ITHACA, NY 14853, 25 May 2019 (2019-05-25), 201 Olin Library Cornell University Ithaca, NY 14853 , XP081600164 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116109372A (en) * 2022-12-05 2023-05-12 淮阴工学院 Cold chain logistics product federal recommendation method and device based on multi-level block chain
CN116109372B (en) * 2022-12-05 2023-09-29 淮阴工学院 Cold chain logistics product federal recommendation method and device based on multi-level block chain
CN117290609A (en) * 2023-11-24 2023-12-26 中国科学技术大学 Product data recommendation method and product data recommendation device
CN117290609B (en) * 2023-11-24 2024-03-29 中国科学技术大学 Product data recommendation method and product data recommendation device

Also Published As

Publication number Publication date
CN112733181B (en) 2023-09-15
CN112733181A (en) 2021-04-30

Similar Documents

Publication Publication Date Title
WO2021120676A1 (en) Model training method for federated learning network, and related device
WO2020077959A1 (en) Secure multi-party computation with no trusted initializer
US20200294074A1 (en) Location information processing method and apparatus
WO2022126916A1 (en) Product recommendation method, system, computer device and storage medium
US20150199541A1 (en) Method and system for secured communication of personal information
CN113435583B (en) Federal learning-based countermeasure generation network model training method and related equipment thereof
US20140172767A1 (en) Budget optimal crowdsourcing
CN112287244A (en) Product recommendation method and device based on federal learning, computer equipment and medium
CN109923560A (en) Neural network is trained using variation information bottleneck
CN109447791B (en) Block chain-based fund transaction method and device
US11503033B2 (en) Using one or more networks to assess one or more metrics about an entity
CN112766649B (en) Target object evaluation method based on multi-scoring card fusion and related equipment thereof
CN111324812B (en) Federal recommendation method, device, equipment and medium based on transfer learning
CN112116008A (en) Target detection model processing method based on intelligent decision and related equipment thereof
CN112529429B (en) Client information verification method, device, computer equipment and storage medium
CN113158241A (en) Post recommendation method and device based on federal learning
EP4198783A1 (en) Federated model training method and apparatus, electronic device, computer program product, and computer-readable storage medium
WO2020151321A1 (en) Graph computation-based claim anti-fraud method, apparatus and device, and storage medium
CN113434906B (en) Data query method, device, computer equipment and storage medium
CN117349899B (en) Sensitive data processing method, system and storage medium based on forgetting model
CN112101609B (en) Prediction system, method and device for user repayment timeliness and electronic equipment
CN111641517A (en) Community division method and device for homogeneous network, computer equipment and storage medium
CN115758271A (en) Data processing method, data processing device, computer equipment and storage medium
CN115099875A (en) Data classification method based on decision tree model and related equipment
CN114528443A (en) Knowledge graph-based information mining method and related equipment thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21904856

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21904856

Country of ref document: EP

Kind code of ref document: A1