Financial product recommendation method and device based on client, computer equipment and medium
By configuring the reference model and pre-training local model on the client and performing loss updates, the problem of low accuracy of client product recommendations is solved, and financial product recommendations with high accuracy and data privacy and security are achieved.
Patent Information
- Application Number
- CN202411720272.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-18
AI Technical Summary
In the prior art, in financial product recommendations, the accuracy of the client's product recommendation is low and it is difficult to ensure data privacy and security.
By obtaining the initial model parameters sent by the central server, configure the local reference model, and pre-training the local model based on the local historical recommendation records. Then, use the configured reference model and the pre-trained local model to perform product recommendations separately, calculate the update loss and update the local model until the loss converges.
It improves the accuracy of product recommendations on the client, ensures data privacy and security, and enables local models to learn large-scale user information from the reference model.
Smart Images

Figure CN119648416A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a client-based financial product recommendation method, device, computer equipment and medium. Background Art
[0002] With the development of artificial intelligence technology, product recommendations based on artificial intelligence models have been widely used in various application scenarios, such as intelligent sales scenarios, personalized recommendation scenarios, etc. Products can be physical products, virtual products, virtual pages, etc. For example, in commercial or financial scenarios, products can be financial products or wealth management products such as bills of exchange, stocks, futures, bonds, insurance policies, funds, etc. The learning process of artificial intelligence models requires a large amount of user data. Existing methods usually share user data by multiple clients to meet the demand for user data volume.
[0003] However, the direct sharing of user data will result in low privacy security of user data, which is difficult to meet the public's demand for data privacy security. Therefore, existing methods apply federated learning to product recommendation tasks, but federated learning expects to obtain a model with strong generalization on a large amount of user data to ensure that all clients can have a high product recommendation accuracy rate as a whole. It cannot guarantee that when applied to a single client, it can also have a high product recommendation accuracy rate for local user data. Therefore, how to improve the accuracy of client product recommendations is an urgent problem to be solved. Summary of the invention
[0004] In view of this, embodiments of the present invention provide a client-based financial product recommendation method, apparatus, computer equipment, and medium to solve the problem of low accuracy of product recommendations on the client side.
[0005] In a first aspect, an embodiment of the present invention provides a client-based financial product recommendation method, the financial product recommendation method is applied to any client in a federated system, the federated system includes a central server and at least two clients, the financial product recommendation method includes: Acquire the initial model parameters sent by the central server, configure the local reference model with the initial model parameters, and obtain the configured reference model; Obtain local historical recommendation records, and form a historical training set based on the selection information of M products by N historical user information in the historical recommendation records. Pre-train a preset local model based on the historical training set to obtain a pre-trained local model, where N and M are both positive integers; Using the configured reference model and the pre-trained local model, respectively recommend products to the local sample user information, and obtain reference recommended products and their corresponding first prediction values, and local recommended products and their corresponding second prediction values; According to the reference recommended product and its corresponding first prediction value, and the local recommended product and its corresponding second prediction value, an update loss is calculated, and according to the update loss, the pre-trained local model is updated until the update loss converges to obtain an updated local model; The updated local model is used to perform product recommendations on the local target user information to obtain product recommendation results for the target user information.
[0006] In a second aspect, an embodiment of the present invention provides a financial product recommendation device based on federated learning, wherein the financial product recommendation device is applied to any client in a federated system, wherein the federated system includes a central server and at least two clients, and the financial product recommendation device includes: A model configuration module, used to obtain the initial model parameters sent by the central server, configure the local reference model with the initial model parameters, and obtain a configured reference model; A pre-training module is used to obtain local historical recommendation records, and form a historical training set based on the selection information of M products of N historical user information in the historical recommendation records. According to the historical training set, a preset local model is pre-trained to obtain a pre-trained local model, where N and M are both positive integers; A sample prediction module, used to use the configured reference model and the pre-trained local model to make product recommendations for local sample user information, and obtain reference recommended products and their corresponding first prediction values, and local recommended products and their corresponding second prediction values; A model updating module, configured to calculate an update loss based on the reference recommended product and its corresponding first prediction value, and the local recommended product and its corresponding second prediction value, and update the pre-trained local model based on the update loss until the update loss converges to obtain an updated local model; The product recommendation module is used to use the updated local model to recommend products to the local target user information, and obtain the product recommendation results of the target user information.
[0007] In a third aspect, an embodiment of the present invention provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the financial product recommendation method as described in the first aspect when executing the computer program.
[0008] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the financial product recommendation method as described in the first aspect is implemented.
[0009] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: Obtain the initial model parameters sent by the central server, configure the local reference model with the initial model parameters, obtain the configured reference model, obtain the local historical recommendation record, form a historical training set based on the selection information of M products for N historical user information in the historical recommendation record, pre-train the preset local model based on the historical training set, obtain the pre-trained local model, use the configured reference model and the pre-trained local model to recommend products to the local sample user information, obtain the reference recommended product and its corresponding first prediction value, and the local recommended product and its corresponding second prediction value, according to the reference recommended product and its corresponding first prediction value, and the local Recommend products and their corresponding second prediction values, calculate the update loss, update the pre-trained local model according to the update loss, until the update loss converges to obtain an updated local model, use the updated local model to recommend products to the local target user information, obtain the product recommendation results of the target user information, and update the local model with the output of the reference model, so that the local model can learn knowledge about large quantities of user information from the reference model, so that the updated local model can retain the generalization ability of the reference model, while retaining the local model's pertinence to local data, thereby improving the accuracy of product recommendations on the client side while ensuring data privacy and security. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0011] Figure 1 This is a schematic diagram of an application environment of a client-based financial product recommendation method provided in the first embodiment of the present invention; Figure 2 This is a flow chart of a method for recommending financial products based on a client provided in the first embodiment of the present invention; Figure 3 is a structural diagram of a financial product recommendation device based on federated learning provided in Embodiment 2 of the present invention; Figure 4 It is a structural diagram of a computer device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0012] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0013] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0014] It should also be understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0015] As used in the present specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]", depending on the context.
[0016] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0017] References to "one embodiment" or "some embodiments" etc. described in the present specification mean that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0018] The embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0019] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0020] It should be understood that the order of execution of the steps in the following embodiments does not imply a precedence of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0021] In order to illustrate the technical solution of the present invention, specific embodiments are provided below for illustration.
[0022] A method for recommending financial products based on a client provided in the first embodiment of the present invention can be applied in the following aspects: Figure 1 In the application environment, the client communicates with the central server. The client includes but is not limited to PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPC), netbooks, cloud terminal devices, personal digital assistants (PDA) and other computer devices. The central server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0023] Both the client and the server belong to the same federated system. The federated system may include a central server and at least two clients. There is no communication connection between the clients, that is, the clients cannot exchange information. Each client communicates only with the central server. The federated system can be used for a variety of application tasks, such as intelligent sales tasks, personalized information push tasks, etc. The content of product recommendations is determined according to the application scenario. For example, in personalized information push tasks in financial or commercial scenarios, the recommended product content may be financial-related articles, short videos, audio, etc. In intelligent sales scenarios, the recommended product content may be financial products or wealth management products such as bills of exchange, stocks, futures, bonds, insurance policies, and funds.
[0024] See also Figure 2 , is a flow chart of a method for recommending financial products based on a client provided in the first embodiment of the present invention. The method for recommending financial products can be applied to Figure 1 The client in the computer device corresponding to the client is connected to the central server to obtain the initial model parameters from the central server. The initial model parameters may refer to the model parameters obtained by the central server based on the model information provided by multiple clients. The computer device corresponding to the client has a storage function, which stores local historical recommendation records, sample user information, target user information, etc. Figure 2 As shown, the financial product recommendation method may include the following steps: Step S201, obtaining initial model parameters sent by the central server, configuring a local reference model with the initial model parameters, and obtaining a configured reference model.
[0025] The initial model parameters may refer to the model parameters of the reference model configured by the central server after aggregating the reference models of various clients received in the previous batch as the initial model parameters.
[0026] Specifically, the central server may aggregate reference models in a timed or quantitative manner. The timed manner may mean that the central server aggregates all received reference models at a preset time point. The quantitative manner may mean that the central server aggregates after receiving reference models that meet a preset number. For example, the preset time point may be aggregated once every week. In the quantitative manner, the preset number may be set to 5. It should be noted that the preset number should be less than or equal to the total number of clients.
[0027] In this embodiment, the initial model parameters sent by the central server are obtained, and the local reference model is configured with the initial model parameters to obtain a configured reference model. The initial model parameters that aggregate information of multiple clients are obtained through the central server of the federated system, so that the configured reference model is obtained based on a large amount of training data from multiple clients, thereby improving the accuracy and generalization ability of the configured reference model.
[0028] Step S202, obtain local historical recommendation records, form a historical training set based on the selection information of M products by N historical user information in the historical recommendation records, and pre-train the preset local model based on the historical training set to obtain a pre-trained local model.
[0029] Among them, N and M are both positive integers. The historical recommendation record can receive the recommendation information in the smart terminal of the historical user through the client. Usually, a client can be connected with at least one smart terminal of the historical user. The user who has a connection relationship with the client is the local user. The local user can communicate with the client through the APP, mini-programs, etc. in the smart terminal. The historical recommendation record may include N historical user information and the products selected by them. The historical user information may refer to the historical user portrait information. The user portrait information may include user identity information, user browsing information, user access information, etc. The product may refer to a physical product, a financial product, a virtual product, etc. For example, in a commercial or financial scenario, a product may refer to financial products or wealth management products such as bills of exchange, stocks, futures, bonds, insurance policies, and funds. Normally, a product can be characterized by a unique identifier of the corresponding financial product or wealth management product. For example, a stock product has a corresponding stock code, and a futures product has a corresponding futures code, etc. The selection information may refer to the association information between the user and the product. The historical training set may be used to pre-train the local model so that the local model has the basic function of executing downstream tasks. In this embodiment, the downstream task may refer to a product recommendation task, that is, the pre-trained local model may perform product recommendations based on local historical user information.
[0030] Optionally, a historical training set is formed based on the selection information of M products by N historical user information in the historical recommendation records, including: For any historical user information, count the number of times the historical user information selects M products in the historical recommendation records, normalize all the selection times, and obtain the normalized results of the corresponding products. According to the normalized results of the historical user information corresponding to the M products, form the product selection vector corresponding to the historical user information, use the historical user information as the historical sample, and use the product selection vector as the label of the corresponding historical sample; Traverse all historical users to obtain N groups of historical samples and their corresponding labels, and form a historical training set by N groups of historical samples and their corresponding labels.
[0031] Among them, the number of selections may refer to the number of times that historical user information selects a product within a preset time period. For example, the preset time period may be set to one week. The normalization operation may be implemented using an exponential normalization function. The normalization result may be used to characterize the selection probability between historical user information and products. The product selection vector may include M products and their corresponding normalized results. Historical samples may be used as pre-training inputs, and labels may be used to measure the accuracy of pre-training outputs.
[0032] Specifically, the pre-training process may include inputting historical samples into a preset local model, outputting a historical prediction vector, which includes M products and their corresponding predicted selection probabilities, calculating a loss function based on the historical prediction vector and the label, and the pre-trained loss function may adopt a mean square error loss function. The parameters of the local model are updated according to the calculated loss until the loss converges to obtain a pre-trained local model.
[0033] In this embodiment, a historical training set is constructed through product selection information of historical user information, and the local model is pre-trained, so that the pre-trained local model can have basic product recommendation functions and has strong adaptability to local user information. It provides a model basis for subsequent updates of the local model, avoids the problem of difficulty in convergence of model training, and optimizes the efficiency of model updates.
[0034] The above-mentioned steps of obtaining local historical recommendation records, respectively selecting M products according to N historical user information in the historical recommendation records, forming a historical training set, and pre-training a preset local model according to the historical training set to obtain a pre-trained local model can provide a pre-trained local model that is relatively reliable on local user information, so that subsequent local model updates retain the personalized characteristics of local user information, thereby improving the accuracy of product recommendations for local user information by subsequent updated local models.
[0035] Step S203, using the configured reference model and the pre-trained local model, respectively recommend products to the local sample user information, and obtain reference recommended products and their corresponding first prediction values, and local recommended products and their corresponding second prediction values.
[0036] Among them, sample user information can be used as input for updating the pre-trained local model, the reference recommended product can refer to the recommended product predicted by the configured reference model, the first prediction value can be used to characterize the prediction probability of the reference recommended product, the local recommended product can refer to the recommended product predicted by the pre-trained local model, and the second prediction value can be used to characterize the prediction probability of the local recommended product.
[0037] Optionally, using the configured reference model and the pre-trained local model, product recommendations are made to the local sample user information respectively, to obtain reference recommended products and their corresponding first prediction values, and local recommended products and their corresponding second prediction values, including: Use the configured reference model to recommend products to the sample user information, obtain reference prediction values of M products corresponding to the sample user information, determine the maximum value among all the reference prediction values as the first prediction value, use the product corresponding to the first prediction value as the reference recommended product, and form a reference prediction sequence from all the reference prediction values; Use the pre-trained local model to recommend products to sample users, obtain local prediction values of M products corresponding to sample user information, determine the maximum value among all local prediction values as the second prediction value, use the product corresponding to the second prediction value as the local recommended product, and form a local prediction sequence from all local prediction values; Accordingly, based on the reference recommended product and its corresponding first prediction value, and the local recommended product and its corresponding second prediction value, an update loss is calculated, and based on the update loss, the pre-trained local model is updated until the update loss converges to obtain an updated local model, including: According to the reference recommended product and its corresponding first prediction value, the local recommended product and its corresponding second prediction value, the reference prediction sequence and the local prediction sequence, the update loss is calculated, and the pre-trained local model is updated according to the update loss until the update loss converges to obtain an updated local model.
[0038] Among them, the reference prediction value can represent the reference recommendation probability of the corresponding product, the first prediction value can refer to the maximum reference prediction value, and the reference prediction sequence can include M products and their corresponding reference prediction values.
[0039] The local prediction value may represent the local recommendation probability of the corresponding product, the second prediction value may refer to the maximum local prediction value, and the local prediction sequence may include M products and their corresponding local prediction values.
[0040] In this embodiment, a reference prediction sequence and a local prediction sequence are formed to facilitate subsequent update loss calculation, so that the update loss can have more targeted supervision, improve the supervision ability of the update loss, and thus improve the product recommendation accuracy of the updated local model.
[0041] The above-mentioned steps use the configured reference model and the pre-trained local model to make product recommendations for local sample user information, obtain reference recommended products and their corresponding first prediction values, and local recommended products and their corresponding second prediction values, and at the same time obtain the output results of the configured reference model and the pre-trained local model for the sample user information, respectively, to facilitate the subsequent update of the local model based on the output of the joint reference model, so that the local model can learn knowledge of large quantities of user information from the reference model, thereby improving the accuracy of product recommendations on the client.
[0042] Step S204, based on the reference recommended product and its corresponding first prediction value, and the local recommended product and its corresponding second prediction value, calculate the update loss, and update the pre-trained local model based on the update loss until the update loss converges to obtain an updated local model.
[0043] Among them, the update loss can be used to guide the update of the pre-trained local model, that is, to provide an update gradient direction for the update of the pre-trained local model parameters. The updated local model can refer to a local model that integrates the reference model information.
[0044] Optionally, an update loss is calculated according to the reference recommended product and its corresponding first prediction value, the local recommended product and its corresponding second prediction value, the reference prediction sequence and the local prediction sequence, and the pre-trained local model is updated according to the update loss until the update loss converges to obtain an updated local model, including: Obtain label products and label sequences of sample user information, and calculate local classification loss using a preset first classification loss function according to the label products, reference recommended products and their corresponding first prediction values, and local recommended products and their corresponding second prediction values; According to the reference prediction sequence, the local prediction sequence and the label sequence, the local difference loss is calculated using the preset first distribution difference loss function; The local classification loss and the local difference loss are weightedly added to determine the addition result as the update loss. According to the update loss, the pre-trained local model is updated until the update loss converges to obtain an updated local model.
[0045] Among them, the labeled product may refer to the optimal recommended product of the sample user information, which may be determined based on the recommendation record of the sample user information. The label sequence may include M products and their label recommendation probabilities, and the label recommendation probability may be used to characterize the possibility of selecting the corresponding product for the sample user information.
[0046] The local classification loss can be used to supervise the performance of the product recommendation task when the local model is updated, and the local difference loss can be used to supervise the degree of difference between the local prediction sequence and the reference prediction sequence when the local model is updated.
[0047] Specifically, the cross entropy loss function can be used as the first classification loss function, the first classification sub-loss can be calculated based on the reference recommended products and their corresponding first prediction values, the second classification sub-loss can be calculated based on the local recommended products and their corresponding second prediction values, and the sum of the first classification sub-loss and the second classification sub-loss can be used as the local classification loss.
[0048] In one implementation, only the second classification sub-loss may be used as the local classification loss.
[0049] The local prediction sequence and the label sequence are subtracted to obtain a first subtraction result, and the reference prediction sequence and the label sequence are subtracted to obtain a second subtraction result. The KL divergence calculation formula can be used as the first distribution difference loss function to calculate the KL divergence between the second subtraction result and the first subtraction result, and the calculated divergence is used as the local difference loss.
[0050] In this embodiment, the output of the joint reference model is used to calculate the update loss, and then the local model is updated, so that the local model can learn knowledge of large quantities of user information from the reference model, thereby improving the accuracy of product recommendations on the client.
[0051] Optionally, the financial product recommendation method further includes: Obtain the label products and label sequences of the sample user information, and calculate the reference classification loss using a preset second classification loss function according to the label products, the reference recommended products and their corresponding first prediction values, and the local recommended products and their corresponding second prediction values; According to the reference prediction sequence, the local prediction sequence and the label sequence, a reference difference loss is calculated using a preset second distribution difference loss function; The reference classification loss and the reference difference loss are weightedly added to determine the sum as the reference total loss. According to the reference total loss, the configured reference model is updated until the reference total loss converges to obtain an updated reference model. The updated reference model is sent to the central server to update the initial model parameters.
[0052] Among them, the reference classification loss can be used to supervise the performance of the product recommendation task when the reference model is updated, and the reference difference loss can be used to supervise the degree of difference between the local prediction sequence and the reference prediction sequence when the reference model is updated.
[0053] Specifically, the cross entropy loss function can be used as the second classification loss function, the first classification sub-loss can be calculated based on the reference recommended products and their corresponding first prediction values, the second classification sub-loss can be calculated based on the local recommended products and their corresponding second prediction values, and the sum of the first classification sub-loss and the second classification sub-loss can be used as the reference classification loss.
[0054] In one implementation, only the first classification sub-loss may be used as the reference classification loss.
[0055] The local prediction sequence and the label sequence are subtracted to obtain a first subtraction result, and the reference prediction sequence and the label sequence are subtracted to obtain a second subtraction result. The KL divergence calculation formula can be used as the second distribution difference loss function to calculate the KL divergence between the first subtraction result and the second subtraction result, and the calculated divergence is used as the local difference loss.
[0056] In this embodiment, the output of the local model is combined to calculate the total reference loss, and then the reference model is updated, so that the reference model can learn knowledge about the local user information of the client from the local model, thereby improving the accuracy of product recommendations after model aggregation.
[0057] Optionally, the financial product recommendation method further includes: The central server receives updated reference models from at least two corresponding clients, averages all received reference models to obtain averaged model parameters, and updates initial model parameters with the averaged model parameters.
[0058] The averaged model parameters may refer to those obtained by calculating the mean of all received reference models, so that when the central server distributes initial parameters next time, updated initial model parameters are distributed.
[0059] In this embodiment, model parameters are aggregated at the central server to implement federated learning, that is, multi-client collaborative model updates are achieved without leaking data privacy, thereby improving the accuracy of the model while ensuring data privacy security.
[0060] Step S205: Use the updated local model to recommend products to the local target user information, and obtain product recommendation results for the target user information.
[0061] The target user information may refer to user information for which product recommendation is required, and the product recommendation result may be at least one product among the M products.
[0062] Optionally, the updated local model is used to recommend products to the local target user information, and the product recommendation results for the target user information are obtained, including: Use the updated local model to recommend products to the target user information, and obtain the target prediction values of M products corresponding to the target user; The product corresponding to the maximum value among all target prediction values is determined as the product recommendation result.
[0063] Among them, the target prediction value can represent the recommendation possibility of the corresponding product for the target user.
[0064] Specifically, in one implementation, products corresponding to the largest first K values among all target prediction values may also be determined as product recommendation results to provide target users with more information options.
[0065] The above-mentioned step of using the updated local model to recommend products to the local target user information to obtain the product recommendation results of the target user information uses a personalized local model with strong generalization ability to recommend products, taking into account the accuracy and generalization of the client's local user information, thereby improving the accuracy of the client's product recommendation.
[0066] In this embodiment, the local model is updated by combining the output of the reference model so that the local model can learn knowledge about large quantities of user information from the reference model, so that the updated local model can retain the generalization ability of the reference model while retaining the local model's specificity to local data, thereby improving the accuracy of product recommendations on the client while ensuring data privacy and security.
[0067] Corresponding to the client-based financial product recommendation method of the above embodiment, Figure 3 The structural block diagram of the financial product recommendation device based on federated learning provided by the second embodiment of the present invention is shown. The above financial product recommendation device is applied to the client, and the computer device corresponding to the client is connected to the central server to obtain the initial model parameters from the central server. The initial model parameters may refer to the model parameters obtained by the central server based on the model information provided by multiple clients. The computer device corresponding to the client has a storage function, which stores local historical recommendation records, sample user information, target user information, etc. For the convenience of explanation, only the part related to the embodiment of the present invention is shown.
[0068] See also Figure 3 , the financial product recommendation device comprises: The model configuration module 31 is used to obtain the initial model parameters sent by the central server, configure the local reference model with the initial model parameters, and obtain the configured reference model; The pre-training module 32 is used to obtain local historical recommendation records, and form a historical training set based on the selection information of M products of N historical user information in the historical recommendation records. According to the historical training set, the preset local model is pre-trained to obtain a pre-trained local model, where N and M are both positive integers; The sample prediction module 33 is used to use the configured reference model and the pre-trained local model to make product recommendations for local sample user information, and obtain reference recommended products and their corresponding first prediction values, and local recommended products and their corresponding second prediction values; The model updating module 34 is used to calculate the update loss according to the reference recommended product and its corresponding first prediction value, and the local recommended product and its corresponding second prediction value, and update the pre-trained local model according to the update loss until the update loss converges to obtain an updated local model; The product recommendation module 35 is used to use the updated local model to recommend products to the local target user information, and obtain the product recommendation results of the target user information.
[0069] Optionally, the pre-training module 32 includes: For any historical user information, count the number of times the historical user information selects M products in the historical recommendation records, normalize all the selection times, and obtain the normalized results of the corresponding products. According to the normalized results of the historical user information corresponding to the M products, form the product selection vector corresponding to the historical user information, use the historical user information as the historical sample, and use the product selection vector as the label of the corresponding historical sample; Traverse all historical users to obtain N groups of historical samples and their corresponding labels, and form a historical training set by N groups of historical samples and their corresponding labels.
[0070] Optionally, the sample prediction module 33 includes: Use the configured reference model to recommend products to the sample user information, obtain reference prediction values of M products corresponding to the sample user information, determine the maximum value among all the reference prediction values as the first prediction value, use the product corresponding to the first prediction value as the reference recommended product, and form a reference prediction sequence from all the reference prediction values; Use the pre-trained local model to recommend products to sample users, obtain local prediction values of M products corresponding to sample user information, determine the maximum value among all local prediction values as the second prediction value, use the product corresponding to the second prediction value as the local recommended product, and form a local prediction sequence from all local prediction values; Accordingly, the above-mentioned model updating module 34 includes: The local model updating unit is used to calculate the update loss based on the reference recommended product and its corresponding first prediction value, the local recommended product and its corresponding second prediction value, the reference prediction sequence and the local prediction sequence, and update the pre-trained local model according to the update loss until the update loss converges to obtain an updated local model.
[0071] Optionally, the local model updating unit includes: Obtain label products and label sequences of sample user information, and calculate local classification loss using a preset first classification loss function according to the label products, reference recommended products and their corresponding first prediction values, and local recommended products and their corresponding second prediction values; According to the reference prediction sequence, the local prediction sequence and the label sequence, the local difference loss is calculated using the preset first distribution difference loss function; The local classification loss and the local difference loss are weightedly added to determine the addition result as the update loss. According to the update loss, the pre-trained local model is updated until the update loss converges to obtain an updated local model.
[0072] Optionally, the model updating module 34 further includes: Obtain the label products and label sequences of the sample user information, and calculate the reference classification loss using a preset second classification loss function according to the label products, the reference recommended products and their corresponding first prediction values, and the local recommended products and their corresponding second prediction values; According to the reference prediction sequence, the local prediction sequence and the label sequence, a reference difference loss is calculated using a preset second distribution difference loss function; The reference classification loss and the reference difference loss are weightedly added to determine the sum as the reference total loss. According to the reference total loss, the configured reference model is updated until the reference total loss converges to obtain an updated reference model. The updated reference model is sent to the central server to update the initial model parameters.
[0073] Optionally, the financial product recommendation device further includes: The central server receives updated reference models from at least two corresponding clients, averages all received reference models to obtain averaged model parameters, and updates initial model parameters with the averaged model parameters.
[0074] Optionally, the product recommendation module 35 includes: Use the updated local model to recommend products to the target user information, and obtain the target prediction values of M products corresponding to the target user; The product corresponding to the maximum value among all target prediction values is determined as the product recommendation result.
[0075] It should be noted that the information interaction, execution process and other contents between the above-mentioned modules (sub-modules, units, and sub-units as needed) are based on the same concept as the method embodiment of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0076] Figure 4 This is a schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Figure 4 As shown, the computer device of this embodiment includes: at least one processor ( Figure 4 Only one is shown in the figure), a memory, and a computer program stored in the memory and executable on at least one processor, wherein when the processor executes the computer program, the steps in any of the above-mentioned financial product recommendation method embodiments are implemented.
[0077] The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that Figure 4 This is merely an example of a computer device and does not constitute a limitation on the computer device. The computer device may include more or fewer components than those shown in the figure, or a combination of certain components, or different components. For example, it may also include a network interface, a display screen, and an input device.
[0078] The processor may be a CPU, or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0079] The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory may be the memory of a computer device, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The readable storage medium may be a hard disk of a computer device, and in other embodiments, it may also be an external storage device of the computer device, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Further, the memory may also include both an internal storage unit of the computer device and an external storage device. The memory is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of a computer program, etc. The memory may also be used to temporarily store data that has been output or is to be output.
[0080] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the above-mentioned method embodiment, which will not be repeated here. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiment can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0081] The present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by a computer program product. When the computer program product runs on a computer device, the computer device can implement the steps in the above-mentioned method embodiment when executing.
[0082] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0083] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0084] In the embodiments provided by the present invention, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0085] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0086] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A client-based financial product recommendation method, characterized in that: The financial product recommendation method is applied to any client in a federated system, wherein the federated system includes a central server and at least two clients. The financial product recommendation method includes: Acquire the initial model parameters sent by the central server, configure the local reference model with the initial model parameters, and obtain the configured reference model; Obtain local historical recommendation records, and form a historical training set based on the selection information of M products by N historical user information in the historical recommendation records. Pre-train a preset local model based on the historical training set to obtain a pre-trained local model, where N and M are both positive integers; Using the configured reference model and the pre-trained local model, respectively recommend products to the local sample user information, and obtain reference recommended products and their corresponding first prediction values, and local recommended products and their corresponding second prediction values; According to the reference recommended product and its corresponding first prediction value, and the local recommended product and its corresponding second prediction value, an update loss is calculated, and according to the update loss, the pre-trained local model is updated until the update loss converges to obtain an updated local model; The updated local model is used to perform product recommendations on the local target user information to obtain product recommendation results for the target user information.
2. The financial product recommendation method according to claim 1, characterized in that: The forming of a historical training set based on the selection information of M products by N historical user information in the historical recommendation records includes: For any historical user information, count the number of times the historical user information selects the M products in the historical recommendation records, perform normalization on all selection times, and obtain normalized results of corresponding products; and form product selection vectors corresponding to the historical user information according to the normalized results of the M products corresponding to the historical user information, and use the historical user information as a historical sample and the product selection vector as a label corresponding to the historical sample; All historical users are traversed to obtain N groups of historical samples and their corresponding labels, and the historical training set is formed by the N groups of historical samples and their corresponding labels.
3. The financial product recommendation method according to claim 1, characterized in that: The using the configured reference model and the pre-trained local model to respectively recommend products to the local sample user information, and obtaining the reference recommended product and its corresponding first prediction value, and the local recommended product and its corresponding second prediction value, includes: Use the configured reference model to recommend products to the sample user information, obtain reference prediction values of the M products corresponding to the sample user information, determine the maximum value of all reference prediction values as the first prediction value, use the product corresponding to the first prediction value as a reference recommendation product, and form a reference prediction sequence from all reference prediction values; Use the pre-trained local model to recommend products to the sample users, obtain local prediction values of the M products corresponding to the sample user information, determine the maximum value of all local prediction values as the second prediction value, use the product corresponding to the second prediction value as the local recommended product, and form a local prediction sequence from all local prediction values; Accordingly, the updating loss is calculated based on the reference recommended product and its corresponding first prediction value, and the local recommended product and its corresponding second prediction value, and the pre-trained local model is updated according to the updating loss until the updating loss converges to obtain an updated local model, including: The update loss is calculated based on the reference recommended product and its corresponding first prediction value, the local recommended product and its corresponding second prediction value, the reference prediction sequence and the local prediction sequence. The pre-trained local model is updated based on the update loss until the update loss converges to obtain an updated local model.
4. The financial product recommendation method according to claim 3, characterized in that: The updating loss is calculated according to the reference recommended product and its corresponding first prediction value, the local recommended product and its corresponding second prediction value, the reference prediction sequence and the local prediction sequence, and the pre-trained local model is updated according to the updating loss until the updating loss converges to obtain an updated local model, including: Obtain the label product and label sequence of the sample user information, and calculate the local classification loss using a preset first classification loss function according to the label product, the reference recommended product and its corresponding first prediction value, and the local recommended product and its corresponding second prediction value; According to the reference prediction sequence, the local prediction sequence and the label sequence, a local difference loss is calculated using a preset first distribution difference loss function; The local classification loss and the local difference loss are weightedly added to determine the addition result as the update loss, and the pre-trained local model is updated according to the update loss until the update loss converges to obtain the updated local model.
5. The financial product recommendation method according to claim 3, characterized in that: The financial product recommendation method further includes: Obtain the label product and label sequence of the sample user information, and calculate the reference classification loss using a preset second classification loss function according to the label product, the reference recommended product and its corresponding first prediction value, and the local recommended product and its corresponding second prediction value; According to the reference prediction sequence, the local prediction sequence and the label sequence, a reference difference loss is calculated using a preset second distribution difference loss function; The reference classification loss and the reference difference loss are weightedly added to determine the addition result as the reference total loss. According to the reference total loss, the configured reference model is updated until the reference total loss converges to obtain an updated reference model, and the updated reference model is sent to the central server to update the initial model parameters.
6. The financial product recommendation method according to claim 5, characterized in that: The financial product recommendation method further includes: The central server receives updated reference models from at least two corresponding clients, averages all received reference models to obtain averaged model parameters, and updates the initial model parameters with the averaged model parameters.
7. The financial product recommendation method according to any one of claims 1 to 6, characterized in that: The using the updated local model to recommend products to the local target user information to obtain the product recommendation result of the target user information includes: Use the updated local model to recommend products to the target user information, and obtain target prediction values of the M products corresponding to the target user respectively; The product corresponding to the maximum value among all target prediction values is determined as the product recommendation result.
8. A financial product recommendation device based on federated learning, characterized in that: The financial product recommendation device is applied to any client in a federated system, wherein the federated system includes a central server and at least two clients, and the financial product recommendation device includes: A model configuration module, used to obtain the initial model parameters sent by the central server, configure the local reference model with the initial model parameters, and obtain a configured reference model; A pre-training module is used to obtain local historical recommendation records, and form a historical training set based on the selection information of M products of N historical user information in the historical recommendation records. According to the historical training set, a preset local model is pre-trained to obtain a pre-trained local model, where N and M are both positive integers; A sample prediction module, used to use the configured reference model and the pre-trained local model to make product recommendations for local sample user information, and obtain reference recommended products and their corresponding first prediction values, and local recommended products and their corresponding second prediction values; A model updating module, configured to calculate an update loss based on the reference recommended product and its corresponding first prediction value, and the local recommended product and its corresponding second prediction value, and update the pre-trained local model based on the update loss until the update loss converges to obtain an updated local model; The product recommendation module is used to use the updated local model to recommend products to the local target user information, and obtain the product recommendation results of the target user information.
9. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the financial product recommendation method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the financial product recommendation method according to any one of claims 1 to 7 is implemented.