CN111898767A - Data processing method, device, equipment and medium - Google Patents

Data processing method, device, equipment and medium Download PDF

Info

Publication number
CN111898767A
CN111898767A CN202010787194.XA CN202010787194A CN111898767A CN 111898767 A CN111898767 A CN 111898767A CN 202010787194 A CN202010787194 A CN 202010787194A CN 111898767 A CN111898767 A CN 111898767A
Authority
CN
China
Prior art keywords
model
item
data
preset
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010787194.XA
Other languages
Chinese (zh)
Inventor
衣志昊
程勇
刘洋
陈天健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202010787194.XA priority Critical patent/CN111898767A/en
Publication of CN111898767A publication Critical patent/CN111898767A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a data processing method, a device, equipment and a medium, wherein the method comprises the following steps: acquiring sample data, wherein the sample data comprises user data and article data; determining, locally at the first party, a user-embedded vector of the user data, and receiving an item-embedded vector sent by a server, the item-embedded vector being generated locally at the server based on the item data; and obtaining a preset prediction model of the first participant through federal learning training based on the user embedding vector and the article embedding vector. The method and the device solve the technical problem that the federal efficiency of the end equipment model is low in the prior art.

Description

Data processing method, device, equipment and medium
Technical Field
The present application relates to the field of artificial intelligence technology for financial technology (Fintech), and in particular, to a data processing method, apparatus, device, and medium.
Background
With the continuous development of financial technologies, especially internet technology and finance, more and more technologies (such as distributed, Blockchain, artificial intelligence, etc.) are applied to the financial field, but the financial industry also puts higher requirements on the technologies, such as higher requirements on data processing in the financial industry.
At present, in the process of carrying out federal learning, different sample data are generally converted into an embedded vector by the participants, and interactive federal modeling is carried out with a server, however, a large amount of calculation overhead and communication overhead are generated in the mode, and the calculation capacity of each participant, namely end equipment, is generally limited, which can cause the processing performance of the end equipment to be reduced, and the federal efficiency of the model to be reduced.
Disclosure of Invention
The application mainly aims to provide a data processing method, a data processing device, data processing equipment and a data processing medium, and aims to solve the technical problem that in the prior art, the federal efficiency of an end equipment model is low.
In order to achieve the above object, the present application provides a data processing method applied to a first party, the data processing method including:
acquiring sample data, wherein the sample data comprises user data and article data;
determining, locally at the first party, a user-embedded vector of the user data, and receiving an item-embedded vector sent by a server, the item-embedded vector being generated locally at the server based on the item data;
and obtaining a preset prediction model of the first participant through federal learning training based on the user embedding vector and the article embedding vector.
Optionally, the step of determining, locally to the first party, a user-embedded vector of the user data and receiving an item-embedded vector sent by a server includes:
generating, locally at the first participant, a one-hot code of the user data, and obtaining a user-embedded vector of the user data based on the one-hot code;
and receiving an article embedding vector which is sent by the server and obtained based on a preset article prediction model.
Optionally, the step of receiving an item embedding vector sent by the server and obtained based on a preset item prediction model includes:
receiving an article embedding vector which is sent by a server and used for representing article characteristics and obtained after the article data is input into a corresponding preset article prediction model;
the preset article prediction model is a target model obtained after iterative training is carried out on a first preset to-be-trained prediction model based on article training data with preset labels.
Optionally, the step of obtaining the preset prediction model of the first participant through federal learning training based on the user embedding vector and the item embedding vector includes:
carrying out vector combination on the user embedded vector and the article embedded vector of the same user in sample data to obtain an integrated vector of the same user;
obtaining a second basic model to be trained, training and updating the second basic model to be trained based on a plurality of integration vectors until the second basic model to be trained reaches a first preset training completion condition to obtain an initial training model, executing a preset transverse federal flow on an article model variable in the initial training model until the second basic model to be trained reaches a second preset training completion condition to obtain a preset prediction model.
Optionally, the obtaining a second basic model to be trained, training and updating the second basic model to be trained based on a plurality of the integration vectors until the second basic model to be trained reaches a first preset training completion condition to obtain an initial training model, executing a preset horizontal federal process on an article model variable in the initial training model until the second basic model to be trained reaches a second preset training completion condition to obtain a preset prediction model, includes:
acquiring a second basic model to be trained;
performing iterative training on the second basic model to be trained based on the plurality of integration vectors to train and update the item model variables in the second basic model to be trained, and judging whether the second basic model to be trained after the training and updating reaches a first preset training completion condition;
if the updated second basic model to be trained reaches the first preset training completion condition, setting the updated second basic model to be trained as an initial training model;
sending the item model variables in the initial training model to the server side, so that the server side can aggregate the item model variables sent by a plurality of other second participants and the item model variables in the initial training model to obtain aggregate item model variables;
receiving the aggregation commodity model variable fed back by the server, and replacing and updating the commodity model variable of the initial training model which is trained and updated into the aggregation commodity model variable;
and based on the item model variable after replacement and update, performing iterative training on the second basic model to be trained again and judging whether the second basic model to be trained reaches the first preset training completion condition or not until the second basic model to be trained reaches the second preset training completion condition, so as to obtain a preset prediction model.
Optionally, the step of sending the commodity model variables in the initial training model to the server, so that the server performs aggregation processing on the commodity model variables sent by a plurality of other second participants and the commodity model variables in the initial training model to obtain aggregate commodity model variables includes:
encrypting the item model variables in the initial training model and sending the encrypted item model variables to the server side so that the server side can aggregate the item model variables sent by a plurality of other second participants and the item model variables in the initial training model to obtain aggregate item model variables;
receiving the polymeric commodity model variables fed back by the server, and replacing and updating the commodity model variables of the initial training model which are trained and updated into the polymeric commodity model variables, wherein the steps comprise:
and receiving the aggregation commodity model variable fed back by the server side in an encryption manner, and replacing and updating the commodity model variable of the initial training model which is updated in the training manner into the aggregation commodity model variable.
Optionally, after the step of obtaining the preset predictive model of the first participant through federal learning training based on the user embedded vector and the item embedded vector, the method includes:
acquiring data to be processed, and inputting the data to be processed into the preset prediction model;
based on the preset prediction model, performing prediction processing on the data to be processed to obtain a prediction result;
calculating a similarity result of the application articles corresponding to the prediction result, and generating a candidate set of similar articles based on the similarity result;
and executing a preset item recommendation process based on the similar item candidate set.
The present application further provides a data processing apparatus applied to a first party, the data processing apparatus including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring sample data, and the sample data comprises user data and article data;
a receiving module, configured to determine, locally at the first participant, a user-embedded vector of the user data, and receive an item-embedded vector sent by a server, where the item-embedded vector is generated locally at the server based on the item data;
and the second obtaining module is used for obtaining a preset prediction model of the first participant through federal learning training based on the user embedding vector and the article embedding vector.
Optionally, the receiving module includes:
a generating unit, configured to generate a one-hot encoding of the user data locally at the first participant, and obtain a user embedded vector of the user data based on the one-hot encoding;
and the receiving unit is used for receiving the article embedding vector which is sent by the server and obtained based on the preset article prediction model.
Optionally, the receiving unit includes:
the receiving subunit is used for receiving an article embedding vector which is sent by the server and used for representing article characteristics and obtained after the article data is input into the corresponding preset article prediction model;
the preset article prediction model is a target model obtained after iterative training is carried out on a first preset to-be-trained prediction model based on article training data with preset labels.
Optionally, the second obtaining module includes:
the merging unit is used for carrying out vector merging on the user embedded vector and the article embedded vector of the same user in the sample data to obtain an integrated vector of the same user;
and the federation unit is used for acquiring a second to-be-trained basic model, training and updating the second to-be-trained basic model based on a plurality of integration vectors until the second to-be-trained basic model reaches a first preset training completion condition to obtain an initial training model, executing a preset transverse federation flow on the article model variable in the initial training model until the second to-be-trained basic model reaches a second preset training completion condition to obtain a preset prediction model.
Optionally, the federal unit is adapted to implement:
acquiring a second basic model to be trained;
performing iterative training on the second basic model to be trained based on the plurality of integration vectors to train and update the item model variables in the second basic model to be trained, and judging whether the second basic model to be trained after the training and updating reaches a first preset training completion condition;
if the updated second basic model to be trained reaches the first preset training completion condition, setting the updated second basic model to be trained as an initial training model;
sending the item model variables in the initial training model to the server side, so that the server side can aggregate the item model variables sent by a plurality of other second participants and the item model variables in the initial training model to obtain aggregate item model variables;
receiving the aggregation commodity model variable fed back by the server, and replacing and updating the commodity model variable of the initial training model which is trained and updated into the aggregation commodity model variable;
and based on the item model variable after replacement and update, performing iterative training on the second basic model to be trained again and judging whether the second basic model to be trained reaches the first preset training completion condition or not until the second basic model to be trained reaches the second preset training completion condition, so as to obtain a preset prediction model.
Optionally, the federal unit is adapted to implement:
encrypting the item model variables in the initial training model and sending the encrypted item model variables to the server side so that the server side can aggregate the item model variables sent by a plurality of other second participants and the item model variables in the initial training model to obtain aggregate item model variables;
wherein the federal unit is further adapted to implement:
and receiving the aggregation commodity model variable fed back by the server side in an encryption manner, and replacing and updating the commodity model variable of the initial training model which is updated in the training manner into the aggregation commodity model variable.
Optionally, the data processing apparatus includes:
the third acquisition module is used for acquiring data to be processed and inputting the data to be processed into the preset prediction model;
the prediction module is used for carrying out prediction processing on the data to be processed based on the preset prediction model to obtain a prediction result;
the calculation module is used for calculating the similarity result of the application articles corresponding to the prediction result and generating a similar article candidate set based on the similarity result of the application articles;
and the execution module is used for executing a preset item recommendation process based on the similar item candidate set.
The present application further provides a data processing apparatus, where the data processing apparatus is an entity apparatus, and the data processing apparatus includes: a memory, a processor and a program of the data processing method stored on the memory and executable on the processor, which program of the data processing method when executed by the processor may implement the steps of the data processing method as described above.
The present application also provides a medium having stored thereon a program for implementing the above-described data processing method, the program for the data processing method implementing the steps of the above-described data processing method when executed by a processor.
Compared with the prior method, device, equipment and medium for converting different sample data into an embedded vector by a participant and carrying out interactive federated modeling with a server, the method, device and medium for processing data acquire the sample data, wherein the sample data comprises user data and article data; determining, locally at the first party, a user-embedded vector of the user data, and receiving an item-embedded vector sent by a server, the item-embedded vector being generated locally at the server based on the item data; and obtaining a preset prediction model of the first participant through federal learning training based on the user embedding vector and the article embedding vector. In the application, after sample data is obtained, a user embedded vector of the user data is determined locally at the first participant, an article embedded vector determined based on the article data is received at a server side, and then a preset prediction model of the first participant is obtained through federal learning training based on the user embedded vector and the article embedded vector.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 is a schematic flow chart diagram illustrating a first embodiment of a data processing method according to the present application;
FIG. 2 is a flowchart illustrating a detailed process of performing speech recognition on speech data to be recognized to obtain candidate results of the speech data to be recognized according to a first embodiment of the data processing method of the present application;
fig. 3 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present application.
The objectives, features, and advantages of the present application will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In a first embodiment of the data processing method, referring to fig. 1, the data processing method is applied to a first participant, where the first participant is in communication connection with a server, and the data processing method includes:
step S10, sample data is obtained, wherein the sample data comprises user data and article data;
step S20, determining, locally at the first party, a user-embedded vector of the user data, and receiving an item-embedded vector sent by a server, the item-embedded vector being generated locally at the server based on the item data;
and step S30, obtaining a preset prediction model of the first participant through federal learning training based on the user embedding vector and the article embedding vector.
The method comprises the following specific steps:
step S10, sample data is obtained, wherein the sample data comprises user data and article data;
in this embodiment, the data processing method is applied to a first participant, the first participant and another second participant are respectively in communication connection with a server, and the first participant, the second participant and the server together form a data processing system, the data processing system belongs to a data processing device, it is to be noted that, for each participant, a required resource is obtained through each website, such as a social website, and the server of a shopping website, in this embodiment, shopping performed by each participant through the server is taken as an example, that is, sample data is shopping data (including item data and user data), where the user data includes a name of a user, an ID number of the user, an attribute of the user, and the like, the item data includes features of different items, such as the number of times of looking with the item, the length of looking with the item, for example, if the first participant is a user in area a and the second participant is a user in area B, both the first participant and the second participant shop through a server of a shopping website, and for the shopping website, a shopping record of each user in area is reserved at the corresponding server, where the shopping record includes purchased items, time length for viewing the items during purchase, and data such as item click number during purchase, and due to privacy protection, data between participants cannot be directly exchanged, so that model training is performed on each participant by using horizontal federal learning to improve accuracy of each participant model, in the prior art, when model training is performed on each participant by using a horizontal federal method, shopping data (sample data, data including that a certain user purchases a certain article, etc.) is sent to the local of the participator, so that the participator can locally perform one-hot coding on all shopping data, then the shopping data (sample data) after one-hot coding is preprocessed through the embedding layer to obtain an embedding vector corresponding to the shopping data, and subsequent training or prediction processing is performed based on the embedding vector as the input of a model.
That is, in the prior art, shopping data (sample data, including item data and user data) is converted into a high-dimensional one-hot encoding (one-hot encoding) locally at a participant, for example, the shopping data (including user data and item data) is mapped into a plurality of arrays/lists, wherein each word in the shopping data is mapped with a uniquely corresponding array/list, so that each series of shopping data can be integrated into a plurality of sparse matrices, when the sparse matrices are too sparse, resources are excessively occupied, and therefore, the one-hot encoding needs to be learned to obtain a low-dimensional vector containing data features, the low-dimensional vector containing data features can be an embedding vector, i.e., before the one-hot encoding is input as a model, features in the shopping data need to be learned and extracted to further obtain an embedding (embedding) vector, however, since the local data composed of the user data and the item data is usually huge in quantity, and the one-hot coding is usually of a high dimension, a large amount of computation overhead is generated locally at the participants in the process of obtaining the embedded vector of all the shopping data, and since the computation capability of each participant, namely the end device, is usually limited, the processing performance of the end device is reduced, and the horizontal federal efficiency is reduced. Therefore, in this embodiment, the server side performs the preprocessing of the item feature vector, thereby avoiding the consumption of the local computing resources of the participating parties.
Step S20, determining, locally at the first party, a user-embedded vector of the user data, and receiving an item-embedded vector sent by a server, the item-embedded vector being generated locally at the server based on the item data;
in order to avoid consumption of computing resources local to the participating parties, in this embodiment, locally at the first participating party, a user-embedded vector of the user data is determined, an item-embedded vector sent by a server is received, and a preset prediction model of the first participating party is determined based on the user-embedded vector and the item-embedded vector, where the item-embedded vector is generated locally at the server based on the item data.
Specifically, user embedded vectors (obtained based on user data) of sample data are obtained locally at each participant, and article embedded vectors (obtained based on article data) are obtained at a server side, and because the computing capability of the server side is strong, the efficiency in the federal process is not affected, wherein the article embedded vectors at the server side can be obtained through model training.
In this embodiment, since the server only trains the article data (obtains the article embedding vector) instead of all sample data, that is, does not include the user data, the disclosure of the user privacy is not caused.
Said step of determining, locally to said first party, a user-embedded vector of said user data and receiving an item-embedded vector sent by a server, comprising:
step S21, generating a one-hot code of the user data locally at the first party, and obtaining a user embedded vector of the user data based on the one-hot code;
in this embodiment, the first party generates a unique hot code uniquely determining the user identity in the user data, such as a unique hot code generating a user name and an identity card number, and performs user feature extraction based on the unique hot code to obtain a user embedded vector of the user data.
Specifically, assuming that the one-hot encoding of the user data is 01000000, the user embedded vector, such as the user embedded vector, which may correspond to the one-hot encoding 01000000 generated may be 01 (obtained by a preset user data preprocessing model).
Generating, locally at the first participant, a one-hot code of the user data, the step of deriving a user-embedded vector of the user data based on the one-hot code comprising:
step S211, generating a one-hot code of the ID feature of the user in the user data locally at the first party;
step S212, a user embedded vector of the user data is obtained based on the one-hot coding of the ID feature of the user.
It should be noted that, in order to reduce the amount of computation required for encoding, locally at the first party, in this embodiment, the user may be subjected to unique hot encoding processing based on only the ID feature or unique identifier of the user in the user data, and the reason why the amount of computation is reduced by performing unique hot encoding processing on the user based on the ID feature or unique identifier of the user is that the amount of data processing required for the unique ID of the user is less compared with the name, identification number, and the like of the user, and further, the user embedded vector of the user data is obtained based on the unique hot encoding.
In addition, it should be noted that in this embodiment, the unique hot coding process is performed on the user based on the ID features of the user, instead of performing the unique hot coding process on the server side, that is, the unique hot coding (one hot encoding) is not performed on all users on the server side, but the unique hot coding is performed on the user set of each participant (end device) separately, because the user set of each end device is smaller than the user set of all end devices, that is, a high-dimensional unique hot coding vector is not generated on the end device in general, the data calculation amount of the end device is reduced from the source, for example, if the device 1 includes two users a and B, and the device 2 includes two users C and D, the user a and the user B are coded as 10 and 01 on the device 1; on the device 2, the user C and the user D are coded as 10 and 01, and if the unique hot coding is performed on the server side to process the ID features of the users, at least the unique hot coding such as 0100, 1000, 0010, 0001 and the like is required to uniquely determine the user a, the user B, the user C and the user D.
That is, in this embodiment, the unique hot coding process is performed on the user based on the ID features in the user data, and the obtained unique hot coding plays a technical role in reducing the dimension of the unique hot coding from different layers.
It should be noted that, in this embodiment, in addition to being associated with the unique hot code of each user ID feature, the user embedded vector may also locally obtain user data such as behavior features of each user, so as to obtain feature similarity between users, and further obtain the user embedded vector based on the ID features of the users and the feature similarity features between users.
And step S22, receiving an item embedding vector which is sent by the server and obtained based on the preset item prediction model.
In this embodiment, the server side further trains a preprocessing model (preset item prediction model) to accurately obtain an item embedding vector of an item (which may include information), where the item embedding vector is an item feature representation vector such as a probability that the item is purchased or an interest tag representing the item (information),
the step of receiving the article embedding vector sent by the server and obtained based on the preset article prediction model comprises the following steps:
step S221, receiving an article embedding vector which is sent by a server and used for representing article characteristics and obtained after the article data is input into a corresponding preset article prediction model;
the preset article prediction model is a target model obtained after iterative training is carried out on a first preset to-be-trained prediction model based on article training data with preset labels.
For the preset item prediction model, the input data may be one-hot codes corresponding to preset item data (which may be from all parties), and the output data is an item embedding vector.
Receiving an article embedding vector which is sent by a server and used for representing article characteristics and is obtained after the article data is input into a corresponding preset article prediction model, specifically, inputting the article data in the participator sample data into a preprocessing model such as article unique hot code to obtain the article embedding vector, wherein the preset article prediction model is a target model which is obtained after iterative training is carried out on a first preset prediction model to be trained based on article training data with a preset label, and specifically, a model which can obtain article characteristic representation (article embedding vector) is obtained by iterative training a second preset basic model. For example, the item data or the item information records associated data of the item, such as browsing duration, number of clicks and purchase amount of the target item by the user, and in addition, the item information records attribute information of the item, such as type of the item, price of the item, etc., at this time, the item information may be represented by a string of unique hot codes, which is 010000000000000, the unique hot codes (large sparse vectors) are converted into low-dimensional space representation by a preset preprocessing model, for example, if a certain unique hot code is 010000000000000 and the purchase amount of the clothes by the user is 10, the unique hot codes may be processed by the preset preprocessing model to determine that the article-embedded vector (characteristic representing variable) of the clothes is real 10 to represent the click amount of the clothes is 10, or if a certain unique hot code is 0100000000011110 and the purchase probability of the clothes by the user is 80%, the one-hot encoding can be processed through a preset preprocessing model to determine that the article-of-clothing embedding vector (characteristic representation variable) is a real number of 0.8, wherein the server side sends the article embedding vector to the first participant after obtaining the article embedding vector. In the embodiment, the article embedding vector is obtained at the server side, so that the calculation amount of the end equipment is reduced.
And step S30, obtaining a preset prediction model of the first participant through federal learning training based on the user embedding vector and the article embedding vector.
Specifically, the user embedded vector and the received article embedded vector of the server side are locally input to a local second basic model to be trained by the first participant as training data, and the training data has a corresponding preset label, so that the model parameters of the second basic model to be trained can be fed back and adjusted to obtain the preset prediction model.
In this embodiment, since the preset prediction model is trained, the data to be processed may be subjected to prediction processing based on the preset prediction model, so as to obtain a prediction result.
Compared with the prior method, device, equipment and medium for converting different sample data into an embedded vector by a participant and carrying out interactive federated modeling with a server, the method, device and medium for processing data acquire the sample data, wherein the sample data comprises user data and article data; determining, locally at the first party, a user-embedded vector of the user data, and receiving an item-embedded vector sent by a server, the item-embedded vector being generated locally at the server based on the item data; and obtaining a preset prediction model of the first participant through federal learning training based on the user embedding vector and the article embedding vector. In the application, after sample data is obtained, a user embedded vector of the user data is determined locally at the first participant, an article embedded vector determined based on the article data is received at a server side, and then a preset prediction model of the first participant is obtained through federal learning training based on the user embedded vector and the article embedded vector.
In another embodiment of the data processing method, the step of obtaining the preset prediction model of the first participant through federal learning training based on the user embedded vector and the article embedded vector includes:
step A1, carrying out vector combination on the user embedded vector and the article embedded vector of the same user in sample data to obtain an integrated vector of the same user;
step A2, obtaining a second basic model to be trained, training and updating the second basic model to be trained based on a plurality of integration vectors until the second basic model to be trained reaches a first preset training completion condition to obtain an initial training model, executing a preset transverse federal process on the article model variables in the initial training model until the second basic model to be trained reaches a second preset training completion condition to obtain a preset prediction model.
In this embodiment, after obtaining the user embedding vector and the article embedding vector of the same user, vector merging is performed on the user embedding vector and the article embedding vector of the same user to obtain an integration vector of the same user, for example, if the user embedding vector is (1, 0) and the article embedding vector is 0.8, the integration vector is (1, 0, 0.8), and after obtaining the integration vector, the preset prediction model of the first participant is determined through federal learning based on a plurality of the integration vectors.
Specifically, a second basic model to be trained is obtained, and based on a plurality of integration vectors, the second basic model to be trained is trained and updated until the second basic model to be trained reaches a first preset training completion condition, so that an initial training model is obtained; and executing a preset transverse federal flow on the variable of the article model in the initial training model until the second basic model to be trained reaches a second preset training completion condition, so as to obtain a preset prediction model.
The step of obtaining a second basic model to be trained, training and updating the second basic model to be trained based on a plurality of integration vectors until the second basic model to be trained reaches a first preset training completion condition to obtain an initial training model, executing a preset transverse federal flow on an article model variable in the initial training model until the second basic model to be trained reaches a second preset training completion condition to obtain a preset prediction model includes:
step B1, acquiring a second basic model to be trained;
step B2, performing iterative training on the second basic model to be trained based on the plurality of integration vectors to perform training and updating on the item model variables in the second basic model to be trained, and judging whether the second basic model to be trained after the training and updating reaches a first preset training completion condition;
step B3, if the updated basic model to be trained reaches the first preset training completion condition, setting the updated basic model to be trained as an initial training model;
and iteratively training the second basic model to be trained based on the plurality of integration vectors, wherein the method for iteratively training the second basic model to be trained comprises but is not limited to a gradient descent method, and if the second basic model to be trained after the training update reaches the first preset training completion condition, the second basic model to be trained after the training update is set as an initial training model.
Step B4, sending the item model variables in the initial training model to the server, so that the server can aggregate the item model variables sent by a plurality of other second participants and the item model variables in the initial training model to obtain aggregate item model variables;
step B5, receiving the item model variables of the polymer item fed back by the server, and replacing and updating the item model variables of the initial training model which are trained and updated into the item model variables of the polymer item;
in this embodiment, if the trained second basic model to be trained reaches the first preset training completion condition, a preset horizontal federal procedure is executed, namely, the basic model to be trained is horizontally federated with other second participants, the item model variables (excluding user model variables) of the second basic model to be trained after the training update are replaced and updated, specifically, if the second basic model to be trained reaches the first preset training completion condition, directly replacing the item model parameters which are being trained and updated in the second base model to be trained with the aggregation model parameters (obtained by combining with other second participants), if the second base model to be trained does not reach the first preset training completion condition, and performing iterative training on the second basic model to be trained until the second basic model to be trained reaches the first preset training completion condition.
It should be noted that, in the process of replacing and updating the model variables of the second base model to be trained after training and updating, the model parameters of the user embedding layer are not included, that is, only the model parameters of the article embedding layer are replaced and updated in a federal manner.
Specifically, for example, the item purchasing probability of a new user M predicted at the server is 80%, the user similarity of the user M predicted at the first participant to the user of the first participant is 70%, the predicted probability of the user M purchasing the corresponding item is 70% by 80%, and the user actually purchases the item, so that all item model parameters need to be adjusted according to the actual result and the predicted result, and after the adjustment, only the model parameters of the item embedding vector are horizontally federated.
Specifically, the step of sending the commodity model variables in the initial training model to the server side so that the server side performs aggregation processing on the commodity model variables sent by a plurality of other second participants and the commodity model variables in the initial training model to obtain aggregate commodity model variables includes:
step C1, encrypting the item model variables in the initial training model and sending the encrypted item model variables to the server, so that the server can aggregate the item model variables sent by a plurality of other second participants and the item model variables in the initial training model to obtain aggregate item model variables;
receiving the polymeric commodity model variables fed back by the server, and replacing and updating the commodity model variables of the initial training model which are trained and updated into the polymeric commodity model variables, wherein the steps comprise:
step C2, receiving the item model variables of the polymer item fed back by the server side encryption, and replacing and updating the item model variables of the initial training model with the item model variables of the polymer item model.
In this embodiment, the item model variable in the initial training model is encrypted and sent to the server, and the aggregation model variable obtained based on the item model variable encrypted and sent by the server is received to obtain the aggregation model variable, so that information leakage is avoided, and safety is improved.
And step B6, based on the item model variable after replacement and update, repeating the iterative training of the second basic model to be trained and the judgment whether the second basic model to be trained reaches the first preset training completion condition until the second basic model to be trained reaches the second preset training completion condition, so as to obtain a preset prediction model.
In this embodiment, based on the item model variable after replacement and update, the iterative training of the second to-be-trained basic model and the judgment on whether the second to-be-trained basic model reaches the first preset training completion condition are performed again until the second to-be-trained basic model finally reaches the second preset training completion condition, so as to obtain a preset prediction model, for example, if the first preset training completion condition is that the iteration number reaches 500 times, the item model variable is sent once every 500 iterations of the first to-be-trained basic model, so as to receive the aggregation model variable corresponding to feedback, and the item model variable in the to-be-trained basic model is replaced and updated to be the corresponding aggregation model variable.
In the embodiment, the user embedded vectors and the article embedded vectors of the same user in the sample data are subjected to vector combination to obtain the integrated vectors of the same user; obtaining a second basic model to be trained, training and updating the second basic model to be trained based on a plurality of integration vectors until the second basic model to be trained reaches a first preset training completion condition to obtain an initial training model, executing a preset transverse federal flow on an article model variable in the initial training model until the second basic model to be trained reaches a second preset training completion condition to obtain a preset prediction model. In this embodiment, the federation of the user model parameters is not performed, and only the federation of the article model parameters is performed, so that the communication of the model parameters is reduced, and the calculation efficiency of the first party, i.e., the end device, is improved.
In another embodiment of the data processing method, after the step of performing prediction processing on the data to be processed based on the preset prediction model to obtain a prediction result, the data processing method includes:
step D1, acquiring data to be processed, and inputting the data to be processed into a preset prediction model;
step D2, based on the preset prediction model, carrying out prediction processing on the data to be processed to obtain a prediction result;
step D3, calculating the similarity result of the application articles corresponding to the prediction result, and generating a candidate set of similar articles based on the similarity result;
and D4, executing a preset item recommendation process based on the similar item candidate set.
In this embodiment, after a preset prediction model is obtained, prediction processing is performed on the data to be processed based on the preset prediction model to obtain a prediction result, after the prediction result is obtained, an article similarity result corresponding to the prediction result, that is, a similarity between an article and an article, is determined, a similar article candidate set is generated based on the article similarity result, and accurate recommendation is performed on a user.
Referring to fig. 3, fig. 3 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present application.
As shown in fig. 3, the data processing apparatus may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used for realizing connection communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a memory device separate from the processor 1001 described above.
Optionally, the data processing device may further include a rectangular user interface, a network interface, a camera, RF (radio frequency) circuitry, a sensor, audio circuitry, a WiFi module, and so forth. The rectangular user interface may comprise a Display screen (Display), an input sub-module such as a Keyboard (Keyboard), and the optional rectangular user interface may also comprise a standard wired interface, a wireless interface. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface).
Those skilled in the art will appreciate that the data processing device architecture shown in fig. 3 does not constitute a limitation of the data processing device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 3, a memory 1005, which is a kind of computer medium, may include therein an operating system, a network communication module, and a data processing program. An operating system is a program that manages and controls the hardware and software resources of the data processing device, supporting the operation of the data processing program as well as other software and/or programs. The network communication module is used to enable communication between components within the memory 1005, as well as with other hardware and software within the data processing system.
In the data processing apparatus shown in fig. 3, the processor 1001 is configured to execute a data processing program stored in the memory 1005, and implement the steps of the data processing method according to any one of the above.
The specific implementation of the data processing device of the present application is substantially the same as that of each embodiment of the data processing method, and is not described herein again.
The present application further provides a data processing apparatus applied to a first party, the data processing apparatus including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring sample data, and the sample data comprises user data and article data;
a receiving module, configured to determine, locally at the first participant, a user-embedded vector of the user data, and receive an item-embedded vector sent by a server, where the item-embedded vector is generated locally at the server based on the item data;
and the second obtaining module is used for obtaining a preset prediction model of the first participant through federal learning training based on the user embedding vector and the article embedding vector.
Optionally, the receiving module includes:
a generating unit, configured to generate a one-hot encoding of the user data locally at the first participant, and obtain a user embedded vector of the user data based on the one-hot encoding;
and the receiving unit is used for receiving the article embedding vector which is sent by the server and obtained based on the preset article prediction model.
Optionally, the receiving unit includes:
the receiving subunit is used for receiving an article embedding vector which is sent by the server and used for representing article characteristics and obtained after the article data is input into the corresponding preset article prediction model;
the preset article prediction model is a target model obtained after iterative training is carried out on a first preset to-be-trained prediction model based on article training data with preset labels.
Optionally, the second obtaining module includes:
the merging unit is used for carrying out vector merging on the user embedded vector and the article embedded vector of the same user in the sample data to obtain an integrated vector of the same user;
and the federation unit is used for acquiring a second to-be-trained basic model, training and updating the second to-be-trained basic model based on a plurality of integration vectors until the second to-be-trained basic model reaches a first preset training completion condition to obtain an initial training model, executing a preset transverse federation flow on the article model variable in the initial training model until the second to-be-trained basic model reaches a second preset training completion condition to obtain a preset prediction model.
Optionally, the federal unit is adapted to implement:
acquiring a second basic model to be trained;
performing iterative training on the second basic model to be trained based on the plurality of integration vectors to train and update the item model variables in the second basic model to be trained, and judging whether the second basic model to be trained after the training and updating reaches a first preset training completion condition;
if the updated second basic model to be trained reaches the first preset training completion condition, setting the updated second basic model to be trained as an initial training model;
sending the item model variables in the initial training model to the server side, so that the server side can aggregate the item model variables sent by a plurality of other second participants and the item model variables in the initial training model to obtain aggregate item model variables;
receiving the aggregation commodity model variable fed back by the server, and replacing and updating the commodity model variable of the initial training model which is trained and updated into the aggregation commodity model variable;
and based on the item model variable after replacement and update, performing iterative training on the second basic model to be trained again and judging whether the second basic model to be trained reaches the first preset training completion condition or not until the second basic model to be trained reaches the second preset training completion condition, so as to obtain a preset prediction model.
Optionally, the federal unit is adapted to implement:
encrypting the item model variables in the initial training model and sending the encrypted item model variables to the server side so that the server side can aggregate the item model variables sent by a plurality of other second participants and the item model variables in the initial training model to obtain aggregate item model variables;
wherein the federal unit is further adapted to implement:
and receiving the aggregation commodity model variable fed back by the server side in an encryption manner, and replacing and updating the commodity model variable of the initial training model which is updated in the training manner into the aggregation commodity model variable.
Optionally, the data processing apparatus includes:
the third acquisition module is used for acquiring data to be processed and inputting the data to be processed into the preset prediction model;
the prediction module is used for carrying out prediction processing on the data to be processed based on the preset prediction model to obtain a prediction result;
the calculation module is used for calculating the similarity result of the application articles corresponding to the prediction result and generating a similar article candidate set based on the similarity result of the application articles;
and the execution module is used for executing a preset item recommendation process based on the similar item candidate set. The specific implementation of the data processing apparatus of the present application is substantially the same as that of the embodiments of the data processing method, and is not described herein again.
The present embodiment provides a medium, and the medium stores one or more programs, which can be further executed by one or more processors for implementing the steps of the data processing method described in any one of the above.
The specific implementation of the medium of the present application is substantially the same as that of each embodiment of the data processing method, and is not described herein again.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.

Claims (10)

1. A data processing method, applied to a first party, the data processing method comprising:
acquiring sample data, wherein the sample data comprises user data and article data;
determining, locally at the first party, a user-embedded vector of the user data, and receiving an item-embedded vector sent by a server, the item-embedded vector being generated locally at the server based on the item data;
and obtaining a preset prediction model of the first participant through federal learning training based on the user embedding vector and the article embedding vector.
2. The data processing method of claim 1, wherein the step of determining, locally at the first party, a user-embedded vector of the user data and receiving an item-embedded vector sent by a server, comprises:
generating, locally at the first participant, a one-hot code of the user data, and obtaining a user-embedded vector of the user data based on the one-hot code;
and receiving an article embedding vector which is sent by the server and obtained based on a preset article prediction model.
3. The data processing method of claim 2, wherein the step of receiving the item embedding vector sent by the server and obtained based on the preset item prediction model comprises:
receiving an article embedding vector which is sent by a server and used for representing article characteristics and obtained after the article data is input into a corresponding preset article prediction model;
the preset article prediction model is a target model obtained after iterative training is carried out on a first preset to-be-trained prediction model based on article training data with preset labels.
4. The data processing method of claim 1, wherein the step of deriving the pre-set predictive model of the first participant through federal learning training based on the user embedded vector and the item embedded vector comprises:
carrying out vector combination on the user embedded vector and the article embedded vector of the same user in sample data to obtain an integrated vector of the same user;
obtaining a second basic model to be trained, training and updating the second basic model to be trained based on a plurality of integration vectors until the second basic model to be trained reaches a first preset training completion condition to obtain an initial training model, executing a preset transverse federal flow on an article model variable in the initial training model until the second basic model to be trained reaches a second preset training completion condition to obtain a preset prediction model.
5. The data processing method according to claim 4, wherein the step of obtaining a second basic model to be trained, training and updating the second basic model to be trained based on a plurality of the integration vectors until the second basic model to be trained reaches a first preset training completion condition to obtain an initial training model, and executing a preset horizontal federal process on commodity model variables in the initial training model until the second basic model to be trained reaches a second preset training completion condition to obtain a preset prediction model comprises:
acquiring a second basic model to be trained;
performing iterative training on the second basic model to be trained based on the plurality of integration vectors to train and update the item model variables in the second basic model to be trained, and judging whether the second basic model to be trained after the training and updating reaches a first preset training completion condition;
if the updated second basic model to be trained reaches the first preset training completion condition, setting the updated second basic model to be trained as an initial training model;
sending the item model variables in the initial training model to the server side, so that the server side can aggregate the item model variables sent by a plurality of other second participants and the item model variables in the initial training model to obtain aggregate item model variables;
receiving the aggregation commodity model variable fed back by the server, and replacing and updating the commodity model variable of the initial training model which is trained and updated into the aggregation commodity model variable;
and based on the item model variable after replacement and update, performing iterative training on the second basic model to be trained again and judging whether the second basic model to be trained reaches the first preset training completion condition or not until the second basic model to be trained reaches the second preset training completion condition, so as to obtain a preset prediction model.
6. The data processing method according to claim 5, wherein the step of sending the commodity model variables in the initial training model to the server side for the server side to aggregate the commodity model variables sent by the plurality of other second participants and the commodity model variables in the initial training model to obtain aggregate commodity model variables comprises:
encrypting the item model variables in the initial training model and sending the encrypted item model variables to the server side so that the server side can aggregate the item model variables sent by a plurality of other second participants and the item model variables in the initial training model to obtain aggregate item model variables;
receiving the polymeric commodity model variables fed back by the server, and replacing and updating the commodity model variables of the initial training model which are trained and updated into the polymeric commodity model variables, wherein the steps comprise:
and receiving the aggregation commodity model variable fed back by the server side in an encryption manner, and replacing and updating the commodity model variable of the initial training model which is updated in the training manner into the aggregation commodity model variable.
7. The data processing method of claim 1, wherein the step of deriving the pre-set predictive model of the first participant through federal learning training based on the user embedded vector and the item embedded vector comprises, after:
acquiring data to be processed, and inputting the data to be processed into the preset prediction model;
based on the preset prediction model, performing prediction processing on the data to be processed to obtain a prediction result;
calculating a similarity result of the application articles corresponding to the prediction result, and generating a candidate set of similar articles based on the similarity result;
and executing a preset item recommendation process based on the similar item candidate set.
8. A data processing apparatus, for application to a first party, the data processing apparatus comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring sample data, and the sample data comprises user data and article data;
a receiving module, configured to determine, locally at the first participant, a user-embedded vector of the user data, and receive an item-embedded vector sent by a server, where the item-embedded vector is generated locally at the server based on the item data;
and the second obtaining module is used for obtaining a preset prediction model of the first participant through federal learning training based on the user embedding vector and the article embedding vector.
9. A data processing apparatus, characterized in that the data processing apparatus comprises: a memory, a processor and a program stored on the memory for implementing the data processing method,
the memory is used for storing a program for realizing the data processing method;
the processor is configured to execute a program implementing the data processing method to implement the steps of the data processing method according to any one of claims 1 to 7.
10. A medium having stored thereon a program for implementing a data processing method, the program being executed by a processor to implement the steps of the data processing method according to any one of claims 1 to 7.
CN202010787194.XA 2020-08-06 2020-08-06 Data processing method, device, equipment and medium Pending CN111898767A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010787194.XA CN111898767A (en) 2020-08-06 2020-08-06 Data processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010787194.XA CN111898767A (en) 2020-08-06 2020-08-06 Data processing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN111898767A true CN111898767A (en) 2020-11-06

Family

ID=73247192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010787194.XA Pending CN111898767A (en) 2020-08-06 2020-08-06 Data processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN111898767A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112396189A (en) * 2020-11-27 2021-02-23 中国银联股份有限公司 Method and device for multi-party construction of federal learning model
CN112700012A (en) * 2020-12-30 2021-04-23 深圳前海微众银行股份有限公司 Federal feature selection method, device, equipment and storage medium
CN112766312A (en) * 2020-11-26 2021-05-07 上海嗨普智能信息科技股份有限公司 User information acquisition method, electronic device, and medium
CN112906904A (en) * 2021-02-03 2021-06-04 华控清交信息科技(北京)有限公司 Data processing method and device and data processing device
CN114676838A (en) * 2022-04-12 2022-06-28 支付宝(杭州)信息技术有限公司 Method and device for jointly updating model

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190012592A1 (en) * 2017-07-07 2019-01-10 Pointr Data Inc. Secure federated neural networks
CN110297848A (en) * 2019-07-09 2019-10-01 深圳前海微众银行股份有限公司 Recommended models training method, terminal and storage medium based on federation's study
CN111008332A (en) * 2019-12-03 2020-04-14 腾讯科技(深圳)有限公司 Content item recommendation method, device, server and storage medium
CN111178524A (en) * 2019-12-24 2020-05-19 中国平安人寿保险股份有限公司 Data processing method, device, equipment and medium based on federal learning
CN111259263A (en) * 2020-01-15 2020-06-09 腾讯云计算(北京)有限责任公司 Article recommendation method and device, computer equipment and storage medium
CN111275207A (en) * 2020-02-10 2020-06-12 深圳前海微众银行股份有限公司 Semi-supervision-based horizontal federal learning optimization method, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190012592A1 (en) * 2017-07-07 2019-01-10 Pointr Data Inc. Secure federated neural networks
CN110297848A (en) * 2019-07-09 2019-10-01 深圳前海微众银行股份有限公司 Recommended models training method, terminal and storage medium based on federation's study
CN111008332A (en) * 2019-12-03 2020-04-14 腾讯科技(深圳)有限公司 Content item recommendation method, device, server and storage medium
CN111178524A (en) * 2019-12-24 2020-05-19 中国平安人寿保险股份有限公司 Data processing method, device, equipment and medium based on federal learning
CN111259263A (en) * 2020-01-15 2020-06-09 腾讯云计算(北京)有限责任公司 Article recommendation method and device, computer equipment and storage medium
CN111275207A (en) * 2020-02-10 2020-06-12 深圳前海微众银行股份有限公司 Semi-supervision-based horizontal federal learning optimization method, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
QIANG YANG ET AL.: "Federated Machine Learning: Concept and Applications", ACM TRANSACTIONS ON INTELLIGENT SYSTEMS AND TECHNOLOGY, vol. 10, no. 2, 31 January 2019 (2019-01-31), pages 1 - 19, XP058427733, DOI: 10.1145/3298981 *
贾延延;张昭;冯键;王春凯;: "联邦学习模型在涉密数据处理中的应用", 中国电子科学研究院学报, no. 01, 20 January 2020 (2020-01-20) *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112766312A (en) * 2020-11-26 2021-05-07 上海嗨普智能信息科技股份有限公司 User information acquisition method, electronic device, and medium
CN112766312B (en) * 2020-11-26 2023-05-30 上海嗨普智能信息科技股份有限公司 User information acquisition method, electronic equipment and medium
CN112396189A (en) * 2020-11-27 2021-02-23 中国银联股份有限公司 Method and device for multi-party construction of federal learning model
CN112396189B (en) * 2020-11-27 2023-09-01 中国银联股份有限公司 Method and device for constructing federal learning model by multiple parties
CN112700012A (en) * 2020-12-30 2021-04-23 深圳前海微众银行股份有限公司 Federal feature selection method, device, equipment and storage medium
CN112906904A (en) * 2021-02-03 2021-06-04 华控清交信息科技(北京)有限公司 Data processing method and device and data processing device
CN112906904B (en) * 2021-02-03 2024-03-26 华控清交信息科技(北京)有限公司 Data processing method and device for data processing
CN114676838A (en) * 2022-04-12 2022-06-28 支付宝(杭州)信息技术有限公司 Method and device for jointly updating model

Similar Documents

Publication Publication Date Title
CN111898767A (en) Data processing method, device, equipment and medium
CN109492772B (en) Method and device for generating information
CN112035743B (en) Data recommendation method and device, computer equipment and storage medium
CN112418292B (en) Image quality evaluation method, device, computer equipment and storage medium
CN111008335B (en) Information processing method, device, equipment and storage medium
CN113379449B (en) Multimedia resource recall method and device, electronic equipment and storage medium
CN114663198A (en) Product recommendation method, device and equipment based on user portrait and storage medium
CN111291273A (en) Recommendation system optimization method, device, equipment and readable storage medium
CN112258238A (en) User life value cycle detection method and device and computer equipment
CN111325614B (en) Recommendation method and device of electronic object and electronic equipment
CN117217710A (en) Intelligent management method and system for virtual commodity and shortcut service
CN117422553A (en) Transaction processing method, device, equipment, medium and product of blockchain network
CN113742600B (en) Resource recommendation method and device, computer equipment and medium
CN114330519A (en) Data determination method and device, electronic equipment and storage medium
CN114493850A (en) Artificial intelligence-based online notarization method, system and storage medium
CN113793167A (en) Method and apparatus for generating information
CN111784377A (en) Method and apparatus for generating information
CN116911913B (en) Method and device for predicting interaction result
CN117611352A (en) Vehicle insurance claim processing method, device, computer equipment and storage medium
TW202125283A (en) Customer behavior prediction method and system thereof obtain the future prediction sequence to greatly increase the accuracy of selecting target customer groups
CN111768218A (en) Method and device for processing user interaction information
CN114282023A (en) Fingerprint generation method, device, server and storage medium
CN116894112A (en) Data classification method, device, computer equipment and storage medium thereof
CN118013117A (en) Object recommendation method, device, electronic equipment and readable storage medium
CN115774813A (en) Product recommendation method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination