Model training and resource recommendation method and device

Through the federated learning platform and homomorphic encryption technology, the coordination point updates the global sharing parameters of the global recommendation model. Combined with the local sharing layer and the personalization layer, the accuracy of personalized resource recommendation on the mobile terminal is solved, realizing personalized recommendations while protecting user privacy.

CN120429508APending Publication Date: 2025-08-05ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510611488.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

It is difficult for the prior art to accurately recommend personalized resources to users, especially in the recommendation of widget materials configured on mobile terminals. User usage habits vary greatly, which makes it difficult for the global recommendation model to meet personalized needs.

Method used

Using the federated learning platform, the coordination point updates the global shared parameters of the global recommendation model based on the local shared parameters of multiple participant nodes, combines the local sharing layer and personalization layer of the local recommendation model, updates the model parameters through user behavior data, captures global shared characteristics and personalized preference characteristics, performs personalized resource recommendations, and protects private data through homomorphic encryption.

Benefits of technology

It realizes accurate personalized resource recommendations, reduces the risk of private data leakage, reduces data upload volume and communication overhead, and improves the security of private data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120429508A_ABST
    Figure CN120429508A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a model training method and device and a resource recommendation method and device. The method is applied to a federated learning platform, the federated learning platform comprises a coordination node deployed with a global recommendation model and a plurality of participant nodes deployed with local recommendation models, and the method comprises the steps that each participant node uploads local sharing parameters of the local recommendation models to the coordination node, the coordination node updates global sharing parameters of the global recommendation model based on the local sharing parameters of the plurality of participant nodes, and the participant nodes update the local sharing parameters according to the global sharing parameters issued by the coordination node; global sharing parameters and personalized parameters of the local recommendation model are updated, and personalized resource recommendation can be accurately carried out on the local users in combination with global sharing features of the multiple users and personalized preference features of the local users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of artificial intelligence technology, and in particular to a model training method, a resource recommendation method, and an electronic device. Background Art

[0002] With the development of mobile Internet technology, more and more people configure personalized resources such as widget materials on mobile terminals such as mobile phones. How to make personalized resource recommendations to users has become a focus of attention.

[0003] Related technical solutions recommend personalized resources, such as widget assets, to users based on their historical mobile device behavior data. However, due to significant differences in widget asset usage habits among different users, this approach struggles to accurately deliver personalized recommendations. Therefore, accurately delivering personalized resource recommendations has become a pressing technical challenge.

[0004] The content of the background technology section is merely information known to the inventor personally, and does not mean that the above information has entered the public domain before the application date of this disclosure, nor does it mean that it can become the prior art of the present disclosure. Summary of the Invention

[0005] This specification provides a model training method, a resource recommendation method, and an electronic device that can accurately recommend personalized resources to users by combining the global shared features of multiple users and the users' own personalized preference features.

[0006] In a first aspect, an embodiment of this specification provides a model training method applied to a participant node of a federated learning platform, wherein the federated learning platform includes a coordination node and multiple participant nodes, the coordination node is deployed with a global recommendation model, and the participant nodes are deployed with a local recommendation model, wherein the local recommendation model includes a local shared layer and a personalized layer, and the model parameters of the local recommendation model include local shared parameters of the local shared layer and personalized parameters of the personalized layer. The method includes:

[0007] For each round of training, obtaining the global shared parameters of the global recommendation model issued by the coordination node, and updating the local shared parameters of the local recommendation model based on the global shared parameters;

[0008] Based on the user behavior data for the target resource, updating the local shared parameters and the personalized parameters of the local recommendation model; and

[0009] The updated local shared parameters are uploaded to the coordination node, so that the coordination node updates the global shared parameters of the global recommendation model based on the local shared parameters of the multiple participant nodes.

[0010] In some example embodiments, based on the above solution, the local shared parameters are used to implicitly represent the shared characteristics of the participant node for the target resource, and the personalized parameters are used to implicitly represent the personalized preference characteristics of the participant node for the target resource.

[0011] In some example embodiments, based on the above solution, updating the local shared parameters and the personalized parameters of the local recommendation model based on the user behavior data of the participant node for the target resource includes:

[0012] Inputting the user behavior data of the participant node for the target resource into the local recommendation model to determine the recommendation score of the local recommendation model;

[0013] Determining a model loss of the local recommendation model based on a difference between the recommendation score and a true label of the user behavior data, wherein the model loss includes a prediction loss; and

[0014] The local shared parameters and the personalized parameters of the local recommendation model are updated based on the model loss.

[0015] In some example embodiments, based on the above solution, the model loss further includes a regularization term, the regularization term being used to constrain the difference between the local shared parameters of the local recommendation model and the global shared parameters of the global recommendation model. Determining the model loss of the local recommendation model based on the difference between the recommendation score and the true label of the user behavior data includes:

[0016] determining the prediction loss of the local recommendation model based on a difference between the recommendation score and a true label of the user behavior data;

[0017] determining the regularization term based on a difference between the local shared parameters of the local recommendation model and the global shared parameters of the global recommendation model; and

[0018] Based on the prediction loss and the regularization term, a model loss of the local recommendation model is determined.

[0019] In some example embodiments, based on the above solution, determining the regularization term based on the difference between the local shared parameter of the local recommendation model and the global shared parameter of the global recommendation model includes:

[0020] determining a difference between the local shared parameters of the local recommendation model and the global shared parameters of the global recommendation model;

[0021] The regularization term is determined by adjusting the difference between the local shared parameter and the global shared parameter using a regularization coefficient.

[0022] In some example embodiments, based on the above solution, before updating the local shared parameters and the personalized parameters of the local recommendation model, the method further includes:

[0023] receiving layer division information for the local recommendation model sent by the coordination node, where the layer division information is used to divide the local shared layer and the personalized layer of the local recommendation model;

[0024] Based on the layer division information, a boundary between the local shared layer and the personalized layer of the local recommendation model is adjusted.

[0025] In some example embodiments, based on the above scheme, the coordination node determines the gradient consistency of each network layer of the local recommendation model of the multiple participant nodes based on the gradient parameter information of each network layer of the local recommendation model of each participant node, and determines the layer division information of the local recommendation model based on the gradient consistency.

[0026] In some example embodiments, based on the above solution, uploading the local shared parameters to the coordination node includes:

[0027] Homomorphically encrypt the local shared parameters, and upload the encrypted local shared parameters to the coordination node.

[0028] In some example embodiments, based on the above solution, the participant node is a mobile terminal, and the target resource is a widget resource of the mobile terminal.

[0029] In a second aspect, an embodiment of this specification provides a model training method, which is applied to a coordination node of a federated learning platform, wherein the federated learning platform includes the coordination node and multiple participant nodes, the coordination node is deployed with a global recommendation model, and the participant nodes are deployed with a local recommendation model, wherein the local recommendation model includes a local shared layer and a personalized layer, and the model parameters of the local recommendation model include local shared parameters of the local shared layer and personalized parameters of the personalized layer, wherein the method includes:

[0030] For each round of training, the global shared parameters of the global recommendation model are distributed to each of the participant nodes, so that the participant nodes update the local shared parameters of the local recommendation model according to the global shared parameters;

[0031] receiving the local shared parameters of the local recommendation model uploaded by each of the participant nodes; and

[0032] Aggregate the local shared parameters uploaded by each of the participant nodes, and update the global shared parameters of the global recommendation model according to the aggregation result.

[0033] In some example embodiments, based on the above solution, aggregating the local shared parameters uploaded by each of the participant nodes includes:

[0034] The local shared parameters uploaded by each of the participating nodes are aggregated through a central federation optimization method.

[0035] In some example embodiments, based on the above solution, the method further includes:

[0036] Receiving gradient parameter information of each network layer of the local recommendation model uploaded by each of the participant nodes;

[0037] Determining the gradient consistency of each network layer of the local recommendation model of the multiple participant nodes based on the gradient parameter information;

[0038] Layer division information of the local recommendation model is determined based on the gradient consistency, where the layer division information is used to divide the local shared layer and the personalized layer of the local recommendation model.

[0039] In some example embodiments, based on the above solution, determining the layer division information of the local recommendation model based on the gradient consistency includes:

[0040] If the gradient consistency is greater than a predetermined threshold, dividing the network layer into the local shared layer of the local recommendation model; and

[0041] If the gradient consistency is less than or equal to the predetermined threshold, dividing the network layer into the personalized layer of the local recommendation model.

[0042] In a third aspect, embodiments of this specification provide a resource recommendation method, which is applied to a target participant node among multiple participant nodes of a federated learning platform, wherein the participant node is deployed with a local recommendation model, wherein the local recommendation model includes a local sharing layer and a personalized layer, and wherein the local recommendation model is a model trained based on the model training method described in the first aspect above, wherein the method includes:

[0043] Extracting shared features of the target participant node for the target resource based on the local sharing layer of the local recommendation model;

[0044] Extracting personalized preference features of the target participant node for the target resource based on the personalized layer of the local recommendation model;

[0045] Based on the shared features and the personalized preference features, the target resource is recommended to the target user of the target participant node.

[0046] In a fourth aspect, this specification also provides an electronic device, comprising: at least one storage medium storing at least one instruction set for performing resource recommendation processing; and at least one processor communicatively connected to the at least one storage medium, wherein, when the electronic device is running, the at least one processor reads the at least one instruction set and executes the resource recommendation method described in the first aspect of this specification according to the instructions of the at least one instruction set.

[0047] It can be seen from the above technical solutions that the resource recommendation method and device provided in the embodiments of this specification, on the one hand, the coordination node updates the global shared parameters of the global recommendation model based on the local shared parameters of multiple participant nodes, which can capture the global shared features of multiple participant nodes across users for the target resource; on the other hand, the local recommendation model includes a local shared layer and a personalized layer, and the model parameters include local shared parameters of the local shared layer and personalized parameters of the personalized layer. The local shared parameters are updated according to the global shared parameters issued by the coordination node, and the local shared parameters and personalized parameters of the local recommendation model are updated based on the user behavior data for the target resource. The global shared features of the user for the target resource can be learned through the local shared layer, and the personalized preference features of the user for the target resource can be learned by adapting the local data to the personalized layer, so that personalized resource recommendations can be accurately made to local users by combining the global shared features of multiple users and the personalized preference features of local users; on the other hand, the shared parameters of the local shared layer of the local recommendation model are uploaded to the coordination node, and the personalized parameters of the personalized layer are retained locally, which can reduce the risk of privacy data leakage, improve the security of privacy data, and at the same time reduce the amount of data uploaded and reduce communication overhead.

[0048] Other features of the model training method, resource recommendation method, and device provided in this specification are partially listed in the following description. Based on the description, the following figures and examples will be readily apparent to those skilled in the art. The inventive aspects of the model training method, resource recommendation method, and device provided in this specification can be fully explained through practice or use of the methods, devices, and combinations described in the following detailed examples. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of this specification, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0050] Figure 1 A schematic diagram showing an implementation environment of a model training method provided in an embodiment of this specification is shown;

[0051] Figure 2 FIG2 shows a hardware structure diagram of an electronic device 200 provided according to an embodiment of this specification;

[0052] Figure 3 A schematic diagram of a flow chart of a model training method provided according to some embodiments of this specification is shown;

[0053] Figure 4 A schematic diagram of a process for performing network layer division according to some embodiments of this specification is shown;

[0054] Figure 5 A schematic diagram showing a flow chart of a resource recommendation method provided according to an embodiment of this specification; and

[0055] Figure 6 A flow chart of a model training method provided according to other embodiments of this specification is shown. DETAILED DESCRIPTION

[0056] The following description provides specific application scenarios and requirements for this specification, with the goal of enabling those skilled in the art to make and use the contents of this specification. Various modifications to the disclosed embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of this specification. Therefore, this specification is not limited to the embodiments shown, but is intended to be accorded the broadest scope consistent with the claims.

[0057] The terms used herein are for the purpose of describing specific example embodiments only and are not intended to be limiting. For example, as used herein, the singular forms "a," "an," and "the" may also include the plural forms unless the context clearly indicates otherwise. When used in this specification, the terms "comprise," "include," and / or "contain" are intended to refer to the presence of the associated integers, steps, operations, elements, and / or components, but do not preclude the presence of one or more other features, integers, steps, operations, elements, components, and / or groups or the addition of other features, integers, steps, operations, elements, components, and / or groups in the system / method.

[0058] These and other features of this specification, as well as the operation and function of the associated elements of the structure, and the economical assembly and manufacture of the components, can be significantly improved with consideration of the following description. Reference is made to the accompanying drawings, all of which form a part of this specification. However, it should be expressly understood that the drawings are for illustration and description purposes only and are not intended to limit the scope of this specification. It should also be understood that the drawings are not drawn to scale.

[0059] The flowcharts used in this specification illustrate operations implemented by systems according to some embodiments of the present specification. It should be clearly understood that the operations of the flowcharts may not be implemented in sequence. Rather, the operations may be implemented in reverse order or simultaneously. Furthermore, one or more additional operations may be added to the flowcharts. One or more operations may be removed from the flowcharts.

[0060] It should be noted that the user data obtained in this manual is authorized by the user and does not involve user privacy.

[0061] First, the terms involved in one or more embodiments of this specification are explained.

[0062] Mobile widgets: These provide quick access to app information and functionality without having to open the full app, allowing users to quickly access specific information or functionality. For example, widgets like weather, calendar, and clock allow users to view important information directly on the home screen without having to open the corresponding app.

[0063] Material: The style information of the content displayed in the widget, including pictures, text and other information.

[0064] Federated Learning: A machine learning technology that allows multiple participants to jointly train a machine learning model without sharing the original data. In federated learning, the original data remains local to each participant's device. Through encryption technology and communication protocols, participants only exchange model parameters or intermediate results. This enables joint data utilization and collaborative model optimization while protecting data privacy and security.

[0065] In related technical solutions, a recommendation model is trained on the server side based on historical user behavior data on mobile terminals. This trained recommendation model then recommends personalized resources, such as widget assets, to users. However, in this technical solution, because different users have significantly different habits for widget assets, the server-side training generates a generic, global recommendation model that is difficult to meet users' personalized needs. In other words, the server-side global recommendation model struggles to accurately provide personalized recommendations.

[0066] Based on the above content, the embodiments of this specification provide a model training method, a resource recommendation method and an electronic device, which are applied to a federated learning platform. The federated learning platform includes a coordination node and multiple participant nodes. The coordination node is deployed with a global recommendation model, and the participant nodes are deployed with a local recommendation model. On the one hand, the coordination node updates the global shared parameters of the global recommendation model based on the local shared parameters of multiple participating nodes, which can capture the global shared features of multiple participating nodes across users for the target resources; on the other hand, the local recommendation model includes a local shared layer and a personalized layer, and the model parameters include the local shared parameters of the local shared layer and the personalized parameters of the personalized layer. The local shared parameters are updated according to the global shared parameters issued by the coordination node, and the local shared parameters and personalized parameters of the local recommendation model are updated based on the user behavior data for the target resources. The local shared layer can learn the user's global shared features for the target resources and the personalized layer can adapt the local data to learn the user's personalized preference features for the target resources, thereby combining the global shared features of multiple users and the personalized preference features of local users to accurately recommend personalized resources to local users; on the other hand, the shared parameters of the local shared layer of the local recommendation model are uploaded to the coordination node, and the personalized parameters of the personalized layer are retained locally, which can reduce the risk of privacy data leakage and improve the security of privacy data, while reducing the amount of data uploaded and reducing communication overhead.

[0067] The technical solutions of the embodiments of this specification will be described in detail below with reference to the accompanying drawings.

[0068] Figure 1 A schematic diagram of an implementation environment of a model training method or resource recommendation method provided in an embodiment of this specification is shown.

[0069] See also Figure 1 As shown, the implementation environment 100 may include multiple participant nodes 110 and a coordination node 120 .

[0070] The participant node 110 is connected to the coordination node 120 via a wireless network or a wired network. The participant node 110 can be a mobile phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto.

[0071] The participant node 110 may store data or instructions for executing the model training method or resource recommendation method described in this specification. The participant node 110 may include a hardware device with data information processing capabilities and the necessary programs required to drive the hardware device to work.

[0072] The coordination node 120 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, 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, distribution networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The coordination node 120 provides background services for applications running on the participant nodes 110.

[0073] The coordination node 120 is equipped with an integrated development platform. An integrated development platform, also known as an integrated development environment (IDE), is an application used to provide a program development environment, generally including tools such as a code editor, a compiler, a debugger, and a human-computer interaction interface. Developers can write program code (i.e., program development) on the integrated development platform. The integrated development platform server can be a computing device specifically used by the integrated development platform to implement model training methods or resource recommendation methods. The coordination node 120 can communicate data with the participant node 110 and the database respectively.

[0074] In addition, the coordination node 120 may store data or instructions for executing the model training method or resource recommendation method described in this specification. The coordination node 120 may include a hardware device with data information processing capabilities and the necessary programs required to drive the operation of the hardware device. Of course, the coordination node 120 may also be only a hardware device with data processing capabilities, or only a program running on the hardware device.

[0075] The database can store data and / or instructions. In some embodiments, the database can store human-computer dialogue data corresponding to the user. In some embodiments, the database can store data and / or instructions executed by the coordination node 120 or used to execute the model training method described in this specification. The participant node 110 and the coordination node 120 have access to the database of the coordination node 120, and the participant node 110 and the coordination node 120 can access the data or instructions stored in the database through the network. In some embodiments, the database can be directly connected to the participant node 110 and the coordination node 120. In some embodiments, the database can be part of the coordination node 120. In some embodiments, the database can include mass storage, removable storage, volatile read-write memory, read-only memory (ROM) or similar content, or any combination thereof. Exemplary mass storage may include non-transitory storage media such as disks, optical disks, solid-state drives, etc. Example removable storage may include flash drives, floppy disks, optical disks, memory cards, zip disks, tapes, etc. Typical volatile read-write memory may include random access memory (RAM). Example RAMs may include dynamic RAM (DRAM), double date rate synchronous dynamic RAM (DDRSDRAM), static RAM (SRAM), thyristor RAM (T-RAM), zero capacitance RAM (Z-RAM), etc. Example ROMs may include mask ROM (MROM), programmable ROM (PROM), virtually programmable ROM (PEROM), electronically programmable ROM (EEPROM), compact disc ROM (CD ROM), digital versatile disk ROM, etc.

[0076] Those skilled in the art will appreciate that the number of participating nodes can be greater or lesser. For example, the number of participating nodes can be three, or dozens, hundreds, or even greater. In this case, the implementation environment also includes other participating nodes. The embodiments of this specification do not limit the number or device type of participating nodes.

[0077] After introducing the implementation environment of the embodiments of this specification, the application scenarios of the embodiments of this specification will be introduced in combination with the above implementation environment. In the following description, the terminal node is also the participant node 110 in the above implementation environment, and the server is also the coordination node 120 in the above implementation environment. The technical solutions provided by the embodiments of this specification can be applied in various resource recommendation scenarios, such as widget resource recommendation, theme resource recommendation, or wallpaper resource recommendation.

[0078] Taking the application of the technical solution provided in the embodiments of this specification in widget resource recommendation as an example, the federated learning platform includes a coordination node and multiple terminal nodes. The coordination node is deployed with a global recommendation model, and the terminal node is deployed with a local recommendation model. The local recommendation model includes a local shared layer and a personalized layer. The model parameters of the local recommendation model include local shared parameters of the local shared layer and personalized parameters of the personalized layer. For each round of training, the terminal node obtains the global shared parameters of the global recommendation model issued by the coordination node, and updates the local shared parameters of the local recommendation model based on the global shared parameters; based on the user behavior data of the terminal node for widget resources, the local shared parameters of the local shared layer and the personalized parameters of the personalized layer of the local recommendation model are updated; and the updated local shared parameters are uploaded to the coordination node, so that the coordination node updates the global shared parameters of the global recommendation model based on the local shared parameters of multiple participating nodes.

[0079] It should be noted that the above is explained using the example of the technical solution provided in the embodiments of this specification applied in an emotional companionship application. The technical solution provided in the embodiments of this specification can also be applied to other appropriate applications or intelligent body scenarios, such as mental health intelligent bodies or customer service dialogue applications, etc. The implementation process belongs to the same inventive concept as the above description and will not be repeated here.

[0080] It should be noted that the steps in the model training method in the example embodiment of this specification can be partially executed by the client, partially executed by the server, or all executed by the server or all executed by the client, and this specification does not specifically limit this.

[0081] based on Figure 1 The implementation environment shown below will be combined with Figure 2-Figure 6 , the model training method, resource recommendation method, and electronic device provided in the embodiments of this specification are described in detail. It should be noted that the above implementation environment is only provided to facilitate understanding of the spirit and principles of this specification, and the embodiments of this specification are not limited in this respect. On the contrary, the embodiments of this specification can be applied to any applicable scenario.

[0082] Figure 2 It is a structural diagram of an electronic device 200 provided according to some embodiments of this specification. The electronic device 200 can execute the model training method or resource recommendation method described in this specification. The model training method or resource recommendation method is introduced in other parts of this specification. The electronic device 200 can be a general-purpose computer or a special-purpose computer. For example, the electronic device 200 can be a server, a personal computer, a portable computer (such as a notebook computer, a tablet computer, etc.), or other electronic devices with computing capabilities. Of course, the electronic device can be Figure 1The participant node 110 or the coordination node 120 may also be a participant node device used by multiple developers to develop programs on an integrated development platform.

[0083] The electronic device in this specification may include one or more of the following components: a processor 210 , a memory 220 , an input device 230 , an output device 240 , and a bus 250 . The processor 210 , the memory 220 , the input device 230 , and the output device 240 may be connected via the bus 250 .

[0084] The processor 210 may include one or more processing cores. The processor 210 utilizes various interfaces and lines to connect various components within the entire electronic device. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 220, and calling data stored in the memory 220, the processor 210 executes the model training method or resource recommendation method described in this specification. Optionally, the processor 210 may be implemented in at least one hardware form selected from digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 210 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 210 and may be implemented separately via a communication chip.

[0085] The memory 220 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 220 includes a non-transitory computer-readable storage medium. The memory 220 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 220 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The operating system may be an Android system, including a system deeply developed based on the Android system, an IOS system, including a system deeply developed based on the IOS system, or other systems.

[0086] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up data communication between third-party applications and the operating system so that the operating system can obtain the current scenario information of third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.

[0087] The input device 230 is used to receive input commands or data and includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch-sensitive device. The output device 240 is used to output commands or data and includes, but is not limited to, a display device and a speaker. In one example, the input device 230 and the output device 240 may be combined, and the input device 230 and the output device 240 may be a touch-sensitive display.

[0088] In addition, those skilled in the art will understand that the structures of the electronic devices shown in the above figures do not limit the electronic devices. The electronic devices may include more or fewer components than shown, or may combine certain components, or arrange the components differently. For example, the electronic devices may also include radio frequency circuits, input units, sensors, audio circuits, wireless fidelity (WiFi) modules, power supplies, Bluetooth modules, and other components, which will not be described in detail here.

[0089] Figure 3A flowchart of a model training method provided according to an embodiment of this specification is shown. As before, the electronic device 200 can execute the model training method of the embodiment of this specification. Specifically, the processor 210 can read the instruction set stored in its local storage medium, and then execute the model training method of the embodiment of this specification according to the provisions of the instruction set. Below, steps S310 to S350 in the model training method will be described in detail with reference to the accompanying drawings.

[0090] like Figure 3 As shown, in step S310, for each round of training, the coordination node sends the global shared parameters of the global recommendation model to each participating node.

[0091] In an example embodiment, the model training method is applied to a federated learning platform, which includes multiple participant nodes 110 and a coordination node 120. The coordination node 120 is a server node, and the participant nodes 110 are client nodes, such as mobile terminal nodes. The coordination node 120 is deployed with a global recommendation model, which includes a global shared layer. The participant nodes 110 are deployed with a local recommendation model, which includes a local shared layer and a personalized layer. The model parameters of the global recommendation model include the global shared layer parameters of the global shared layer, which are used to implicitly represent the common features and global knowledge of the multiple participant nodes 110.

[0092] In this example embodiment, both the local recommendation model and the global recommendation model are deep neural network models, such as Transformer-based deep neural network models. At the start of training, the coordination node 120 initializes the global shared parameters of the global recommendation model's global shared layer, and each participant node 110 initializes the personalized parameters of the local recommendation model's personalized layer. For each round of training, the coordination node 120 updates the global shared parameters of the global recommendation model's global shared layer based on the results of the previous round of federated aggregation and distributes the updated global shared parameters to each participant node 110.

[0093] Taking widget resource recommendation as an example, the coordination node 120 is a server node, the participant node 110 is a mobile client of multiple users, the global recommendation model is a widget resource recommendation model, and the global sharing layer learns the shared features of multiple users for widget resources, such as popular widget resource types, etc. The coordination node 120 aggregates the local shared parameters uploaded by multiple participant nodes 100, i.e., mobile clients, generates the global shared parameters of the tth round, serializes the global shared parameters of the tth round into binary form, and sends the global shared parameters to each participant node 110 participating in this round of training through broadcasting.

[0094] In step S320 , the participant node updates the local shared parameters of the local recommendation model based on the global shared parameters.

[0095] In an exemplary embodiment, the model parameters of the local recommendation model include local shared parameters at the local sharing layer and personalized parameters at the personalized layer. The local shared parameters implicitly represent the shared characteristics of the participant node 110 for the target resource, while the personalized parameters implicitly represent the personalized preference characteristics of the participant node 110 for the target resource. The participant node 110 receives the global shared parameters of the global recommendation model issued by the coordination node 120 and uses the received global shared parameters to update the local shared parameters of the local recommendation model.

[0096] For example, the participant node 110 receives the global shared parameters of the global recommendation model sent by the coordination node 120, loads the global shared parameters into the shared layer of the local model, updates the local shared parameters of the local recommendation model, and the personalized layer retains the original personalized parameters.

[0097] In step S330 , the participant node updates the global shared parameters and personalized parameters of the local recommendation model based on the user behavior data for the target resource.

[0098] In an exemplary embodiment, a database of a participant node 110, such as a mobile terminal, stores user behavior data for target resources, such as the frequency of clicks on widgets and duration of use. Based on the user behavior data for target resources, the participant node trains a local recommendation model and updates the global shared parameters and personalized parameters of the local recommendation model.

[0099] In some example embodiments, the participant node 110 inputs the user behavior data of the participant node 110 for the target resource into the local recommendation model to determine the recommendation score of the local recommendation model; based on the difference between the recommendation score and the true label of the user behavior data, the model loss of the local recommendation model is determined, the model loss includes prediction loss, such as cross entropy loss; and the global shared parameters and personalized parameters of the local recommendation model are updated based on the model loss.

[0100] Take the target resource as widget material as an example, such as the materials of widgets such as weather components, calendar components, and news components. User behavior data includes click data, long press deletion data, manual sorting data, usage time data, and preference labels of users of mobile terminals for widget materials. The participant node 110 loads the locally stored user behavior data and preprocesses the user behavior data, such as denoising and standardization; loads the global shared parameters under the coordination node into the local shared layer of the local recommendation model, and the personalized layer uses the local personalized parameters, inputs user behavior data into the local recommendation model, and calculates the recommendation score for the widget material, such as the click probability, through the local shared layer and the personalized layer; calculates the model loss, such as the cross entropy loss, based on the difference between the recommendation score of the widget material and the true label; and updates the parameters of the local shared layer and the personalized layer by gradient descent.

[0101] It should be noted that although the target resource is described with a widget resource as an example, a person skilled in the art should understand that the target resource can also be other appropriate resources such as theme resources or wallpaper resources, which is also within the scope of the embodiments of this specification.

[0102] In step S340, each participant node uploads the updated local shared parameters to the coordination node.

[0103] In an exemplary embodiment, local shared parameters are used to implicitly represent the shared features of the participant node 110 for the target resource. Taking widget resources as an example, the local shared layer learns the shared features of users for widget resources, such as preferred popular widget resource types. After completing local training, each participant node 110 extracts the local shared parameters (such as embedding vectors and weight matrices) of the local shared layer from the local recommendation model; converts the parameters into a lightweight format (such as Protocol Buffers, JSON, binary files) to reduce the amount of transmitted data; and uploads the updated local shared parameters of the local shared layer to the coordination node 120 via a communication protocol such as HTTP / HTTPS or a dedicated protocol.

[0104] For example, the participant node 110 cryptographic protocol (such as multi-party computing) performs homomorphic encryption on the local shared parameters and uploads the encrypted shared parameters to the coordination node 120. Homomorphic encryption is a special encryption method that allows certain types of calculations to be performed directly on ciphertext without first decrypting the data. For example, in a cloud computing environment, the participant node 110 can send homomorphically encrypted data to the coordination node 120 for storage and calculation. Since the data is in an encrypted state, even the server provider of the coordination node 120 cannot know the true content of the data. However, through homomorphic encryption technology, the cloud server of the coordination node 120 can still perform computing tasks on these encrypted data as needed, and return the encrypted calculation results to the participant node 110. The participant node 110 can decrypt and obtain the final calculation results.

[0105] By encrypting local shared parameters using homomorphic encryption, the coordination node can process the data without exposing the data content, thereby enhancing data privacy and security protection.

[0106] In step S350 , the coordination node updates the global shared parameters of the global recommendation model based on the local shared parameters of the multiple participant nodes.

[0107] In an exemplary embodiment, the coordination node 120 receives local shared parameters uploaded by multiple participant nodes 110, aggregates the local shared parameters uploaded by each participant node 110, and updates the global shared parameters of the global recommendation model based on the aggregation results. For example, the local shared parameters uploaded by each participant node 110 are dynamically aggregated through a central federated optimization method, such as adaptive optimization aggregation or weighted average aggregation. Adaptive optimization aggregation is combined with an adaptive optimizer such as Adam to dynamically adjust the learning rate or gradient update direction; the aggregation weight of the weighted average aggregation is determined based on the proportion of the user behavior data on the participant nodes.

[0108] Taking widget resource recommendation as an example, the coordination node 120 counts the amount of user behavior data of each participant node 110 and determines the amount of user behavior data of each participant node 110 for widget resources. The aggregation weight of the weighted average aggregation is determined based on the ratio of the amount of user behavior data on the participant nodes, and the aggregation weight is allocated according to the amount of data of the participant nodes. For example, participant node A has 200 pieces of user behavior data and participant node B has 300 pieces of user behavior data, then the aggregation weights are 0.4 and 0.6 respectively. The coordination node 120 performs weighted average aggregation on the local shared parameters uploaded by each participant node 110 according to the above-mentioned aggregation weight, and updates the global shared parameters of the global recommendation model according to the aggregation result.

[0109] according to Figure 3 In the technical solution of the example embodiment, on the one hand, the coordination node updates the global shared parameters of the global recommendation model based on the local shared parameters of multiple participant nodes, which can capture the global shared features of multiple participant nodes across users for the target resource; on the other hand, the local recommendation model includes a local shared layer and a personalized layer, and the model parameters include local shared parameters of the local shared layer and personalized parameters of the personalized layer. The local shared parameters are updated according to the global shared parameters issued by the coordination node, and the local shared parameters and personalized parameters of the local recommendation model are updated based on user behavior data for the target resource. The global shared features of the user for the target resource can be learned through the local shared layer, and the personalized preference features of the user for the target resource can be learned by adapting the local data to the personalized layer, so that personalized resource recommendations can be accurately made to local users by combining the global shared features of multiple users and the personalized preference features of local users; on the other hand, the shared parameters of the local shared layer of the local recommendation model are uploaded to the coordination node, and the personalized parameters of the personalized layer are retained locally, which can reduce the risk of privacy data leakage, improve the security of privacy data, and at the same time reduce the amount of data uploaded and reduce communication overhead.

[0110] In addition, during the local training process, the local shared parameters of the local shared layer may over-fit the local data distribution due to the particularity of the local data, making it difficult to accurately capture the global shared features. Therefore, in some example embodiments, the model loss also includes a regularization term, which is used to constrain the difference between the local shared parameters of the local recommendation model and the global shared parameters of the global recommendation model. The participant node 110 determines the prediction loss of the local recommendation model based on the difference between the recommendation score of the local recommendation model and the true label of the user behavior data; determines the regularization term based on the difference between the local shared parameters of the local recommendation model and the global shared parameters of the global recommendation model; and determines the model loss of the local recommendation model based on the prediction loss and the regularization term. As shown in the following formula (1):

[0111] L=L R +||θ local -θ global || 2 (1)

[0112] Among them, L is the model loss, L R is the prediction loss, i.e. the difference between the predicted recommendation score and the true score, θ local is the local shared parameter, θ global is a globally shared parameter.

[0113] According to the technical solution in the above example embodiment, the difference between the shared layer parameters and the global parameters is constrained by the regularization term, which not only retains the local personalization capability but also ensures that the update direction of the shared layer is consistent with the global model.

[0114] Furthermore, the participant node 100 determines the difference between the local shared parameters of the local recommendation model and the global shared parameters of the global recommendation model; and adjusts the difference between the local shared parameters and the global shared parameters using a regularization coefficient to determine the regularization term, as shown in the following formula (2):

[0115] L=L R +λ||θ local -θ global || 2 (2)

[0116] Among them, λ is the regularization coefficient, which is used to adjust the regularization term.

[0117] The regularization coefficient can be adaptively adjusted according to the amount of local data or the number of training rounds. For example, a larger regularization coefficient is used for participating nodes with less local data because they rely more on global information when the local data volume is small. The regularization coefficient is larger at the initial node of training and is more dependent on global information. In the later stages of training, the regularization coefficient is gradually reduced to enhance the personalized recommendation performance of the model.

[0118] By adaptively adjusting the regularization term through the regularization coefficient, the recommendation results of the trained local recommendation model can be made more in line with the user's personalized needs, thereby improving the accuracy of the model's personalized recommendations.

[0119] Figure 4 A schematic diagram of a process for performing layer division according to some embodiments of this specification is shown.

[0120] Reference Figure 4 As shown, in step S410, each participant node uploads the gradient parameter information of each network layer of the local recommendation model to the coordination node.

[0121] In this example embodiment, after completing this round of training, participant node 110 records the gradient parameter information of each network layer of the local recommendation model and uploads this information to the coordination node. For example, in each round of federated training, the device of participant node 110 collects statistics on the gradient parameter information of each network layer and uploads this statistics to the coordination node 120.

[0122] In step S420 , the coordination node determines the gradient consistency of each network layer of the local recommendation models of the multiple participant nodes based on the gradient parameters of each network layer of the local recommendation models of the participant nodes.

[0123] In some example embodiments, the coordination node 120 receives gradient parameter information of each network layer of the local recommendation model uploaded by each participant node 110, and calculates the global gradient variance of each network layer based on the gradient parameters of each network layer of the local recommendation model of each participant node, where the global gradient variance represents the gradient consistency of each network layer of the local recommendation model of each participant node.

[0124] For example, the coordination node 120 determines the gradient mean of each network layer based on the gradient parameters of each network layer of the local recommendation model of each participant node; and calculates the global gradient variance of each network layer based on the gradient parameters and gradient mean of each network layer.

[0125] In other example embodiments, the coordination node 120 receives gradient parameter information of each network layer of the local recommendation model uploaded by each participant node 110, and calculates the average cosine similarity of each network layer based on the gradient parameters of each network layer of the local recommendation model of each participant node. The average cosine similarity represents the gradient consistency of each network layer of the local recommendation model of each participant node.

[0126] In step S430 , the coordination node determines layer division information of the local recommendation model based on gradient consistency.

[0127] In an exemplary embodiment, the layer partitioning information is used to partition the local recommendation model into a local shared layer and a personalized layer. The coordination node 120 determines the layer partitioning information for the local recommendation model based on gradient consistency. If the gradient consistency is greater than a predetermined threshold, the network layer is partitioned into the local shared layer of the local recommendation model. If the gradient consistency is less than or equal to the predetermined threshold, the network layer is partitioned into the personalized layer of the local recommendation model.

[0128] Taking the global gradient variance as an example to represent gradient consistency, if the global gradient variance of the Lth network layer is larger, it means that the difference of the Lth network layer of each participating node is larger (that is, there are more personalized features), and the Lth network layer needs to be divided into a personalized layer; if the global gradient variance of the Lth network layer is smaller, it means that the difference of the Lth network layer of each participating node is smaller (that is, there are more shared features), and the Lth network layer needs to be divided into a shared layer.

[0129] Taking the average cosine similarity to represent gradient consistency as an example, if the average cosine similarity of the Lth network layer is smaller, it means that the difference between the Lth network layer of each participating node is greater, and the Lth network layer needs to be divided into a personalized layer; if the average cosine similarity of the Lth network layer is larger, it means that the difference between the Lth network layer of each participating node is smaller, and the Lth network layer needs to be divided into a shared layer.

[0130] Furthermore, a predetermined threshold is set, such as a threshold of average cosine similarity, and the network layers with a value greater than the predetermined threshold are sorted from large to small according to the gradient consistency, such as the value of average cosine similarity. The network layers with a value greater than the predetermined threshold are divided into the local shared layer of the local recommendation model; and the network layers with a value less than the predetermined threshold are divided into the personalized layer of the local recommendation model.

[0131] In step S440, the coordination node sends layer division information to the participating nodes.

[0132] In step S450 , the participant node adjusts the boundary between the local sharing layer and the personalized layer of the local recommendation model based on the layer division information.

[0133] In an example embodiment, the participant node 110 receives layer division information for the local recommendation model issued by the coordination node 120, where the layer division information is used to divide the local shared layer and the personalized layer of the local recommendation model; based on the layer division information, the boundary between the local shared layer and the personalized layer of the local recommendation model is adjusted.

[0134] For example, during initial training, the participant node 110 determines the boundary between the local shared layer and the personalized layer of the local recommendation model based on the layer division information; when the layer division information changes, the boundary between the local shared layer and the personalized layer of the local recommendation model is adjusted according to the changed layer division information. For example, when the participant node detects that the boundary between the local shared layer and the personalized layer in the layer division information has changed, such as due to an increase in user interest in a new type of widget (an increase in gradient variance), the local shared layer and the personalized layer of the local recommendation model are adjusted according to the changed layer division information.

[0135] according to Figure 4 The technical solution in the example embodiment determines layer division information based on the gradient consistency of each network layer of the local recommendation model of multiple participant nodes, and adjusts the boundary between the local shared layer and the personalized layer of the local recommendation model based on the layer division information. During the model training process, the boundary between the shared layer and the personalized layer can be automatically adjusted according to the dynamic changes of the data of the participant nodes (such as user interest migration and the emergence of new features) to balance the model generalization ability and personalization effect.

[0136] Figure 5 A schematic flow chart of a resource recommendation method provided according to an embodiment of this specification is shown.

[0137] Reference Figure 5 As shown, in step S510, the shared features of multiple participant nodes for the target resource are extracted based on the local sharing layer of the local recommendation model.

[0138] In an example embodiment, this resource recommendation method is applied to a federated learning platform, which includes multiple participant nodes 110 and a coordination node 120. Coordination node 120 is a server node, while participant nodes 110 are client nodes, such as mobile phone terminals. Participant nodes 110 are deployed with a local recommendation model, which includes a local sharing layer and a personalization layer. The local sharing layer is used to extract shared features across multiple participants, namely, common patterns in the data of multiple participants, such as common features of user behavior and resources.

[0139] Furthermore, the local shared layer is typically the bottom or middle layer of the local recommendation model (such as the first few layers of a deep neural network), responsible for extracting common features of multiple users for the target resource. Based on the local shared layer of the local recommendation model, the participant node 110 extracts the shared features of the target resource from multiple participant nodes to obtain a shared feature vector. For example, assume that the target resource is the "smart home control" widget, and the shared feature of multiple users for the target resource is the feature of controlling light brightness.

[0140] In step S520 , the personalized preference features of the target participant node for the target resource are extracted based on the personalized layer.

[0141] In an exemplary embodiment, the personalization layer of the local recommendation model is used to extract the target participant's personalized preference features, namely, preferences or behavioral patterns unique to the participant's local data. Based on the personalization layer, participant node 110 extracts the target participant's personalized preference features for the target resource, generating a personalized preference feature vector. For example, user A prefers the "Weather + Calendar" widget combination, while user B prefers the "Music + Smart Home Control" widget combination.

[0142] In step S530 , target resources are recommended to target users of the participant nodes based on the shared features and personalized preference features.

[0143] In an exemplary embodiment, participant node 110 performs feature fusion on shared features and personalized preference features, determines a recommendation score for a target resource based on the fused features, ranks the target resources based on the recommendation scores, generates a resource recommendation list, and recommends the target resource to the target user of participant node 110 based on the resource recommendation list. Taking widget resources as an example, shared features may include features of popular widget resources, and personalized features may include features of user preferences for the widget.

[0144] For example, the participant node 100 performs feature splicing or weighted fusion on the shared features and personalized preference features of the widget resources, determines the recommendation score of the widget resources based on the fused features, sorts the widget resources based on the recommendation score, generates a resource recommendation list of the widget resources, and recommends the widget resources to the user based on the resource recommendation list of the widget resources.

[0145] according to Figure 5 The technical solution in the example embodiment learns the user's global shared features for target resources through the local sharing layer and learns the user's personalized preference features for target resources by adapting local data through the personalization layer, thereby being able to combine the global shared features of multiple users and the user's personalized preference features to accurately recommend personalized resources to the user.

[0146] It should be noted that the implementation principles and effects of each step in the resource recommendation method are similar to the implementation principles and effects of the corresponding steps in the above-mentioned model training method, and will not be repeated here.

[0147] Figure 6 A flow chart of a model training method provided according to other embodiments of this specification is shown.

[0148] Reference Figure 6 As shown, in step S605, user behavior data is collected.

[0149] In an example embodiment, the participant node 110 collects user behavior data of users with respect to target resources, such as click frequency and usage duration of target resources, and stores the collected user behavior data in a local database.

[0150] For example, the target resource is a widget asset, such as a weather widget, calendar widget, or news widget. The collected user behavior data includes click data on widget assets, long-press deletion data, manual sorting data, usage time data, and preference tags.

[0151] In step S610 , a local recommendation model is trained.

[0152] In an example embodiment, the participant node 110 loads the locally stored user behavior data and performs preprocessing on the user behavior data, such as denoising and standardization; inputs the user behavior data into the local recommendation model, and calculates the recommendation score for the widget material, such as the click probability, through the local sharing layer and the personalized layer; calculates the model loss, such as the cross entropy loss, based on the difference between the recommendation score and the true label (such as whether it is clicked); and updates the parameters of the local sharing layer and the personalized layer by gradient descent.

[0153] In step S615 , the local shared parameters are encrypted.

[0154] In an exemplary embodiment, the participant nodes 110 perform homomorphic encryption on the shared parameters using a cryptographic protocol (e.g., multi-party computing) and upload the encrypted shared parameters to the coordination node 120. The use of a cryptographic protocol (e.g., multi-party computing) ensures that the server cannot independently parse the parameters of a single client and can only obtain an aggregated result.

[0155] In step S620 , the encrypted local shared parameters are uploaded to the coordination node.

[0156] In an example embodiment, after completing local training, each participant node 110 extracts the local shared parameters of the shared layer (such as embedding vectors, weight matrices) from the local recommendation model; converts the parameters into a lightweight format (such as Protocol Buffers, JSON, binary files) to reduce the amount of transmitted data; and uploads the updated local shared parameters of the local shared layer to the coordination node 120 via a communication protocol such as HTTP / HTTPS or a dedicated protocol.

[0157] In step S625, the local shared parameters uploaded by each participant node are cached.

[0158] In step S630 , dynamic parameter fusion is performed.

[0159] In an exemplary embodiment, after the cloud database's data cache reaches its upper limit, the coordination node 120 aggregates the local shared parameters uploaded by each participant node 110. For example, the local shared parameters uploaded by each participant node are dynamically aggregated using a centralized federated optimization method, such as adaptive optimization aggregation or weighted average aggregation. Adaptive optimization aggregation combines an adaptive optimizer, such as Adam, to dynamically adjust the learning rate or gradient update direction; and the weighted average aggregation is determined based on the proportion of user behavior data stored on the participant nodes 110.

[0160] In step S635 , the global recommendation model is updated.

[0161] In an exemplary embodiment, the coordination node 120 updates the global shared parameters of the global recommendation model according to the aggregation result. In step S640 , the coordination node distributes the global shared parameters to each participant node.

[0162] In step S645 , the participant node receives the global shared parameters distributed by the coordination node.

[0163] In step S650 , the local recommendation model is updated.

[0164] In an exemplary embodiment, the local model parameters of the local recommendation model include local shared parameters of the local sharing layer and personalized parameters of the personalized layer. The participant node 110 receives the global shared parameters issued by the coordination node 120 and updates the local shared parameters of the local recommendation model using the received global shared parameters.

[0165] For example, the participant node 110 receives the global shared parameters sent by the coordination node 120, loads the global parameters into the shared layer of the local model, and the personalized layer retains the original parameters.

[0166] In step S655, resource recommendation is performed.

[0167] In an example embodiment, the participant node 100 extracts shared features of multiple participant nodes for the target resource based on the local sharing layer of the local recommendation model; extracts personalized preference features of the target participant node for the target resource based on the personalized layer; performs feature fusion on the shared features and the personalized preference features, determines the recommendation score of the target resource based on the fused fusion features, sorts the target resources based on the recommendation score, generates a resource recommendation list, and recommends the target resource to the target user of the participant node 110 according to the resource recommendation list.

[0168] For example, the participant node 100 performs feature splicing or weighted fusion on the shared features and personalized preference features of the widget resources, determines the recommendation score of the widget resources based on the fused features, sorts the widget resources based on the recommendation score, generates a resource recommendation list of the widget resources, and recommends the widget resources to the user based on the resource recommendation list of the widget resources.

[0169] according to Figure 6 The technical solution in the example embodiment, on the one hand, fully utilizes the global shared features of multiple participant nodes across users for target resources and the personalized features of local participant nodes, has rich user features and undistorted model training, and can accurately recommend personalized resources to local users based on the global shared features of multiple users and the personalized preference features of local users, so as to achieve personalized recommendations for each user; on the other hand, the main computing processes such as local model training and resource recommendation are completed on the local device, reducing the consumption of cloud resources; on the other hand, the user privacy data used for local recommendation model training is stored locally, and the shared parameters of the local shared layer of the local recommendation model are uploaded after encryption, the personalized parameters of the personalized layer are retained locally, and the privacy data is still privatized to achieve privacy protection.

[0170] On the other hand, this specification provides a non-transitory storage medium that stores at least one set of executable instructions for model training or resource recommendation. When the executable instructions are executed by a processor, the executable instructions instruct the processor to implement the steps of the model training method or resource recommendation method described in this specification. In some possible implementations, various aspects of this specification can also be implemented in the form of a program product, which includes program code. When the program product is run on an electronic device 200, the program code is used to enable the electronic device 200 to perform the steps of the model training method or resource recommendation method described in this specification. The program product for implementing the above method can use a portable compact disk read-only memory (CD-ROM) to include program code and can be run on the electronic device 200. However, the program product of this specification is not limited to this. In this specification, a readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system. The program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media include: an electrical connection having one or more conductors, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. The computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable storage medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing. Program code for performing the operations described herein may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the electronic device 200, partially on the electronic device 200, as a stand-alone software package, partially on the electronic device 200 and partially on a remote computing device, or entirely on the remote computing device.

[0171] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the particular order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0172] In summary, after reading this detailed disclosure, those skilled in the art will appreciate that the foregoing detailed disclosure may be presented by way of example only and may not be limiting. Although not expressly stated herein, those skilled in the art will understand that this specification encompasses various reasonable changes, improvements, and modifications to the embodiments. Such changes, improvements, and modifications are intended to be suggested by this specification and are within the spirit and scope of the exemplary embodiments of this specification.

[0173] Furthermore, certain terms in this specification have been used to describe embodiments of this specification. For example, “one embodiment,” “an embodiment,” and / or “some embodiments” mean that a particular feature, structure, or characteristic described in connection with that embodiment may be included in at least one embodiment of this specification. Therefore, it is emphasized and should be understood that two or more references to “an embodiment,” “one embodiment,” or “an alternative embodiment” in various parts of this specification do not necessarily refer to the same embodiment. Furthermore, particular features, structures, or characteristics may be appropriately combined in one or more embodiments of this specification.

[0174] It should be understood that in the foregoing descriptions of the embodiments of this specification, to facilitate understanding of a feature and to simplify this specification, various features are combined in a single embodiment, figure, or description thereof. However, this does not necessarily mean that these features are combined. When reading this specification, a person skilled in the art may label some of the devices as separate embodiments. In other words, the embodiments of this specification can also be understood as the integration of multiple sub-embodiments. This also applies when each sub-embodiment contains fewer than all the features of a single previously disclosed embodiment.

[0175] Each patent, patent application, patent application publication, and other materials, such as articles, books, specifications, publications, documents, articles, etc., cited herein is hereby incorporated by reference, except for any content of the same that appears in the relevant documents that may be inconsistent or conflicting with this document, or that may have a limiting effect on the broadest scope of the claims. For example, if there is any inconsistency or conflict between the description, definition, and / or use of terms associated with any incorporated material and the terminology, description, definition, and / or use associated with this document, the terminology in this document will control.

[0176] Finally, it should be understood that the embodiments of the application disclosed herein are illustrative of the principles of the embodiments of this specification. Other modified embodiments are also within the scope of this specification. Therefore, the embodiments disclosed in this specification are merely examples and not limitations. Those skilled in the art can adopt alternative configurations based on the embodiments in this specification to implement the application in this specification. Therefore, the embodiments of this specification are not limited to the embodiments precisely described in the application.

Claims

1. A model training method, applied to a participant node of a federated learning platform, the federated learning platform comprising a coordination node and multiple participant nodes, the coordination node deploying a global recommendation model, the participant nodes deploying a local recommendation model, the local recommendation model comprising a local shared layer and a personalized layer, the model parameters of the local recommendation model comprising local shared parameters of the local shared layer and personalized parameters of the personalized layer, the method comprising: For each round of training, obtaining the global shared parameters of the global recommendation model issued by the coordination node, and updating the local shared parameters of the local recommendation model based on the global shared parameters; Based on the user behavior data for the target resource, updating the local shared parameters and the personalized parameters of the local recommendation model; as well as The updated local shared parameters are uploaded to the coordination node, so that the coordination node updates the global shared parameters of the global recommendation model based on the local shared parameters of the multiple participant nodes.

2. The method according to claim 1, wherein The local shared parameters are used to implicitly represent the shared features of the participant node for the target resource, and the personalized parameters are used to implicitly represent the personalized preference features of the participant node for the target resource.

3. The method according to claim 1, wherein The updating of the local shared parameters and the personalized parameters of the local recommendation model based on the user behavior data of the participant node for the target resource includes: Inputting the user behavior data of the participant node for the target resource into the local recommendation model to determine the recommendation score of the local recommendation model; Determining a model loss of the local recommendation model based on a difference between the recommendation score and a true label of the user behavior data, wherein the model loss includes a prediction loss; and The local shared parameters and the personalized parameters of the local recommendation model are updated based on the model loss.

4. The method according to claim 3, wherein: The model loss further includes a regularization term, wherein the regularization term is used to constrain the difference between the local shared parameters of the local recommendation model and the global shared parameters of the global recommendation model. The determining of the model loss of the local recommendation model based on the difference between the recommendation score and the true label of the user behavior data includes: determining the prediction loss of the local recommendation model based on a difference between the recommendation score and a true label of the user behavior data; determining the regularization term based on a difference between the local shared parameters of the local recommendation model and the global shared parameters of the global recommendation model; and Based on the prediction loss and the regularization term, a model loss of the local recommendation model is determined.

5. The method according to claim 4, wherein The determining the regularization term based on a difference between the local shared parameter of the local recommendation model and the global shared parameter of the global recommendation model includes: determining a difference between the local shared parameters of the local recommendation model and the global shared parameters of the global recommendation model; The regularization term is determined by adjusting the difference between the local shared parameter and the global shared parameter using a regularization coefficient.

6. The method according to claim 1, wherein Before updating the local shared parameters and the personalized parameters of the local recommendation model, the method further includes: receiving layer division information for the local recommendation model sent by the coordination node, where the layer division information is used to divide the local shared layer and the personalized layer of the local recommendation model; Based on the layer division information, a boundary between the local shared layer and the personalized layer of the local recommendation model is adjusted.

7. The method according to claim 6, wherein: The coordination node determines the gradient consistency of each network layer of the local recommendation model of the multiple participant nodes based on the gradient parameter information of each network layer of the local recommendation model of each participant node, and determines the layer division information of the local recommendation model based on the gradient consistency.

8. The method according to claim 1, wherein The uploading of the local shared parameters to the coordination node includes: Homomorphically encrypt the local shared parameters, and upload the encrypted local shared parameters to the coordination node.

9. The method according to claim 1, wherein The participant node is a mobile terminal, and the target resource is a widget resource of the mobile terminal.

10. A model training method, applied to a coordination node of a federated learning platform, the federated learning platform comprising the coordination node and multiple participant nodes, the coordination node deploying a global recommendation model, the participant nodes deploying a local recommendation model, the local recommendation model comprising a local shared layer and a personalized layer, the model parameters of the local recommendation model comprising local shared parameters of the local shared layer and personalized parameters of the personalized layer, the method comprising: For each round of training, the global shared parameters of the global recommendation model are distributed to each of the participant nodes, so that the participant nodes update the local shared parameters of the local recommendation model according to the global shared parameters; Receiving the local shared parameters of the local recommendation model uploaded by each of the participant nodes; as well as Aggregate the local shared parameters uploaded by each of the participant nodes, and update the global shared parameters of the global recommendation model according to the aggregation result.

11. The method according to claim 10, wherein: The aggregating the local shared parameters uploaded by each of the participant nodes includes: The local shared parameters uploaded by each of the participating nodes are aggregated through a central federation optimization method.

12. The method according to claim 10, wherein: The method further comprises: Receiving gradient parameter information of each network layer of the local recommendation model uploaded by each of the participant nodes; Determining the gradient consistency of each network layer of the local recommendation model of the multiple participant nodes based on the gradient parameter information; Layer division information of the local recommendation model is determined based on the gradient consistency, where the layer division information is used to divide the local shared layer and the personalized layer of the local recommendation model.

13. The method according to claim 12, wherein: The determining, based on the gradient consistency, the layer division information of the local recommendation model includes: If the gradient consistency is greater than a predetermined threshold, dividing the network layer into the local shared layer of the local recommendation model; and If the gradient consistency is less than or equal to the predetermined threshold, dividing the network layer into the personalized layer of the local recommendation model.

14. A resource recommendation method, applied to a target participant node among multiple participant nodes of a federated learning platform, wherein the participant node is deployed with a local recommendation model, the local recommendation model comprising a local sharing layer and a personalized layer, the local recommendation model being a model trained using the model training method according to any one of claims 1 to 9, the method comprising: Extracting shared features of the target participant node for the target resource based on the local sharing layer of the local recommendation model; Extracting personalized preference features of the target participant node for the target resource based on the personalized layer of the local recommendation model; Based on the shared features and the personalized preference features, the target resource is recommended to the target user of the target participant node.

15. An electronic device comprising: At least one storage medium storing at least one instruction set for performing model training processing or resource recommendation processing; as well as at least one processor, in communication with the at least one storage medium; Wherein, when the electronic device is running, the at least one processor reads the at least one instruction set and executes the model training method as described in any one of claims 1 to 13 or the resource recommendation method as described in claim 14 according to the instructions of the at least one instruction set.

Citation Information

Cited By

  • Cross-platform commodity recommendation method based on federal learning and related equipment

    CN121352934A